aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dist/changes-5.7.164
-rw-r--r--examples/qml/networkaccessmanagerfactory/main.cpp16
-rw-r--r--examples/quick/demos/stocqt/content/Banner.qml (renamed from examples/quick/localstorage/localstorage/hello.qml)70
-rw-r--r--examples/quick/demos/stocqt/content/CheckBox.qml1
-rw-r--r--examples/quick/demos/stocqt/content/StockChart.qml535
-rw-r--r--examples/quick/demos/stocqt/content/StockInfo.qml99
-rw-r--r--examples/quick/demos/stocqt/content/StockListDelegate.qml153
-rw-r--r--examples/quick/demos/stocqt/content/StockListView.qml124
-rw-r--r--examples/quick/demos/stocqt/content/StockSettingsPanel.qml204
-rw-r--r--examples/quick/demos/stocqt/content/StockView.qml67
-rw-r--r--examples/quick/demos/stocqt/content/qmldir2
-rw-r--r--examples/quick/demos/stocqt/stocqt.qml115
-rw-r--r--examples/quick/demos/stocqt/stocqt.qrc2
-rw-r--r--examples/quick/localstorage/doc/src/localstorage.qdoc11
-rw-r--r--examples/quick/localstorage/localstorage/Database.js97
-rw-r--r--examples/quick/localstorage/localstorage/Header.qml173
-rw-r--r--examples/quick/localstorage/localstorage/MyButton.qml76
-rw-r--r--examples/quick/localstorage/localstorage/MyDelegate.qml74
-rw-r--r--examples/quick/localstorage/localstorage/MyModel.qml35
-rw-r--r--examples/quick/localstorage/localstorage/localstorage.qml209
-rw-r--r--examples/quick/localstorage/localstorage/localstorage.qmlproject16
-rw-r--r--examples/quick/localstorage/localstorage/localstorage.qrc8
-rw-r--r--examples/quick/localstorage/localstorage/main.cpp65
-rw-r--r--examples/quick/localstorage/localstorage/qml-localstorage-example.pngbin0 -> 46168 bytes
-rw-r--r--examples/quick/quickwidgets/quickwidget/fbitem.cpp4
-rw-r--r--examples/quick/scenegraph/rendernode/customrenderitem.cpp2
-rw-r--r--examples/quick/scenegraph/rendernode/openglrenderer.cpp4
-rw-r--r--examples/quick/scenegraph/rendernode/openglrenderer.h4
-rw-r--r--examples/quick/scenegraph/scenegraph.pro1
-rw-r--r--src/3rdparty/masm/wtf/OSAllocatorPosix.cpp10
-rw-r--r--src/imports/folderlistmodel/fileinfothread.cpp16
-rw-r--r--src/imports/folderlistmodel/fileinfothread_p.h4
-rw-r--r--src/imports/folderlistmodel/plugin.cpp2
-rw-r--r--src/imports/folderlistmodel/qquickfolderlistmodel.cpp6
-rw-r--r--src/imports/layouts/qquicklayout.cpp32
-rw-r--r--src/imports/layouts/qquicklayout_p.h4
-rw-r--r--src/imports/layouts/qquicklinearlayout.cpp54
-rw-r--r--src/imports/layouts/qquicklinearlayout_p.h9
-rw-r--r--src/imports/localstorage/plugin.cpp6
-rw-r--r--src/imports/testlib/SignalSpy.qml10
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp2
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp2
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp5
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp9
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp4
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/globalinspector.h2
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/qquickwindowinspector.cpp2
-rw-r--r--src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp24
-rw-r--r--src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp72
-rw-r--r--src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp12
-rw-r--r--src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp24
-rw-r--r--src/qml/compiler/qqmlirbuilder.cpp10
-rw-r--r--src/qml/compiler/qqmlpropertycachecreator_p.h56
-rw-r--r--src/qml/compiler/qqmlpropertyvalidator.cpp4
-rw-r--r--src/qml/compiler/qqmltypecompiler.cpp12
-rw-r--r--src/qml/compiler/qv4compileddata.cpp2
-rw-r--r--src/qml/compiler/qv4compileddata_p.h16
-rw-r--r--src/qml/compiler/qv4ssa.cpp15
-rw-r--r--src/qml/debugger/qqmldebugconnector.cpp5
-rw-r--r--src/qml/debugger/qqmlmemoryprofiler.cpp4
-rw-r--r--src/qml/debugger/qqmlprofiler_p.h9
-rw-r--r--src/qml/doc/src/javascript/resources.qdoc8
-rw-r--r--src/qml/jit/qv4isel_masm.cpp49
-rw-r--r--src/qml/jsapi/qjsvalue.cpp16
-rw-r--r--src/qml/jsruntime/jsruntime.pri3
-rw-r--r--src/qml/jsruntime/qv4argumentsobject.cpp19
-rw-r--r--src/qml/jsruntime/qv4argumentsobject_p.h2
-rw-r--r--src/qml/jsruntime/qv4context.cpp169
-rw-r--r--src/qml/jsruntime/qv4context_p.h47
-rw-r--r--src/qml/jsruntime/qv4context_p_p.h83
-rw-r--r--src/qml/jsruntime/qv4dateobject.cpp11
-rw-r--r--src/qml/jsruntime/qv4dateobject_p.h2
-rw-r--r--src/qml/jsruntime/qv4engine.cpp63
-rw-r--r--src/qml/jsruntime/qv4engine_p.h29
-rw-r--r--src/qml/jsruntime/qv4errorobject_p.h2
-rw-r--r--src/qml/jsruntime/qv4function.cpp4
-rw-r--r--src/qml/jsruntime/qv4function_p.h18
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp262
-rw-r--r--src/qml/jsruntime/qv4functionobject_p.h38
-rw-r--r--src/qml/jsruntime/qv4global_p.h6
-rw-r--r--src/qml/jsruntime/qv4globalobject.cpp5
-rw-r--r--src/qml/jsruntime/qv4include.cpp1
-rw-r--r--src/qml/jsruntime/qv4jsonobject.cpp14
-rw-r--r--src/qml/jsruntime/qv4lookup.cpp178
-rw-r--r--src/qml/jsruntime/qv4managed_p.h18
-rw-r--r--src/qml/jsruntime/qv4memberdata.cpp30
-rw-r--r--src/qml/jsruntime/qv4memberdata_p.h3
-rw-r--r--src/qml/jsruntime/qv4numberobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4object.cpp11
-rw-r--r--src/qml/jsruntime/qv4object_p.h4
-rw-r--r--src/qml/jsruntime/qv4objectiterator.cpp19
-rw-r--r--src/qml/jsruntime/qv4objectproto.cpp16
-rw-r--r--src/qml/jsruntime/qv4profiling_p.h2
-rw-r--r--src/qml/jsruntime/qv4property_p.h4
-rw-r--r--src/qml/jsruntime/qv4qmlcontext.cpp (renamed from src/qml/qml/qqmlcontextwrapper.cpp)71
-rw-r--r--src/qml/jsruntime/qv4qmlcontext_p.h (renamed from src/qml/qml/qqmlcontextwrapper_p.h)37
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp9
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper_p.h17
-rw-r--r--src/qml/jsruntime/qv4regexpobject.cpp12
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp217
-rw-r--r--src/qml/jsruntime/qv4runtime_p.h3
-rw-r--r--src/qml/jsruntime/qv4runtimeapi_p.h5
-rw-r--r--src/qml/jsruntime/qv4scopedvalue_p.h48
-rw-r--r--src/qml/jsruntime/qv4script.cpp76
-rw-r--r--src/qml/jsruntime/qv4script_p.h3
-rw-r--r--src/qml/jsruntime/qv4string_p.h2
-rw-r--r--src/qml/jsruntime/qv4stringobject.cpp12
-rw-r--r--src/qml/jsruntime/qv4value.cpp52
-rw-r--r--src/qml/jsruntime/qv4value_p.h83
-rw-r--r--src/qml/jsruntime/qv4vme_moth.cpp6
-rw-r--r--src/qml/memory/qv4mm.cpp16
-rw-r--r--src/qml/parser/qqmljs.g60
-rw-r--r--src/qml/parser/qqmljsast_p.h12
-rw-r--r--src/qml/parser/qqmljsgrammar.cpp1804
-rw-r--r--src/qml/parser/qqmljsgrammar_p.h12
-rw-r--r--src/qml/parser/qqmljsmemorypool_p.h5
-rw-r--r--src/qml/parser/qqmljsparser.cpp446
-rw-r--r--src/qml/parser/qqmljsparser_p.h4
-rw-r--r--src/qml/qml/qml.pri3
-rw-r--r--src/qml/qml/qqmlapplicationengine.cpp6
-rw-r--r--src/qml/qml/qqmlapplicationengine_p.h2
-rw-r--r--src/qml/qml/qqmlbinding.cpp73
-rw-r--r--src/qml/qml/qqmlbinding_p.h10
-rw-r--r--src/qml/qml/qqmlboundsignal.cpp68
-rw-r--r--src/qml/qml/qqmlboundsignal_p.h6
-rw-r--r--src/qml/qml/qqmldelayedcallqueue.cpp1
-rw-r--r--src/qml/qml/qqmlerror.cpp2
-rw-r--r--src/qml/qml/qqmlexpression.cpp4
-rw-r--r--src/qml/qml/qqmlglobal.cpp2
-rw-r--r--src/qml/qml/qqmlglobal_p.h2
-rw-r--r--src/qml/qml/qqmlimport.cpp14
-rw-r--r--src/qml/qml/qqmljavascriptexpression.cpp59
-rw-r--r--src/qml/qml/qqmljavascriptexpression_p.h13
-rw-r--r--src/qml/qml/qqmllocale.cpp64
-rw-r--r--src/qml/qml/qqmlmetatype.cpp2
-rw-r--r--src/qml/qml/qqmlnotifier.cpp6
-rw-r--r--src/qml/qml/qqmlnotifier_p.h2
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp25
-rw-r--r--src/qml/qml/qqmlproperty_p.h16
-rw-r--r--src/qml/qml/qqmlstringconverters.cpp12
-rw-r--r--src/qml/qml/qqmlstringconverters_p.h2
-rw-r--r--src/qml/qml/qqmltypeloader.cpp3
-rw-r--r--src/qml/qml/qqmltypewrapper.cpp1
-rw-r--r--src/qml/qml/qqmlvaluetypewrapper.cpp7
-rw-r--r--src/qml/qml/qqmlvme.cpp1
-rw-r--r--src/qml/qml/qqmlvmemetaobject.cpp6
-rw-r--r--src/qml/qml/qqmlxmlhttprequest.cpp11
-rw-r--r--src/qml/qml/qqmlxmlhttprequest_p.h4
-rw-r--r--src/qml/qml/v8/qqmlbuiltinfunctions.cpp37
-rw-r--r--src/qml/qml/v8/qqmlbuiltinfunctions_p.h18
-rw-r--r--src/qml/qml/v8/qv8engine.cpp5
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp23
-rw-r--r--src/qml/types/qqmldelegatemodel_p_p.h3
-rw-r--r--src/qml/types/qqmllistmodel.cpp48
-rw-r--r--src/qml/types/qqmllistmodel_p_p.h2
-rw-r--r--src/qml/types/qquickworkerscript.cpp16
-rw-r--r--src/qmltest/quicktest.cpp2
-rw-r--r--src/qmltest/quicktestevent.cpp4
-rw-r--r--src/qmltest/quicktestevent_p.h2
-rw-r--r--src/quick/accessible/qaccessiblequickitem.cpp4
-rw-r--r--src/quick/accessible/qaccessiblequickitem_p.h4
-rw-r--r--src/quick/accessible/qaccessiblequickview.cpp4
-rw-r--r--src/quick/accessible/qaccessiblequickview_p.h4
-rw-r--r--src/quick/accessible/qquickaccessiblefactory.cpp2
-rw-r--r--src/quick/accessible/qquickaccessiblefactory_p.h2
-rw-r--r--src/quick/designer/qquickdesignercustomobjectdata.cpp2
-rw-r--r--src/quick/designer/qquickdesignersupport.cpp2
-rw-r--r--src/quick/designer/qquickdesignerwindowmanager.cpp4
-rw-r--r--src/quick/designer/qquickdesignerwindowmanager_p.h4
-rw-r--r--src/quick/items/context2d/qquickcanvasitem.cpp2
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp14
-rw-r--r--src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp2
-rw-r--r--src/quick/items/context2d/qquickcontext2dtexture.cpp10
-rw-r--r--src/quick/items/context2d/qquickcontext2dtexture_p.h8
-rw-r--r--src/quick/items/context2d/qquickcontext2dtile.cpp4
-rw-r--r--src/quick/items/context2d/qquickcontext2dtile_p.h4
-rw-r--r--src/quick/items/qquickaccessibleattached.cpp2
-rw-r--r--src/quick/items/qquickaccessibleattached_p.h4
-rw-r--r--src/quick/items/qquickdrag.cpp4
-rw-r--r--src/quick/items/qquickdrag_p.h4
-rw-r--r--src/quick/items/qquickdroparea.cpp4
-rw-r--r--src/quick/items/qquickdroparea_p.h4
-rw-r--r--src/quick/items/qquickevents.cpp2
-rw-r--r--src/quick/items/qquickevents_p_p.h9
-rw-r--r--src/quick/items/qquickflickable.cpp2
-rw-r--r--src/quick/items/qquickflickable_p.h2
-rw-r--r--src/quick/items/qquickgraphicsinfo.cpp2
-rw-r--r--src/quick/items/qquickitem.cpp68
-rw-r--r--src/quick/items/qquickitem.h14
-rw-r--r--src/quick/items/qquickitem_p.h10
-rw-r--r--src/quick/items/qquickitemsmodule.cpp8
-rw-r--r--src/quick/items/qquickmousearea.cpp30
-rw-r--r--src/quick/items/qquickmousearea_p.h12
-rw-r--r--src/quick/items/qquickmousearea_p_p.h4
-rw-r--r--src/quick/items/qquickpainteditem.cpp2
-rw-r--r--src/quick/items/qquickpincharea.cpp4
-rw-r--r--src/quick/items/qquickrendercontrol.cpp8
-rw-r--r--src/quick/items/qquickshadereffect.cpp48
-rw-r--r--src/quick/items/qquickshadereffect_p.h2
-rw-r--r--src/quick/items/qquickspriteengine.cpp11
-rw-r--r--src/quick/items/qquickspriteengine_p.h2
-rw-r--r--src/quick/items/qquicktext.cpp6
-rw-r--r--src/quick/items/qquicktextcontrol.cpp96
-rw-r--r--src/quick/items/qquicktextcontrol_p.h9
-rw-r--r--src/quick/items/qquicktextcontrol_p_p.h8
-rw-r--r--src/quick/items/qquicktextdocument.cpp2
-rw-r--r--src/quick/items/qquicktextedit.cpp72
-rw-r--r--src/quick/items/qquicktextedit_p.h6
-rw-r--r--src/quick/items/qquicktextedit_p_p.h6
-rw-r--r--src/quick/items/qquicktextinput.cpp160
-rw-r--r--src/quick/items/qquicktextinput_p.h8
-rw-r--r--src/quick/items/qquicktextinput_p_p.h28
-rw-r--r--src/quick/items/qquicktextnode.cpp12
-rw-r--r--src/quick/items/qquicktextnodeengine.cpp6
-rw-r--r--src/quick/items/qquickwindow.cpp68
-rw-r--r--src/quick/items/qquickwindow.h8
-rw-r--r--src/quick/items/qquickwindow_p.h28
-rw-r--r--src/quick/qtquick2.cpp5
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp12
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp24
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp6
-rw-r--r--src/quick/scenegraph/coreapi/qsggeometry.cpp4
-rw-r--r--src/quick/scenegraph/coreapi/qsgmaterial.cpp10
-rw-r--r--src/quick/scenegraph/coreapi/qsgmaterial.h12
-rw-r--r--src/quick/scenegraph/coreapi/qsgmaterialshader_p.h2
-rw-r--r--src/quick/scenegraph/coreapi/qsgrenderer.cpp24
-rw-r--r--src/quick/scenegraph/coreapi/qsgrenderer_p.h2
-rw-r--r--src/quick/scenegraph/qsgadaptationlayer.cpp6
-rw-r--r--src/quick/scenegraph/qsgcontextplugin.cpp12
-rw-r--r--src/quick/scenegraph/qsgrenderloop.cpp24
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp24
-rw-r--r--src/quick/scenegraph/qsgwindowsrenderloop.cpp21
-rw-r--r--src/quick/scenegraph/util/qsgatlastexture.cpp17
-rw-r--r--src/quick/scenegraph/util/qsgdistancefieldutil.cpp2
-rw-r--r--src/quick/scenegraph/util/qsgengine.cpp6
-rw-r--r--src/quick/scenegraph/util/qsgflatcolormaterial.cpp10
-rw-r--r--src/quick/scenegraph/util/qsgsimplematerial.h4
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp36
-rw-r--r--src/quick/scenegraph/util/qsgtexture_p.h2
-rw-r--r--src/quick/scenegraph/util/qsgtexturematerial.cpp18
-rw-r--r--src/quick/scenegraph/util/qsgvertexcolormaterial.cpp10
-rw-r--r--src/quick/util/qquickanimatorjob_p.h2
-rw-r--r--src/quick/util/qquickglobal.cpp2
-rw-r--r--src/quick/util/qquickprofiler_p.h141
-rw-r--r--src/quick/util/qquickpropertychanges.cpp12
-rw-r--r--src/quick/util/qquickutilmodule.cpp4
-rw-r--r--src/quick/util/qquickvalidator.cpp4
-rw-r--r--src/quick/util/qquickvalidator_p.h4
-rw-r--r--src/quickwidgets/qquickwidget.cpp47
-rw-r--r--src/quickwidgets/qquickwidget.h4
-rw-r--r--src/quickwidgets/qquickwidget_p.h4
-rw-r--r--tests/auto/auto.pro1
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp2
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp8
-rw-r--r--tests/auto/qml/qmlmin/tst_qmlmin.cpp1
-rw-r--r--tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp6
-rw-r--r--tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp2
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp4
-rw-r--r--tests/auto/qml/qqmllanguage/data/dynamicObjectProperties.2.qml2
-rw-r--r--tests/auto/qml/qqmllanguage/data/namespacedPropertyTypes.qml8
-rw-r--r--tests/auto/qml/qqmllanguage/testtypes.cpp7
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp10
-rw-r--r--tests/auto/qml/qqmllistmodel/data/bindingsOnGetResult.qml27
-rw-r--r--tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp13
-rw-r--r--tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp26
-rw-r--r--tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp38
-rw-r--r--tests/auto/quick/examples/tst_examples.cpp2
-rw-r--r--tests/auto/quick/nokeywords/tst_nokeywords.cpp2
-rw-r--r--tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp4
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp2
-rw-r--r--tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp4
-rw-r--r--tests/auto/quick/qquickitem2/tst_qquickitem.cpp4
-rw-r--r--tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp6
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp218
-rw-r--r--tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp6
-rw-r--r--tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp4
-rw-r--r--tests/auto/quick/qquickpathview/tst_qquickpathview.cpp13
-rw-r--r--tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp10
-rw-r--r--tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp14
-rw-r--r--tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp14
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp22
-rw-r--r--tests/auto/quick/scenegraph/tst_scenegraph.cpp14
-rw-r--r--tests/auto/quick/shared/viewtestutil.cpp2
-rw-r--r--tests/auto/quicktest/quicktest.pro3
-rw-r--r--tests/auto/quicktest/signalspy/data/signalspy.qml60
-rw-r--r--tests/auto/quicktest/signalspy/mypropertymap.cpp38
-rw-r--r--tests/auto/quicktest/signalspy/mypropertymap.h41
-rw-r--r--tests/auto/quicktest/signalspy/signalspy.pro9
-rw-r--r--tests/auto/quicktest/signalspy/tst_signalspy.cpp95
-rw-r--r--tests/auto/shared/platformquirks.h2
-rw-r--r--tests/benchmarks/qml/compilation/tst_compilation.cpp2
-rw-r--r--tests/benchmarks/qml/creation/tst_creation.cpp8
-rw-r--r--tests/benchmarks/qml/qml.pro2
-rw-r--r--tests/tests.pro3
-rw-r--r--tools/qml/main.cpp10
-rw-r--r--tools/qmleasing/splineeditor.cpp4
-rw-r--r--tools/qmleasing/splineeditor.h4
-rw-r--r--tools/qmlplugindump/main.cpp11
-rw-r--r--tools/qmlscene/main.cpp16
299 files changed, 5332 insertions, 4262 deletions
diff --git a/dist/changes-5.7.1 b/dist/changes-5.7.1
new file mode 100644
index 0000000000..b9bdaedca3
--- /dev/null
+++ b/dist/changes-5.7.1
@@ -0,0 +1,64 @@
+Qt 5.7.1 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.7.0.
+
+For more details, refer to the online documentation included in this
+distribution. The documentation is also available online:
+
+http://doc.qt.io/qt-5/index.html
+
+The Qt version 5.7 series is binary compatible with the 5.6.x series.
+Applications compiled for 5.6 will continue to run with 5.7.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+https://bugreports.qt.io/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
+
+ - [QTBUG-55935] AnimatedSprite will no longer cause scenegraph updates when not
+ visible
+ - [QTBUG-46263] Fix QObjects becoming undefined when used in multiple QML
+ engines
+ - [QTBUG-54238] qt.scenegraph.info logging category got renamed to
+ qt.scenegraph.general.
+ - [QTBUG-50592] QVariants (e.g. QUrl) will now be better handled by
+ JSON.stringify
+ - [QTBUG-37095] Canvas now properly supports high-DPI screens
+ - QQuickWidget now properly repaints text on high-DPI screen changes.
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+QtQml
+-----
+
+ - [QTBUG-53412] Fix mapping of null JS values to null SQL values instead
+ of empty strings.
+ - [QTBUG-53794] Fix crash when using the "with" statement with an
+ expression that throws an exception.
+ - [QTBUG-54589] Fix assertion when deleting properties of JS objects
+ - [QTBUG-56658] Fix a crash in the QML compiler
+ - [QTBUG-53672] Fix crash caused by passing 0 to Array.join
+
+QtQuick
+-------
+
+ - The relevant child item is now sent a hover event when the window
+ receives a QEnterEvent, making sure hovering is recognized without
+ waiting for mouse movement.
+ - The threaded scene graph renderer does not sleep up to one vsync
+ interval before the first frame anymore.
+ - [QTBUG-56056] Fix crash when cancelling a QQuickImageResponse
+ - [QTBUG-39888] Fix crash with QQuickItems created via JavaScript being
+ garbage collected sometimes when they're not assigned to a window.
+ - [QTBUG-31861] Item: Fixed issue with mouse button events being sent even
+ when they were disabled by setAcceptedMouseButtons.
+ - [QTBUG-52389] Text: Fixed clipping of glyphs that extend beyond font's em
+ square.
diff --git a/examples/qml/networkaccessmanagerfactory/main.cpp b/examples/qml/networkaccessmanagerfactory/main.cpp
index 55e00d6917..5b6b7681a9 100644
--- a/examples/qml/networkaccessmanagerfactory/main.cpp
+++ b/examples/qml/networkaccessmanagerfactory/main.cpp
@@ -56,10 +56,10 @@
networkaccessmanagerfactory [-host <proxy> -port <port>] [file]
*/
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
static QString proxyHost;
static int proxyPort = 0;
-#endif // !QT_NO_NETWORKPROXY
+#endif // networkproxy
class MyNetworkAccessManagerFactory : public QQmlNetworkAccessManagerFactory
{
@@ -70,13 +70,13 @@ public:
QNetworkAccessManager *MyNetworkAccessManagerFactory::create(QObject *parent)
{
QNetworkAccessManager *nam = new QNetworkAccessManager(parent);
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
if (!proxyHost.isEmpty()) {
qDebug() << "Created QNetworkAccessManager using proxy" << (proxyHost + ":" + QString::number(proxyPort));
QNetworkProxy proxy(QNetworkProxy::HttpCachingProxy, proxyHost, proxyPort);
nam->setProxy(proxy);
}
-#endif // !QT_NO_NETWORKPROXY
+#endif // networkproxy
return nam;
}
@@ -88,12 +88,12 @@ int main(int argc, char ** argv)
QGuiApplication app(argc, argv);
QCommandLineParser parser;
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
QCommandLineOption proxyHostOption("host", "The proxy host to use.", "host");
parser.addOption(proxyHostOption);
QCommandLineOption proxyPortOption("port", "The proxy port to use.", "port", "0");
parser.addOption(proxyPortOption);
-#endif // !QT_NO_NETWORKPROXY
+#endif // networkproxy
parser.addPositionalArgument("file", "The file to use.");
QCommandLineOption helpOption = parser.addHelpOption();
parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
@@ -106,7 +106,7 @@ int main(int argc, char ** argv)
qWarning() << parser.helpText();
exit(0);
}
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
if (parser.isSet(proxyHostOption))
proxyHost = parser.value(proxyHostOption);
if (parser.isSet(proxyPortOption)) {
@@ -118,7 +118,7 @@ int main(int argc, char ** argv)
exit(1);
}
}
-#endif // !QT_NO_NETWORKPROXY
+#endif // networkproxy
if (parser.positionalArguments().count() == 1)
source = QUrl::fromLocalFile(parser.positionalArguments().first());
diff --git a/examples/quick/localstorage/localstorage/hello.qml b/examples/quick/demos/stocqt/content/Banner.qml
index d4f82ba2fe..8d64e88410 100644
--- a/examples/quick/localstorage/localstorage/hello.qml
+++ b/examples/quick/demos/stocqt/content/Banner.qml
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2016 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
@@ -37,42 +37,50 @@
** $QT_END_LICENSE$
**
****************************************************************************/
-//![0]
+
import QtQuick 2.0
-import QtQuick.LocalStorage 2.0
+import QtQuick.Layouts 1.1
Rectangle {
- width: 200
- height: 100
-
- Text {
- text: "?"
- anchors.horizontalCenter: parent.horizontalCenter
-
- function findGreetings() {
- var db = LocalStorage.openDatabaseSync("QQmlExampleDB", "1.0", "The Example QML SQL!", 1000000);
-
- db.transaction(
- function(tx) {
- // Create the database if it doesn't already exist
- tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
+ id: banner
+ height: 80
+ color: "#000000"
- // Add (another) greeting row
- tx.executeSql('INSERT INTO Greeting VALUES(?, ?)', [ 'hello', 'world' ]);
+ GridLayout {
+ anchors.fill: parent
+ rows: 1
+ columns: 3
+ Rectangle {
+ Layout.leftMargin: 10
+ Layout.topMargin: 20
+ Layout.alignment: Qt.AlignLeft | Qt.AlignTop
+ Image {
+ id: arrow
+ source: "./images/icon-left-arrow.png"
+ visible: root.currentIndex == 1 ? true : false
- // Show all added greetings
- var rs = tx.executeSql('SELECT * FROM Greeting');
-
- var r = ""
- for(var i = 0; i < rs.rows.length; i++) {
- r += rs.rows.item(i).salutation + ", " + rs.rows.item(i).salutee + "\n"
- }
- text = r
+ MouseArea {
+ anchors.fill: parent
+ onClicked: root.currentIndex = 0;
}
- )
+ }
+ }
+ Text {
+ id: stocText
+ color: "#ffffff"
+ font.family: "Abel"
+ font.pointSize: 40
+ text: "Stoc"
+ Layout.alignment: Qt.AlignRight
+ Layout.leftMargin: parent.width / 2.5
+ }
+ Text {
+ id: qtText
+ color: "#5caa15"
+ font.family: "Abel"
+ font.pointSize: 40
+ text: "Qt"
+ Layout.fillWidth: true
}
-
- Component.onCompleted: findGreetings()
}
}
-//![0]
diff --git a/examples/quick/demos/stocqt/content/CheckBox.qml b/examples/quick/demos/stocqt/content/CheckBox.qml
index 5702b17709..f62eb538fb 100644
--- a/examples/quick/demos/stocqt/content/CheckBox.qml
+++ b/examples/quick/demos/stocqt/content/CheckBox.qml
@@ -60,7 +60,6 @@ Item {
id: checkbox
width: 30
height: 30
- anchors.left: parent.left
border.color: "#999999"
border.width: 1
antialiasing: true
diff --git a/examples/quick/demos/stocqt/content/StockChart.qml b/examples/quick/demos/stocqt/content/StockChart.qml
index cd8b9f3db9..e90aba3aef 100644
--- a/examples/quick/demos/stocqt/content/StockChart.qml
+++ b/examples/quick/demos/stocqt/content/StockChart.qml
@@ -39,20 +39,19 @@
****************************************************************************/
import QtQuick 2.0
+import QtQuick.Layouts 1.1
import "."
Rectangle {
id: chart
- width: 320
- height: 200
property var stockModel: null
property var startDate: new Date()
property var endDate: new Date()
- property string activeChart: "year"
+ property string activeChart: "week"
property var settings
property int gridSize: 4
- property real gridStep: gridSize ? (width - canvas.tickMargin) / gridSize : canvas.xGridStep
+ property real gridStep: gridSize ? (canvas.width - canvas.tickMargin) / gridSize : canvas.xGridStep
function update() {
endDate = new Date();
@@ -66,7 +65,7 @@ Rectangle {
chart.startDate = new Date(chart.endDate.getFullYear(),
chart.endDate.getMonth() - 1,
chart.endDate.getDate());
- gridSize = 0;
+ gridSize = 4;
}
else if (chart.activeChart === "week") {
chart.startDate = new Date(chart.endDate.getFullYear(),
@@ -74,6 +73,18 @@ Rectangle {
chart.endDate.getDate() - 7);
gridSize = 0;
}
+ else if (chart.activeChart === "halfyear") {
+ chart.startDate = new Date(chart.endDate.getFullYear(),
+ chart.endDate.getMonth() - 6,
+ chart.endDate.getDate());
+ gridSize = 6;
+ }
+ else if (chart.activeChart === "quarter") {
+ chart.startDate = new Date(chart.endDate.getFullYear(),
+ chart.endDate.getMonth() - 3,
+ chart.endDate.getDate());
+ gridSize = 3;
+ }
else {
chart.startDate = new Date(2005, 3, 25);
gridSize = 4;
@@ -82,315 +93,327 @@ Rectangle {
canvas.requestPaint();
}
- Row {
- id: activeChartRow
- anchors.left: chart.left
- anchors.right: chart.right
- anchors.top: chart.top
- anchors.topMargin: 4
- spacing: 52
- onWidthChanged: {
- var buttonsLen = maxButton.width + yearButton.width + monthButton.width + weekButton.width;
- var space = (width - buttonsLen) / 3;
- spacing = Math.max(space, 10);
+ GridLayout {
+ anchors.fill: parent
+ columns: 6
+ rows: 3
+ columnSpacing: 4
+ Button {
+ id: weekButton
+ text: "Week"
+ buttonEnabled: chart.activeChart === "week"
+ onClicked: {
+ chart.activeChart = "week";
+ chart.update();
+ }
}
Button {
- id: maxButton
- text: "Max"
- buttonEnabled: chart.activeChart === "max"
+ id: monthButton
+ text: "Month"
+ buttonEnabled: chart.activeChart === "month"
onClicked: {
- chart.activeChart = "max";
+ chart.activeChart = "month";
chart.update();
}
}
+
Button {
- id: yearButton
- text: "Year"
- buttonEnabled: chart.activeChart === "year"
+ id: quarterlyButton
+ text: "3M"
+ buttonEnabled: chart.activeChart === "quarter"
onClicked: {
- chart.activeChart = "year";
+ chart.activeChart = "quarter";
chart.update();
}
}
+
Button {
- id: monthButton
- text: "Month"
- buttonEnabled: chart.activeChart === "month"
+ id: halfYearlyButton
+ text: "6M"
+ buttonEnabled: chart.activeChart === "halfyear"
onClicked: {
- chart.activeChart = "month";
+ chart.activeChart = "halfyear";
chart.update();
}
}
Button {
- id: weekButton
- text: "Week"
- buttonEnabled: chart.activeChart === "week"
+ id: yearButton
+ text: "Year"
+ buttonEnabled: chart.activeChart === "year"
onClicked: {
- chart.activeChart = "week";
+ chart.activeChart = "year";
+ chart.update();
+ }
+ }
+ Button {
+ id: maxButton
+ text: "Max"
+ buttonEnabled: chart.activeChart === "max"
+ onClicked: {
+ chart.activeChart = "max";
chart.update();
}
}
- }
- Text {
- id: fromDate
- color: "#000000"
- font.family: Settings.fontFamily
- font.pointSize: 8
- anchors.left: parent.left
- anchors.bottom: parent.bottom
- text: "| " + startDate.toDateString()
- }
+ Canvas {
+ id: canvas
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ Layout.columnSpan: 6
+ // Uncomment below lines to use OpenGL hardware accelerated rendering.
+ // See Canvas documentation for available options.
+ // renderTarget: Canvas.FramebufferObject
+ // renderStrategy: Canvas.Threaded
+
+ property int pixelSkip: 1
+ property int numPoints: 1
+ property int tickMargin: 34
+
+ property real xGridStep: (canvas.width - tickMargin) / numPoints
+ property real yGridOffset: canvas.height / 26
+ property real yGridStep: canvas.height / 12
+
+ function drawBackground(ctx) {
+ ctx.save();
+ ctx.fillStyle = "#ffffff";
+ ctx.fillRect(0, 0, canvas.width, canvas.height);
+ ctx.strokeStyle = "#d7d7d7";
+ ctx.beginPath();
+ // Horizontal grid lines
+ for (var i = 0; i < 12; i++) {
+ ctx.moveTo(0, canvas.yGridOffset + i * canvas.yGridStep);
+ ctx.lineTo(canvas.width, canvas.yGridOffset + i * canvas.yGridStep);
+ }
- Text {
- id: toDate
- color: "#000000"
- font.family: Settings.fontFamily
- font.pointSize: 8
- anchors.right: parent.right
- anchors.rightMargin: canvas.tickMargin
- anchors.bottom: parent.bottom
- text: endDate.toDateString() + " |"
- }
+ // Vertical grid lines
+ var height = 35 * canvas.height / 36;
+ var yOffset = canvas.height - height;
+ var xOffset = 0;
+ for (i = 0; i < chart.gridSize; i++) {
+ ctx.moveTo(xOffset + i * chart.gridStep, yOffset);
+ ctx.lineTo(xOffset + i * chart.gridStep, height);
+ }
+ ctx.stroke();
+
+ // Right ticks
+ ctx.strokeStyle = "#666666";
+ ctx.beginPath();
+ var xStart = canvas.width - tickMargin;
+ ctx.moveTo(xStart, 0);
+ ctx.lineTo(xStart, canvas.height);
+ for (i = 0; i < 12; i++) {
+ ctx.moveTo(xStart, canvas.yGridOffset + i * canvas.yGridStep);
+ ctx.lineTo(canvas.width, canvas.yGridOffset + i * canvas.yGridStep);
+ }
+ ctx.moveTo(0, canvas.yGridOffset + 9 * canvas.yGridStep);
+ ctx.lineTo(canvas.width, canvas.yGridOffset + 9 * canvas.yGridStep);
+ ctx.closePath();
+ ctx.stroke();
- Canvas {
- id: canvas
-
- // Uncomment below lines to use OpenGL hardware accelerated rendering.
- // See Canvas documentation for available options.
- // renderTarget: Canvas.FramebufferObject
- // renderStrategy: Canvas.Threaded
-
- anchors.top: activeChartRow.bottom
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.bottom: fromDate.top
-
- property int pixelSkip: 1
- property int numPoints: 1
- property int tickMargin: 34
-
- property real xGridStep: (width - tickMargin) / numPoints
- property real yGridOffset: height / 26
- property real yGridStep: height / 12
-
- function drawBackground(ctx) {
- ctx.save();
- ctx.fillStyle = "#ffffff";
- ctx.fillRect(0, 0, canvas.width, canvas.height);
- ctx.strokeStyle = "#d7d7d7";
- ctx.beginPath();
- // Horizontal grid lines
- for (var i = 0; i < 12; i++) {
- ctx.moveTo(0, canvas.yGridOffset + i * canvas.yGridStep);
- ctx.lineTo(canvas.width, canvas.yGridOffset + i * canvas.yGridStep);
+ ctx.restore();
}
- // Vertical grid lines
- var height = 35 * canvas.height / 36;
- var yOffset = canvas.height - height;
- var xOffset = 0;
- for (i = 0; i < chart.gridSize; i++) {
- ctx.moveTo(xOffset + i * chart.gridStep, yOffset);
- ctx.lineTo(xOffset + i * chart.gridStep, height);
- }
- ctx.stroke();
-
- // Right ticks
- ctx.strokeStyle = "#666666";
- ctx.beginPath();
- var xStart = canvas.width - tickMargin;
- ctx.moveTo(xStart, 0);
- ctx.lineTo(xStart, canvas.height);
- for (i = 0; i < 12; i++) {
- ctx.moveTo(xStart, canvas.yGridOffset + i * canvas.yGridStep);
- ctx.lineTo(canvas.width, canvas.yGridOffset + i * canvas.yGridStep);
+ // Returns a shortened, readable version of the potentially
+ // large volume number.
+ function volumeToString(value) {
+ if (value < 1000)
+ return value;
+ var exponent = parseInt(Math.log(value) / Math.log(1000));
+ var shortVal = parseFloat(parseFloat(value) / Math.pow(1000, exponent)).toFixed(1);
+
+ // Drop the decimal point on 3-digit values to make it fit
+ if (shortVal >= 100.0) {
+ shortVal = parseFloat(shortVal).toFixed(0);
+ }
+ return shortVal + "KMBTG".charAt(exponent - 1);
}
- ctx.moveTo(0, canvas.yGridOffset + 9 * canvas.yGridStep);
- ctx.lineTo(canvas.width, canvas.yGridOffset + 9 * canvas.yGridStep);
- ctx.closePath();
- ctx.stroke();
- ctx.restore();
- }
+ function drawScales(ctx, high, low, vol)
+ {
+ ctx.save();
+ ctx.strokeStyle = "#888888";
+ ctx.font = "10px Open Sans"
- // Returns a shortened, readable version of the potentially
- // large volume number.
- function volumeToString(value) {
- if (value < 1000)
- return value;
- var exponent = parseInt(Math.log(value) / Math.log(1000));
- var shortVal = parseFloat(parseFloat(value) / Math.pow(1000, exponent)).toFixed(1);
-
- // Drop the decimal point on 3-digit values to make it fit
- if (shortVal >= 100.0) {
- shortVal = parseFloat(shortVal).toFixed(0);
- }
- return shortVal + "KMBTG".charAt(exponent - 1);
- }
+ ctx.beginPath();
- function drawScales(ctx, high, low, vol)
- {
- ctx.save();
- ctx.strokeStyle = "#888888";
- ctx.font = "10px Open Sans"
- ctx.beginPath();
-
- // prices on y-axis
- var x = canvas.width - tickMargin + 3;
- var priceStep = (high - low) / 9.0;
- for (var i = 0; i < 10; i += 2) {
- var price = parseFloat(high - i * priceStep).toFixed(1);
- ctx.text(price, x, canvas.yGridOffset + i * yGridStep - 2);
- }
+ // prices on y-axis
+ var x = canvas.width - tickMargin + 3;
+ var priceStep = (high - low) / 9.0;
+ for (var i = 0; i < 10; i += 2) {
+ var price = parseFloat(high - i * priceStep).toFixed(1);
+ ctx.text(price, x, canvas.yGridOffset + i * yGridStep - 2);
+ }
+
+ // volume scale
+ for (i = 0; i < 3; i++) {
+ var volume = volumeToString(vol - (i * (vol/3)));
+ ctx.text(volume, x, canvas.yGridOffset + (i + 9) * yGridStep + 10);
+ }
- // volume scale
- for (i = 0; i < 3; i++) {
- var volume = volumeToString(vol - (i * (vol/3)));
- ctx.text(volume, x, canvas.yGridOffset + (i + 9) * yGridStep + 10);
+ ctx.closePath();
+ ctx.stroke();
+ ctx.restore();
}
- ctx.closePath();
- ctx.stroke();
- ctx.restore();
- }
+ function drawPrice(ctx, from, to, color, price, points, highest, lowest)
+ {
+ ctx.save();
+ ctx.globalAlpha = 0.7;
+ ctx.strokeStyle = color;
- function drawPrice(ctx, from, to, color, price, points, highest, lowest)
- {
- ctx.save();
- ctx.globalAlpha = 0.7;
- ctx.strokeStyle = color;
- ctx.lineWidth = 3;
- ctx.beginPath();
+ ctx.lineWidth = numPoints > 200 ? 1 : 3
- var end = points.length;
+ ctx.beginPath();
- var range = highest - lowest;
- if (range == 0) {
- range = 1;
- }
+ var end = points.length;
- for (var i = 0; i < end; i += pixelSkip) {
- var x = points[i].x;
- var y = points[i][price];
- var h = 9 * yGridStep;
+ var range = highest - lowest;
+ if (range == 0) {
+ range = 1;
+ }
- y = h * (lowest - y)/range + h + yGridOffset;
+ for (var i = 0; i < end; i += pixelSkip) {
+ var x = points[i].x;
+ var y = points[i][price];
+ var h = 9 * yGridStep;
- if (i == 0) {
- ctx.moveTo(x, y);
- } else {
- ctx.lineTo(x, y);
+ y = h * (lowest - y)/range + h + yGridOffset;
+
+ if (i == 0) {
+ ctx.moveTo(x, y);
+ } else {
+ ctx.lineTo(x, y);
+ }
}
+ ctx.stroke();
+ ctx.restore();
}
- ctx.stroke();
- ctx.restore();
- }
- function drawVolume(ctx, from, to, color, price, points, highest)
- {
- ctx.save();
- ctx.fillStyle = color;
- ctx.globalAlpha = 0.8;
- ctx.lineWidth = 0;
- ctx.beginPath();
+ function drawVolume(ctx, from, to, color, price, points, highest)
+ {
+ ctx.save();
+ ctx.fillStyle = color;
+ ctx.globalAlpha = 0.8;
+ ctx.lineWidth = 0;
+ ctx.beginPath();
+
+ var end = points.length;
+ var margin = 0;
+
+ if (chart.activeChart === "month" || chart.activeChart === "week") {
+ margin = 8;
+ ctx.shadowOffsetX = 4;
+ ctx.shadowBlur = 3.5;
+ ctx.shadowColor = Qt.darker(color);
+ }
- var end = points.length;
- var margin = 0;
+ // To match the volume graph with price grid, skip drawing the initial
+ // volume of the first day on chart.
+ for (var i = 1; i < end; i += pixelSkip) {
+ var x = points[i - 1].x;
+ var y = points[i][price];
+ y = canvas.height * (y / highest);
+ y = 3 * y / 12;
+ ctx.fillRect(x, canvas.height - y + yGridOffset,
+ canvas.xGridStep - margin, y);
+ }
- if (chart.activeChart === "month" || chart.activeChart === "week") {
- margin = 8;
- ctx.shadowOffsetX = 4;
- ctx.shadowBlur = 3.5;
- ctx.shadowColor = Qt.darker(color);
+ ctx.stroke();
+ ctx.restore();
}
- // To match the volume graph with price grid, skip drawing the initial
- // volume of the first day on chart.
- for (var i = 1; i < end; i += pixelSkip) {
- var x = points[i - 1].x;
- var y = points[i][price];
- y = canvas.height * (y / highest);
- y = 3 * y / 12;
- ctx.fillRect(x, canvas.height - y + yGridOffset,
- canvas.xGridStep - margin, y);
+ function drawError(ctx, msg)
+ {
+ ctx.save();
+ ctx.strokeStyle = "#888888";
+ ctx.font = "24px Open Sans"
+ ctx.textAlign = "center"
+ ctx.shadowOffsetX = 4;
+ ctx.shadowOffsetY = 4;
+ ctx.shadowBlur = 1.5;
+ ctx.shadowColor = "#aaaaaa";
+ ctx.beginPath();
+
+ ctx.fillText(msg, (canvas.width - tickMargin) / 2,
+ (canvas.height - yGridOffset - yGridStep) / 2);
+
+ ctx.closePath();
+ ctx.stroke();
+ ctx.restore();
}
- ctx.stroke();
- ctx.restore();
- }
+ onPaint: {
+ numPoints = stockModel.indexOf(chart.startDate);
- function drawError(ctx, msg)
- {
- ctx.save();
- ctx.strokeStyle = "#888888";
- ctx.font = "24px Open Sans"
- ctx.textAlign = "center"
- ctx.shadowOffsetX = 4;
- ctx.shadowOffsetY = 4;
- ctx.shadowBlur = 1.5;
- ctx.shadowColor = "#aaaaaa";
- ctx.beginPath();
-
- ctx.fillText(msg, (canvas.width - tickMargin) / 2,
- (canvas.height - yGridOffset - yGridStep) / 2);
-
- ctx.closePath();
- ctx.stroke();
- ctx.restore();
- }
+ if (chart.gridSize == 0)
+ chart.gridSize = numPoints
- onPaint: {
- numPoints = stockModel.indexOf(chart.startDate);
+ var ctx = canvas.getContext("2d");
+ ctx.globalCompositeOperation = "source-over";
+ ctx.lineWidth = 1;
- if (chart.gridSize == 0)
- chart.gridSize = numPoints
+ drawBackground(ctx);
- var ctx = canvas.getContext("2d");
- ctx.globalCompositeOperation = "source-over";
- ctx.lineWidth = 1;
+ if (!stockModel.ready) {
+ drawError(ctx, "No data available.");
+ return;
+ }
- drawBackground(ctx);
+ var highestPrice = 0;
+ var highestVolume = 0;
+ var lowestPrice = -1;
+ var points = [];
+ for (var i = numPoints, j = 0; i >= 0 ; i -= pixelSkip, j += pixelSkip) {
+ var price = stockModel.get(i);
+ if (parseFloat(highestPrice) < parseFloat(price.high))
+ highestPrice = price.high;
+ if (parseInt(highestVolume, 10) < parseInt(price.volume, 10))
+ highestVolume = price.volume;
+ if (lowestPrice < 0 || parseFloat(lowestPrice) > parseFloat(price.low))
+ lowestPrice = price.low;
+ points.push({
+ x: j * xGridStep,
+ open: price.open,
+ close: price.close,
+ high: price.high,
+ low: price.low,
+ volume: price.volume
+ });
+ }
- if (!stockModel.ready) {
- drawError(ctx, "No data available.");
- return;
+ if (settings.drawHighPrice)
+ drawPrice(ctx, 0, numPoints, settings.highColor, "high", points, highestPrice, lowestPrice);
+ if (settings.drawLowPrice)
+ drawPrice(ctx, 0, numPoints, settings.lowColor, "low", points, highestPrice, lowestPrice);
+ if (settings.drawOpenPrice)
+ drawPrice(ctx, 0, numPoints,settings.openColor, "open", points, highestPrice, lowestPrice);
+ if (settings.drawClosePrice)
+ drawPrice(ctx, 0, numPoints, settings.closeColor, "close", points, highestPrice, lowestPrice);
+
+ drawVolume(ctx, 0, numPoints, settings.volumeColor, "volume", points, highestVolume);
+ drawScales(ctx, highestPrice, lowestPrice, highestVolume);
}
+ }
- var highestPrice = 0;
- var highestVolume = 0;
- var lowestPrice = -1;
- var points = [];
- for (var i = numPoints, j = 0; i >= 0 ; i -= pixelSkip, j += pixelSkip) {
- var price = stockModel.get(i);
- if (parseFloat(highestPrice) < parseFloat(price.high))
- highestPrice = price.high;
- if (parseInt(highestVolume, 10) < parseInt(price.volume, 10))
- highestVolume = price.volume;
- if (lowestPrice < 0 || parseFloat(lowestPrice) > parseFloat(price.low))
- lowestPrice = price.low;
- points.push({
- x: j * xGridStep,
- open: price.open,
- close: price.close,
- high: price.high,
- low: price.low,
- volume: price.volume
- });
- }
- if (settings.drawHighPrice)
- drawPrice(ctx, 0, numPoints, settings.highColor, "high", points, highestPrice, lowestPrice);
- if (settings.drawLowPrice)
- drawPrice(ctx, 0, numPoints, settings.lowColor, "low", points, highestPrice, lowestPrice);
- if (settings.drawOpenPrice)
- drawPrice(ctx, 0, numPoints,settings.openColor, "open", points, highestPrice, lowestPrice);
- if (settings.drawClosePrice)
- drawPrice(ctx, 0, numPoints, settings.closeColor, "close", points, highestPrice, lowestPrice);
-
- drawVolume(ctx, 0, numPoints, settings.volumeColor, "volume", points, highestVolume);
- drawScales(ctx, highestPrice, lowestPrice, highestVolume);
+ Text {
+ id: fromDate
+ color: "#000000"
+ font.family: Settings.fontFamily
+ font.pointSize: 8
+ Layout.alignment: Qt.AlignLeft
+ text: "| " + startDate.toDateString()
+ }
+ Text {
+ id: toDate
+ color: "#000000"
+ font.family: Settings.fontFamily
+ font.pointSize: 8
+ Layout.alignment: Qt.AlignRight
+ Layout.rightMargin: canvas.tickMargin
+ Layout.columnSpan: 5
+ text: endDate.toDateString() + " |"
}
}
}
diff --git a/examples/quick/demos/stocqt/content/StockInfo.qml b/examples/quick/demos/stocqt/content/StockInfo.qml
index 88f540fa09..2935e74db9 100644
--- a/examples/quick/demos/stocqt/content/StockInfo.qml
+++ b/examples/quick/demos/stocqt/content/StockInfo.qml
@@ -39,42 +39,43 @@
****************************************************************************/
import QtQuick 2.0
+import QtQuick.Layouts 1.1
import "."
Rectangle {
id: root
- width: 440
- height: 160
color: "transparent"
property var stock: null
- Column {
- id: stockColumn
+ GridLayout {
+ id: stockInfoLayout
anchors.fill: parent
- spacing: 4
+ columns: 2
+ rows: 3
+ rowSpacing: 4
- Flow {
- anchors { left: parent.left; right: parent.right }
- spacing: 12
-
- Text {
- id: stockIdText
- color: "#000000"
- font.family: Settings.fontFamily
- font.pointSize: 28
- font.weight: Font.DemiBold
- text: root.stock.stockId
- }
+ Text {
+ id: stockIdText
+ color: "#000000"
+ font.family: Settings.fontFamily
+ font.pointSize: 28
+ font.weight: Font.DemiBold
+ text: root.stock.stockId
+ Layout.alignment: Qt.AlignLeft | Qt.AlignBottom
+ Layout.leftMargin: 10
+ }
- Text {
- id: price
- color: "#6d6d6d"
- font.family: Settings.fontFamily
- font.pointSize: 28
- font.weight: Font.DemiBold
- text: parseFloat(root.stock.stockPrice).toFixed(2);
- }
+ Text {
+ id: price
+ color: "#6d6d6d"
+ font.family: Settings.fontFamily
+ font.pointSize: 28
+ font.weight: Font.DemiBold
+ text: parseFloat(root.stock.stockPrice).toFixed(2);
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignLeft | Qt.AlignBottom
+ Layout.leftMargin: 5
}
Text {
@@ -82,38 +83,38 @@ Rectangle {
color: "#0c0c0c"
font.family: Settings.fontFamily
font.pointSize: 16
- width: stockColumn.width
elide: Text.ElideRight
maximumLineCount: 3
wrapMode: Text.WordWrap
text: root.stock.stockName
+ Layout.leftMargin: 10
+ Layout.columnSpan: 2
+ Layout.alignment: Qt.AlignLeft
}
- Flow {
- anchors { left: parent.left; right: parent.right }
- spacing: 12
- Text {
- id: priceChange
- horizontalAlignment: Text.AlignRight
- color: root.stock.stockPriceChanged < 0 ? "#d40000" : "#328930"
- font.family: Settings.fontFamily
- font.pointSize: 18
- text: parseFloat(root.stock.stockPriceChanged).toFixed(2);
- }
+ Text {
+ id: priceChange
+ Layout.alignment: Qt.AlignLeft | Qt.AlignTop
+ Layout.leftMargin: 10
+ color: root.stock.stockPriceChanged < 0 ? "#d40000" : "#328930"
+ font.family: Settings.fontFamily
+ font.pointSize: 18
+ text: parseFloat(root.stock.stockPriceChanged).toFixed(2);
+ }
- Text {
- id: priceChangePercentage
- horizontalAlignment: Text.AlignRight
- color: root.stock.stockPriceChanged < 0 ? "#d40000" : "#328930"
- font.family: Settings.fontFamily
- font.pointSize: 18
- font.weight: Font.DemiBold
- text: "(" +
- parseFloat(root.stock.stockPriceChanged /
- (root.stock.stockPrice - root.stock.stockPriceChanged) * 100.0).toFixed(2) +
- "%)"
- }
+ Text {
+ id: priceChangePercentage
+ Layout.alignment: Qt.AlignLeft | Qt.AlignTop
+ color: root.stock.stockPriceChanged < 0 ? "#d40000" : "#328930"
+ font.family: Settings.fontFamily
+ font.pointSize: 18
+ font.weight: Font.DemiBold
+ Layout.fillWidth: true
+ text: "(" +
+ parseFloat(root.stock.stockPriceChanged /
+ (root.stock.stockPrice - root.stock.stockPriceChanged) * 100.0).toFixed(2) +
+ "%)"
}
}
}
diff --git a/examples/quick/demos/stocqt/content/StockListDelegate.qml b/examples/quick/demos/stocqt/content/StockListDelegate.qml
new file mode 100644
index 0000000000..f3a3ab6976
--- /dev/null
+++ b/examples/quick/demos/stocqt/content/StockListDelegate.qml
@@ -0,0 +1,153 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** 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 The Qt Company Ltd 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.5
+import QtQuick.Layouts 1.1
+import "."
+
+Rectangle {
+ height: 102
+ width: parent.width
+ color: "transparent"
+ MouseArea {
+ anchors.fill: parent;
+ onClicked: {
+ if (view.currentIndex == index)
+ mainRect.currentIndex = 1;
+ else
+ view.currentIndex = index;
+ }
+ }
+ GridLayout {
+ id: stockGrid
+ columns: 3
+ rows: 2
+ anchors.fill: parent
+
+ Text {
+ id: stockIdText
+ Layout.alignment: Qt.AlignLeft | Qt.AlignBottom
+ Layout.leftMargin: 10
+ color: "#000000"
+ font.family: Settings.fontFamily
+ font.pointSize: 20
+ font.weight: Font.Bold
+ verticalAlignment: Text.AlignVCenter
+ text: stockId
+ }
+
+ Text {
+ id: stockValueText
+ Layout.preferredWidth: 100
+ Layout.alignment: Qt.AlignRight | Qt.AlignBottom
+ color: "#000000"
+ font.family: Settings.fontFamily
+ font.pointSize: 20
+ font.bold: true
+ horizontalAlignment: Text.AlignRight
+ verticalAlignment: Text.AlignVCenter
+ text: value
+ }
+ Text {
+ id: stockValueChangeText
+ Layout.preferredWidth: 135
+ Layout.rightMargin: 10
+ Layout.alignment: Qt.AlignRight | Qt.AlignBottom
+ color: "#328930"
+ font.family: Settings.fontFamily
+ font.pointSize: 20
+ font.bold: true
+ horizontalAlignment: Text.AlignRight
+ verticalAlignment: Text.AlignVCenter
+ text: change
+ onTextChanged: {
+ if (parseFloat(text) >= 0.0)
+ color = "#328930";
+ else
+ color = "#d40000";
+ }
+ }
+ Text {
+ id: stockNameText
+ Layout.preferredWidth: 300
+ Layout.leftMargin: 10
+ Layout.alignment: Qt.AlignLeft | Qt.AlignTop
+ color: "#000000"
+ font.family: Settings.fontFamily
+ font.pointSize: 16
+ font.bold: false
+ elide: Text.ElideRight
+ maximumLineCount: 1
+ verticalAlignment: Text.AlignVCenter
+ text: name
+ }
+
+ Item {Layout.fillWidth: true }
+
+ Text {
+ id: stockValueChangePercentageText
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignRight | Qt.AlignTop
+ Layout.rightMargin: 10
+ color: "#328930"
+ font.family: Settings.fontFamily
+ font.pointSize: 18
+ font.bold: false
+ horizontalAlignment: Text.AlignRight
+ verticalAlignment: Text.AlignVCenter
+ text: changePercentage
+ onTextChanged: {
+ if (parseFloat(text) >= 0.0)
+ color = "#328930";
+ else
+ color = "#d40000";
+ }
+ }
+ }
+
+ Rectangle {
+ id: endingLine
+ anchors.top: stockGrid.bottom
+ height: 1
+ width: parent.width
+ color: "#d7d7d7"
+ }
+}
+
diff --git a/examples/quick/demos/stocqt/content/StockListView.qml b/examples/quick/demos/stocqt/content/StockListView.qml
index d2bd52a69d..177580cf6b 100644
--- a/examples/quick/demos/stocqt/content/StockListView.qml
+++ b/examples/quick/demos/stocqt/content/StockListView.qml
@@ -43,8 +43,6 @@ import "."
Rectangle {
id: root
- width: 320
- height: 410
anchors.top: parent.top
anchors.bottom: parent.bottom
color: "white"
@@ -55,13 +53,12 @@ Rectangle {
ListView {
id: view
anchors.fill: parent
- width: parent.width
clip: true
keyNavigationWraps: true
highlightMoveDuration: 0
focus: true
snapMode: ListView.SnapToItem
- model: StockListModel{}
+ model: StockListModel {}
currentIndex: -1 // Don't pre-select any item
onCurrentIndexChanged: {
@@ -71,124 +68,7 @@ Rectangle {
}
}
- delegate: Rectangle {
- height: 102
- width: parent.width
- color: "transparent"
- MouseArea {
- anchors.fill: parent;
- onClicked: {
- if (view.currentIndex == index)
- mainRect.currentIndex = 1;
- else
- view.currentIndex = index;
- }
- }
-
- Text {
- id: stockIdText
- anchors.top: parent.top
- anchors.topMargin: 15
- anchors.left: parent.left
- anchors.leftMargin: 15
- width: 125
- height: 40
- color: "#000000"
- font.family: Settings.fontFamily
- font.pointSize: 20
- font.weight: Font.Bold
- verticalAlignment: Text.AlignVCenter
- text: stockId
- }
-
- Text {
- id: stockValueText
- anchors.top: parent.top
- anchors.topMargin: 15
- anchors.right: parent.right
- anchors.rightMargin: 0.31 * parent.width
- width: 190
- height: 40
- color: "#000000"
- font.family: Settings.fontFamily
- font.pointSize: 20
- font.bold: true
- horizontalAlignment: Text.AlignRight
- verticalAlignment: Text.AlignVCenter
- text: value
- }
-
- Text {
- id: stockValueChangeText
- anchors.top: parent.top
- anchors.topMargin: 15
- anchors.right: parent.right
- anchors.rightMargin: 20
- width: 135
- height: 40
- color: "#328930"
- font.family: Settings.fontFamily
- font.pointSize: 20
- font.bold: true
- horizontalAlignment: Text.AlignRight
- verticalAlignment: Text.AlignVCenter
- text: change
- onTextChanged: {
- if (parseFloat(text) >= 0.0)
- color = "#328930";
- else
- color = "#d40000";
- }
- }
-
- Text {
- id: stockNameText
- anchors.top: stockIdText.bottom
- anchors.left: parent.left
- anchors.leftMargin: 15
- width: 330
- height: 30
- color: "#000000"
- font.family: Settings.fontFamily
- font.pointSize: 16
- font.bold: false
- elide: Text.ElideRight
- maximumLineCount: 1
- verticalAlignment: Text.AlignVCenter
- text: name
- }
-
- Text {
- id: stockValueChangePercentageText
- anchors.top: stockIdText.bottom
- anchors.right: parent.right
- anchors.rightMargin: 20
- width: 120
- height: 30
- color: "#328930"
- font.family: Settings.fontFamily
- font.pointSize: 18
- font.bold: false
- horizontalAlignment: Text.AlignRight
- verticalAlignment: Text.AlignVCenter
- text: changePercentage
- onTextChanged: {
- if (parseFloat(text) >= 0.0)
- color = "#328930";
- else
- color = "#d40000";
- }
- }
-
- Rectangle {
- id: endingLine
- anchors.bottom: parent.bottom
- anchors.left: parent.left
- height: 1
- width: parent.width
- color: "#d7d7d7"
- }
- }
+ delegate: StockListDelegate {}
highlight: Rectangle {
width: view.width
diff --git a/examples/quick/demos/stocqt/content/StockSettingsPanel.qml b/examples/quick/demos/stocqt/content/StockSettingsPanel.qml
index 0c34e453de..1ac1035789 100644
--- a/examples/quick/demos/stocqt/content/StockSettingsPanel.qml
+++ b/examples/quick/demos/stocqt/content/StockSettingsPanel.qml
@@ -39,12 +39,11 @@
****************************************************************************/
import QtQuick 2.0
+import QtQuick.Layouts 1.1
import "."
Rectangle {
id: root
- width: 440
- height: 160
color: "transparent"
property bool drawOpenPrice: openButton.buttonEnabled
@@ -58,118 +57,93 @@ Rectangle {
property string lowColor: "#f30000"
property string volumeColor: "#14aaff"
- Text {
- id: openText
- anchors.left: root.left
- anchors.top: root.top
- color: "#000000"
- font.family: Settings.fontFamily
- font.pointSize: 19
- text: "Open"
- }
-
- Text {
- id: closeText
- anchors.left: root.left
- anchors.top: openText.bottom
- anchors.topMargin: 10
- color: "#000000"
- font.family: Settings.fontFamily
- font.pointSize: 19
- text: "Close"
- }
-
- Text {
- id: highText
- anchors.left: root.left
- anchors.top: closeText.bottom
- anchors.topMargin: 10
- color: "#000000"
- font.family: Settings.fontFamily
- font.pointSize: 19
- text: "High"
- }
-
- Text {
- id: lowText
- anchors.left: root.left
- anchors.top: highText.bottom
- anchors.topMargin: 10
- color: "#000000"
- font.family: Settings.fontFamily
- font.pointSize: 19
- text: "Low"
- }
-
- Rectangle {
- height: 4
- anchors.left: root.left
- anchors.leftMargin: 114
- anchors.right: openButton.left
- anchors.rightMargin: 65
- anchors.verticalCenter: openText.verticalCenter
- color: openColor
- }
-
- Rectangle {
- height: 4
- anchors.left: root.left
- anchors.leftMargin: 114
- anchors.right: closeButton.left
- anchors.rightMargin: 65
- anchors.verticalCenter: closeText.verticalCenter
- color: closeColor
- }
-
- Rectangle {
- height: 4
- anchors.left: root.left
- anchors.leftMargin: 114
- anchors.right: highButton.left
- anchors.rightMargin: 65
- anchors.verticalCenter: highText.verticalCenter
- color: highColor
- }
-
- Rectangle {
- height: 4
- anchors.left: root.left
- anchors.leftMargin: 114
- anchors.right: lowButton.left
- anchors.rightMargin: 65
- anchors.verticalCenter: lowText.verticalCenter
- color: lowColor
- }
-
- CheckBox {
- id: openButton
- buttonEnabled: false
- anchors.verticalCenter: openText.verticalCenter
- anchors.right: root.right
- anchors.rightMargin: 40
- }
-
- CheckBox {
- id: closeButton
- buttonEnabled: false
- anchors.verticalCenter: closeText.verticalCenter
- anchors.right: root.right
- anchors.rightMargin: 40
- }
-
- CheckBox {
- id: highButton
- buttonEnabled: true
- anchors.verticalCenter: highText.verticalCenter
- anchors.right: root.right
- anchors.rightMargin: 40
- }
-
- CheckBox {
- id: lowButton
- buttonEnabled: true
- anchors.verticalCenter: lowText.verticalCenter
- anchors.right: root.right
- anchors.rightMargin: 40
+ GridLayout {
+ id: settingsGrid
+ rows: 5
+ columns: 3
+ rowSpacing: 4
+ anchors.fill: parent
+
+ Item {
+ Layout.fillHeight: true
+ Layout.columnSpan: 3
+ }
+
+ Text {
+ id: openText
+ color: "#000000"
+ font.family: Settings.fontFamily
+ font.pointSize: 19
+ text: "Open"
+ Layout.leftMargin: 10
+ }
+ Rectangle {
+ Layout.preferredHeight: 4
+ Layout.preferredWidth: 114
+ color: openColor
+ }
+ CheckBox {
+ id: openButton
+ buttonEnabled: false
+ Layout.rightMargin: 10
+ }
+
+ Text {
+ id: closeText
+ Layout.leftMargin: 10
+ color: "#000000"
+ font.family: Settings.fontFamily
+ font.pointSize: 19
+ text: "Close"
+ }
+ Rectangle {
+ Layout.preferredHeight: 4
+ Layout.preferredWidth: 114
+ color: closeColor
+ }
+ CheckBox {
+ id: closeButton
+ buttonEnabled: false
+ Layout.rightMargin: 10
+ }
+
+ Text {
+ id: highText
+ Layout.leftMargin: 10
+ color: "#000000"
+ font.family: Settings.fontFamily
+ font.pointSize: 19
+ text: "High"
+ }
+ Rectangle {
+ Layout.preferredHeight: 4
+ Layout.preferredWidth: 114
+ color: highColor
+ }
+ CheckBox {
+ id: highButton
+ buttonEnabled: true
+ Layout.rightMargin: 10
+ }
+
+ Text {
+ id: lowText
+ Layout.leftMargin: 10
+ color: "#000000"
+ font.family: Settings.fontFamily
+ font.pointSize: 19
+ text: "Low"
+ }
+ Rectangle {
+ Layout.preferredHeight: 4
+ Layout.preferredWidth: 114
+ color: lowColor
+ }
+
+ CheckBox {
+ id: lowButton
+ buttonEnabled: true
+ Layout.rightMargin: 10
+ }
}
}
diff --git a/examples/quick/demos/stocqt/content/StockView.qml b/examples/quick/demos/stocqt/content/StockView.qml
index ec89c52510..d598ddd201 100644
--- a/examples/quick/demos/stocqt/content/StockView.qml
+++ b/examples/quick/demos/stocqt/content/StockView.qml
@@ -40,6 +40,7 @@
import QtQuick 2.0
import QtQuick.Window 2.1
+import QtQuick.Layouts 1.1
Rectangle {
id: root
@@ -60,42 +61,40 @@ Rectangle {
color: "transparent"
anchors.fill: parent
- StockInfo {
- id: stockInfo
- anchors.left: parent.left
- anchors.leftMargin: 10
- anchors.top: parent.top
- anchors.topMargin: 15
- height: 160
- anchors.right: Screen.primaryOrientation === Qt.PortraitOrientation ? parent.right : chart.left
- anchors.rightMargin: 20
- stock: root.stock
- }
+ GridLayout {
+ anchors.fill: parent
+ rows: 2
+ columns: Screen.primaryOrientation === Qt.PortraitOrientation ? 1 : 2
- StockChart {
- id: chart
- anchors.bottom: Screen.primaryOrientation === Qt.PortraitOrientation ? settingsPanel.top : parent.bottom
- anchors.bottomMargin: 20
- anchors.top : Screen.primaryOrientation === Qt.PortraitOrientation ? stockInfo.bottom : parent.top
- anchors.topMargin: 20
- anchors.right: parent.right
- anchors.rightMargin: 20
- width: Screen.primaryOrientation === Qt.PortraitOrientation ? parent.width - 40 : 0.6 * parent.width
- stockModel: root.stock
- settings: settingsPanel
- }
+ StockInfo {
+ id: stockInfo
+ Layout.alignment: Qt.AlignTop
+ Layout.preferredWidth: 400
+ Layout.preferredHeight: 160
+ stock: root.stock
+ }
- StockSettingsPanel {
- id: settingsPanel
- anchors.left: parent.left
- anchors.leftMargin: 20
- anchors.right: Screen.primaryOrientation === Qt.PortraitOrientation ? parent.right : chart.left
- anchors.rightMargin: 20
- anchors.bottom: parent.bottom
- onDrawOpenPriceChanged: root.update()
- onDrawClosePriceChanged: root.update();
- onDrawHighPriceChanged: root.update();
- onDrawLowPriceChanged: root.update();
+ StockChart {
+ id: chart
+ Layout.alignment: Qt.AlignRight
+ Layout.margins: 5
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ Layout.rowSpan: 2
+ stockModel: root.stock
+ settings: settingsPanel
+ }
+ StockSettingsPanel {
+ id: settingsPanel
+ Layout.alignment: Qt.AlignBottom
+ Layout.fillHeight: true
+ Layout.preferredWidth: 400
+ Layout.bottomMargin: 5
+ onDrawOpenPriceChanged: root.update()
+ onDrawClosePriceChanged: root.update();
+ onDrawHighPriceChanged: root.update();
+ onDrawLowPriceChanged: root.update();
+ }
}
}
}
diff --git a/examples/quick/demos/stocqt/content/qmldir b/examples/quick/demos/stocqt/content/qmldir
index bcfa27b484..77f5ed3c56 100644
--- a/examples/quick/demos/stocqt/content/qmldir
+++ b/examples/quick/demos/stocqt/content/qmldir
@@ -8,3 +8,5 @@ StockListView 1.0 StockListView.qml
StockModel 1.0 StockModel.qml
StockSettingsPanel 1.0 StockSettingsPanel.qml
StockView 1.0 StockView.qml
+StockListDelegate 1.0 StockListDelegate.qml
+Banner 1.0 Banner.qml
diff --git a/examples/quick/demos/stocqt/stocqt.qml b/examples/quick/demos/stocqt/stocqt.qml
index 6b1da1713a..a13e63fd50 100644
--- a/examples/quick/demos/stocqt/stocqt.qml
+++ b/examples/quick/demos/stocqt/stocqt.qml
@@ -40,6 +40,7 @@
import QtQuick 2.0
import QtQml.Models 2.1
+import QtQuick.Layouts 1.1
import "./content"
Rectangle {
@@ -49,90 +50,50 @@ Rectangle {
property alias currentIndex: root.currentIndex
- Rectangle {
- id: banner
- height: 80
- anchors.top: parent.top
- width: parent.width
- color: "#000000"
+ ColumnLayout {
+ anchors.fill: parent
- Image {
- id: arrow
- source: "./content/images/icon-left-arrow.png"
- anchors.left: banner.left
- anchors.leftMargin: 20
- anchors.verticalCenter: banner.verticalCenter
- visible: root.currentIndex == 1 ? true : false
-
- MouseArea {
- anchors.fill: parent
- onClicked: root.currentIndex = 0;
- }
- }
-
- Item {
- id: textItem
- width: stocText.width + qtText.width
- height: stocText.height + qtText.height
- anchors.horizontalCenter: banner.horizontalCenter
- anchors.verticalCenter: banner.verticalCenter
-
- Text {
- id: stocText
- anchors.verticalCenter: textItem.verticalCenter
- color: "#ffffff"
- font.family: "Abel"
- font.pointSize: 40
- text: "Stoc"
- }
- Text {
- id: qtText
- anchors.verticalCenter: textItem.verticalCenter
- anchors.left: stocText.right
- color: "#5caa15"
- font.family: "Abel"
- font.pointSize: 40
- text: "Qt"
- }
+ Banner {
+ id: banner
+ Layout.fillWidth: true
}
- }
- ListView {
- id: root
- width: parent.width
- anchors.top: banner.bottom
- anchors.bottom: parent.bottom
- snapMode: ListView.SnapOneItem
- highlightRangeMode: ListView.StrictlyEnforceRange
- highlightMoveDuration: 250
- focus: false
- orientation: ListView.Horizontal
- boundsBehavior: Flickable.StopAtBounds
+ ListView {
+ id: root
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ snapMode: ListView.SnapOneItem
+ highlightRangeMode: ListView.StrictlyEnforceRange
+ highlightMoveDuration: 250
+ focus: false
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
- StockModel {
- id: stock
- stockId: listView.currentStockId
- stockName: listView.currentStockName
- onStockIdChanged: stock.updateStock();
- onDataReady: {
- root.currentIndex = 1
- stockView.update()
+ StockModel {
+ id: stock
+ stockId: listView.currentStockId
+ stockName: listView.currentStockName
+ onStockIdChanged: stock.updateStock();
+ onDataReady: {
+ root.currentIndex = 1
+ stockView.update()
+ }
}
- }
- model: ObjectModel {
- StockListView {
- id: listView
- width: root.width
- height: root.height
- }
+ model: ObjectModel {
+ StockListView {
+ id: listView
+ width: root.width
+ height: root.height
+ }
- StockView {
- id: stockView
- width: root.width
- height: root.height
- stocklist: listView
- stock: stock
+ StockView {
+ id: stockView
+ width: root.width
+ height: root.height
+ stocklist: listView
+ stock: stock
+ }
}
}
}
diff --git a/examples/quick/demos/stocqt/stocqt.qrc b/examples/quick/demos/stocqt/stocqt.qrc
index 920e56d4d0..ab7772a62a 100644
--- a/examples/quick/demos/stocqt/stocqt.qrc
+++ b/examples/quick/demos/stocqt/stocqt.qrc
@@ -16,5 +16,7 @@
<file>content/StockInfo.qml</file>
<file>content/Settings.qml</file>
<file>content/+windows/Settings.qml</file>
+ <file>content/StockListDelegate.qml</file>
+ <file>content/Banner.qml</file>
</qresource>
</RCC>
diff --git a/examples/quick/localstorage/doc/src/localstorage.qdoc b/examples/quick/localstorage/doc/src/localstorage.qdoc
index b52e0afd80..1bfba147e1 100644
--- a/examples/quick/localstorage/doc/src/localstorage.qdoc
+++ b/examples/quick/localstorage/doc/src/localstorage.qdoc
@@ -35,8 +35,13 @@
\include examples-run.qdocinc
- \section1 Hello World
+ \section1 Activity Tracker
- \e {Hello World} demonstrates creating a simple SQL table and doing
- insert and select operations.
+ \e {Activity tracker} allows you to keep track of walks, hikes, or bike trips.
+
+ All database transactions are handled in Database.js. The database is
+ checked at startup, and created if it does not exist. LocalStorage uses
+ SQLite, which is a self-contained, serverless, public-domain database.
+ Opening a connection to the database is handled at the beginning of each
+ function that manipulates or retrieves data.
*/
diff --git a/examples/quick/localstorage/localstorage/Database.js b/examples/quick/localstorage/localstorage/Database.js
new file mode 100644
index 0000000000..387033795f
--- /dev/null
+++ b/examples/quick/localstorage/localstorage/Database.js
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+function dbInit()
+{
+ var db = LocalStorage.openDatabaseSync("Activity_Tracker_DB", "", "Track exercise", 1000000)
+ try {
+ db.transaction(function (tx) {
+ tx.executeSql('CREATE TABLE IF NOT EXISTS trip_log (date text,trip_desc text,distance numeric)')
+ })
+ } catch (err) {
+ console.log("Error creating table in database: " + err)
+ };
+}
+
+function dbGetHandle()
+{
+ try {
+ var db = LocalStorage.openDatabaseSync("Activity_Tracker_DB", "",
+ "Track exercise", 1000000)
+ } catch (err) {
+ console.log("Error opening database: " + err)
+ }
+ return db
+}
+
+function dbInsert(Pdate, Pdesc, Pdistance)
+{
+ var db = dbGetHandle()
+ var rowid = 0;
+ db.transaction(function (tx) {
+ tx.executeSql('INSERT INTO trip_log VALUES(?, ?, ?)',
+ [Pdate, Pdesc, Pdistance])
+ var result = tx.executeSql('SELECT last_insert_rowid()')
+ rowid = result.insertId
+ })
+ return rowid;
+}
+
+function dbReadAll()
+{
+ var db = dbGetHandle()
+ db.transaction(function (tx) {
+ var results = tx.executeSql(
+ 'SELECT rowid,date,trip_desc,distance FROM trip_log order by rowid desc')
+ for (var i = 0; i < results.rows.length; i++) {
+ listModel.append({
+ id: results.rows.item(i).rowid,
+ checked: " ",
+ date: results.rows.item(i).date,
+ trip_desc: results.rows.item(i).trip_desc,
+ distance: results.rows.item(i).distance
+ })
+ }
+ })
+}
+
+function dbUpdate(Pdate, Pdesc, Pdistance, Prowid)
+{
+ var db = dbGetHandle()
+ db.transaction(function (tx) {
+ tx.executeSql(
+ 'update trip_log set date=?, trip_desc=?, distance=? where rowid = ?', [Pdate, Pdesc, Pdistance, Prowid])
+ })
+}
+
+function dbDeleteRow(Prowid)
+{
+ var db = dbGetHandle()
+ db.transaction(function (tx) {
+ tx.executeSql('delete from trip_log where rowid = ?', [Prowid])
+ })
+}
diff --git a/examples/quick/localstorage/localstorage/Header.qml b/examples/quick/localstorage/localstorage/Header.qml
new file mode 100644
index 0000000000..a08645a170
--- /dev/null
+++ b/examples/quick/localstorage/localstorage/Header.qml
@@ -0,0 +1,173 @@
+
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.7
+import QtQuick.Window 2.0
+import QtQuick.LocalStorage 2.0
+import "Database.js" as JS
+import QtQuick.Layouts 1.1
+
+Item {
+ id: root
+ width: Screen.width / 2
+ height: Screen.height / 7
+
+ function insertrec() {
+ var rowid = parseInt(JS.dbInsert(dateInput.text, descInput.text, distInput.text), 10)
+ if (rowid) {
+ listView.model.setProperty(listView.currentIndex, "id", rowid)
+ listView.forceLayout()
+ }
+ return rowid;
+ }
+
+ function editrec(Pdate, Pdesc, Pdistance, Prowid) {
+ dateInput.text = Pdate
+ descInput.text = Pdesc
+ distInput.text = Pdistance
+ }
+
+ function initrec_new() {
+ dateInput.clear()
+ descInput.clear()
+ distInput.clear()
+ listView.model.insert(0, {
+ date: "",
+ trip_desc: "",
+ distance: 0
+ })
+ listView.currentIndex = 0
+ dateInput.forceActiveFocus()
+ }
+
+ function initrec() {
+ dateInput.clear()
+ descInput.clear()
+ distInput.clear()
+ }
+
+ function setlistview() {
+ listView.model.setProperty(listView.currentIndex, "date",
+ dateInput.text)
+ listView.model.setProperty(listView.currentIndex, "trip_desc",
+ descInput.text)
+ listView.model.setProperty(listView.currentIndex, "distance",
+ parseInt(distInput.text,10))
+ }
+
+ Rectangle {
+ id: rootrect
+ border.width: 10
+ color: "#161616"
+
+ ColumnLayout {
+ id: mainLayout
+ anchors.fill: parent
+
+ Rectangle {
+ id: gridBox
+ Layout.fillWidth: true
+
+ GridLayout {
+ id: gridLayout
+ rows: 3
+ flow: GridLayout.TopToBottom
+ anchors.fill: parent
+
+ Text {
+ text: "Date"
+ font.pixelSize: 22
+ rightPadding: 10
+ }
+
+ Text {
+ text: "Description"
+ font.pixelSize: 22
+ rightPadding: 10
+ }
+
+ Text {
+ text: "Distance"
+ font.pixelSize: 22
+ }
+
+ TextInput {
+ id: dateInput
+ font.pixelSize: 22
+ activeFocusOnPress: true
+ activeFocusOnTab: true
+ validator: RegExpValidator {
+ regExp: /[0-9/,:.]+/
+ }
+ onEditingFinished: {
+ if (dateInput.text == "") {
+ statustext.text = "Please fill in the date"
+ dateInput.forceActiveFocus()
+ }
+ }
+ }
+
+ TextInput {
+ id: descInput
+ font.pixelSize: 22
+ activeFocusOnPress: true
+ activeFocusOnTab: true
+ onEditingFinished: {
+ if (descInput.text.length < 8) {
+ statustext.text = "Enter a description of minimum 8 characters"
+ descInput.forceActiveFocus()
+ } else {
+ statustext.text = ""
+ }
+ }
+ }
+
+ TextInput {
+ id: distInput
+ font.pixelSize: 22
+ activeFocusOnPress: true
+ activeFocusOnTab: true
+ validator: RegExpValidator {
+ regExp: /\d{1,3}/
+ }
+ onEditingFinished: {
+ if (distInput.text == "") {
+ statustext.text = "Please fill in the distance"
+ distInput.forceActiveFocus()
+ }
+ }
+ }
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: dateInput.forceActiveFocus()
+ }
+ }
+ }
+}
diff --git a/examples/quick/localstorage/localstorage/MyButton.qml b/examples/quick/localstorage/localstorage/MyButton.qml
new file mode 100644
index 0000000000..4659b45f64
--- /dev/null
+++ b/examples/quick/localstorage/localstorage/MyButton.qml
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ id: button
+
+ property bool checked: false
+ property alias text: buttonText.text
+
+ Accessible.name: text
+ Accessible.description: "This button does " + text
+ Accessible.role: Accessible.Button
+ Accessible.onPressAction: button.clicked()
+
+ signal clicked
+
+ implicitWidth: buttonText.implicitWidth + 20
+ implicitHeight: 30
+ gradient: Gradient {
+ GradientStop {
+ position: 0.0
+ color: "grey"
+ }
+ GradientStop {
+ position: 1.0
+ color: button.focus ? "red" : "grey"
+ }
+ }
+
+ radius: 5
+ antialiasing: true
+
+ Text {
+ id: buttonText
+ text: parent.description
+ anchors.centerIn: parent
+ font.pixelSize: parent.height * .5
+ style: enabled ? Text.Sunken : Text.Normal
+ color: enabled ? "white" : "#555"
+ styleColor: "black"
+ }
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ onClicked: parent.clicked()
+ }
+
+ Keys.onSpacePressed: clicked()
+}
diff --git a/examples/quick/localstorage/localstorage/MyDelegate.qml b/examples/quick/localstorage/localstorage/MyDelegate.qml
new file mode 100644
index 0000000000..9a4ac1cc46
--- /dev/null
+++ b/examples/quick/localstorage/localstorage/MyDelegate.qml
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.LocalStorage 2.0
+import QtQuick.Layouts 1.1
+import "Database.js" as JS
+
+Item {
+ width: parent.width
+ height: rDate.implicitHeight
+
+ Rectangle {
+ id: baseRec
+ anchors.fill: parent
+ opacity: 0.8
+ color: index % 2 ? "lightgrey" : "grey"
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: listView.currentIndex = index
+ }
+ GridLayout {
+ anchors.fill:parent
+ columns: 3
+
+ Text {
+ id: rDate
+ text: date
+ font.pixelSize: 22
+ Layout.preferredWidth: parent.width / 4
+ color: "black"
+ }
+ Text {
+ id: rDesc
+ text: trip_desc
+ Layout.fillWidth: true
+ font.pixelSize: 22
+ color: "black"
+ }
+ Text {
+ id: rDistance
+ text: distance
+ font.pixelSize: 22
+ Layout.alignment: Qt.AlignRight
+ color: "black"
+ }
+ }
+ }
+}
diff --git a/examples/quick/localstorage/localstorage/MyModel.qml b/examples/quick/localstorage/localstorage/MyModel.qml
new file mode 100644
index 0000000000..0677ec74d6
--- /dev/null
+++ b/examples/quick/localstorage/localstorage/MyModel.qml
@@ -0,0 +1,35 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.LocalStorage 2.0
+import "Database.js" as JS
+
+ListModel {
+ id: listModel
+ Component.onCompleted: JS.dbReadAll()
+}
diff --git a/examples/quick/localstorage/localstorage/localstorage.qml b/examples/quick/localstorage/localstorage/localstorage.qml
index 61e9eff8b6..b85fad4764 100644
--- a/examples/quick/localstorage/localstorage/localstorage.qml
+++ b/examples/quick/localstorage/localstorage/localstorage.qml
@@ -1,54 +1,183 @@
- /****************************************************************************
+/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2016 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
-** This file is part of the examples of the Qt Toolkit.
+** This file is part of the documentation 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 The Qt Company Ltd 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_BEGIN_LICENSE:FDL$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/
-import QtQuick 2.0
-import "../../shared" as Examples
+import QtQuick 2.5
+import QtQuick.Window 2.2
+import QtQuick.Layouts 1.1
+import QtQuick.LocalStorage 2.0
+import "Database.js" as JS
+
+Window {
+ visible: true
+ width: Screen.width / 2
+ height: Screen.height / 1.8
+ color: "#161616"
-Item {
- height: 480
- width: 320
- Examples.LauncherList {
- id: ll
+ property bool creatingNewEntry: false
+ property bool editingEntry: false
+
+ Rectangle {
anchors.fill: parent
- Component.onCompleted: {
- addExample("Hello World", "Simple SQL operations with local storage API", Qt.resolvedUrl("hello.qml"));
+
+ ColumnLayout {
+ anchors.fill: parent
+
+ Header {
+ id: input
+ Layout.fillWidth: true
+ }
+ RowLayout {
+ MyButton {
+ text: "New"
+ onClicked: {
+ input.initrec_new()
+ creatingNewEntry = true
+ listView.model.setProperty(listView.currentIndex, "id", 0)
+ }
+ }
+ MyButton {
+ id: saveButton
+ enabled: (creatingNewEntry || editingEntry) && listView.currentIndex != -1
+ text: "Save"
+ onClicked: {
+ var insertedRow = false;
+ if (listView.model.get(listView.currentIndex).id < 1) {
+ //insert mode
+ if (input.insertrec()) {
+ // Successfully inserted a row.
+ input.setlistview()
+ insertedRow = true
+ } else {
+ // Failed to insert a row; display an error message.
+ statustext.text = "Failed to insert row"
+ }
+ } else {
+ // edit mode
+ input.setlistview()
+ JS.dbUpdate(listView.model.get(listView.currentIndex).date,
+ listView.model.get(listView.currentIndex).trip_desc,
+ listView.model.get(listView.currentIndex).distance,
+ listView.model.get(listView.currentIndex).id)
+ }
+
+ if (insertedRow) {
+ input.initrec()
+ creatingNewEntry = false
+ editingEntry = false
+ listView.forceLayout()
+ }
+ }
+ }
+ MyButton {
+ id: editButton
+ text: "Edit"
+ enabled: !creatingNewEntry && !editingEntry && listView.currentIndex != -1
+ onClicked: {
+ input.editrec(listView.model.get(listView.currentIndex).date,
+ listView.model.get(listView.currentIndex).trip_desc,
+ listView.model.get(listView.currentIndex).distance,
+ listView.model.get(listView.currentIndex).id)
+
+ editingEntry = true
+ }
+ }
+ MyButton {
+ id: deleteButton
+ text: "Delete"
+ enabled: !creatingNewEntry && listView.currentIndex != -1
+ onClicked: {
+ JS.dbDeleteRow(listView.model.get(listView.currentIndex).id)
+ listView.model.remove(listView.currentIndex, 1)
+ if (listView.count == 0) {
+ // ListView doesn't automatically set its currentIndex to -1
+ // when the count becomes 0.
+ listView.currentIndex = -1
+ }
+ }
+ }
+ MyButton {
+ id: cancelButton
+ text: "Cancel"
+ enabled: (creatingNewEntry || editingEntry) && listView.currentIndex != -1
+ onClicked: {
+ if (listView.model.get(listView.currentIndex).id === 0) {
+ // This entry had an id of 0, which means it was being created and hadn't
+ // been saved to the database yet, so we can safely remove it from the model.
+ listView.model.remove(listView.currentIndex, 1)
+ }
+ listView.forceLayout()
+ creatingNewEntry = false
+ editingEntry = false
+ input.initrec()
+ }
+ }
+ MyButton {
+ text: "Exit"
+ onClicked: Qt.quit()
+ }
+ }
+ Component {
+ id: highlightBar
+ Rectangle {
+ width: listView.currentItem.width
+ height: listView.currentItem.height
+ color: "lightgreen"
+ }
+ }
+ ListView {
+ id: listView
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ model: MyModel {}
+ delegate: MyDelegate {}
+ // Don't allow changing the currentIndex while the user is creating/editing values.
+ enabled: !creatingNewEntry && !editingEntry
+
+ highlight: highlightBar
+ highlightFollowsCurrentItem: true
+ focus: true
+
+ header: Component {
+ Text {
+ text: "Saved activities"
+ }
+ }
+ }
+ Text {
+ id: statustext
+ color: "red"
+ Layout.fillWidth: true
+ font.bold: true
+ font.pointSize: 20
+
+ }
}
}
+ Component.onCompleted: {
+ JS.dbInit()
+ }
}
diff --git a/examples/quick/localstorage/localstorage/localstorage.qmlproject b/examples/quick/localstorage/localstorage/localstorage.qmlproject
deleted file mode 100644
index 6835d23503..0000000000
--- a/examples/quick/localstorage/localstorage/localstorage.qmlproject
+++ /dev/null
@@ -1,16 +0,0 @@
-import QmlProject 1.0
-
-Project {
- mainFile: "localstorage.qml"
- /* Include .qml, .js, and image files from current directory and subdirectories */
-
- QmlFiles {
- directory: "."
- }
- JavaScriptFiles {
- directory: "."
- }
- ImageFiles {
- directory: "."
- }
-} \ No newline at end of file
diff --git a/examples/quick/localstorage/localstorage/localstorage.qrc b/examples/quick/localstorage/localstorage/localstorage.qrc
index 09ac2de033..079438be2b 100644
--- a/examples/quick/localstorage/localstorage/localstorage.qrc
+++ b/examples/quick/localstorage/localstorage/localstorage.qrc
@@ -1,6 +1,10 @@
<RCC>
- <qresource prefix="/localstorage/localstorage">
- <file>hello.qml</file>
+ <qresource prefix="/">
+ <file>Header.qml</file>
+ <file>Database.js</file>
+ <file>MyModel.qml</file>
+ <file>MyButton.qml</file>
+ <file>MyDelegate.qml</file>
<file>localstorage.qml</file>
</qresource>
</RCC>
diff --git a/examples/quick/localstorage/localstorage/main.cpp b/examples/quick/localstorage/localstorage/main.cpp
index 6e522753e9..9f8adbb7a5 100644
--- a/examples/quick/localstorage/localstorage/main.cpp
+++ b/examples/quick/localstorage/localstorage/main.cpp
@@ -1,41 +1,38 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
+** Copyright (C) 2016 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
-** 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 The Qt Company Ltd 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."
-**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** 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 The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/
-#include "../../shared/shared.h"
-DECLARATIVE_EXAMPLE_MAIN(localstorage/localstorage/localstorage)
+#include <QGuiApplication>
+#include <QQmlApplicationEngine>
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+
+ QQmlApplicationEngine engine;
+ engine.load(QUrl(QStringLiteral("qrc:/localstorage.qml")));
+
+ return app.exec();
+}
diff --git a/examples/quick/localstorage/localstorage/qml-localstorage-example.png b/examples/quick/localstorage/localstorage/qml-localstorage-example.png
new file mode 100644
index 0000000000..7d7edafe63
--- /dev/null
+++ b/examples/quick/localstorage/localstorage/qml-localstorage-example.png
Binary files differ
diff --git a/examples/quick/quickwidgets/quickwidget/fbitem.cpp b/examples/quick/quickwidgets/quickwidget/fbitem.cpp
index fc2a4ea7ad..cb3cc976fb 100644
--- a/examples/quick/quickwidgets/quickwidget/fbitem.cpp
+++ b/examples/quick/quickwidgets/quickwidget/fbitem.cpp
@@ -44,7 +44,7 @@
#include <QtGui/QOpenGLFunctions>
#include <QtCore/QDebug>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
class FbRenderer : public QQuickFramebufferObject::Renderer
{
public:
@@ -82,7 +82,7 @@ private:
QQuickFramebufferObject::Renderer *FbItem::createRenderer() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
return new FbRenderer;
#else
return nullptr;
diff --git a/examples/quick/scenegraph/rendernode/customrenderitem.cpp b/examples/quick/scenegraph/rendernode/customrenderitem.cpp
index a92a400922..27c55bf86d 100644
--- a/examples/quick/scenegraph/rendernode/customrenderitem.cpp
+++ b/examples/quick/scenegraph/rendernode/customrenderitem.cpp
@@ -62,7 +62,7 @@ QSGNode *CustomRenderItem::updatePaintNode(QSGNode *node, UpdatePaintNodeData *)
return nullptr;
switch (ri->graphicsApi()) {
case QSGRendererInterface::OpenGL:
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
n = new OpenGLRenderNode(this);
break;
#endif
diff --git a/examples/quick/scenegraph/rendernode/openglrenderer.cpp b/examples/quick/scenegraph/rendernode/openglrenderer.cpp
index 2edb6bd929..c84867797d 100644
--- a/examples/quick/scenegraph/rendernode/openglrenderer.cpp
+++ b/examples/quick/scenegraph/rendernode/openglrenderer.cpp
@@ -41,7 +41,7 @@
#include "openglrenderer.h"
#include <QQuickItem>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <QOpenGLShaderProgram>
#include <QOpenGLBuffer>
@@ -161,4 +161,4 @@ QRectF OpenGLRenderNode::rect() const
return QRect(0, 0, m_item->width(), m_item->height());
}
-#endif // QT_NO_OPENGL
+#endif // opengl
diff --git a/examples/quick/scenegraph/rendernode/openglrenderer.h b/examples/quick/scenegraph/rendernode/openglrenderer.h
index 92cc2bc72b..ea2bbcbc38 100644
--- a/examples/quick/scenegraph/rendernode/openglrenderer.h
+++ b/examples/quick/scenegraph/rendernode/openglrenderer.h
@@ -43,7 +43,7 @@
#include <qsgrendernode.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QT_BEGIN_NAMESPACE
@@ -75,6 +75,6 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_OPENGL
+#endif // opengl
#endif
diff --git a/examples/quick/scenegraph/scenegraph.pro b/examples/quick/scenegraph/scenegraph.pro
index e13e8198b0..2efeb5ed83 100644
--- a/examples/quick/scenegraph/scenegraph.pro
+++ b/examples/quick/scenegraph/scenegraph.pro
@@ -7,7 +7,6 @@ qtConfig(opengl(es1|es2)?) {
sgengine \
textureinsgnode \
openglunderqml \
- textureinsgnode \
textureinthread \
twotextureproviders
}
diff --git a/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp b/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp
index bbf11e4488..0c902c7172 100644
--- a/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp
+++ b/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp
@@ -191,6 +191,16 @@ void OSAllocator::releaseDecommitted(void* address, size_t bytes)
bool OSAllocator::canAllocateExecutableMemory()
{
+ int flags = MAP_PRIVATE | MAP_ANON;
+#if PLATFORM(IOS)
+ if (executable)
+ flags |= MAP_JIT;
+#endif
+ const auto size = pageSize();
+ void *testPage = mmap(nullptr, size, PROT_READ | PROT_WRITE | PROT_EXEC, flags, /*fd*/-1, /*offset*/0);
+ if (testPage == MAP_FAILED)
+ return false;
+ munmap(testPage, size);
return true;
}
diff --git a/src/imports/folderlistmodel/fileinfothread.cpp b/src/imports/folderlistmodel/fileinfothread.cpp
index 0b62935f87..d3e256bb7e 100644
--- a/src/imports/folderlistmodel/fileinfothread.cpp
+++ b/src/imports/folderlistmodel/fileinfothread.cpp
@@ -46,7 +46,7 @@
FileInfoThread::FileInfoThread(QObject *parent)
: QThread(parent),
abort(false),
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
watcher(0),
#endif
sortFlags(QDir::Name),
@@ -61,11 +61,11 @@ FileInfoThread::FileInfoThread(QObject *parent)
showOnlyReadable(false),
caseSensitive(true)
{
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
watcher = new QFileSystemWatcher(this);
connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(dirChanged(QString)));
connect(watcher, SIGNAL(fileChanged(QString)), this, SLOT(updateFile(QString)));
-#endif // !QT_NO_FILESYSTEMWATCHER
+#endif // filesystemwatcher
}
FileInfoThread::~FileInfoThread()
@@ -80,7 +80,7 @@ FileInfoThread::~FileInfoThread()
void FileInfoThread::clear()
{
QMutexLocker locker(&mutex);
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
watcher->removePaths(watcher->files());
watcher->removePaths(watcher->directories());
#endif
@@ -89,7 +89,7 @@ void FileInfoThread::clear()
void FileInfoThread::removePath(const QString &path)
{
QMutexLocker locker(&mutex);
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
if (!path.startsWith(QLatin1Char(':')))
watcher->removePath(path);
#else
@@ -103,7 +103,7 @@ void FileInfoThread::setPath(const QString &path)
Q_ASSERT(!path.isEmpty());
QMutexLocker locker(&mutex);
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
if (!path.startsWith(QLatin1Char(':')))
watcher->addPath(path);
#endif
@@ -120,7 +120,7 @@ void FileInfoThread::setRootPath(const QString &path)
rootPath = path;
}
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
void FileInfoThread::dirChanged(const QString &directoryPath)
{
Q_UNUSED(directoryPath);
@@ -204,7 +204,7 @@ void FileInfoThread::setCaseSensitive(bool on)
condition.wakeAll();
}
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
void FileInfoThread::updateFile(const QString &path)
{
Q_UNUSED(path);
diff --git a/src/imports/folderlistmodel/fileinfothread_p.h b/src/imports/folderlistmodel/fileinfothread_p.h
index 56058fd6be..b505ece750 100644
--- a/src/imports/folderlistmodel/fileinfothread_p.h
+++ b/src/imports/folderlistmodel/fileinfothread_p.h
@@ -88,7 +88,7 @@ public:
void setCaseSensitive(bool on);
public Q_SLOTS:
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
void dirChanged(const QString &directoryPath);
void updateFile(const QString &path);
#endif
@@ -103,7 +103,7 @@ private:
QWaitCondition condition;
volatile bool abort;
-#ifndef QT_NO_FILESYSTEMWATCHER
+#if QT_CONFIG(filesystemwatcher)
QFileSystemWatcher *watcher;
#endif
QList<FileProperty> currentFileList;
diff --git a/src/imports/folderlistmodel/plugin.cpp b/src/imports/folderlistmodel/plugin.cpp
index affde1c3aa..ef719109bd 100644
--- a/src/imports/folderlistmodel/plugin.cpp
+++ b/src/imports/folderlistmodel/plugin.cpp
@@ -62,12 +62,10 @@ public:
void registerTypes(const char *uri) Q_DECL_OVERRIDE
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.folderlistmodel"));
-#ifndef QT_NO_DIRMODEL
qmlRegisterType<QQuickFolderListModel>(uri,1,0,"FolderListModel");
qmlRegisterType<QQuickFolderListModel>(uri,2,0,"FolderListModel");
qmlRegisterType<QQuickFolderListModel,1>(uri,2,1,"FolderListModel");
qmlRegisterType<QQuickFolderListModel,2>(uri,2,2,"FolderListModel");
-#endif
}
};
//![class decl]
diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
index 1c94fddecf..fdcce9c685 100644
--- a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
+++ b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
@@ -447,9 +447,9 @@ void QQuickFolderListModel::setFolder(const QUrl &folder)
/*!
\qmlproperty url FolderListModel::rootFolder
- When the rootFolder is set, then this folder will
- be threated as the root in the file system, so that
- you can only travers sub folders from this rootFolder.
+ When this property is set, the given folder will
+ be treated as the root in the file system, so that
+ you can only traverse subfolders within it.
*/
QUrl QQuickFolderListModel::rootFolder() const
{
diff --git a/src/imports/layouts/qquicklayout.cpp b/src/imports/layouts/qquicklayout.cpp
index 07ada75a5f..3786d21727 100644
--- a/src/imports/layouts/qquicklayout.cpp
+++ b/src/imports/layouts/qquicklayout.cpp
@@ -763,18 +763,14 @@ void QQuickLayout::itemChange(ItemChange change, const ItemChangeData &value)
{
if (change == ItemChildAddedChange) {
QQuickItem *item = value.item;
- qmlobject_connect(item, QQuickItem, SIGNAL(implicitWidthChanged()), this, QQuickLayout, SLOT(invalidateSenderItem()));
- qmlobject_connect(item, QQuickItem, SIGNAL(implicitHeightChanged()), this, QQuickLayout, SLOT(invalidateSenderItem()));
qmlobject_connect(item, QQuickItem, SIGNAL(baselineOffsetChanged(qreal)), this, QQuickLayout, SLOT(invalidateSenderItem()));
- QQuickItemPrivate::get(item)->addItemChangeListener(this, QQuickItemPrivate::SiblingOrder);
+ QQuickItemPrivate::get(item)->addItemChangeListener(this, QQuickItemPrivate::SiblingOrder | QQuickItemPrivate::ImplicitWidth | QQuickItemPrivate::ImplicitHeight | QQuickItemPrivate::Destroyed | QQuickItemPrivate::Visibility);
if (isReady())
updateLayoutItems();
} else if (change == ItemChildRemovedChange) {
QQuickItem *item = value.item;
- qmlobject_disconnect(item, QQuickItem, SIGNAL(implicitWidthChanged()), this, QQuickLayout, SLOT(invalidateSenderItem()));
- qmlobject_disconnect(item, QQuickItem, SIGNAL(implicitHeightChanged()), this, QQuickLayout, SLOT(invalidateSenderItem()));
qmlobject_disconnect(item, QQuickItem, SIGNAL(baselineOffsetChanged(qreal)), this, QQuickLayout, SLOT(invalidateSenderItem()));
- QQuickItemPrivate::get(item)->removeItemChangeListener(this, QQuickItemPrivate::SiblingOrder);
+ QQuickItemPrivate::get(item)->removeItemChangeListener(this, QQuickItemPrivate::SiblingOrder | QQuickItemPrivate::ImplicitWidth | QQuickItemPrivate::ImplicitHeight | QQuickItemPrivate::Destroyed | QQuickItemPrivate::Visibility);
if (isReady())
updateLayoutItems();
}
@@ -812,6 +808,30 @@ void QQuickLayout::itemSiblingOrderChanged(QQuickItem *item)
updateLayoutItems();
}
+void QQuickLayout::itemImplicitWidthChanged(QQuickItem *item)
+{
+ if (!isReady() || item->signalsBlocked())
+ return;
+ invalidate(item);
+}
+
+void QQuickLayout::itemImplicitHeightChanged(QQuickItem *item)
+{
+ if (!isReady() || item->signalsBlocked())
+ return;
+ invalidate(item);
+}
+
+void QQuickLayout::itemDestroyed(QQuickItem *item)
+{
+ Q_UNUSED(item);
+}
+
+void QQuickLayout::itemVisibilityChanged(QQuickItem *item)
+{
+ Q_UNUSED(item);
+}
+
void QQuickLayout::rearrange(const QSizeF &/*size*/)
{
m_dirty = false;
diff --git a/src/imports/layouts/qquicklayout_p.h b/src/imports/layouts/qquicklayout_p.h
index c7f04c1fed..eece6f8658 100644
--- a/src/imports/layouts/qquicklayout_p.h
+++ b/src/imports/layouts/qquicklayout_p.h
@@ -99,6 +99,10 @@ public:
/* QQuickItemChangeListener */
void itemSiblingOrderChanged(QQuickItem *item) Q_DECL_OVERRIDE;
+ void itemImplicitWidthChanged(QQuickItem *item) Q_DECL_OVERRIDE;
+ void itemImplicitHeightChanged(QQuickItem *item) Q_DECL_OVERRIDE;
+ void itemDestroyed(QQuickItem *item) Q_DECL_OVERRIDE;
+ void itemVisibilityChanged(QQuickItem *item) Q_DECL_OVERRIDE;
protected:
void updatePolish() Q_DECL_OVERRIDE;
diff --git a/src/imports/layouts/qquicklinearlayout.cpp b/src/imports/layouts/qquicklinearlayout.cpp
index 7fad395a29..13fdd496c2 100644
--- a/src/imports/layouts/qquicklinearlayout.cpp
+++ b/src/imports/layouts/qquicklinearlayout.cpp
@@ -303,17 +303,13 @@ QQuickGridLayoutBase::~QQuickGridLayoutBase()
{
Q_D(QQuickGridLayoutBase);
- /* Avoid messy deconstruction, should give:
- * Faster deconstruction
- * Less risk of signals reaching already deleted objects
- */
+ // Remove item listeners so we do not act on signalling unnecessarily
+ // (there is no point, as the layout will be torn down anyway).
for (int i = 0; i < itemCount(); ++i) {
QQuickItem *item = itemAt(i);
- qmlobject_disconnect(item, QQuickItem, SIGNAL(destroyed()), this, QQuickGridLayoutBase, SLOT(onItemDestroyed()));
- qmlobject_disconnect(item, QQuickItem, SIGNAL(visibleChanged()), this, QQuickGridLayoutBase, SLOT(onItemVisibleChanged()));
- qmlobject_disconnect(item, QQuickItem, SIGNAL(implicitWidthChanged()), this, QQuickGridLayoutBase, SLOT(invalidateSenderItem()));
- qmlobject_disconnect(item, QQuickItem, SIGNAL(implicitHeightChanged()), this, QQuickGridLayoutBase, SLOT(invalidateSenderItem()));
+ QQuickItemPrivate::get(item)->removeItemChangeListener(this, QQuickItemPrivate::SiblingOrder | QQuickItemPrivate::ImplicitWidth | QQuickItemPrivate::ImplicitHeight | QQuickItemPrivate::Destroyed | QQuickItemPrivate::Visibility);
}
+
delete d->styleInfo;
}
@@ -436,23 +432,6 @@ int QQuickGridLayoutBase::itemCount() const
return d->engine.itemCount();
}
-void QQuickGridLayoutBase::itemChange(ItemChange change, const ItemChangeData &value)
-{
- if (change == ItemChildAddedChange) {
- quickLayoutDebug() << "ItemChildAddedChange";
- QQuickItem *item = value.item;
- qmlobject_connect(item, QQuickItem, SIGNAL(destroyed()), this, QQuickGridLayoutBase, SLOT(onItemDestroyed()));
- qmlobject_connect(item, QQuickItem, SIGNAL(visibleChanged()), this, QQuickGridLayoutBase, SLOT(onItemVisibleChanged()));
- } else if (change == ItemChildRemovedChange) {
- quickLayoutDebug() << "ItemChildRemovedChange";
- QQuickItem *item = value.item;
- qmlobject_disconnect(item, QQuickItem, SIGNAL(destroyed()), this, QQuickGridLayoutBase, SLOT(onItemDestroyed()));
- qmlobject_disconnect(item, QQuickItem, SIGNAL(visibleChanged()), this, QQuickGridLayoutBase, SLOT(onItemVisibleChanged()));
- }
-
- QQuickLayout::itemChange(change, value);
-}
-
void QQuickGridLayoutBase::removeGridItem(QGridLayoutItem *gridItem)
{
Q_D(QQuickGridLayoutBase);
@@ -461,28 +440,29 @@ void QQuickGridLayoutBase::removeGridItem(QGridLayoutItem *gridItem)
d->engine.removeRows(index, 1, d->orientation);
}
-void QQuickGridLayoutBase::onItemVisibleChanged()
-{
- if (!isReady())
- return;
- quickLayoutDebug() << "QQuickGridLayoutBase::onItemVisibleChanged";
- updateLayoutItems();
-}
-
-void QQuickGridLayoutBase::onItemDestroyed()
+void QQuickGridLayoutBase::itemDestroyed(QQuickItem *item)
{
if (!isReady())
return;
Q_D(QQuickGridLayoutBase);
- quickLayoutDebug() << "QQuickGridLayoutBase::onItemDestroyed";
- QQuickItem *inDestruction = static_cast<QQuickItem *>(sender());
- if (QQuickGridLayoutItem *gridItem = d->engine.findLayoutItem(inDestruction)) {
+ quickLayoutDebug() << "QQuickGridLayoutBase::itemDestroyed";
+ if (QQuickGridLayoutItem *gridItem = d->engine.findLayoutItem(item)) {
removeGridItem(gridItem);
delete gridItem;
invalidate();
}
}
+void QQuickGridLayoutBase::itemVisibilityChanged(QQuickItem *item)
+{
+ Q_UNUSED(item);
+
+ if (!isReady())
+ return;
+ quickLayoutDebug() << "QQuickGridLayoutBase::itemVisibilityChanged";
+ updateLayoutItems();
+}
+
void QQuickGridLayoutBase::rearrange(const QSizeF &size)
{
Q_D(QQuickGridLayoutBase);
diff --git a/src/imports/layouts/qquicklinearlayout_p.h b/src/imports/layouts/qquicklinearlayout_p.h
index ca8b867824..b425df0fa4 100644
--- a/src/imports/layouts/qquicklinearlayout_p.h
+++ b/src/imports/layouts/qquicklinearlayout_p.h
@@ -77,6 +77,10 @@ public:
Qt::LayoutDirection effectiveLayoutDirection() const;
void setAlignment(QQuickItem *item, Qt::Alignment align) Q_DECL_OVERRIDE;
+ /* QQuickItemChangeListener */
+ void itemDestroyed(QQuickItem *item) Q_DECL_OVERRIDE;
+ void itemVisibilityChanged(QQuickItem *item) Q_DECL_OVERRIDE;
+
protected:
void updateLayoutItems() Q_DECL_OVERRIDE;
QQuickItem *itemAt(int index) const Q_DECL_OVERRIDE;
@@ -84,15 +88,10 @@ protected:
void rearrange(const QSizeF &size) Q_DECL_OVERRIDE;
virtual void insertLayoutItems() {}
- void itemChange(ItemChange change, const ItemChangeData &data) Q_DECL_OVERRIDE;
signals:
Q_REVISION(1) void layoutDirectionChanged();
-protected slots:
- void onItemVisibleChanged();
- void onItemDestroyed();
-
private:
void removeGridItem(QGridLayoutItem *gridItem);
Q_DECLARE_PRIVATE(QQuickGridLayoutBase)
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index b8fd307215..ebffb07346 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -449,7 +449,7 @@ static ReturnedValue qmlsqldatabase_changeVersion(CallContext *ctx)
if (ok) {
*w->d()->version = to_version;
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
QSettings ini(qmlsqldatabase_databaseFile(db.connectionName(), scope.engine) + QLatin1String(".ini"), QSettings::IniFormat);
ini.setValue(QLatin1String("Version"), to_version);
#endif
@@ -700,7 +700,7 @@ public:
void QQuickLocalStorage::openDatabaseSync(QQmlV4Function *args)
{
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
QV4::Scope scope(args->v4engine());
if (scope.engine->qmlEngine()->offlineStoragePath().isEmpty())
V4THROW_SQL2(SQLEXCEPTION_DATABASE_ERR, QQmlEngine::tr("SQL: can't create database, offline storage is disabled."));
@@ -770,7 +770,7 @@ void QQuickLocalStorage::openDatabaseSync(QQmlV4Function *args)
}
args->setReturnValue(db.asReturnedValue());
-#endif // QT_NO_SETTINGS
+#endif // settings
}
static QObject *module_api_factory(QQmlEngine *engine, QJSEngine *scriptEngine)
diff --git a/src/imports/testlib/SignalSpy.qml b/src/imports/testlib/SignalSpy.qml
index 200fc725f7..8a8e844a21 100644
--- a/src/imports/testlib/SignalSpy.qml
+++ b/src/imports/testlib/SignalSpy.qml
@@ -230,8 +230,14 @@ Item {
qtest_prevSignalName = ""
}
if (target != null && signalName != "") {
- var handlerName = qtest_signalHandlerName(signalName)
- var func = target[handlerName]
+ // Look for the signal name in the object
+ var func = target[signalName]
+ if (typeof func !== "function") {
+ // If it is not a function, try looking for signal handler
+ // i.e. (onSignal) this is needed for cases where there is a property
+ // and a signal with the same name, e.g. Mousearea.pressed
+ func = target[qtest_signalHandlerName(signalName)]
+ }
if (func === undefined) {
spy.qtest_valid = false
console.log("Signal '" + signalName + "' not found")
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
index fe88d686fc..151e44c4d4 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
@@ -662,7 +662,7 @@ bool QQmlEngineDebugServiceImpl::setBinding(int objectId,
filename, line, column);
QQmlPropertyPrivate::takeSignalExpression(property, qmlExpression);
} else if (property.isProperty()) {
- QQmlBinding *binding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, expression.toString(), object, QQmlContextData::get(context), filename, line, column);
+ QQmlBinding *binding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core, expression.toString(), object, QQmlContextData::get(context), filename, line);
binding->setTarget(property);
QQmlPropertyPrivate::setBinding(binding);
binding->update();
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
index b2db23d78c..aed2759383 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
@@ -60,7 +60,7 @@ QV4::CallContext *QV4DataCollector::findContext(int frame)
QV4::ExecutionContext *ctx = engine()->currentContext;
while (ctx) {
QV4::CallContext *cCtxt = ctx->asCallContext();
- if (cCtxt && cCtxt->d()->function) {
+ if (cCtxt && cCtxt->d()->v4Function) {
if (frame < 1)
return cCtxt;
--frame;
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp
index 44810dd4cb..5cc2043cb1 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugger.cpp
@@ -252,9 +252,8 @@ QV4::Function *QV4Debugger::getFunction() const
{
QV4::Scope scope(m_engine);
QV4::ExecutionContext *context = m_engine->currentContext;
- QV4::ScopedFunctionObject function(scope, context->getFunctionObject());
- if (function)
- return function->function();
+ if (QV4::Function *function = context->getFunction())
+ return function;
else
return context->d()->engine->globalCode;
}
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp b/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
index 6c1e353b4d..df316c1ae6 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
@@ -41,6 +41,7 @@
#include <private/qv4script_p.h>
#include <private/qqmlcontext_p.h>
+#include <private/qv4qmlcontext_p.h>
#include <private/qv4qobjectwrapper_p.h>
#include <private/qqmldebugservice_p.h>
@@ -78,8 +79,8 @@ void JavaScriptJob::run()
if (context >= 0) {
QQmlContext *extraContext = qmlContext(QQmlDebugService::objectForId(context));
if (extraContext) {
- engine->pushContext(ctx->newQmlContext(QQmlContextData::get(extraContext),
- &scopeObject));
+ engine->pushContext(QV4::QmlContext::create(ctx, QQmlContextData::get(extraContext),
+ &scopeObject));
ctx = engine->currentContext;
}
} else if (frameNr < 0) { // Use QML context if available
@@ -99,7 +100,7 @@ void JavaScriptJob::run()
}
}
if (!engine->qmlContext()) {
- engine->pushContext(ctx->newQmlContext(QQmlContextData::get(qmlRootContext),
+ engine->pushContext(QV4::QmlContext::create(ctx, QQmlContextData::get(qmlRootContext),
&scopeObject));
ctx = engine->currentContext;
}
@@ -212,7 +213,7 @@ void ValueLookupJob::run()
QV4::ExecutionEngine *engine = collector->engine();
if (engine->qmlEngine() && !engine->qmlContext()) {
scopeObject.reset(new QObject);
- engine->pushContext(engine->currentContext->newQmlContext(
+ engine->pushContext(QV4::QmlContext::create(engine->currentContext,
QQmlContextData::get(engine->qmlEngine()->rootContext()),
scopeObject.data()));
}
diff --git a/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp b/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp
index eb254ca1e0..7145645609 100644
--- a/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp
+++ b/src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp
@@ -235,9 +235,7 @@ bool GlobalInspector::syncSelectedItems(const QList<QQuickItem *> &items)
// Disconnect and remove items that are no longer selected
const auto selectedItemsCopy = m_selectedItems;
- for (const QPointer<QQuickItem> &item : selectedItemsCopy) {
- if (!item) // Don't see how this can happen due to handling of destroyed()
- continue;
+ for (QQuickItem *item : selectedItemsCopy) {
if (items.contains(item))
continue;
diff --git a/src/plugins/qmltooling/qmldbg_inspector/globalinspector.h b/src/plugins/qmltooling/qmldbg_inspector/globalinspector.h
index 338eee14c3..f7b325c454 100644
--- a/src/plugins/qmltooling/qmldbg_inspector/globalinspector.h
+++ b/src/plugins/qmltooling/qmldbg_inspector/globalinspector.h
@@ -84,7 +84,7 @@ private:
bool syncSelectedItems(const QList<QQuickItem *> &items);
// Hash< object to be destroyed, QPair<destroy eventId, object debugId> >
- QList<QPointer<QQuickItem> > m_selectedItems;
+ QList<QQuickItem *> m_selectedItems;
QHash<QQuickItem *, SelectionHighlight *> m_highlightItems;
QList<QQuickWindowInspector *> m_windowInspectors;
int m_eventId;
diff --git a/src/plugins/qmltooling/qmldbg_inspector/qquickwindowinspector.cpp b/src/plugins/qmltooling/qmldbg_inspector/qquickwindowinspector.cpp
index 2525500e65..7d260a4d2a 100644
--- a/src/plugins/qmltooling/qmldbg_inspector/qquickwindowinspector.cpp
+++ b/src/plugins/qmltooling/qmldbg_inspector/qquickwindowinspector.cpp
@@ -153,7 +153,7 @@ bool QQuickWindowInspector::eventFilter(QObject *obj, QEvent *event)
case QEvent::MouseButtonDblClick:
m_tool->mouseDoubleClickEvent(static_cast<QMouseEvent*>(event));
return true;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
return true;
#endif
diff --git a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
index 9c198a8afc..7f842419e7 100644
--- a/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
@@ -336,18 +336,16 @@ void NativeDebugger::handleBacktrace(QJsonObject *response, const QJsonObject &a
QJsonArray frameArray;
QV4::ExecutionContext *executionContext = m_engine->currentContext;
for (int i = 0; i < limit && executionContext; ++i) {
- QV4::Heap::FunctionObject *heapFunctionObject = executionContext->getFunctionObject();
- if (heapFunctionObject) {
+ if (QV4::Function *function = executionContext->getFunction()) {
QJsonObject frame;
frame.insert(QStringLiteral("language"), QStringLiteral("js"));
frame.insert(QStringLiteral("context"), encodeContext(executionContext));
- if (QV4::Function *function = heapFunctionObject->function) {
- if (QV4::Heap::String *functionName = function->name())
- frame.insert(QStringLiteral("function"), functionName->toQString());
- frame.insert(QStringLiteral("file"), function->sourceFile());
- }
+ if (QV4::Heap::String *functionName = function->name())
+ frame.insert(QStringLiteral("function"), functionName->toQString());
+ frame.insert(QStringLiteral("file"), function->sourceFile());
+
int line = executionContext->d()->lineNumber;
frame.insert(QStringLiteral("line"), (line < 0 ? -line : line));
@@ -667,11 +665,9 @@ void NativeDebugger::aboutToThrow()
QV4::Function *NativeDebugger::getFunction() const
{
- QV4::Scope scope(m_engine);
QV4::ExecutionContext *context = m_engine->currentContext;
- QV4::ScopedFunctionObject function(scope, context->getFunctionObject());
- if (function)
- return function->function();
+ if (QV4::Function *function = context->getFunction())
+ return function;
else
return context->d()->engine->globalCode;
}
@@ -683,10 +679,8 @@ void NativeDebugger::pauseAndWait()
event.insert(QStringLiteral("event"), QStringLiteral("break"));
event.insert(QStringLiteral("language"), QStringLiteral("js"));
if (QV4::ExecutionContext *executionContext = m_engine->currentContext) {
- QV4::Heap::FunctionObject *heapFunctionObject = executionContext->getFunctionObject();
- if (heapFunctionObject) {
- if (QV4::Function *function = heapFunctionObject->function)
- event.insert(QStringLiteral("file"), function->sourceFile());
+ if (QV4::Function *function = executionContext->getFunction()) {
+ event.insert(QStringLiteral("file"), function->sourceFile());
int line = executionContext->d()->lineNumber;
event.insert(QStringLiteral("line"), (line < 0 ? -line : line));
}
diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp
index caf64ebb8b..908f1221ab 100644
--- a/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp
+++ b/src/plugins/scenegraph/d3d12/qsgd3d12engine.cpp
@@ -61,6 +61,8 @@
#include <windows.ui.xaml.media.dxinterop.h>
#endif
+#include <comdef.h>
+
QT_BEGIN_NAMESPACE
// NOTE: Avoid categorized logging. It is slow.
@@ -98,6 +100,19 @@ static const int BUCKETS_PER_HEAP = 8; // must match freeMap
static const int DESCRIPTORS_PER_BUCKET = 32; // the bit map (freeMap) is quint32
static const int MAX_DESCRIPTORS_PER_HEAP = BUCKETS_PER_HEAP * DESCRIPTORS_PER_BUCKET;
+static QString comErrorMessage(HRESULT hr)
+{
+#ifndef Q_OS_WINRT
+ const _com_error comError(hr);
+#else
+ const _com_error comError(hr, nullptr);
+#endif
+ QString result = QLatin1String("Error 0x") + QString::number(ulong(hr), 16);
+ if (const wchar_t *msg = comError.ErrorMessage())
+ result += QLatin1String(": ") + QString::fromWCharArray(msg);
+ return result;
+}
+
D3D12_CPU_DESCRIPTOR_HANDLE QSGD3D12CPUDescriptorHeapManager::allocate(D3D12_DESCRIPTOR_HEAP_TYPE type)
{
D3D12_CPU_DESCRIPTOR_HANDLE h = {};
@@ -128,7 +143,8 @@ D3D12_CPU_DESCRIPTOR_HANDLE QSGD3D12CPUDescriptorHeapManager::allocate(D3D12_DES
HRESULT hr = m_device->CreateDescriptorHeap(&heapDesc, IID_PPV_ARGS(&heap.heap));
if (FAILED(hr)) {
- qWarning("Failed to create heap with type 0x%x: %x", type, hr);
+ qWarning("Failed to create heap with type 0x%x: %s",
+ type, qPrintable(comErrorMessage(hr)));
return h;
}
@@ -211,7 +227,8 @@ static void getHardwareAdapter(IDXGIFactory1 *factory, IDXGIAdapter1 **outAdapte
*outAdapter = adapter.Detach();
return;
} else {
- qWarning("Failed to create device for requested adapter '%s': 0x%x", qPrintable(name), hr);
+ qWarning("Failed to create device for requested adapter '%s': %s",
+ qPrintable(name), qPrintable(comErrorMessage(hr)));
}
}
}
@@ -270,7 +287,7 @@ void QSGD3D12DeviceManager::ensureCreated()
HRESULT hr = CreateDXGIFactory2(0, IID_PPV_ARGS(&m_factory));
if (FAILED(hr)) {
- qWarning("Failed to create DXGI: 0x%x", hr);
+ qWarning("Failed to create DXGI: %s", qPrintable(comErrorMessage(hr)));
return;
}
@@ -283,7 +300,7 @@ void QSGD3D12DeviceManager::ensureCreated()
if (SUCCEEDED(hr))
warp = false;
else
- qWarning("Failed to create device: 0x%x", hr);
+ qWarning("Failed to create device: %s", qPrintable(comErrorMessage(hr)));
}
if (warp) {
@@ -291,7 +308,7 @@ void QSGD3D12DeviceManager::ensureCreated()
m_factory->EnumWarpAdapter(IID_PPV_ARGS(&adapter));
HRESULT hr = D3D12CreateDevice(adapter.Get(), D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&m_device));
if (FAILED(hr)) {
- qWarning("Failed to create WARP device: 0x%x", hr);
+ qWarning("Failed to create WARP device: %s", qPrintable(comErrorMessage(hr)));
return;
}
}
@@ -798,15 +815,18 @@ void QSGD3D12EnginePrivate::initialize(WId w, const QSize &size, float dpr, int
if (SUCCEEDED(hr)) {
hr = dcompDevice->CreateVisual(&dcompVisual);
if (FAILED(hr)) {
- qWarning("Failed to create DirectComposition visual: 0x%x", hr);
+ qWarning("Failed to create DirectComposition visual: %s",
+ qPrintable(comErrorMessage(hr)));
windowAlpha = false;
}
} else {
- qWarning("Failed to create DirectComposition target: 0x%x", hr);
+ qWarning("Failed to create DirectComposition target: %s",
+ qPrintable(comErrorMessage(hr)));
windowAlpha = false;
}
} else {
- qWarning("Failed to create DirectComposition device: 0x%x", hr);
+ qWarning("Failed to create DirectComposition device: %s",
+ qPrintable(comErrorMessage(hr)));
windowAlpha = false;
}
}
@@ -833,11 +853,13 @@ void QSGD3D12EnginePrivate::initialize(WId w, const QSize &size, float dpr, int
if (SUCCEEDED(hr)) {
hr = dcompTarget->SetRoot(dcompVisual.Get());
if (FAILED(hr)) {
- qWarning("SetRoot failed for DirectComposition target: 0x%x", hr);
+ qWarning("SetRoot failed for DirectComposition target: %s",
+ qPrintable(comErrorMessage(hr)));
windowAlpha = false;
}
} else {
- qWarning("SetContent failed for DirectComposition visual: 0x%x", hr);
+ qWarning("SetContent failed for DirectComposition visual: %s",
+ qPrintable(comErrorMessage(hr)));
windowAlpha = false;
}
} else {
@@ -867,11 +889,12 @@ void QSGD3D12EnginePrivate::initialize(WId w, const QSize &size, float dpr, int
ComPtr<IDXGISwapChain> baseSwapChain;
HRESULT hr = dev->dxgi()->CreateSwapChain(commandQueue.Get(), &swapChainDesc, &baseSwapChain);
if (FAILED(hr)) {
- qWarning("Failed to create swap chain: 0x%x", hr);
+ qWarning("Failed to create swap chain: %s", qPrintable(comErrorMessage(hr)));
return;
}
- if (FAILED(baseSwapChain.As(&swapChain))) {
- qWarning("Failed to cast swap chain");
+ hr = baseSwapChain.As(&swapChain);
+ if (FAILED(hr)) {
+ qWarning("Failed to cast swap chain: %s", qPrintable(comErrorMessage(hr)));
return;
}
}
@@ -1165,7 +1188,7 @@ void QSGD3D12EnginePrivate::setWindowSize(const QSize &size, float dpr)
deviceManager()->deviceLossDetected();
return;
} else if (FAILED(hr)) {
- qWarning("Failed to resize buffers: 0x%x", hr);
+ qWarning("Failed to resize buffers: %s", qPrintable(comErrorMessage(hr)));
return;
}
@@ -1188,7 +1211,7 @@ QSGD3D12CPUWaitableFence *QSGD3D12EnginePrivate::createCPUWaitableFence() const
QSGD3D12CPUWaitableFence *f = new QSGD3D12CPUWaitableFence;
HRESULT hr = device->CreateFence(f->value, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&f->fence));
if (FAILED(hr)) {
- qWarning("Failed to create fence: 0x%x", hr);
+ qWarning("Failed to create fence: %s", qPrintable(comErrorMessage(hr)));
return f;
}
f->event = CreateEvent(nullptr, FALSE, FALSE, nullptr);
@@ -1202,7 +1225,7 @@ void QSGD3D12EnginePrivate::waitForGPU(QSGD3D12CPUWaitableFence *f) const
if (f->fence->GetCompletedValue() < newValue) {
HRESULT hr = f->fence->SetEventOnCompletion(newValue, f->event);
if (FAILED(hr)) {
- qWarning("SetEventOnCompletion failed: 0x%x", hr);
+ qWarning("SetEventOnCompletion failed: %s", qPrintable(comErrorMessage(hr)));
return;
}
WaitForSingleObject(f->event, INFINITE);
@@ -1283,7 +1306,7 @@ ID3D12Resource *QSGD3D12EnginePrivate::createBuffer(int size)
HRESULT hr = device->CreateCommittedResource(&uploadHeapProp, D3D12_HEAP_FLAG_NONE, &bufDesc,
D3D12_RESOURCE_STATE_GENERIC_READ, nullptr, IID_PPV_ARGS(&buf));
if (FAILED(hr))
- qWarning("Failed to create buffer resource: 0x%x", hr);
+ qWarning("Failed to create buffer resource: %s", qPrintable(comErrorMessage(hr)));
return buf;
}
@@ -1640,7 +1663,7 @@ void QSGD3D12EnginePrivate::endDrawCalls(bool lastInFrame)
// Go!
HRESULT hr = frameCommandList->Close();
if (FAILED(hr)) {
- qWarning("Failed to close command list: 0x%x", hr);
+ qWarning("Failed to close command list: %s", qPrintable(comErrorMessage(hr)));
if (hr == E_INVALIDARG)
qWarning("Invalid arguments. Some of the commands in the list is invalid in some way.");
}
@@ -1874,7 +1897,8 @@ void QSGD3D12EnginePrivate::finalizePipeline(const QSGD3D12PipelineState &pipeli
HRESULT hr = device->CreateGraphicsPipelineState(&psoDesc, IID_PPV_ARGS(&cachedPso->pso));
if (FAILED(hr)) {
- qWarning("Failed to create graphics pipeline state");
+ qWarning("Failed to create graphics pipeline state: %s",
+ qPrintable(comErrorMessage(hr)));
return;
}
@@ -2179,7 +2203,7 @@ void QSGD3D12EnginePrivate::present()
deviceManager()->deviceLossDetected();
return;
} else if (FAILED(hr)) {
- qWarning("Present failed: 0x%x", hr);
+ qWarning("Present failed: %s", qPrintable(comErrorMessage(hr)));
return;
}
@@ -2433,7 +2457,7 @@ void QSGD3D12EnginePrivate::createTexture(uint id, const QSize &size, QImage::Fo
HRESULT hr = device->CreateCommittedResource(&defaultHeapProp, D3D12_HEAP_FLAG_NONE, &textureDesc,
D3D12_RESOURCE_STATE_COMMON, nullptr, IID_PPV_ARGS(&t.texture));
if (FAILED(hr)) {
- qWarning("Failed to create texture resource: 0x%x", hr);
+ qWarning("Failed to create texture resource: %s", qPrintable(comErrorMessage(hr)));
return;
}
@@ -2498,7 +2522,8 @@ void QSGD3D12EnginePrivate::queueTextureResize(uint id, const QSize &size)
HRESULT hr = device->CreateCommittedResource(&defaultHeapProp, D3D12_HEAP_FLAG_NONE, &textureDesc,
D3D12_RESOURCE_STATE_COMMON, nullptr, IID_PPV_ARGS(&t.texture));
if (FAILED(hr)) {
- qWarning("Failed to create resized texture resource: 0x%x", hr);
+ qWarning("Failed to create resized texture resource: %s",
+ qPrintable(comErrorMessage(hr)));
return;
}
@@ -2954,7 +2979,8 @@ void QSGD3D12EnginePrivate::createRenderTarget(uint id, const QSize &size, const
HRESULT hr = device->CreateCommittedResource(&defaultHeapProp, D3D12_HEAP_FLAG_NONE, &textureDesc,
D3D12_RESOURCE_STATE_COMMON, nullptr, IID_PPV_ARGS(&rt.colorResolve));
if (FAILED(hr)) {
- qWarning("Failed to create resolve buffer: 0x%x", hr);
+ qWarning("Failed to create resolve buffer: %s",
+ qPrintable(comErrorMessage(hr)));
return;
}
diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
index c53a1fa6c1..60b76deb2e 100644
--- a/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
+++ b/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
@@ -421,7 +421,8 @@ void QSGD3D12RenderLoop::renderWindow(QQuickWindow *window)
if (profileFrames)
polishTime = renderTimer.nsecsElapsed();
Q_QUICK_SG_PROFILE_SWITCH(QQuickProfiler::SceneGraphPolishFrame,
- QQuickProfiler::SceneGraphRenderLoopFrame);
+ QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphPolishPolish);
emit window->afterAnimating();
@@ -463,13 +464,15 @@ void QSGD3D12RenderLoop::renderWindow(QQuickWindow *window)
if (profileFrames)
syncTime = renderTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSync);
wd->renderSceneGraph(window->size());
if (profileFrames)
renderTime = renderTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopRender);
if (!data.grabOnly) {
// The engine is able to have multiple frames in flight. This in effect is
@@ -496,7 +499,8 @@ void QSGD3D12RenderLoop::renderWindow(QQuickWindow *window)
qint64 swapTime = 0;
if (profileFrames)
swapTime = renderTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSwap);
if (Q_UNLIKELY(debug_time())) {
static QTime lastFrameTime = QTime::currentTime();
diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp
index a803f67380..317471eeec 100644
--- a/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp
+++ b/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp
@@ -597,7 +597,8 @@ void QSGD3D12RenderThread::syncAndRender()
if (Q_UNLIKELY(debug_time()))
syncTime = threadTimer.nsecsElapsed();
#endif
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSync);
if (!syncResultedInChanges && !repaintRequested) {
if (Q_UNLIKELY(debug_loop()))
@@ -632,7 +633,8 @@ void QSGD3D12RenderThread::syncAndRender()
wd->renderSceneGraph(engine->windowSize());
if (Q_UNLIKELY(debug_time()))
renderTime = threadTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopRender);
// The engine is able to have multiple frames in flight. This in effect is
// similar to BufferQueueingOpenGL. Provide an env var to force the
@@ -649,7 +651,8 @@ void QSGD3D12RenderThread::syncAndRender()
// blockOnEachFrame is not used, but emit it for compatibility.
wd->fireFrameSwapped();
} else {
- Q_QUICK_SG_PROFILE_SKIP(QQuickProfiler::SceneGraphRenderLoopFrame, 1);
+ Q_QUICK_SG_PROFILE_SKIP(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSync, 1);
if (Q_UNLIKELY(debug_loop()))
qDebug("RT - window not ready, skipping render");
}
@@ -671,7 +674,8 @@ void QSGD3D12RenderThread::syncAndRender()
int((renderTime - syncTime) / 1000000),
int(threadTimer.elapsed() - renderTime / 1000000));
- Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSwap);
static int devLossTest = qEnvironmentVariableIntValue("QT_D3D_TEST_DEVICE_LOSS");
if (devLossTest > 0) {
@@ -1127,7 +1131,8 @@ void QSGD3D12ThreadedRenderLoop::polishAndSync(WindowData *w, bool inExpose)
if (Q_UNLIKELY(debug_time()))
polishTime = timer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync,
+ QQuickProfiler::SceneGraphPolishAndSyncPolish);
w->updateDuringSync = false;
@@ -1144,7 +1149,8 @@ void QSGD3D12ThreadedRenderLoop::polishAndSync(WindowData *w, bool inExpose)
qDebug("polishAndSync - wait for sync");
if (Q_UNLIKELY(debug_time()))
waitTime = timer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync,
+ QQuickProfiler::SceneGraphPolishAndSyncWait);
w->thread->waitCondition.wait(&w->thread->mutex);
lockedForSync = false;
w->thread->mutex.unlock();
@@ -1153,7 +1159,8 @@ void QSGD3D12ThreadedRenderLoop::polishAndSync(WindowData *w, bool inExpose)
if (Q_UNLIKELY(debug_time()))
syncTime = timer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync,
+ QQuickProfiler::SceneGraphPolishAndSyncSync);
if (!animationTimer && anim->isRunning()) {
if (Q_UNLIKELY(debug_loop()))
@@ -1175,7 +1182,8 @@ void QSGD3D12ThreadedRenderLoop::polishAndSync(WindowData *w, bool inExpose)
<< ", animations=" << (timer.nsecsElapsed() - syncTime) / 1000000
<< " - (on gui thread) " << window;
- Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphPolishAndSync);
+ Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphPolishAndSync,
+ QQuickProfiler::SceneGraphPolishAndSyncAnimations);
}
#include "qsgd3d12threadedrenderloop.moc"
diff --git a/src/qml/compiler/qqmlirbuilder.cpp b/src/qml/compiler/qqmlirbuilder.cpp
index e66e8ccbff..54d0cb4f46 100644
--- a/src/qml/compiler/qqmlirbuilder.cpp
+++ b/src/qml/compiler/qqmlirbuilder.cpp
@@ -758,7 +758,7 @@ bool IRBuilder::visit(QQmlJS::AST::UiPublicMember *node)
QQmlJS::AST::UiParameterList *p = node->parameters;
while (p) {
- const QStringRef &memberType = p->type;
+ const QString memberType = asString(p->type);
if (memberType.isEmpty()) {
recordError(node->typeToken, QCoreApplication::translate("QQmlParser","Expected parameter type"));
@@ -781,10 +781,10 @@ bool IRBuilder::visit(QQmlJS::AST::UiPublicMember *node)
// Must be a QML object type.
// Lazily determine type during compilation.
param->type = QV4::CompiledData::Property::Custom;
- param->customTypeNameIndex = registerString(p->type.toString());
+ param->customTypeNameIndex = registerString(memberType);
} else {
QString errStr = QCoreApplication::translate("QQmlParser","Invalid signal parameter type: ");
- errStr.append(memberType.toString());
+ errStr.append(memberType);
recordError(node->typeToken, errStr);
return false;
}
@@ -813,7 +813,7 @@ bool IRBuilder::visit(QQmlJS::AST::UiPublicMember *node)
return false;
}
} else {
- const QStringRef &memberType = node->memberType;
+ QString memberType = asString(node->memberType);
if (memberType == QLatin1String("alias")) {
return appendAlias(node);
} else {
@@ -858,7 +858,7 @@ bool IRBuilder::visit(QQmlJS::AST::UiPublicMember *node)
property->flags |= QV4::CompiledData::Property::IsReadOnly;
property->type = type;
if (type >= QV4::CompiledData::Property::Custom)
- property->customTypeNameIndex = registerString(memberType.toString());
+ property->customTypeNameIndex = registerString(memberType);
else
property->customTypeNameIndex = emptyStringIndex;
diff --git a/src/qml/compiler/qqmlpropertycachecreator_p.h b/src/qml/compiler/qqmlpropertycachecreator_p.h
index 10bcd1dbc1..3c14abc019 100644
--- a/src/qml/compiler/qqmlpropertycachecreator_p.h
+++ b/src/qml/compiler/qqmlpropertycachecreator_p.h
@@ -118,7 +118,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::buildMetaObje
bool needVMEMetaObject = obj->propertyCount() != 0 || obj->aliasCount() != 0 || obj->signalCount() != 0 || obj->functionCount() != 0;
if (!needVMEMetaObject) {
- for (auto binding = obj->bindingsBegin(), end = obj->bindingsEnd(); binding != end; ++binding) {
+ auto binding = obj->bindingsBegin();
+ auto end = obj->bindingsEnd();
+ for ( ; binding != end; ++binding) {
if (binding->type == QV4::CompiledData::Binding::Type_Object && (binding->flags & QV4::CompiledData::Binding::IsOnAssignment)) {
// If the on assignment is inside a group property, we need to distinguish between QObject based
// group properties and value type group properties. For the former the base type is derived from
@@ -162,7 +164,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::buildMetaObje
}
if (QQmlPropertyCache *thisCache = propertyCaches->at(objectIndex)) {
- for (auto binding = obj->bindingsBegin(), end = obj->bindingsEnd(); binding != end; ++binding)
+ auto binding = obj->bindingsBegin();
+ auto end = obj->bindingsEnd();
+ for ( ; binding != end; ++binding)
if (binding->type >= QV4::CompiledData::Binding::Type_Object) {
QQmlBindingInstantiationContext context(objectIndex, &(*binding), stringAt(binding->propertyNameIndex), thisCache);
QQmlCompileError error = buildMetaObjectRecursively(binding->value.objectIndex, context);
@@ -296,7 +300,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj
QmlIR::PropertyResolver resolver(baseTypeCache);
- for (auto p = obj->propertiesBegin(), end = obj->propertiesEnd(); p != end; ++p) {
+ auto p = obj->propertiesBegin();
+ auto pend = obj->propertiesEnd();
+ for ( ; p != pend; ++p) {
if (p->type == QV4::CompiledData::Property::Var)
varPropCount++;
@@ -306,7 +312,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj
return QQmlCompileError(p->location, QQmlPropertyCacheCreatorBase::tr("Cannot override FINAL property"));
}
- for (auto a = obj->aliasesBegin(), end = obj->aliasesEnd(); a != end; ++a) {
+ auto a = obj->aliasesBegin();
+ auto aend = obj->aliasesEnd();
+ for ( ; a != aend; ++a) {
bool notInRevision = false;
QQmlPropertyData *d = resolver.property(stringAt(a->nameIndex), &notInRevision);
if (d && d->isFinal())
@@ -340,7 +348,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj
}
// Set up notify signals for properties - first normal, then alias
- for (auto p = obj->propertiesBegin(), end = obj->propertiesEnd(); p != end; ++p) {
+ p = obj->propertiesBegin();
+ pend = obj->propertiesEnd();
+ for ( ; p != pend; ++p) {
auto flags = QQmlPropertyData::defaultSignalFlags();
QString changedSigName = stringAt(p->nameIndex) + QLatin1String("Changed");
@@ -349,7 +359,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj
cache->appendSignal(changedSigName, flags, effectiveMethodIndex++);
}
- for (auto a = obj->aliasesBegin(), end = obj->aliasesEnd(); a != end; ++a) {
+ a = obj->aliasesBegin();
+ aend = obj->aliasesEnd();
+ for ( ; a != aend; ++a) {
auto flags = QQmlPropertyData::defaultSignalFlags();
QString changedSigName = stringAt(a->nameIndex) + QLatin1String("Changed");
@@ -359,7 +371,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj
}
// Dynamic signals
- for (auto s = obj->signalsBegin(), end = obj->signalsEnd(); s != end; ++s) {
+ auto s = obj->signalsBegin();
+ auto send = obj->signalsEnd();
+ for ( ; s != send; ++s) {
const int paramCount = s->parameterCount();
QList<QByteArray> names;
@@ -370,7 +384,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj
paramTypes[0] = paramCount;
int i = 0;
- for (auto param = s->parametersBegin(), end = s->parametersEnd(); param != end; ++param, ++i) {
+ auto param = s->parametersBegin();
+ auto end = s->parametersEnd();
+ for ( ; param != end; ++param, ++i) {
names.append(stringAt(param->nameIndex).toUtf8());
if (param->type < builtinTypeCount) {
// built-in type
@@ -415,7 +431,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj
// Dynamic slots
- for (auto function = objectContainer->objectFunctionsBegin(obj), end = objectContainer->objectFunctionsEnd(obj); function != end; ++function) {
+ auto function = objectContainer->objectFunctionsBegin(obj);
+ auto fend = objectContainer->objectFunctionsEnd(obj);
+ for ( ; function != fend; ++function) {
auto flags = QQmlPropertyData::defaultSlotFlags();
const QString slotName = stringAt(function->nameIndex);
@@ -425,7 +443,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj
// protect against overriding change signals or methods with properties.
QList<QByteArray> parameterNames;
- for (auto formal = function->formalsBegin(), end = function->formalsEnd(); formal != end; ++formal) {
+ auto formal = function->formalsBegin();
+ auto end = function->formalsEnd();
+ for ( ; formal != end; ++formal) {
flags.hasArguments = true;
parameterNames << stringAt(*formal).toUtf8();
}
@@ -437,7 +457,9 @@ inline QQmlCompileError QQmlPropertyCacheCreator<ObjectContainer>::createMetaObj
// Dynamic properties
int effectiveSignalIndex = cache->signalHandlerIndexCacheStart;
int propertyIdx = 0;
- for (auto p = obj->propertiesBegin(), end = obj->propertiesEnd(); p != end; ++p, ++propertyIdx) {
+ p = obj->propertiesBegin();
+ pend = obj->propertiesEnd();
+ for ( ; p != pend; ++p, ++propertyIdx) {
int propertyType = 0;
QQmlPropertyData::Flags propertyFlags;
@@ -561,7 +583,9 @@ inline void QQmlPropertyCacheAliasCreator<ObjectContainer>::appendAliasPropertie
return;
const auto allAliasTargetsExist = [this, &component](const CompiledObject &object) {
- for (auto alias = object.aliasesBegin(), end = object.aliasesEnd(); alias != end; ++alias) {
+ auto alias = object.aliasesBegin();
+ auto end = object.aliasesEnd();
+ for ( ; alias != end; ++alias) {
Q_ASSERT(alias->flags & QV4::CompiledData::Alias::Resolved);
const int targetObjectIndex = objectForId(component, alias->targetObjectId);
@@ -612,7 +636,9 @@ inline void QQmlPropertyCacheAliasCreator<ObjectContainer>::collectObjectsWithAl
if (object.flags & QV4::CompiledData::Object::IsComponent && objectIndex != objectContainer->rootObjectIndex())
return;
- for (auto binding = object.bindingsBegin(), end = object.bindingsEnd(); binding != end; ++binding) {
+ auto binding = object.bindingsBegin();
+ auto end = object.bindingsEnd();
+ for (; binding != end; ++binding) {
if (binding->type != QV4::CompiledData::Binding::Type_Object
&& binding->type != QV4::CompiledData::Binding::Type_AttachedProperty
&& binding->type != QV4::CompiledData::Binding::Type_GroupProperty)
@@ -707,7 +733,9 @@ inline void QQmlPropertyCacheAliasCreator<ObjectContainer>::appendAliasesToPrope
int effectivePropertyIndex = propertyCache->propertyIndexCacheStart + propertyCache->propertyIndexCache.count();
int aliasIndex = 0;
- for (auto alias = object.aliasesBegin(), end = object.aliasesEnd(); alias != end; ++alias, ++aliasIndex) {
+ auto alias = object.aliasesBegin();
+ auto end = object.aliasesEnd();
+ for ( ; alias != end; ++alias, ++aliasIndex) {
Q_ASSERT(alias->flags & QV4::CompiledData::Alias::Resolved);
int type = 0;
diff --git a/src/qml/compiler/qqmlpropertyvalidator.cpp b/src/qml/compiler/qqmlpropertyvalidator.cpp
index 45379d5155..383c20239f 100644
--- a/src/qml/compiler/qqmlpropertyvalidator.cpp
+++ b/src/qml/compiler/qqmlpropertyvalidator.cpp
@@ -412,7 +412,7 @@ QQmlCompileError QQmlPropertyValidator::validateLiteralBinding(QQmlPropertyCache
}
}
break;
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
case QVariant::Date: {
bool ok = false;
QQmlStringConverters::dateFromString(binding->valueAsString(qmlUnit), &ok);
@@ -437,7 +437,7 @@ QQmlCompileError QQmlPropertyValidator::validateLiteralBinding(QQmlPropertyCache
}
}
break;
-#endif // QT_NO_DATESTRING
+#endif // datestring
case QVariant::Point: {
bool ok = false;
QQmlStringConverters::pointFFromString(binding->valueAsString(qmlUnit), &ok);
diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp
index 5e05485b93..ab2b0553a9 100644
--- a/src/qml/compiler/qqmltypecompiler.cpp
+++ b/src/qml/compiler/qqmltypecompiler.cpp
@@ -1570,19 +1570,15 @@ bool QQmlJavaScriptBindingExpressionSimplificationPass::simplifyBinding(QV4::IR:
if (!_canSimplify)
return false;
}
- if (!_canSimplify)
- return false;
}
if (_returnValueOfBindingExpression == -1)
return false;
- if (_canSimplify) {
- if (_nameOfFunctionCalled) {
- if (_functionCallReturnValue != _returnValueOfBindingExpression)
- return false;
- return detectTranslationCallAndConvertBinding(binding);
- }
+ if (_nameOfFunctionCalled) {
+ if (_functionCallReturnValue != _returnValueOfBindingExpression)
+ return false;
+ return detectTranslationCallAndConvertBinding(binding);
}
return false;
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index f8668b48e4..8586c84c3d 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -471,7 +471,7 @@ QString Binding::valueAsString(const Unit *unit) const
return QString::number(valueAsNumber());
case Type_Invalid:
return QString();
-#ifdef QT_NO_TRANSLATION
+#if !QT_CONFIG(translation)
case Type_TranslationById:
case Type_Translation:
return unit->stringAt(stringIndex);
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h
index 90cbe04505..2682365182 100644
--- a/src/qml/compiler/qv4compileddata_p.h
+++ b/src/qml/compiler/qv4compileddata_p.h
@@ -71,7 +71,7 @@
QT_BEGIN_NAMESPACE
// Bump this whenever the compiler data structures change in an incompatible way.
-#define QV4_DATA_STRUCTURE_VERSION 0x07
+#define QV4_DATA_STRUCTURE_VERSION 0x08
class QIODevice;
class QQmlPropertyCache;
@@ -207,9 +207,9 @@ struct String
struct Function
{
enum Flags : unsigned int {
- HasDirectEval = 0x1,
- UsesArgumentsObject = 0x2,
- IsStrict = 0x4,
+ IsStrict = 0x1,
+ HasDirectEval = 0x2,
+ UsesArgumentsObject = 0x4,
IsNamedExpression = 0x8,
HasCatchOrWith = 0x10
};
@@ -749,7 +749,9 @@ struct TypeReferenceMap : QHash<int, TypeReference>
r.errorWhenNotFound = true;
}
- for (auto prop = obj->propertiesBegin(), propEnd = obj->propertiesEnd(); prop != propEnd; ++prop) {
+ auto prop = obj->propertiesBegin();
+ auto propEnd = obj->propertiesEnd();
+ for ( ; prop != propEnd; ++prop) {
if (prop->type >= QV4::CompiledData::Property::Custom) {
// ### FIXME: We could report the more accurate location here by using prop->location, but the old
// compiler can't and the tests expect it to be the object location right now.
@@ -758,7 +760,9 @@ struct TypeReferenceMap : QHash<int, TypeReference>
}
}
- for (auto binding = obj->bindingsBegin(), bindingEnd = obj->bindingsEnd(); binding != bindingEnd; ++binding) {
+ auto binding = obj->bindingsBegin();
+ auto bindingEnd = obj->bindingsEnd();
+ for ( ; binding != bindingEnd; ++binding) {
if (binding->type == QV4::CompiledData::Binding::Type_AttachedProperty)
this->add(binding->propertyNameIndex, binding->location);
}
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp
index 46de24c264..943700de44 100644
--- a/src/qml/compiler/qv4ssa.cpp
+++ b/src/qml/compiler/qv4ssa.cpp
@@ -1838,11 +1838,6 @@ public:
return *this;
}
- bool isEmpty() const
- {
- return worklistSize == 0;
- }
-
unsigned size() const
{
return worklistSize;
@@ -1850,7 +1845,7 @@ public:
Stmt *takeNext(Stmt *last)
{
- if (isEmpty())
+ if (worklistSize == 0)
return 0;
const int startAt = last ? last->id() + 1 : 0;
@@ -1866,6 +1861,10 @@ public:
--worklistSize;
Stmt *s = stmts.at(pos);
Q_ASSERT(s);
+
+ if (removed.at(s->id()))
+ return takeNext(s);
+
return s;
}
@@ -3992,9 +3991,7 @@ void optimizeSSA(StatementWorklist &W, DefUses &defUses, DominatorTree &df)
ExprReplacer replaceUses(defUses, function);
Stmt *s = 0;
- while (!W.isEmpty()) {
- s = W.takeNext(s);
- Q_ASSERT(s);
+ while ((s = W.takeNext(s))) {
if (Phi *phi = s->asPhi()) {
// dead code elimination:
diff --git a/src/qml/debugger/qqmldebugconnector.cpp b/src/qml/debugger/qqmldebugconnector.cpp
index 3adf335ffd..8a16d56c45 100644
--- a/src/qml/debugger/qqmldebugconnector.cpp
+++ b/src/qml/debugger/qqmldebugconnector.cpp
@@ -164,7 +164,10 @@ QQmlDebugConnectorFactory::~QQmlDebugConnectorFactory()
{
// This is triggered when the plugin is unloaded.
QQmlDebugConnectorParams *params = qmlDebugConnectorParams();
- if (params && params->instance) {
+ if (params) {
+ params->pluginKey.clear();
+ params->arguments.clear();
+ params->services.clear();
delete params->instance;
params->instance = 0;
}
diff --git a/src/qml/debugger/qqmlmemoryprofiler.cpp b/src/qml/debugger/qqmlmemoryprofiler.cpp
index 53d4e7ab21..b89dbfd02d 100644
--- a/src/qml/debugger/qqmlmemoryprofiler.cpp
+++ b/src/qml/debugger/qqmlmemoryprofiler.cpp
@@ -62,13 +62,13 @@ static qmlmemprofile_pop_location *memprofile_pop_location;
static qmlmemprofile_save *memprofile_save;
static qmlmemprofile_is_enabled *memprofile_is_enabled;
-#ifndef QT_NO_LIBRARY
+#if QT_CONFIG(library)
extern QFunctionPointer qt_linux_find_symbol_sys(const char *symbol);
#endif
bool QQmlMemoryScope::doOpenLibrary()
{
-#if defined(Q_OS_LINUX) && !defined(QT_NO_LIBRARY)
+#if defined(Q_OS_LINUX) && QT_CONFIG(library)
if (state == Unloaded) {
memprofile_stats = (qmlmemprofile_stats *) qt_linux_find_symbol_sys("qmlmemprofile_stats");
memprofile_clear = (qmlmemprofile_clear *) qt_linux_find_symbol_sys("qmlmemprofile_clear");
diff --git a/src/qml/debugger/qqmlprofiler_p.h b/src/qml/debugger/qqmlprofiler_p.h
index 6643695d11..242f26ee0d 100644
--- a/src/qml/debugger/qqmlprofiler_p.h
+++ b/src/qml/debugger/qqmlprofiler_p.h
@@ -204,6 +204,11 @@ public:
ref(new BindingRefCount(binding), QQmlRefPointer<QQmlRefCount>::Adopt), sent(false)
{}
+ RefLocation(QQmlBinding *binding, QV4::Function *function) :
+ Location(function->sourceLocation()), locationType(Binding),
+ ref(new BindingRefCount(binding), QQmlRefPointer<QQmlRefCount>::Adopt), sent(false)
+ {}
+
RefLocation(QV4::CompiledData::CompilationUnit *ref, const QUrl &url, const QV4::CompiledData::Object *obj,
const QString &type) :
Location(QQmlSourceLocation(type, obj->location.line, obj->location.column), url),
@@ -231,7 +236,7 @@ public:
typedef QHash<quintptr, Location> LocationHash;
- void startBinding(QQmlBinding *binding, QV4::FunctionObject *function)
+ void startBinding(QQmlBinding *binding, QV4::Function *function)
{
quintptr locationId(id(binding));
m_data.append(QQmlProfilerData(m_timer.nsecsElapsed(),
@@ -326,7 +331,7 @@ struct QQmlProfilerHelper : public QQmlProfilerDefinitions {
struct QQmlBindingProfiler : public QQmlProfilerHelper {
QQmlBindingProfiler(QQmlProfiler *profiler, QQmlBinding *binding,
- QV4::FunctionObject *function) :
+ QV4::Function *function) :
QQmlProfilerHelper(profiler)
{
Q_QML_PROFILE(QQmlProfilerDefinitions::ProfileBinding, profiler,
diff --git a/src/qml/doc/src/javascript/resources.qdoc b/src/qml/doc/src/javascript/resources.qdoc
index b831e2ba70..4f9b40f1d7 100644
--- a/src/qml/doc/src/javascript/resources.qdoc
+++ b/src/qml/doc/src/javascript/resources.qdoc
@@ -78,13 +78,13 @@ Rectangle {
\code
// my_button_impl.js
-property var clickCount = 0; // this state is separate for each instance of MyButton
-function onClicked(btn) {
+var clickCount = 0; // this state is separate for each instance of MyButton
+function onClicked(button) {
clickCount += 1;
if ((clickCount % 5) == 0) {
- obj.color = Qt.rgba(1,0,0,1);
+ button.color = Qt.rgba(1,0,0,1);
} else {
- obj.color = Qt.rgba(0,1,0,1);
+ button.color = Qt.rgba(0,1,0,1);
}
}
\endcode
diff --git a/src/qml/jit/qv4isel_masm.cpp b/src/qml/jit/qv4isel_masm.cpp
index 515b8aea4d..c5d612ae65 100644
--- a/src/qml/jit/qv4isel_masm.cpp
+++ b/src/qml/jit/qv4isel_masm.cpp
@@ -69,13 +69,6 @@ using namespace QV4::JIT;
namespace {
-inline bool isPregOrConst(IR::Expr *e)
-{
- if (IR::Temp *t = e->asTemp())
- return t->kind == IR::Temp::PhysicalRegister;
- return e->asConst() != 0;
-}
-
class QIODevicePrintStream: public FilePrintStream
{
Q_DISABLE_COPY(QIODevicePrintStream)
@@ -1164,11 +1157,41 @@ void InstructionSelection::convertTypeToBool(IR::Expr *source, IR::Expr *target)
_as->storeBool(false, target);
break;
case IR::StringType:
+ generateRuntimeCall(Assembler::ReturnValueRegister, toBoolean,
+ Assembler::PointerToValue(source));
+ _as->storeBool(Assembler::ReturnValueRegister, target);
case IR::VarType:
default:
+ Assembler::Pointer addr = _as->loadAddress(Assembler::ScratchRegister, source);
+ Assembler::Pointer tagAddr = addr;
+ tagAddr.offset += 4;
+ _as->load32(tagAddr, Assembler::ReturnValueRegister);
+
+ // checkif it's a bool:
+ Assembler::Jump notBool = _as->branch32(Assembler::NotEqual, Assembler::ReturnValueRegister,
+ Assembler::TrustedImm32(Value::Boolean_Type_Internal));
+ _as->load32(addr, Assembler::ReturnValueRegister);
+ Assembler::Jump boolDone = _as->jump();
+ // check if it's an int32:
+ notBool.link(_as);
+ Assembler::Jump fallback = _as->branch32(Assembler::NotEqual, Assembler::ReturnValueRegister,
+ Assembler::TrustedImm32(Value::Integer_Type_Internal));
+ _as->load32(addr, Assembler::ReturnValueRegister);
+ Assembler::Jump isZero = _as->branch32(Assembler::Equal, Assembler::ReturnValueRegister,
+ Assembler::TrustedImm32(0));
+ _as->move(Assembler::TrustedImm32(1), Assembler::ReturnValueRegister);
+ Assembler::Jump intDone = _as->jump();
+
+ // not an int:
+ fallback.link(_as);
generateRuntimeCall(Assembler::ReturnValueRegister, toBoolean,
- Assembler::PointerToValue(source));
+ Assembler::PointerToValue(source));
+
+ isZero.link(_as);
+ intDone.link(_as);
+ boolDone.link(_as);
_as->storeBool(Assembler::ReturnValueRegister, target);
+
break;
}
}
@@ -1713,9 +1736,6 @@ QT_END_NAMESPACE
bool InstructionSelection::visitCJumpDouble(IR::AluOp op, IR::Expr *left, IR::Expr *right,
IR::BasicBlock *iftrue, IR::BasicBlock *iffalse)
{
- if (!isPregOrConst(left) || !isPregOrConst(right))
- return false;
-
if (_as->nextBlock() == iftrue) {
Assembler::Jump target = _as->branchDouble(true, op, left, right);
_as->addPatch(iffalse, target);
@@ -1730,9 +1750,6 @@ bool InstructionSelection::visitCJumpDouble(IR::AluOp op, IR::Expr *left, IR::Ex
bool InstructionSelection::visitCJumpSInt32(IR::AluOp op, IR::Expr *left, IR::Expr *right,
IR::BasicBlock *iftrue, IR::BasicBlock *iffalse)
{
- if (!isPregOrConst(left) || !isPregOrConst(right))
- return false;
-
if (_as->nextBlock() == iftrue) {
Assembler::Jump target = _as->branchInt32(true, op, left, right);
_as->addPatch(iffalse, target);
@@ -1831,7 +1848,7 @@ bool InstructionSelection::visitCJumpStrictUndefined(IR::Binop *binop,
Assembler::RelationalCondition cond = binop->op == IR::OpStrictEqual ? Assembler::Equal
: Assembler::NotEqual;
- const Assembler::RegisterID tagReg = Assembler::ScratchRegister;
+ const Assembler::RegisterID tagReg = Assembler::ReturnValueRegister;
#ifdef QV4_USE_64_BIT_VALUE_ENCODING
Assembler::Pointer addr = _as->loadAddress(Assembler::ScratchRegister, varSrc);
_as->load64(addr, tagReg);
@@ -1930,7 +1947,7 @@ bool InstructionSelection::visitCJumpNullUndefined(IR::Type nullOrUndef, IR::Bin
Assembler::Pointer tagAddr = _as->loadAddress(Assembler::ScratchRegister, varSrc);
tagAddr.offset += 4;
- const Assembler::RegisterID tagReg = Assembler::ScratchRegister;
+ const Assembler::RegisterID tagReg = Assembler::ReturnValueRegister;
_as->load32(tagAddr, tagReg);
if (binop->op == IR::OpNotEqual)
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp
index a4a96a96a7..b473e96286 100644
--- a/src/qml/jsapi/qjsvalue.cpp
+++ b/src/qml/jsapi/qjsvalue.cpp
@@ -612,8 +612,8 @@ QVariant QJSValue::toVariant() const
if (Object *o = val->as<Object>())
return o->engine()->toVariant(*val, /*typeHint*/ -1, /*createJSValueForObjects*/ false);
- if (val->isString())
- return QVariant(val->stringValue()->toQString());
+ if (String *s = val->stringValue())
+ return QVariant(s->toQString());
if (val->isBoolean())
return QVariant(val->booleanValue());
if (val->isNumber()) {
@@ -885,14 +885,14 @@ QJSValue& QJSValue::operator=(const QJSValue& other)
static bool js_equal(const QString &string, const QV4::Value &value)
{
- if (value.isString())
- return string == value.stringValue()->toQString();
+ if (String *s = value.stringValue())
+ return string == s->toQString();
if (value.isNumber())
return RuntimeHelpers::stringToNumber(string) == value.asDouble();
if (value.isBoolean())
return RuntimeHelpers::stringToNumber(string) == double(value.booleanValue());
- if (value.isObject()) {
- Scope scope(value.objectValue()->engine());
+ if (Object *o = value.objectValue()) {
+ Scope scope(o->engine());
ScopedValue p(scope, RuntimeHelpers::toPrimitive(value, PREFERREDTYPE_HINT));
return js_equal(string, p);
}
@@ -979,8 +979,8 @@ bool QJSValue::strictlyEquals(const QJSValue& other) const
return *variant == *QJSValuePrivate::getVariant(&other);
if (variant->type() == QVariant::Map || variant->type() == QVariant::List)
return false;
- if (ov->isString())
- return variant->toString() == ov->stringValue()->toQString();
+ if (String *s = ov->stringValue())
+ return variant->toString() == s->toQString();
return false;
}
if (!ov)
diff --git a/src/qml/jsruntime/jsruntime.pri b/src/qml/jsruntime/jsruntime.pri
index 4343924436..919524d1ed 100644
--- a/src/qml/jsruntime/jsruntime.pri
+++ b/src/qml/jsruntime/jsruntime.pri
@@ -27,6 +27,7 @@ SOURCES += \
$$PWD/qv4numberobject.cpp \
$$PWD/qv4object.cpp \
$$PWD/qv4objectproto.cpp \
+ $$PWD/qv4qmlcontext.cpp \
$$PWD/qv4regexpobject.cpp \
$$PWD/qv4stringobject.cpp \
$$PWD/qv4variantobject.cpp \
@@ -48,7 +49,6 @@ HEADERS += \
$$PWD/qv4global_p.h \
$$PWD/qv4engine_p.h \
$$PWD/qv4context_p.h \
- $$PWD/qv4context_p_p.h \
$$PWD/qv4math_p.h \
$$PWD/qv4persistent_p.h \
$$PWD/qv4debugging_p.h \
@@ -73,6 +73,7 @@ HEADERS += \
$$PWD/qv4numberobject_p.h \
$$PWD/qv4object_p.h \
$$PWD/qv4objectproto_p.h \
+ $$PWD/qv4qmlcontext_p.h \
$$PWD/qv4regexpobject_p.h \
$$PWD/qv4stringobject_p.h \
$$PWD/qv4variantobject_p.h \
diff --git a/src/qml/jsruntime/qv4argumentsobject.cpp b/src/qml/jsruntime/qv4argumentsobject.cpp
index 0dfdf25158..5a190d6690 100644
--- a/src/qml/jsruntime/qv4argumentsobject.cpp
+++ b/src/qml/jsruntime/qv4argumentsobject.cpp
@@ -39,7 +39,8 @@
#include <qv4argumentsobject_p.h>
#include <qv4alloca_p.h>
#include <qv4scopedvalue_p.h>
-#include "qv4string_p.h"
+#include <qv4string_p.h>
+#include <qv4function_p.h>
using namespace QV4;
@@ -56,8 +57,6 @@ void Heap::ArgumentsObject::init(QV4::CallContext *context)
Scope scope(v4);
Scoped<QV4::ArgumentsObject> args(scope, this);
- args->setArrayType(Heap::ArrayData::Complex);
-
if (context->d()->strictMode) {
Q_ASSERT(CalleePropertyIndex == args->internalClass()->find(context->d()->engine->id_callee()));
Q_ASSERT(CallerPropertyIndex == args->internalClass()->find(context->d()->engine->id_caller()));
@@ -83,7 +82,7 @@ void ArgumentsObject::fullyCreate()
return;
uint argCount = context()->callData->argc;
- uint numAccessors = qMin(context()->function->formalParameterCount(), argCount);
+ uint numAccessors = qMin(context()->formalParameterCount(), argCount);
ArrayData::realloc(this, Heap::ArrayData::Sparse, argCount, true);
context()->engine->requireArgumentsAccessors(numAccessors);
@@ -110,7 +109,7 @@ bool ArgumentsObject::defineOwnProperty(ExecutionEngine *engine, uint index, con
ScopedProperty map(scope);
PropertyAttributes mapAttrs;
bool isMapped = false;
- uint numAccessors = qMin((int)context()->function->formalParameterCount(), context()->callData->argc);
+ uint numAccessors = qMin((int)context()->formalParameterCount(), context()->callData->argc);
if (pd && index < (uint)numAccessors)
isMapped = arrayData()->attributes(index).isAccessor() &&
pd->getter() == context()->engine->argumentsAccessors[index].getter();
@@ -193,7 +192,7 @@ PropertyAttributes ArgumentsObject::queryIndexed(const Managed *m, uint index)
if (args->fullyCreated())
return Object::queryIndexed(m, index);
- uint numAccessors = qMin((int)args->context()->function->formalParameterCount(), args->context()->callData->argc);
+ uint numAccessors = qMin((int)args->context()->formalParameterCount(), args->context()->callData->argc);
uint argCount = args->context()->callData->argc;
if (index >= argCount)
return PropertyAttributes();
@@ -245,3 +244,11 @@ void ArgumentsObject::markObjects(Heap::Base *that, ExecutionEngine *e)
Object::markObjects(that, e);
}
+
+uint ArgumentsObject::getLength(const Managed *m)
+{
+ const ArgumentsObject *a = static_cast<const ArgumentsObject *>(m);
+ if (a->propertyData(Heap::ArgumentsObject::LengthPropertyIndex)->isInteger())
+ return a->propertyData(Heap::ArgumentsObject::LengthPropertyIndex)->integerValue();
+ return Primitive::toUInt32(a->propertyData(Heap::ArgumentsObject::LengthPropertyIndex)->doubleValue());
+}
diff --git a/src/qml/jsruntime/qv4argumentsobject_p.h b/src/qml/jsruntime/qv4argumentsobject_p.h
index 37a8d0a94a..0a2ea3b42a 100644
--- a/src/qml/jsruntime/qv4argumentsobject_p.h
+++ b/src/qml/jsruntime/qv4argumentsobject_p.h
@@ -132,8 +132,10 @@ struct ArgumentsObject: Object {
static bool deleteIndexedProperty(Managed *m, uint index);
static PropertyAttributes queryIndexed(const Managed *m, uint index);
static void markObjects(Heap::Base *that, ExecutionEngine *e);
+ static uint getLength(const Managed *m);
void fullyCreate();
+
};
}
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index 390a5e7d7a..544d39339b 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -39,7 +39,7 @@
#include <QString>
#include "qv4debugging_p.h"
-#include <qv4context_p_p.h>
+#include <qv4context_p.h>
#include <qv4object_p.h>
#include <qv4objectproto_p.h>
#include <private/qv4mm_p.h>
@@ -47,6 +47,9 @@
#include "qv4function_p.h"
#include "qv4errorobject_p.h"
#include "qv4string_p.h"
+#include "qv4qmlcontext_p.h"
+#include "qv4profiling_p.h"
+#include <private/qqmljavascriptexpression_p.h>
using namespace QV4;
@@ -55,29 +58,31 @@ DEFINE_MANAGED_VTABLE(CallContext);
DEFINE_MANAGED_VTABLE(WithContext);
DEFINE_MANAGED_VTABLE(CatchContext);
DEFINE_MANAGED_VTABLE(GlobalContext);
-DEFINE_MANAGED_VTABLE(QmlContext);
-Heap::CallContext *ExecutionContext::newCallContext(const FunctionObject *function, CallData *callData)
-{
- Q_ASSERT(function->function());
+/* Function *f, int argc */
+#define requiredMemoryForExecutionContect(f, argc) \
+ ((sizeof(CallContext::Data) + 7) & ~7) + \
+ sizeof(Value) * (f->compiledFunction->nLocals + qMax((uint)argc, f->nFormals)) + sizeof(CallData)
+Heap::CallContext *ExecutionContext::newCallContext(Function *function, CallData *callData)
+{
Heap::CallContext *c = d()->engine->memoryManager->allocManaged<CallContext>(
requiredMemoryForExecutionContect(function, callData->argc));
c->init(d()->engine, Heap::ExecutionContext::Type_CallContext);
- c->function = function->d();
+ c->v4Function = function;
- c->strictMode = function->strictMode();
- c->outer = function->scope();
+ c->strictMode = function->isStrict();
+ c->outer = this->d();
c->activation = 0;
- c->compilationUnit = function->function()->compilationUnit;
+ c->compilationUnit = function->compilationUnit;
c->lookups = c->compilationUnit->runtimeLookups;
c->constantTable = c->compilationUnit->constants;
c->locals = (Value *)((quintptr(c + 1) + 7) & ~7);
- const CompiledData::Function *compiledFunction = function->function()->compiledFunction;
+ const CompiledData::Function *compiledFunction = function->compiledFunction;
int nLocals = compiledFunction->nLocals;
if (nLocals)
std::fill(c->locals, c->locals + nLocals, Primitive::undefinedValue());
@@ -102,20 +107,6 @@ Heap::CatchContext *ExecutionContext::newCatchContext(Heap::String *exceptionVar
return d()->engine->memoryManager->alloc<CatchContext>(d(), exceptionVarName, e);
}
-Heap::QmlContext *ExecutionContext::newQmlContext(QmlContextWrapper *qml)
-{
- Heap::QmlContext *c = d()->engine->memoryManager->alloc<QmlContext>(this, qml);
- return c;
-}
-
-Heap::QmlContext *ExecutionContext::newQmlContext(QQmlContextData *context, QObject *scopeObject)
-{
- Scope scope(this);
- Scoped<QmlContextWrapper> qml(scope, QmlContextWrapper::qmlScope(scope.engine, context, scopeObject));
- Heap::QmlContext *c = d()->engine->memoryManager->alloc<QmlContext>(this, qml);
- return c;
-}
-
void ExecutionContext::createMutableBinding(String *name, bool deletable)
{
Scope scope(this);
@@ -182,38 +173,25 @@ void Heap::CatchContext::init(ExecutionContext *outerContext, String *exceptionV
this->exceptionValue = exceptionValue;
}
-void Heap::QmlContext::init(QV4::ExecutionContext *outerContext, QV4::QmlContextWrapper *qml)
-{
- Heap::ExecutionContext::init(outerContext->engine(), Heap::ExecutionContext::Type_QmlContext);
- outer = outerContext->d();
- strictMode = false;
- callData = outer->callData;
- lookups = outer->lookups;
- constantTable = outer->constantTable;
- compilationUnit = outer->compilationUnit;
-
- this->qml = qml->d();
-}
-
Identifier * const *CallContext::formals() const
{
- return (d()->function && d()->function->function) ? d()->function->function->internalClass->nameMap.constData() : 0;
+ return d()->v4Function ? d()->v4Function->internalClass->nameMap.constData() : 0;
}
unsigned int CallContext::formalCount() const
{
- return d()->function ? d()->function->formalParameterCount() : 0;
+ return d()->v4Function ? d()->v4Function->nFormals : 0;
}
Identifier * const *CallContext::variables() const
{
- return (d()->function && d()->function->function) ? d()->function->function->internalClass->nameMap.constData() + d()->function->formalParameterCount() : 0;
+ return d()->v4Function ? d()->v4Function->internalClass->nameMap.constData() + d()->v4Function->nFormals : 0;
}
unsigned int CallContext::variableCount() const
{
- return d()->function ? d()->function->varCount() : 0;
+ return d()->v4Function ? d()->v4Function->compiledFunction->nLocals : 0;
}
@@ -247,9 +225,8 @@ bool ExecutionContext::deleteProperty(String *name)
case Heap::ExecutionContext::Type_CallContext:
case Heap::ExecutionContext::Type_SimpleCallContext: {
Heap::CallContext *c = static_cast<Heap::CallContext *>(ctx->d());
- ScopedFunctionObject f(scope, c->function);
- if (f->needsActivation() || hasWith) {
- uint index = f->function()->internalClass->find(name);
+ if (c->v4Function && (c->v4Function->needsActivation() || hasWith)) {
+ uint index = c->v4Function->internalClass->find(name);
if (index < UINT_MAX)
// ### throw in strict mode?
return false;
@@ -272,7 +249,8 @@ bool ExecutionContext::deleteProperty(String *name)
bool CallContext::needsOwnArguments() const
{
- return d()->function->needsActivation() || argc() < static_cast<int>(d()->function->formalParameterCount());
+ QV4::Function *f = d()->v4Function;
+ return (f && f->needsActivation()) || (argc() < (f ? static_cast<int>(f->nFormals) : 0));
}
void ExecutionContext::markObjects(Heap::Base *m, ExecutionEngine *engine)
@@ -304,14 +282,16 @@ void ExecutionContext::markObjects(Heap::Base *m, ExecutionEngine *engine)
break;
case Heap::ExecutionContext::Type_CallContext: {
QV4::Heap::CallContext *c = static_cast<Heap::CallContext *>(ctx);
+ Q_ASSERT(c->v4Function);
ctx->callData->thisObject.mark(engine);
- for (int arg = 0; arg < qMax(ctx->callData->argc, (int)c->function->formalParameterCount()); ++arg)
+ for (int arg = 0; arg < qMax(ctx->callData->argc, (int)c->v4Function->nFormals); ++arg)
ctx->callData->args[arg].mark(engine);
- for (unsigned local = 0, lastLocal = c->function->varCount(); local < lastLocal; ++local)
+ for (unsigned local = 0, lastLocal = c->v4Function->compiledFunction->nLocals; local < lastLocal; ++local)
c->locals[local].mark(engine);
if (c->activation)
c->activation->mark(engine);
- c->function->mark(engine);
+ if (c->function)
+ c->function->mark(engine);
break;
}
case Heap::ExecutionContext::Type_QmlContext: {
@@ -322,6 +302,51 @@ void ExecutionContext::markObjects(Heap::Base *m, ExecutionEngine *engine)
}
}
+// Do a standard call with this execution context as the outer scope
+void ExecutionContext::call(Scope &scope, CallData *callData, Function *function, const FunctionObject *f)
+{
+ ExecutionContextSaver ctxSaver(scope);
+
+ Scoped<CallContext> ctx(scope, newCallContext(function, callData));
+ if (f)
+ ctx->d()->function = f->d();
+ scope.engine->pushContext(ctx);
+
+ scope.result = Q_V4_PROFILE(scope.engine, function);
+
+ if (function->hasQmlDependencies)
+ QQmlPropertyCapture::registerQmlDependencies(function->compiledFunction, scope);
+}
+
+// Do a simple, fast call with this execution context as the outer scope
+void QV4::ExecutionContext::simpleCall(Scope &scope, CallData *callData, Function *function)
+{
+ Q_ASSERT(function->canUseSimpleFunction());
+
+ ExecutionContextSaver ctxSaver(scope);
+
+ CallContext::Data ctx = CallContext::Data::createOnStack(scope.engine);
+
+ ctx.strictMode = function->isStrict();
+ ctx.callData = callData;
+ ctx.v4Function = function;
+ ctx.compilationUnit = function->compilationUnit;
+ ctx.lookups = function->compilationUnit->runtimeLookups;
+ ctx.constantTable = function->compilationUnit->constants;
+ ctx.outer = this->d();
+ ctx.locals = scope.alloc(function->compiledFunction->nLocals);
+ for (int i = callData->argc; i < (int)function->nFormals; ++i)
+ callData->args[i] = Encode::undefined();
+
+ scope.engine->pushContext(&ctx);
+ Q_ASSERT(scope.engine->current == &ctx);
+
+ scope.result = Q_V4_PROFILE(scope.engine, function);
+
+ if (function->hasQmlDependencies)
+ QQmlPropertyCapture::registerQmlDependencies(function->compiledFunction, scope);
+}
+
void ExecutionContext::setProperty(String *name, const Value &value)
{
Scope scope(this);
@@ -354,13 +379,13 @@ void ExecutionContext::setProperty(String *name, const Value &value)
case Heap::ExecutionContext::Type_CallContext:
case Heap::ExecutionContext::Type_SimpleCallContext: {
Heap::CallContext *c = static_cast<Heap::CallContext *>(ctx->d());
- if (c->function->function) {
- uint index = c->function->function->internalClass->find(name);
+ if (c->v4Function) {
+ uint index = c->v4Function->internalClass->find(name);
if (index < UINT_MAX) {
- if (index < c->function->formalParameterCount()) {
- c->callData->args[c->function->formalParameterCount() - index - 1] = value;
+ if (index < c->v4Function->nFormals) {
+ c->callData->args[c->v4Function->nFormals - index - 1] = value;
} else {
- index -= c->function->formalParameterCount();
+ index -= c->v4Function->nFormals;
c->locals[index] = value;
}
return;
@@ -435,13 +460,12 @@ ReturnedValue ExecutionContext::getProperty(String *name)
case Heap::ExecutionContext::Type_CallContext:
case Heap::ExecutionContext::Type_SimpleCallContext: {
Heap::CallContext *c = static_cast<Heap::CallContext *>(ctx->d());
- ScopedFunctionObject f(scope, c->function);
- if (f->function() && (f->needsActivation() || hasWith || hasCatchScope)) {
- uint index = f->function()->internalClass->find(name);
+ if (c->v4Function && (c->v4Function->needsActivation() || hasWith || hasCatchScope)) {
+ uint index = c->v4Function->internalClass->find(name);
if (index < UINT_MAX) {
- if (index < c->function->formalParameterCount())
- return c->callData->args[c->function->formalParameterCount() - index - 1].asReturnedValue();
- return c->locals[index - c->function->formalParameterCount()].asReturnedValue();
+ if (index < c->v4Function->nFormals)
+ return c->callData->args[c->v4Function->nFormals - index - 1].asReturnedValue();
+ return c->locals[index - c->v4Function->nFormals].asReturnedValue();
}
}
ScopedObject activation(scope, c->activation);
@@ -451,9 +475,9 @@ ReturnedValue ExecutionContext::getProperty(String *name)
if (hasProperty)
return v->asReturnedValue();
}
- if (f->function() && f->function()->isNamedExpression()
- && name->equals(ScopedString(scope, f->function()->name())))
- return f.asReturnedValue();
+ if (c->function && c->v4Function->isNamedExpression()
+ && name->equals(ScopedString(scope, c->v4Function->name())))
+ return c->function->asReturnedValue();
break;
}
case Heap::ExecutionContext::Type_QmlContext: {
@@ -514,13 +538,12 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Value *base)
case Heap::ExecutionContext::Type_CallContext:
case Heap::ExecutionContext::Type_SimpleCallContext: {
Heap::CallContext *c = static_cast<Heap::CallContext *>(ctx->d());
- ScopedFunctionObject f(scope, c->function);
- if (f->function() && (f->needsActivation() || hasWith || hasCatchScope)) {
- uint index = f->function()->internalClass->find(name);
+ if (c->v4Function && (c->v4Function->needsActivation() || hasWith || hasCatchScope)) {
+ uint index = c->v4Function->internalClass->find(name);
if (index < UINT_MAX) {
- if (index < c->function->formalParameterCount())
- return c->callData->args[c->function->formalParameterCount() - index - 1].asReturnedValue();
- return c->locals[index - c->function->formalParameterCount()].asReturnedValue();
+ if (index < c->v4Function->nFormals)
+ return c->callData->args[c->v4Function->nFormals - index - 1].asReturnedValue();
+ return c->locals[index - c->v4Function->nFormals].asReturnedValue();
}
}
ScopedObject activation(scope, c->activation);
@@ -530,9 +553,9 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Value *base)
if (hasProperty)
return v->asReturnedValue();
}
- if (f->function() && f->function()->isNamedExpression()
- && name->equals(ScopedString(scope, f->function()->name())))
- return f.asReturnedValue();
+ if (c->function && c->v4Function->isNamedExpression()
+ && name->equals(ScopedString(scope, c->v4Function->name())))
+ return c->function->asReturnedValue();
break;
}
case Heap::ExecutionContext::Type_QmlContext: {
@@ -551,13 +574,13 @@ ReturnedValue ExecutionContext::getPropertyAndBase(String *name, Value *base)
return engine()->throwReferenceError(n);
}
-Heap::FunctionObject *ExecutionContext::getFunctionObject() const
+Function *ExecutionContext::getFunction() const
{
Scope scope(d()->engine);
ScopedContext it(scope, this->d());
for (; it; it = it->d()->outer) {
if (const CallContext *callCtx = it->asCallContext())
- return callCtx->d()->function;
+ return callCtx->d()->v4Function;
else if (it->asCatchContext() || it->asWithContext())
continue; // look in the parent context for a FunctionObject
else
diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h
index 0b42288ccc..c985fdb24d 100644
--- a/src/qml/jsruntime/qv4context_p.h
+++ b/src/qml/jsruntime/qv4context_p.h
@@ -55,8 +55,8 @@
QT_BEGIN_NAMESPACE
-class QQmlContextData;
class QObject;
+class QQmlContextData;
namespace QV4 {
@@ -65,11 +65,13 @@ struct CompilationUnit;
struct Function;
}
-struct QmlContextWrapper;
+struct Function;
struct Identifier;
struct CallContext;
struct CatchContext;
struct WithContext;
+struct QmlContext;
+struct QmlContextWrapper;
struct CallData
{
@@ -91,6 +93,8 @@ struct CallData
namespace Heap {
+struct QmlContext;
+
struct ExecutionContext : Base {
enum ContextType {
Type_GlobalContext = 0x1,
@@ -137,11 +141,15 @@ struct CallContext : ExecutionContext {
{
ExecutionContext::init(engine, t);
function = 0;
+ v4Function = 0;
locals = 0;
activation = 0;
}
+ inline unsigned int formalParameterCount() const;
+
Pointer<FunctionObject> function;
+ QV4::Function *v4Function;
Value *locals;
Pointer<Object> activation;
};
@@ -177,14 +185,6 @@ struct WithContext : ExecutionContext {
};
V4_ASSERT_IS_TRIVIAL(WithContext)
-struct QmlContextWrapper;
-
-struct QmlContext : ExecutionContext {
- void init(QV4::ExecutionContext *outerContext, QV4::QmlContextWrapper *qml);
-
- Pointer<QmlContextWrapper> qml;
-};
-
}
struct Q_QML_EXPORT ExecutionContext : public Managed
@@ -198,11 +198,9 @@ struct Q_QML_EXPORT ExecutionContext : public Managed
ExecutionEngine *engine() const { return d()->engine; }
- Heap::CallContext *newCallContext(const FunctionObject *f, CallData *callData);
+ Heap::CallContext *newCallContext(Function *f, CallData *callData);
Heap::WithContext *newWithContext(Heap::Object *with);
Heap::CatchContext *newCatchContext(Heap::String *exceptionVarName, ReturnedValue exceptionValue);
- Heap::QmlContext *newQmlContext(QmlContextWrapper *qml);
- Heap::QmlContext *newQmlContext(QQmlContextData *context, QObject *scopeObject);
void createMutableBinding(String *name, bool deletable);
@@ -216,7 +214,7 @@ struct Q_QML_EXPORT ExecutionContext : public Managed
inline const CatchContext *asCatchContext() const;
inline const WithContext *asWithContext() const;
- Heap::FunctionObject *getFunctionObject() const;
+ Function *getFunction() const;
static void markObjects(Heap::Base *m, ExecutionEngine *e);
@@ -232,6 +230,9 @@ struct Q_QML_EXPORT ExecutionContext : public Managed
ReturnedValue argument(int i) const {
return d()->callData->argument(i);
}
+
+ void call(Scope &scope, CallData *callData, QV4::Function *function, const QV4::FunctionObject *f = 0);
+ void simpleCall(Scope &scope, CallData *callData, QV4::Function *function);
};
struct Q_QML_EXPORT CallContext : public ExecutionContext
@@ -244,11 +245,11 @@ struct Q_QML_EXPORT CallContext : public ExecutionContext
Identifier * const *variables() const;
unsigned int variableCount() const;
- inline ReturnedValue argument(int i);
+ inline ReturnedValue argument(int i) const;
bool needsOwnArguments() const;
};
-inline ReturnedValue CallContext::argument(int i) {
+inline ReturnedValue CallContext::argument(int i) const {
return i < argc() ? args()[i].asReturnedValue() : Primitive::undefinedValue().asReturnedValue();
}
@@ -268,16 +269,6 @@ struct WithContext : public ExecutionContext
V4_MANAGED(WithContext, ExecutionContext)
};
-struct Q_QML_EXPORT QmlContext : public ExecutionContext
-{
- V4_MANAGED(QmlContext, ExecutionContext)
-
- QObject *qmlScope() const;
- QQmlContextData *qmlContext() const;
-
- void takeContextOwnership();
-};
-
inline CallContext *ExecutionContext::asCallContext()
{
return d()->type >= Heap::ExecutionContext::Type_SimpleCallContext ? static_cast<CallContext *>(this) : 0;
@@ -308,10 +299,6 @@ inline Heap::CallContext Heap::CallContext::createOnStack(ExecutionEngine *v4)
return ctxt;
}
-/* Function *f, int argc */
-#define requiredMemoryForExecutionContect(f, argc) \
- ((sizeof(CallContext::Data) + 7) & ~7) + sizeof(Value) * (f->varCount() + qMax((uint)argc, f->formalParameterCount())) + sizeof(CallData)
-
} // namespace QV4
QT_END_NAMESPACE
diff --git a/src/qml/jsruntime/qv4context_p_p.h b/src/qml/jsruntime/qv4context_p_p.h
deleted file mode 100644
index ca8dc0b518..0000000000
--- a/src/qml/jsruntime/qv4context_p_p.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QV4CONTEXT_P_P_H
-#define QV4CONTEXT_P_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.
-//
-
-// This header defines a couple of inlinable methods.
-// These implementation cannot be put in qv4context_p.h, because they rely on the
-// QQmlContextWrapper, which in turn is a QV4::Object subclass (so it includes qv4object_p.h),
-// which includes qv4engine_p.h, that needs to include qv4context_p.h
-
-#include "qv4context_p.h"
-#include "private/qqmlcontextwrapper_p.h"
-
-QT_BEGIN_NAMESPACE
-
-namespace QV4 {
-
-QObject *QmlContext::qmlScope() const
-{
- return d()->qml->scopeObject;
-}
-
-QQmlContextData *QmlContext::qmlContext() const
-{
- return *d()->qml->context;
-}
-
-void QmlContext::takeContextOwnership() {
- d()->qml->ownsContext = true;
-}
-
-} // QV4 namespace
-
-QT_END_NAMESPACE
-
-#endif // QV4CONTEXT_P_P_H
diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp
index 4f3138a452..8cc6a25fea 100644
--- a/src/qml/jsruntime/qv4dateobject.cpp
+++ b/src/qml/jsruntime/qv4dateobject.cpp
@@ -689,8 +689,8 @@ void DateCtor::construct(const Managed *, Scope &scope, CallData *callData)
} else {
arg = RuntimeHelpers::toPrimitive(arg, PREFERREDTYPE_HINT);
- if (arg->isString())
- t = ParseString(arg->stringValue()->toQString());
+ if (String *s = arg->stringValue())
+ t = ParseString(s->toQString());
else
t = TimeClip(arg->toNumber());
}
@@ -1319,14 +1319,17 @@ ReturnedValue DatePrototype::method_toISOString(CallContext *ctx)
ReturnedValue DatePrototype::method_toJSON(CallContext *ctx)
{
Scope scope(ctx);
- ScopedValue O(scope, RuntimeHelpers::toObject(scope.engine, ctx->thisObject()));
+ ScopedObject O(scope, ctx->thisObject().toObject(scope.engine));
+ if (scope.hasException())
+ return Encode::undefined();
+
ScopedValue tv(scope, RuntimeHelpers::toPrimitive(O, NUMBER_HINT));
if (tv->isNumber() && !std::isfinite(tv->toNumber()))
return Encode::null();
ScopedString s(scope, ctx->d()->engine->newString(QStringLiteral("toISOString")));
- ScopedValue v(scope, O->objectValue()->get(s));
+ ScopedValue v(scope, O->get(s));
FunctionObject *toIso = v->as<FunctionObject>();
if (!toIso)
diff --git a/src/qml/jsruntime/qv4dateobject_p.h b/src/qml/jsruntime/qv4dateobject_p.h
index 2d0648396e..835f6adbe0 100644
--- a/src/qml/jsruntime/qv4dateobject_p.h
+++ b/src/qml/jsruntime/qv4dateobject_p.h
@@ -101,7 +101,7 @@ struct DateObject: Object {
template<>
inline const DateObject *Value::as() const {
- return isManaged() && m() && m()->vtable()->type == Managed::Type_DateObject ? static_cast<const DateObject *>(this) : 0;
+ return isManaged() && m()->vtable()->type == Managed::Type_DateObject ? static_cast<const DateObject *>(this) : 0;
}
struct DateCtor: FunctionObject
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 7265952f72..8f2c5174da 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
#include <qv4engine_p.h>
-#include <qv4context_p.h>
+#include <qv4qmlcontext_p.h>
#include <qv4value_p.h>
#include <qv4object_p.h>
#include <qv4objectproto_p.h>
@@ -71,7 +71,6 @@
#include "qv4typedarray_p.h"
#include <private/qv8engine_p.h>
#include <private/qjsvalue_p.h>
-#include <private/qqmlcontextwrapper_p.h>
#include <private/qqmltypewrapper_p.h>
#include <private/qqmlvaluetypewrapper_p.h>
#include <private/qqmlvaluetype_p.h>
@@ -282,10 +281,10 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory)
jsObjects[FunctionProto] = memoryManager->allocObject<FunctionPrototype>(functionProtoClass, objectPrototype());
functionClass = emptyClass->addMember(id_prototype(), Attr_NotEnumerable|Attr_NotConfigurable, &index);
Q_ASSERT(index == Heap::FunctionObject::Index_Prototype);
- simpleScriptFunctionClass = functionClass->addMember(id_name(), Attr_ReadOnly, &index);
- Q_ASSERT(index == Heap::SimpleScriptFunction::Index_Name);
- simpleScriptFunctionClass = simpleScriptFunctionClass->addMember(id_length(), Attr_ReadOnly, &index);
- Q_ASSERT(index == Heap::SimpleScriptFunction::Index_Length);
+ scriptFunctionClass = functionClass->addMember(id_name(), Attr_ReadOnly, &index);
+ Q_ASSERT(index == Heap::ScriptFunction::Index_Name);
+ scriptFunctionClass = scriptFunctionClass->addMember(id_length(), Attr_ReadOnly, &index);
+ Q_ASSERT(index == Heap::ScriptFunction::Index_Length);
protoClass = emptyClass->addMember(id_constructor(), Attr_NotEnumerable, &index);
Q_ASSERT(index == Heap::FunctionObject::Index_ProtoConstructor);
@@ -714,6 +713,27 @@ Heap::Object *ExecutionEngine::newForEachIteratorObject(Object *o)
return obj->d();
}
+Heap::QmlContext *ExecutionEngine::qmlContext() const
+{
+ Heap::ExecutionContext *ctx = current;
+
+ // get the correct context when we're within a builtin function
+ if (ctx->type == Heap::ExecutionContext::Type_SimpleCallContext && !ctx->outer)
+ ctx = parentContext(currentContext)->d();
+
+ if (ctx->type != Heap::ExecutionContext::Type_QmlContext && !ctx->outer)
+ return 0;
+
+ while (ctx->outer && ctx->outer->type != Heap::ExecutionContext::Type_GlobalContext)
+ ctx = ctx->outer;
+
+ Q_ASSERT(ctx);
+ if (ctx->type != Heap::ExecutionContext::Type_QmlContext)
+ return 0;
+
+ return static_cast<Heap::QmlContext *>(ctx);
+}
+
QObject *ExecutionEngine::qmlScopeObject() const
{
Heap::QmlContext *ctx = qmlContext();
@@ -760,21 +780,17 @@ QVector<StackFrame> ExecutionEngine::stackTrace(int frameLimit) const
QVector<StackFrame> stack;
ExecutionContext *c = currentContext;
- ScopedFunctionObject function(scope);
while (c && frameLimit) {
- function = c->getFunctionObject();
+ QV4::Function *function = c->getFunction();
if (function) {
StackFrame frame;
- if (const Function *f = function->function())
- frame.source = f->sourceFile();
+ frame.source = function->sourceFile();
name = function->name();
frame.function = name->toQString();
- frame.line = -1;
- frame.column = -1;
- if (function->function())
- // line numbers can be negative for places where you can't set a real breakpoint
- frame.line = qAbs(c->d()->lineNumber);
+ // line numbers can be negative for places where you can't set a real breakpoint
+ frame.line = qAbs(c->d()->lineNumber);
+ frame.column = -1;
stack.append(frame);
--frameLimit;
@@ -850,9 +866,8 @@ QUrl ExecutionEngine::resolvedUrl(const QString &file)
ExecutionContext *c = currentContext;
while (c) {
CallContext *callCtx = c->asCallContext();
- if (callCtx && callCtx->d()->function) {
- if (callCtx->d()->function->function)
- base.setUrl(callCtx->d()->function->function->sourceFile());
+ if (callCtx && callCtx->d()->v4Function) {
+ base.setUrl(callCtx->d()->v4Function->sourceFile());
break;
}
c = parentContext(c);
@@ -1151,8 +1166,8 @@ static QVariant toVariant(QV4::ExecutionEngine *e, const QV4::Value &value, int
return value.integerValue();
if (value.isNumber())
return value.asDouble();
- if (value.isString()) {
- const QString &str = value.toQString();
+ if (String *s = value.stringValue()) {
+ const QString &str = s->toQString();
// QChars are stored as a strings
if (typeHint == QVariant::Char && str.size() == 1)
return str.at(0);
@@ -1591,8 +1606,8 @@ bool ExecutionEngine::metaTypeFromJS(const Value *value, int type, void *data)
*reinterpret_cast<unsigned char*>(data) = (unsigned char)(value->toInt32());
return true;
case QMetaType::QChar:
- if (value->isString()) {
- QString str = value->stringValue()->toQString();
+ if (String *s = value->stringValue()) {
+ QString str = s->toQString();
*reinterpret_cast<QChar*>(data) = str.isEmpty() ? QChar() : str.at(0);
} else {
*reinterpret_cast<QChar*>(data) = QChar(ushort(value->toUInt16()));
@@ -1704,10 +1719,10 @@ bool ExecutionEngine::metaTypeFromJS(const Value *value, int type, void *data)
// We have T t, T* is requested, so return &t.
*reinterpret_cast<void* *>(data) = var.data();
return true;
- } else if (value->isObject()) {
+ } else if (Object *o = value->objectValue()) {
// Look in the prototype chain.
QV4::Scope scope(this);
- QV4::ScopedObject proto(scope, value->objectValue()->prototype());
+ QV4::ScopedObject proto(scope, o->prototype());
while (proto) {
bool canCast = false;
if (QV4::VariantObject *vo = proto->as<QV4::VariantObject>()) {
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h
index 25d6fc1970..1c20ad30aa 100644
--- a/src/qml/jsruntime/qv4engine_p.h
+++ b/src/qml/jsruntime/qv4engine_p.h
@@ -128,7 +128,8 @@ public:
--jsStackTop;
return jsStackTop->heapObject();
}
- Value *jsAlloca(int nValues) {
+
+ QML_NEARLY_ALWAYS_INLINE Value *jsAlloca(int nValues) {
Value *ptr = jsStackTop;
jsStackTop = ptr + nValues;
for (int i = 0; i < nValues; ++i)
@@ -254,7 +255,7 @@ public:
InternalClass *stringClass;
InternalClass *functionClass;
- InternalClass *simpleScriptFunctionClass;
+ InternalClass *scriptFunctionClass;
InternalClass *protoClass;
InternalClass *regExpExecArrayClass;
@@ -547,27 +548,6 @@ inline ExecutionContext *ExecutionEngine::parentContext(ExecutionContext *contex
return o ? context - o : 0;
}
-inline Heap::QmlContext *ExecutionEngine::qmlContext() const
-{
- Heap::ExecutionContext *ctx = current;
-
- // get the correct context when we're within a builtin function
- if (ctx->type == Heap::ExecutionContext::Type_SimpleCallContext && !ctx->outer)
- ctx = parentContext(currentContext)->d();
-
- if (ctx->type != Heap::ExecutionContext::Type_QmlContext && !ctx->outer)
- return 0;
-
- while (ctx->outer && ctx->outer->type != Heap::ExecutionContext::Type_GlobalContext)
- ctx = ctx->outer;
-
- Q_ASSERT(ctx);
- if (ctx->type != Heap::ExecutionContext::Type_QmlContext)
- return 0;
-
- return static_cast<Heap::QmlContext *>(ctx);
-}
-
inline
void Heap::Base::mark(QV4::ExecutionEngine *engine)
{
@@ -583,9 +563,6 @@ void Heap::Base::mark(QV4::ExecutionEngine *engine)
inline void Value::mark(ExecutionEngine *e)
{
- if (!isManaged())
- return;
-
Heap::Base *o = heapObject();
if (o)
o->mark(e);
diff --git a/src/qml/jsruntime/qv4errorobject_p.h b/src/qml/jsruntime/qv4errorobject_p.h
index 42a6e0b4b1..2b3ab25e2d 100644
--- a/src/qml/jsruntime/qv4errorobject_p.h
+++ b/src/qml/jsruntime/qv4errorobject_p.h
@@ -178,7 +178,7 @@ struct ErrorObject: Object {
template<>
inline const ErrorObject *Value::as() const {
- return isManaged() && m() && m()->vtable()->isErrorObject ? reinterpret_cast<const ErrorObject *>(this) : 0;
+ return isManaged() && m()->vtable()->isErrorObject ? reinterpret_cast<const ErrorObject *>(this) : 0;
}
struct EvalErrorObject: ErrorObject {
diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp
index caabee322a..358c2d079c 100644
--- a/src/qml/jsruntime/qv4function.cpp
+++ b/src/qml/jsruntime/qv4function.cpp
@@ -55,6 +55,7 @@ Function::Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit,
, compilationUnit(unit)
, code(codePtr)
, codeData(0)
+ , hasQmlDependencies(function->hasQmlDependencies())
{
Q_UNUSED(engine);
@@ -83,6 +84,9 @@ Function::Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit,
internalClass = internalClass->addMember(compilationUnit->runtimeStrings[localsIndices[i]]->identifier, Attr_NotConfigurable);
activationRequired = compiledFunction->nInnerFunctions > 0 || (compiledFunction->flags & (CompiledData::Function::HasDirectEval | CompiledData::Function::UsesArgumentsObject));
+
+ canUseSimpleCall = !needsActivation() && !(compiledFunction->flags & CompiledData::Function::HasCatchOrWith) &&
+ !(compiledFunction->nFormals > QV4::Global::ReservedArgumentCount) && !isNamedExpression();
}
Function::~Function()
diff --git a/src/qml/jsruntime/qv4function_p.h b/src/qml/jsruntime/qv4function_p.h
index aeef9ad61b..54d0528c42 100644
--- a/src/qml/jsruntime/qv4function_p.h
+++ b/src/qml/jsruntime/qv4function_p.h
@@ -51,7 +51,9 @@
//
#include "qv4global_p.h"
+#include <private/qqmlglobal_p.h>
#include <private/qv4compileddata_p.h>
+#include <private/qv4context_p.h>
QT_BEGIN_NAMESPACE
@@ -68,6 +70,8 @@ struct Q_QML_EXPORT Function {
InternalClass *internalClass;
uint nFormals;
bool activationRequired;
+ bool hasQmlDependencies;
+ bool canUseSimpleCall;
Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit, const CompiledData::Function *function,
ReturnedValue (*codePtr)(ExecutionEngine *, const uchar *));
@@ -88,8 +92,22 @@ struct Q_QML_EXPORT Function {
inline bool needsActivation() const
{ return activationRequired; }
+ inline bool canUseSimpleFunction() const { return canUseSimpleCall; }
+
+ QQmlSourceLocation sourceLocation() const
+ {
+ return QQmlSourceLocation(sourceFile(), compiledFunction->location.line, compiledFunction->location.column);
+ }
+
};
+
+inline unsigned int Heap::CallContext::formalParameterCount() const
+{
+ return v4Function ? v4Function->nFormals : 0;
+}
+
+
}
QT_END_NAMESPACE
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index 2cc58b74a6..64f7b98618 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -47,6 +47,7 @@
#include "qv4arrayobject_p.h"
#include "qv4scopedvalue_p.h"
+#include "qv4argumentsobject_p.h"
#include <private/qqmljsengine_p.h>
#include <private/qqmljslexer_p.h>
@@ -81,7 +82,8 @@ void Heap::FunctionObject::init(QV4::ExecutionContext *scope, QV4::String *name,
void Heap::FunctionObject::init(QV4::ExecutionContext *scope, Function *function, bool createProto)
{
Object::init();
- function = nullptr;
+ this->function = function;
+ function->compilationUnit->addref();
this->scope = scope->d();
Scope s(scope->engine());
ScopedString name(s, function->name());
@@ -91,46 +93,9 @@ void Heap::FunctionObject::init(QV4::ExecutionContext *scope, Function *function
void Heap::FunctionObject::init(QV4::ExecutionContext *scope, const QString &name, bool createProto)
{
- Object::init();
- function = nullptr;
- this->scope = scope->d();
- Scope s(scope->engine());
- ScopedFunctionObject f(s, this);
- ScopedString n(s, s.engine->newString(name));
- f->init(n, createProto);
-}
-
-void Heap::FunctionObject::init(ExecutionContext *scope, const QString &name, bool createProto)
-{
- Object::init();
- function = nullptr;
- this->scope = scope;
- Scope s(scope->engine);
- ScopedFunctionObject f(s, this);
- ScopedString n(s, s.engine->newString(name));
- f->init(n, createProto);
-}
-
-void Heap::FunctionObject::init(QV4::ExecutionContext *scope, const ReturnedValue name)
-{
- Object::init();
- function = nullptr;
- this->scope = scope->d();
- Scope s(scope);
- ScopedFunctionObject f(s, this);
- ScopedString n(s, name);
- f->init(n, false);
-}
-
-void Heap::FunctionObject::init(ExecutionContext *scope, const ReturnedValue name)
-{
- Object::init();
- function = nullptr;
- this->scope = scope;
- Scope s(scope->engine);
- ScopedFunctionObject f(s, this);
- ScopedString n(s, name);
- f->init(n, false);
+ Scope valueScope(scope);
+ ScopedString s(valueScope, valueScope.engine->newString(name));
+ init(scope, s, createProto);
}
void Heap::FunctionObject::init()
@@ -165,8 +130,8 @@ void FunctionObject::init(String *n, bool createProto)
*propertyData(Heap::FunctionObject::Index_Prototype) = Encode::undefined();
}
- ScopedValue v(s, n);
- defineReadonlyProperty(s.engine->id_name(), v);
+ if (n)
+ defineReadonlyProperty(s.engine->id_name(), *n);
}
ReturnedValue FunctionObject::name() const
@@ -193,34 +158,11 @@ void FunctionObject::markObjects(Heap::Base *that, ExecutionEngine *e)
Object::markObjects(that, e);
}
-Heap::FunctionObject *FunctionObject::createScriptFunction(ExecutionContext *scope, Function *function, bool createProto)
+Heap::FunctionObject *FunctionObject::createScriptFunction(ExecutionContext *scope, Function *function)
{
- if (function->needsActivation() ||
- function->compiledFunction->flags & CompiledData::Function::HasCatchOrWith ||
- function->compiledFunction->nFormals > QV4::Global::ReservedArgumentCount ||
- function->isNamedExpression())
- return scope->d()->engine->memoryManager->allocObject<ScriptFunction>(scope, function);
- return scope->d()->engine->memoryManager->allocObject<SimpleScriptFunction>(scope, function, createProto);
+ return scope->d()->engine->memoryManager->allocObject<ScriptFunction>(scope, function);
}
-Heap::FunctionObject *FunctionObject::createQmlFunction(QQmlContextData *qmlContext, QObject *scopeObject, Function *runtimeFunction, const QList<QByteArray> &signalParameters, QString *error)
-{
- ExecutionEngine *engine = QQmlEnginePrivate::getV4Engine(qmlContext->engine);
- QV4::Scope valueScope(engine);
- ExecutionContext *global = valueScope.engine->rootContext();
- QV4::Scoped<QmlContext> wrapperContext(valueScope, global->newQmlContext(qmlContext, scopeObject));
-
- if (!signalParameters.isEmpty()) {
- if (error)
- QQmlPropertyCache::signalParameterStringForJS(engine, signalParameters, error);
- runtimeFunction->updateInternalClass(engine, signalParameters);
- }
-
- QV4::ScopedFunctionObject function(valueScope, QV4::FunctionObject::createScriptFunction(wrapperContext, runtimeFunction));
- return function->d();
-}
-
-
bool FunctionObject::isBinding() const
{
return d()->vtable() == QQmlBindingFunction::staticVTable();
@@ -233,14 +175,7 @@ bool FunctionObject::isBoundFunction() const
QQmlSourceLocation FunctionObject::sourceLocation() const
{
- if (isBinding()) {
- Q_ASSERT(as<const QV4::QQmlBindingFunction>());
- return *static_cast<QV4::Heap::QQmlBindingFunction *>(d())->bindingLocation;
- }
- QV4::Function *function = d()->function;
- Q_ASSERT(function);
-
- return QQmlSourceLocation(function->sourceFile(), function->compiledFunction->location.line, function->compiledFunction->location.column);
+ return d()->function->sourceLocation();
}
DEFINE_OBJECT_VTABLE(FunctionCtor);
@@ -346,11 +281,11 @@ ReturnedValue FunctionPrototype::method_toString(CallContext *ctx)
ReturnedValue FunctionPrototype::method_apply(CallContext *ctx)
{
- Scope scope(ctx);
- ScopedFunctionObject o(scope, ctx->thisObject().as<FunctionObject>());
+ FunctionObject *o = ctx->thisObject().as<FunctionObject>();
if (!o)
return ctx->engine()->throwTypeError();
+ Scope scope(ctx);
ScopedValue arg(scope, ctx->argument(1));
ScopedObject arr(scope, arg);
@@ -367,17 +302,24 @@ ReturnedValue FunctionPrototype::method_apply(CallContext *ctx)
ScopedCallData callData(scope, len);
if (len) {
- if (arr->arrayType() != Heap::ArrayData::Simple || arr->protoHasArray()) {
- for (quint32 i = 0; i < len; ++i)
- callData->args[i] = arr->getIndexed(i);
- } else {
- uint alen = arr->arrayData() ? arr->arrayData()->len : 0;
+ if (ArgumentsObject::isNonStrictArgumentsObject(arr) && !arr->cast<ArgumentsObject>()->fullyCreated()) {
+ QV4::ArgumentsObject *a = arr->cast<ArgumentsObject>();
+ int l = qMin(len, (uint)a->d()->context->callData->argc);
+ memcpy(callData->args, a->d()->context->callData->args, l*sizeof(Value));
+ for (quint32 i = l; i < len; ++i)
+ callData->args[i] = Primitive::undefinedValue();
+ } else if (arr->arrayType() == Heap::ArrayData::Simple && !arr->protoHasArray()) {
+ auto sad = static_cast<Heap::SimpleArrayData *>(arr->arrayData());
+ uint alen = sad ? sad->len : 0;
if (alen > len)
alen = len;
for (uint i = 0; i < alen; ++i)
- callData->args[i] = static_cast<Heap::SimpleArrayData *>(arr->arrayData())->data(i);
+ callData->args[i] = sad->data(i);
for (quint32 i = alen; i < len; ++i)
callData->args[i] = Primitive::undefinedValue();
+ } else {
+ for (quint32 i = 0; i < len; ++i)
+ callData->args[i] = arr->getIndexed(i);
}
}
@@ -388,12 +330,11 @@ ReturnedValue FunctionPrototype::method_apply(CallContext *ctx)
ReturnedValue FunctionPrototype::method_call(CallContext *ctx)
{
- Scope scope(ctx);
-
- ScopedFunctionObject o(scope, ctx->thisObject().as<FunctionObject>());
+ FunctionObject *o = ctx->thisObject().as<FunctionObject>();
if (!o)
return ctx->engine()->throwTypeError();
+ Scope scope(ctx);
ScopedCallData callData(scope, ctx->argc() ? ctx->argc() - 1 : 0);
if (ctx->argc()) {
for (int i = 1; i < ctx->argc(); ++i)
@@ -407,11 +348,11 @@ ReturnedValue FunctionPrototype::method_call(CallContext *ctx)
ReturnedValue FunctionPrototype::method_bind(CallContext *ctx)
{
- Scope scope(ctx);
- ScopedFunctionObject target(scope, ctx->thisObject());
+ FunctionObject *target = ctx->thisObject().as<FunctionObject>();
if (!target)
return ctx->engine()->throwTypeError();
+ Scope scope(ctx);
ScopedValue boundThis(scope, ctx->argument(0));
Scoped<MemberData> boundArgs(scope, (Heap::MemberData *)0);
if (ctx->argc() > 1) {
@@ -426,15 +367,10 @@ ReturnedValue FunctionPrototype::method_bind(CallContext *ctx)
DEFINE_OBJECT_VTABLE(ScriptFunction);
-void Heap::ScriptFunction::init(QV4::ExecutionContext *scope, Function *function)
-{
- Heap::SimpleScriptFunction::init(scope, function, true);
-}
-
void ScriptFunction::construct(const Managed *that, Scope &scope, CallData *callData)
{
ExecutionEngine *v4 = scope.engine;
- if (v4->hasException) {
+ if (Q_UNLIKELY(v4->hasException)) {
scope.result = Encode::undefined();
return;
}
@@ -447,17 +383,18 @@ void ScriptFunction::construct(const Managed *that, Scope &scope, CallData *call
InternalClass *ic = v4->emptyClass;
ScopedObject proto(scope, f->protoForConstructor());
ScopedObject obj(scope, v4->newObject(ic, proto));
-
callData->thisObject = obj.asReturnedValue();
- Scoped<CallContext> ctx(scope, v4->currentContext->newCallContext(f, callData));
- v4->pushContext(ctx);
- scope.result = Q_V4_PROFILE(v4, f->function());
+ QV4::Function *v4Function = f->function();
+ Q_ASSERT(v4Function);
- if (f->function()->compiledFunction->hasQmlDependencies())
- QQmlPropertyCapture::registerQmlDependencies(f->function()->compiledFunction, scope);
+ ScopedContext c(scope, f->scope());
+ if (v4Function->canUseSimpleCall)
+ c->simpleCall(scope, callData, v4Function);
+ else
+ c->call(scope, callData, v4Function, f);
- if (v4->hasException) {
+ if (Q_UNLIKELY(v4->hasException)) {
scope.result = Encode::undefined();
} else if (!scope.result.isObject()) {
scope.result = obj.asReturnedValue();
@@ -467,27 +404,25 @@ void ScriptFunction::construct(const Managed *that, Scope &scope, CallData *call
void ScriptFunction::call(const Managed *that, Scope &scope, CallData *callData)
{
ExecutionEngine *v4 = scope.engine;
- if (v4->hasException) {
+ if (Q_UNLIKELY(v4->hasException)) {
scope.result = Encode::undefined();
return;
}
CHECK_STACK_LIMITS(v4, scope);
- ExecutionContextSaver ctxSaver(scope);
-
Scoped<ScriptFunction> f(scope, static_cast<const ScriptFunction *>(that));
- Scoped<CallContext> ctx(scope, v4->currentContext->newCallContext(f, callData));
- v4->pushContext(ctx);
- scope.result = Q_V4_PROFILE(v4, f->function());
+ QV4::Function *v4Function = f->function();
+ Q_ASSERT(v4Function);
- if (f->function()->compiledFunction->hasQmlDependencies())
- QQmlPropertyCapture::registerQmlDependencies(f->function()->compiledFunction, scope);
+ ScopedContext c(scope, f->scope());
+ if (v4Function->canUseSimpleCall)
+ c->simpleCall(scope, callData, v4Function);
+ else
+ c->call(scope, callData, v4Function, f);
}
-DEFINE_OBJECT_VTABLE(SimpleScriptFunction);
-
-void Heap::SimpleScriptFunction::init(QV4::ExecutionContext *scope, Function *function, bool createProto)
+void Heap::ScriptFunction::init(QV4::ExecutionContext *scope, Function *function)
{
FunctionObject::init();
this->scope = scope->d();
@@ -500,16 +435,10 @@ void Heap::SimpleScriptFunction::init(QV4::ExecutionContext *scope, Function *fu
Scope s(scope);
ScopedFunctionObject f(s, this);
- if (createProto) {
- ScopedString name(s, function->name());
- f->init(name, createProto);
- f->defineReadonlyProperty(scope->d()->engine->id_length(), Primitive::fromInt32(f->formalParameterCount()));
- } else {
- Q_ASSERT(internalClass && internalClass->find(s.engine->id_length()) == Index_Length);
- Q_ASSERT(internalClass && internalClass->find(s.engine->id_name()) == Index_Name);
- *propertyData(Index_Name) = function->name();
- *propertyData(Index_Length) = Primitive::fromInt32(f->formalParameterCount());
- }
+ ScopedString name(s, function->name());
+ f->init(name, true);
+ Q_ASSERT(internalClass && internalClass->find(s.engine->id_length()) == Index_Length);
+ *propertyData(Index_Length) = Primitive::fromInt32(f->formalParameterCount());
if (scope->d()->strictMode) {
ScopedProperty pd(s);
@@ -520,89 +449,12 @@ void Heap::SimpleScriptFunction::init(QV4::ExecutionContext *scope, Function *fu
}
}
-void SimpleScriptFunction::construct(const Managed *that, Scope &scope, CallData *callData)
-{
- ExecutionEngine *v4 = scope.engine;
- if (v4->hasException) {
- scope.result = Encode::undefined();
- return;
- }
- CHECK_STACK_LIMITS(v4, scope);
-
- ExecutionContextSaver ctxSaver(scope);
-
- Scoped<SimpleScriptFunction> f(scope, static_cast<const SimpleScriptFunction *>(that));
-
- InternalClass *ic = scope.engine->emptyClass;
- ScopedObject proto(scope, f->protoForConstructor());
- callData->thisObject = v4->newObject(ic, proto);
-
- CallContext::Data ctx = CallContext::Data::createOnStack(v4);
- ctx.strictMode = f->strictMode();
- ctx.callData = callData;
- ctx.function = f->d();
- ctx.compilationUnit = f->function()->compilationUnit;
- ctx.lookups = ctx.compilationUnit->runtimeLookups;
- ctx.constantTable = ctx.compilationUnit->constants;
- ctx.outer = f->scope();
- ctx.locals = scope.alloc(f->varCount());
- for (int i = callData->argc; i < (int)f->formalParameterCount(); ++i)
- callData->args[i] = Encode::undefined();
- v4->pushContext(&ctx);
- Q_ASSERT(v4->current == &ctx);
-
- scope.result = Q_V4_PROFILE(v4, f->function());
-
- if (f->function()->compiledFunction->hasQmlDependencies())
- QQmlPropertyCapture::registerQmlDependencies(f->function()->compiledFunction, scope);
-
- if (v4->hasException) {
- scope.result = Encode::undefined();
- } else if (!scope.result.isObject()) {
- scope.result = callData->thisObject;
- }
-}
-
-void SimpleScriptFunction::call(const Managed *that, Scope &scope, CallData *callData)
-{
- ExecutionEngine *v4 = scope.engine;
- if (v4->hasException) {
- scope.result = Encode::undefined();
- return;
- }
- CHECK_STACK_LIMITS(v4, scope);
-
- ExecutionContextSaver ctxSaver(scope);
-
- Scoped<SimpleScriptFunction> f(scope, static_cast<const SimpleScriptFunction *>(that));
-
- CallContext::Data ctx = CallContext::Data::createOnStack(v4);
- ctx.strictMode = f->strictMode();
- ctx.callData = callData;
- ctx.function = f->d();
- ctx.compilationUnit = f->function()->compilationUnit;
- ctx.lookups = ctx.compilationUnit->runtimeLookups;
- ctx.constantTable = ctx.compilationUnit->constants;
- ctx.outer = f->scope();
- ctx.locals = scope.alloc(f->varCount());
- for (int i = callData->argc; i < (int)f->formalParameterCount(); ++i)
- callData->args[i] = Encode::undefined();
- v4->pushContext(&ctx);
- Q_ASSERT(v4->current == &ctx);
-
- scope.result = Q_V4_PROFILE(v4, f->function());
-
- if (f->function()->compiledFunction->hasQmlDependencies())
- QQmlPropertyCapture::registerQmlDependencies(f->function()->compiledFunction, scope);
-}
-
-Heap::Object *SimpleScriptFunction::protoForConstructor()
+Heap::Object *ScriptFunction::protoForConstructor() const
{
- Scope scope(engine());
- ScopedObject p(scope, protoProperty());
- if (p)
- return p->d();
- return scope.engine->objectPrototype()->d();
+ const Object *o = d()->protoProperty();
+ if (o)
+ return o->d();
+ return engine()->objectPrototype()->d();
}
diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h
index e58b83e2c3..a02e89e883 100644
--- a/src/qml/jsruntime/qv4functionobject_p.h
+++ b/src/qml/jsruntime/qv4functionobject_p.h
@@ -69,12 +69,9 @@ struct Q_QML_PRIVATE_EXPORT FunctionObject : Object {
Index_ProtoConstructor = 0
};
- void init(QV4::ExecutionContext *scope, QV4::String *name, bool createProto = false);
+ void init(QV4::ExecutionContext *scope, QV4::String *name = 0, bool createProto = false);
void init(QV4::ExecutionContext *scope, QV4::Function *function, bool createProto = false);
- void init(QV4::ExecutionContext *scope, const QString &name = QString(), bool createProto = false);
- void init(ExecutionContext *scope, const QString &name = QString(), bool createProto = false);
- void init(QV4::ExecutionContext *scope, const ReturnedValue name);
- void init(ExecutionContext *scope, const ReturnedValue name);
+ void init(QV4::ExecutionContext *scope, const QString &name, bool createProto = false);
void init();
void destroy();
@@ -82,6 +79,8 @@ struct Q_QML_PRIVATE_EXPORT FunctionObject : Object {
unsigned int varCount() { return function ? function->compiledFunction->nLocals : 0; }
bool needsActivation() const { return function ? function->needsActivation() : false; }
+ const QV4::Object *protoProperty() const { return propertyData(Index_Prototype)->cast<QV4::Object>(); }
+
Pointer<ExecutionContext> scope;
Function *function;
};
@@ -105,15 +104,11 @@ struct IndexedBuiltinFunction : FunctionObject {
uint index;
};
-struct SimpleScriptFunction : FunctionObject {
+struct ScriptFunction : FunctionObject {
enum {
Index_Name = FunctionObject::Index_Prototype + 1,
Index_Length
};
- void init(QV4::ExecutionContext *scope, Function *function, bool createProto);
-};
-
-struct ScriptFunction : SimpleScriptFunction {
void init(QV4::ExecutionContext *scope, Function *function);
};
@@ -150,11 +145,7 @@ struct Q_QML_EXPORT FunctionObject: Object {
static void construct(const Managed *that, Scope &scope, CallData *);
static void call(const Managed *that, Scope &scope, CallData *d);
- static Heap::FunctionObject *createScriptFunction(ExecutionContext *scope, Function *function, bool createProto = true);
- static Heap::FunctionObject *createQmlFunction(QQmlContextData *qmlContext, QObject *scopeObject, QV4::Function *runtimeFunction,
- const QList<QByteArray> &signalParameters = QList<QByteArray>(), QString *error = 0);
-
- ReturnedValue protoProperty() { return propertyData(Heap::FunctionObject::Index_Prototype)->asReturnedValue(); }
+ static Heap::FunctionObject *createScriptFunction(ExecutionContext *scope, Function *function);
bool needsActivation() const { return d()->needsActivation(); }
bool strictMode() const { return d()->function ? d()->function->isStrict() : false; }
@@ -168,7 +159,7 @@ struct Q_QML_EXPORT FunctionObject: Object {
template<>
inline const FunctionObject *Value::as() const {
- return isManaged() && m() && m()->vtable()->isFunctionObject ? reinterpret_cast<const FunctionObject *>(this) : 0;
+ return isManaged() && m()->vtable()->isFunctionObject ? reinterpret_cast<const FunctionObject *>(this) : 0;
}
@@ -225,21 +216,14 @@ void Heap::IndexedBuiltinFunction::init(QV4::ExecutionContext *scope, uint index
}
-struct SimpleScriptFunction: FunctionObject {
- V4_OBJECT2(SimpleScriptFunction, FunctionObject)
- V4_INTERNALCLASS(simpleScriptFunctionClass)
-
- static void construct(const Managed *, Scope &scope, CallData *callData);
- static void call(const Managed *that, Scope &scope, CallData *callData);
-
- Heap::Object *protoForConstructor();
-};
-
-struct ScriptFunction: SimpleScriptFunction {
+struct ScriptFunction : FunctionObject {
V4_OBJECT2(ScriptFunction, FunctionObject)
+ V4_INTERNALCLASS(scriptFunctionClass)
static void construct(const Managed *, Scope &scope, CallData *callData);
static void call(const Managed *that, Scope &scope, CallData *callData);
+
+ Heap::Object *protoForConstructor() const;
};
diff --git a/src/qml/jsruntime/qv4global_p.h b/src/qml/jsruntime/qv4global_p.h
index 184375a9b6..c37ad1668d 100644
--- a/src/qml/jsruntime/qv4global_p.h
+++ b/src/qml/jsruntime/qv4global_p.h
@@ -58,6 +58,12 @@
#include <QtCore/qglobal.h>
#include <QString>
+#ifdef QT_NO_DEBUG
+#define QML_NEARLY_ALWAYS_INLINE Q_ALWAYS_INLINE
+#else
+#define QML_NEARLY_ALWAYS_INLINE inline
+#endif
+
#ifdef V4_BOOTSTRAP
#include <private/qtqmldevtoolsglobal_p.h>
#else
diff --git a/src/qml/jsruntime/qv4globalobject.cpp b/src/qml/jsruntime/qv4globalobject.cpp
index feb0d90d26..af92ce1ad8 100644
--- a/src/qml/jsruntime/qv4globalobject.cpp
+++ b/src/qml/jsruntime/qv4globalobject.cpp
@@ -357,12 +357,13 @@ void EvalFunction::evalCall(Scope &scope, CallData *callData, bool directCall) c
ctx = v4->pushGlobalContext();
}
- if (!callData->args[0].isString()) {
+ String *scode = callData->args[0].stringValue();
+ if (!scode) {
scope.result = callData->args[0].asReturnedValue();
return;
}
- const QString code = callData->args[0].stringValue()->toQString();
+ const QString code = scode->toQString();
bool inheritContext = !ctx->d()->strictMode;
Script script(ctx, code, QStringLiteral("eval code"));
diff --git a/src/qml/jsruntime/qv4include.cpp b/src/qml/jsruntime/qv4include.cpp
index be8057e9f5..1d393cf0aa 100644
--- a/src/qml/jsruntime/qv4include.cpp
+++ b/src/qml/jsruntime/qv4include.cpp
@@ -53,7 +53,6 @@
#include <private/qv4functionobject_p.h>
#include <private/qv4script_p.h>
#include <private/qv4context_p.h>
-#include <private/qqmlcontextwrapper_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp
index 94a6e4daa1..d79e6242ba 100644
--- a/src/qml/jsruntime/qv4jsonobject.cpp
+++ b/src/qml/jsruntime/qv4jsonobject.cpp
@@ -727,8 +727,8 @@ QString Stringify::Str(const QString &key, const Value &v)
return QStringLiteral("null");
if (scope.result.isBoolean())
return scope.result.booleanValue() ? QStringLiteral("true") : QStringLiteral("false");
- if (scope.result.isString())
- return quote(scope.result.stringValue()->toQString());
+ if (String *s = scope.result.stringValue())
+ return quote(s->toQString());
if (scope.result.isNumber()) {
double d = scope.result.toNumber();
@@ -917,7 +917,7 @@ ReturnedValue JsonObject::method_stringify(CallContext *ctx)
Value *v = stringify.propertyList + i;
*v = o->getIndexed(i);
if (v->as<NumberObject>() || v->as<StringObject>() || v->isNumber())
- *v = RuntimeHelpers::toString(scope.engine, *v);
+ *v = v->toString(scope.engine);
if (!v->isString()) {
v->setM(0);
} else {
@@ -940,8 +940,8 @@ ReturnedValue JsonObject::method_stringify(CallContext *ctx)
if (s->isNumber()) {
stringify.gap = QString(qMin(10, (int)s->toInteger()), ' ');
- } else if (s->isString()) {
- stringify.gap = s->stringValue()->toQString().left(10);
+ } else if (String *str = s->stringValue()) {
+ stringify.gap = str->toQString().left(10);
}
@@ -982,8 +982,8 @@ QJsonValue JsonObject::toJsonValue(const Value &value, V4ObjectSet &visitedObjec
return QJsonValue(QJsonValue::Null);
else if (value.isUndefined())
return QJsonValue(QJsonValue::Undefined);
- else if (value.isString())
- return QJsonValue(value.toQString());
+ else if (String *s = value.stringValue())
+ return QJsonValue(s->toQString());
Q_ASSERT(value.isObject());
Scope scope(value.as<Object>()->engine());
diff --git a/src/qml/jsruntime/qv4lookup.cpp b/src/qml/jsruntime/qv4lookup.cpp
index 84755a6402..52ed449664 100644
--- a/src/qml/jsruntime/qv4lookup.cpp
+++ b/src/qml/jsruntime/qv4lookup.cpp
@@ -118,7 +118,8 @@ ReturnedValue Lookup::lookup(const Object *thisObject, PropertyAttributes *attrs
ReturnedValue Lookup::indexedGetterGeneric(Lookup *l, const Value &object, const Value &index)
{
- if (object.isObject() && index.asArrayIndex() < UINT_MAX) {
+ uint idx;
+ if (object.isObject() && index.asArrayIndex(idx)) {
l->indexedGetter = indexedGetterObjectInt;
return indexedGetterObjectInt(l, object, index);
}
@@ -129,11 +130,12 @@ ReturnedValue Lookup::indexedGetterFallback(Lookup *l, const Value &object, cons
{
Q_UNUSED(l);
Scope scope(l->engine);
- uint idx = index.asArrayIndex();
+ uint idx = 0;
+ bool isInt = index.asArrayIndex(idx);
ScopedObject o(scope, object);
if (!o) {
- if (idx < UINT_MAX) {
+ if (isInt) {
if (const String *str = object.as<String>()) {
if (idx >= (uint)str->toQString().length()) {
return Encode::undefined();
@@ -153,7 +155,7 @@ ReturnedValue Lookup::indexedGetterFallback(Lookup *l, const Value &object, cons
return Encode::undefined();
}
- if (idx < UINT_MAX) {
+ if (isInt) {
if (o->d()->arrayData && !o->d()->arrayData->attrs) {
ScopedValue v(scope, Scoped<ArrayData>(scope, o->arrayData())->get(idx));
if (!v->isEmpty())
@@ -173,16 +175,19 @@ ReturnedValue Lookup::indexedGetterFallback(Lookup *l, const Value &object, cons
ReturnedValue Lookup::indexedGetterObjectInt(Lookup *l, const Value &object, const Value &index)
{
- uint idx = index.asArrayIndex();
- if (idx == UINT_MAX || !object.isObject())
- return indexedGetterFallback(l, object, index);
-
- Object *o = object.objectValue();
- if (o->d()->arrayData && o->d()->arrayData->type == Heap::ArrayData::Simple) {
- Heap::SimpleArrayData *s = o->d()->arrayData.cast<Heap::SimpleArrayData>();
- if (idx < s->len)
- if (!s->data(idx).isEmpty())
- return s->data(idx).asReturnedValue();
+ uint idx;
+ if (index.asArrayIndex(idx)) {
+ if (Heap::Base *b = object.heapObject()) {
+ if (b->vtable()->isObject) {
+ Heap::Object *o = static_cast<Heap::Object *>(b);
+ if (o->arrayData && o->arrayData->type == Heap::ArrayData::Simple) {
+ Heap::SimpleArrayData *s = o->arrayData.cast<Heap::SimpleArrayData>();
+ if (idx < s->len)
+ if (!s->data(idx).isEmpty())
+ return s->data(idx).asReturnedValue();
+ }
+ }
+ }
}
return indexedGetterFallback(l, object, index);
@@ -190,9 +195,9 @@ ReturnedValue Lookup::indexedGetterObjectInt(Lookup *l, const Value &object, con
void Lookup::indexedSetterGeneric(Lookup *l, const Value &object, const Value &index, const Value &v)
{
- if (object.isObject()) {
- Object *o = object.objectValue();
- if (o->d()->arrayData && o->d()->arrayData->type == Heap::ArrayData::Simple && index.asArrayIndex() < UINT_MAX) {
+ if (Object *o = object.objectValue()) {
+ uint idx;
+ if (o->d()->arrayData && o->d()->arrayData->type == Heap::ArrayData::Simple && index.asArrayIndex(idx)) {
l->indexedSetter = indexedSetterObjectInt;
indexedSetterObjectInt(l, object, index, v);
return;
@@ -208,8 +213,8 @@ void Lookup::indexedSetterFallback(Lookup *l, const Value &object, const Value &
if (scope.engine->hasException)
return;
- uint idx = index.asArrayIndex();
- if (idx < UINT_MAX) {
+ uint idx;
+ if (index.asArrayIndex(idx)) {
if (o->d()->arrayData && o->d()->arrayData->type == Heap::ArrayData::Simple) {
Heap::SimpleArrayData *s = o->d()->arrayData.cast<Heap::SimpleArrayData>();
if (idx < s->len) {
@@ -227,18 +232,19 @@ void Lookup::indexedSetterFallback(Lookup *l, const Value &object, const Value &
void Lookup::indexedSetterObjectInt(Lookup *l, const Value &object, const Value &index, const Value &v)
{
- uint idx = index.asArrayIndex();
- if (idx == UINT_MAX || !object.isObject()) {
- indexedSetterGeneric(l, object, index, v);
- return;
- }
-
- Object *o = object.objectValue();
- if (o->d()->arrayData && o->d()->arrayData->type == Heap::ArrayData::Simple) {
- Heap::SimpleArrayData *s = o->d()->arrayData.cast<Heap::SimpleArrayData>();
- if (idx < s->len) {
- s->data(idx) = v;
- return;
+ uint idx;
+ if (index.asArrayIndex(idx)) {
+ if (Heap::Base *b = object.heapObject()) {
+ if (b->vtable()->isObject) {
+ Heap::Object *o = static_cast<Heap::Object *>(b);
+ if (o->arrayData && o->arrayData->type == Heap::ArrayData::Simple) {
+ Heap::SimpleArrayData *s = o->arrayData.cast<Heap::SimpleArrayData>();
+ if (idx < s->len) {
+ s->data(idx) = v;
+ return;
+ }
+ }
+ }
}
}
indexedSetterFallback(l, object, index, v);
@@ -345,11 +351,11 @@ ReturnedValue Lookup::getterFallback(Lookup *l, ExecutionEngine *engine, const V
ReturnedValue Lookup::getter0(Lookup *l, ExecutionEngine *engine, const Value &object)
{
- if (object.isManaged()) {
- // we can safely cast to a QV4::Object here. If object is actually a string,
- // the internal class won't match
- Object *o = object.objectValue();
- if (l->classList[0] == o->internalClass())
+ // we can safely cast to a QV4::Object here. If object is actually a string,
+ // the internal class won't match
+ Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
+ if (o) {
+ if (l->classList[0] == o->internalClass)
return o->propertyData(l->index)->asReturnedValue();
}
return getterTwoClasses(l, engine, object);
@@ -357,25 +363,24 @@ ReturnedValue Lookup::getter0(Lookup *l, ExecutionEngine *engine, const Value &o
ReturnedValue Lookup::getter1(Lookup *l, ExecutionEngine *engine, const Value &object)
{
- if (object.isManaged()) {
- // we can safely cast to a QV4::Object here. If object is actually a string,
- // the internal class won't match
- Object *o = object.objectValue();
- if (l->classList[0] == o->internalClass() &&
- l->classList[1] == o->prototype()->internalClass)
- return o->prototype()->propertyData(l->index)->asReturnedValue();
+ // we can safely cast to a QV4::Object here. If object is actually a string,
+ // the internal class won't match
+ Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
+ if (o) {
+ if (l->classList[0] == o->internalClass && l->classList[1] == o->prototype->internalClass)
+ return o->prototype->propertyData(l->index)->asReturnedValue();
}
return getterTwoClasses(l, engine, object);
}
ReturnedValue Lookup::getter2(Lookup *l, ExecutionEngine *engine, const Value &object)
{
- if (object.isManaged()) {
- // we can safely cast to a QV4::Object here. If object is actually a string,
- // the internal class won't match
- Object *o = object.objectValue();
- if (l->classList[0] == o->internalClass()) {
- Heap::Object *p = o->prototype();
+ // we can safely cast to a QV4::Object here. If object is actually a string,
+ // the internal class won't match
+ Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
+ if (o) {
+ if (l->classList[0] == o->internalClass) {
+ Heap::Object *p = o->prototype;
if (l->classList[1] == p->internalClass) {
p = p->prototype;
if (l->classList[2] == p->internalClass)
@@ -389,13 +394,13 @@ ReturnedValue Lookup::getter2(Lookup *l, ExecutionEngine *engine, const Value &o
ReturnedValue Lookup::getter0getter0(Lookup *l, ExecutionEngine *engine, const Value &object)
{
- if (object.isManaged()) {
- // we can safely cast to a QV4::Object here. If object is actually a string,
- // the internal class won't match
- Object *o = object.objectValue();
- if (l->classList[0] == o->internalClass())
+ // we can safely cast to a QV4::Object here. If object is actually a string,
+ // the internal class won't match
+ Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
+ if (o) {
+ if (l->classList[0] == o->internalClass)
return o->propertyData(l->index)->asReturnedValue();
- if (l->classList[2] == o->internalClass())
+ if (l->classList[2] == o->internalClass)
return o->propertyData(l->index2)->asReturnedValue();
}
l->getter = getterFallback;
@@ -404,15 +409,14 @@ ReturnedValue Lookup::getter0getter0(Lookup *l, ExecutionEngine *engine, const V
ReturnedValue Lookup::getter0getter1(Lookup *l, ExecutionEngine *engine, const Value &object)
{
- if (object.isManaged()) {
- // we can safely cast to a QV4::Object here. If object is actually a string,
- // the internal class won't match
- Object *o = object.objectValue();
- if (l->classList[0] == o->internalClass())
+ // we can safely cast to a QV4::Object here. If object is actually a string,
+ // the internal class won't match
+ Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
+ if (o) {
+ if (l->classList[0] == o->internalClass)
return o->propertyData(l->index)->asReturnedValue();
- if (l->classList[2] == o->internalClass() &&
- l->classList[3] == o->prototype()->internalClass)
- return o->prototype()->propertyData(l->index2)->asReturnedValue();
+ if (l->classList[2] == o->internalClass && l->classList[3] == o->prototype->internalClass)
+ return o->prototype->propertyData(l->index2)->asReturnedValue();
}
l->getter = getterFallback;
return getterFallback(l, engine, object);
@@ -420,16 +424,16 @@ ReturnedValue Lookup::getter0getter1(Lookup *l, ExecutionEngine *engine, const V
ReturnedValue Lookup::getter1getter1(Lookup *l, ExecutionEngine *engine, const Value &object)
{
- if (object.isManaged()) {
- // we can safely cast to a QV4::Object here. If object is actually a string,
- // the internal class won't match
- Object *o = object.objectValue();
- if (l->classList[0] == o->internalClass() &&
- l->classList[1] == o->prototype()->internalClass)
- return o->prototype()->propertyData(l->index)->asReturnedValue();
- if (l->classList[2] == o->internalClass() &&
- l->classList[3] == o->prototype()->internalClass)
- return o->prototype()->propertyData(l->index2)->asReturnedValue();
+ // we can safely cast to a QV4::Object here. If object is actually a string,
+ // the internal class won't match
+ Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
+ if (o) {
+ if (l->classList[0] == o->internalClass &&
+ l->classList[1] == o->prototype->internalClass)
+ return o->prototype->propertyData(l->index)->asReturnedValue();
+ if (l->classList[2] == o->internalClass &&
+ l->classList[3] == o->prototype->internalClass)
+ return o->prototype->propertyData(l->index2)->asReturnedValue();
return getterFallback(l, engine, object);
}
l->getter = getterFallback;
@@ -439,12 +443,12 @@ ReturnedValue Lookup::getter1getter1(Lookup *l, ExecutionEngine *engine, const V
ReturnedValue Lookup::getterAccessor0(Lookup *l, ExecutionEngine *engine, const Value &object)
{
- if (object.isManaged()) {
- // we can safely cast to a QV4::Object here. If object is actually a string,
- // the internal class won't match
- Object *o = object.objectValue();
- if (l->classList[0] == o->internalClass()) {
- Scope scope(o->engine());
+ // we can safely cast to a QV4::Object here. If object is actually a string,
+ // the internal class won't match
+ Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
+ if (o) {
+ if (l->classList[0] == o->internalClass) {
+ Scope scope(o->internalClass->engine);
ScopedFunctionObject getter(scope, o->propertyData(l->index + Object::GetterOffset));
if (!getter)
return Encode::undefined();
@@ -461,10 +465,10 @@ ReturnedValue Lookup::getterAccessor0(Lookup *l, ExecutionEngine *engine, const
ReturnedValue Lookup::getterAccessor1(Lookup *l, ExecutionEngine *engine, const Value &object)
{
- if (object.isManaged()) {
- // we can safely cast to a QV4::Object here. If object is actually a string,
- // the internal class won't match
- Heap::Object *o = object.objectValue()->d();
+ // we can safely cast to a QV4::Object here. If object is actually a string,
+ // the internal class won't match
+ Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
+ if (o) {
if (l->classList[0] == o->internalClass &&
l->classList[1] == o->prototype->internalClass) {
Scope scope(o->internalClass->engine);
@@ -484,10 +488,10 @@ ReturnedValue Lookup::getterAccessor1(Lookup *l, ExecutionEngine *engine, const
ReturnedValue Lookup::getterAccessor2(Lookup *l, ExecutionEngine *engine, const Value &object)
{
- if (object.isManaged()) {
- // we can safely cast to a QV4::Object here. If object is actually a string,
- // the internal class won't match
- Heap::Object *o = object.objectValue()->d();
+ // we can safely cast to a QV4::Object here. If object is actually a string,
+ // the internal class won't match
+ Heap::Object *o = static_cast<Heap::Object *>(object.heapObject());
+ if (o) {
if (l->classList[0] == o->internalClass) {
o = o->prototype;
if (l->classList[1] == o->internalClass) {
diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h
index 28b255bd9a..5c764e7ff0 100644
--- a/src/qml/jsruntime/qv4managed_p.h
+++ b/src/qml/jsruntime/qv4managed_p.h
@@ -206,6 +206,18 @@ public:
bool markBit() const { return d()->isMarked(); }
static void destroy(Heap::Base *) {}
+
+ Q_ALWAYS_INLINE Heap::Base *heapObject() const {
+ return m();
+ }
+
+ template<typename T> inline T *cast() {
+ return static_cast<T *>(this);
+ }
+ template<typename T> inline const T *cast() const {
+ return static_cast<const T *>(this);
+ }
+
private:
friend class MemoryManager;
friend struct Identifiers;
@@ -215,14 +227,12 @@ private:
template<>
inline const Managed *Value::as() const {
- if (isManaged())
- return managed();
- return 0;
+ return managed();
}
template<>
inline const Object *Value::as() const {
- return isManaged() && m() && m()->vtable()->isObject ? objectValue() : 0;
+ return objectValue();
}
}
diff --git a/src/qml/jsruntime/qv4memberdata.cpp b/src/qml/jsruntime/qv4memberdata.cpp
index 5646a44891..d5f75415cc 100644
--- a/src/qml/jsruntime/qv4memberdata.cpp
+++ b/src/qml/jsruntime/qv4memberdata.cpp
@@ -52,30 +52,16 @@ void MemberData::markObjects(Heap::Base *that, ExecutionEngine *e)
m->data[i].mark(e);
}
-static Heap::MemberData *reallocateHelper(ExecutionEngine *e, Heap::MemberData *old, uint n)
+Heap::MemberData *MemberData::allocate(ExecutionEngine *e, uint n, Heap::MemberData *old)
{
+ Q_ASSERT(!old || old->size < n);
+
uint alloc = sizeof(Heap::MemberData) + (n)*sizeof(Value);
- Scope scope(e);
- Scoped<MemberData> newMemberData(scope, e->memoryManager->allocManaged<MemberData>(alloc));
+ Heap::MemberData *m = e->memoryManager->allocManaged<MemberData>(alloc);
if (old)
- memcpy(newMemberData->d_unchecked(), old, sizeof(Heap::MemberData) + old->size * sizeof(Value));
+ memcpy(m, old, sizeof(Heap::MemberData) + old->size * sizeof(Value));
else
- newMemberData->d_unchecked()->init();
- newMemberData->d()->size = n;
- return newMemberData->d();
-}
-
-Heap::MemberData *MemberData::allocate(ExecutionEngine *e, uint n)
-{
- return reallocateHelper(e, 0, n);
-}
-
-Heap::MemberData *MemberData::reallocate(ExecutionEngine *e, Heap::MemberData *old, uint n)
-{
- uint s = old ? old->size : 0;
- if (n < s)
- return old;
-
- // n is multiplied by two to leave room for growth
- return reallocateHelper(e, old, qMax((uint)4, 2*n));
+ m->init();
+ m->size = n;
+ return m;
}
diff --git a/src/qml/jsruntime/qv4memberdata_p.h b/src/qml/jsruntime/qv4memberdata_p.h
index 969eee3619..5c89dfe8ec 100644
--- a/src/qml/jsruntime/qv4memberdata_p.h
+++ b/src/qml/jsruntime/qv4memberdata_p.h
@@ -79,8 +79,7 @@ struct MemberData : Managed
Value *data() { return d()->data; }
inline uint size() const { return d()->size; }
- static Heap::MemberData *allocate(QV4::ExecutionEngine *e, uint n);
- static Heap::MemberData *reallocate(QV4::ExecutionEngine *e, Heap::MemberData *old, uint n);
+ static Heap::MemberData *allocate(QV4::ExecutionEngine *e, uint n, Heap::MemberData *old = 0);
static void markObjects(Heap::Base *that, ExecutionEngine *e);
};
diff --git a/src/qml/jsruntime/qv4numberobject.cpp b/src/qml/jsruntime/qv4numberobject.cpp
index 9b1f72bc17..3a6b9da763 100644
--- a/src/qml/jsruntime/qv4numberobject.cpp
+++ b/src/qml/jsruntime/qv4numberobject.cpp
@@ -285,7 +285,7 @@ ReturnedValue NumberPrototype::method_toPrecision(CallContext *ctx)
return Encode::undefined();
if (!ctx->argc() || ctx->args()[0].isUndefined())
- return RuntimeHelpers::toString(scope.engine, v);
+ return Encode(v->toString(scope.engine));
int precision = ctx->args()[0].toInt32();
if (precision < 1 || precision > 21) {
diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp
index 00e6d230da..8acca16dd0 100644
--- a/src/qml/jsruntime/qv4object.cpp
+++ b/src/qml/jsruntime/qv4object.cpp
@@ -61,7 +61,9 @@ DEFINE_OBJECT_VTABLE(Object);
void Object::setInternalClass(InternalClass *ic)
{
d()->internalClass = ic;
- ensureMemberData();
+ if ((ic->size > d()->inlineMemberSize && !d()->memberData) ||
+ (d()->memberData && d()->memberData->size < ic->size - d()->inlineMemberSize))
+ d()->memberData = MemberData::allocate(ic->engine, ic->size - d()->inlineMemberSize, d()->memberData);
}
void Object::getProperty(uint index, Property *p, PropertyAttributes *attrs) const
@@ -225,13 +227,6 @@ void Object::markObjects(Heap::Base *that, ExecutionEngine *e)
o->prototype->mark(e);
}
-void Object::ensureMemberData()
-{
- QV4::InternalClass *ic = internalClass();
- if (ic->size > d()->inlineMemberSize)
- d()->memberData = MemberData::reallocate(ic->engine, d()->memberData, ic->size - d()->inlineMemberSize);
-}
-
void Object::insertMember(String *s, const Property *p, PropertyAttributes attributes)
{
uint idx;
diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h
index 00a004ef5f..6c679deb10 100644
--- a/src/qml/jsruntime/qv4object_p.h
+++ b/src/qml/jsruntime/qv4object_p.h
@@ -367,8 +367,6 @@ protected:
static void advanceIterator(Managed *m, ObjectIterator *it, Value *name, uint *index, Property *p, PropertyAttributes *attributes);
static uint getLength(const Managed *m);
- void ensureMemberData();
-
private:
ReturnedValue internalGet(String *name, bool *hasProperty) const;
ReturnedValue internalGetIndexed(uint index, bool *hasProperty) const;
@@ -500,7 +498,7 @@ inline void Object::arraySet(uint index, const Value &value)
template<>
inline const ArrayObject *Value::as() const {
- return isManaged() && m() && m()->vtable()->type == Managed::Type_ArrayObject ? static_cast<const ArrayObject *>(this) : 0;
+ return isManaged() && m()->vtable()->type == Managed::Type_ArrayObject ? static_cast<const ArrayObject *>(this) : 0;
}
#ifndef V4_BOOTSTRAP
diff --git a/src/qml/jsruntime/qv4objectiterator.cpp b/src/qml/jsruntime/qv4objectiterator.cpp
index 7943a13ac0..59115dfe21 100644
--- a/src/qml/jsruntime/qv4objectiterator.cpp
+++ b/src/qml/jsruntime/qv4objectiterator.cpp
@@ -70,15 +70,16 @@ void ObjectIterator::next(Value *name, uint *index, Property *pd, PropertyAttrib
ScopedString n(scope);
while (1) {
- if (!current->as<Object>())
+ Object *co = current->objectValue();
+ if (!co)
break;
while (1) {
- current->as<Object>()->advanceIterator(this, name, index, pd, attrs);
+ co->advanceIterator(this, name, index, pd, attrs);
if (attrs->isEmpty())
break;
// check the property is not already defined earlier in the proto chain
- if (current->heapObject() != object->heapObject()) {
+ if (co->heapObject() != object->heapObject()) {
o = object->as<Object>();
n = *name;
bool shadowed = false;
@@ -97,7 +98,7 @@ void ObjectIterator::next(Value *name, uint *index, Property *pd, PropertyAttrib
}
if (flags & WithProtoChain)
- current->setM(current->objectValue()->prototype());
+ current->setM(co->prototype());
else
current->setM(0);
@@ -109,7 +110,8 @@ void ObjectIterator::next(Value *name, uint *index, Property *pd, PropertyAttrib
ReturnedValue ObjectIterator::nextPropertyName(Value *value)
{
- if (!object->as<Object>())
+ Object *o = object->objectValue();
+ if (!o)
return Encode::null();
PropertyAttributes attrs;
@@ -121,7 +123,7 @@ ReturnedValue ObjectIterator::nextPropertyName(Value *value)
if (attrs.isEmpty())
return Encode::null();
- *value = object->objectValue()->getValue(p->value, attrs);
+ *value = o->getValue(p->value, attrs);
if (!!name)
return name->asReturnedValue();
@@ -131,7 +133,8 @@ ReturnedValue ObjectIterator::nextPropertyName(Value *value)
ReturnedValue ObjectIterator::nextPropertyNameAsString(Value *value)
{
- if (!object->as<Object>())
+ Object *o = object->objectValue();
+ if (!o)
return Encode::null();
PropertyAttributes attrs;
@@ -143,7 +146,7 @@ ReturnedValue ObjectIterator::nextPropertyNameAsString(Value *value)
if (attrs.isEmpty())
return Encode::null();
- *value = object->objectValue()->getValue(p->value, attrs);
+ *value = o->getValue(p->value, attrs);
if (!!name)
return name->asReturnedValue();
diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp
index 6020c48250..8191083544 100644
--- a/src/qml/jsruntime/qv4objectproto.cpp
+++ b/src/qml/jsruntime/qv4objectproto.cpp
@@ -62,26 +62,24 @@ void Heap::ObjectCtor::init(QV4::ExecutionContext *scope)
void ObjectCtor::construct(const Managed *that, Scope &scope, CallData *callData)
{
const ObjectCtor *ctor = static_cast<const ObjectCtor *>(that);
- ExecutionEngine *v4 = ctor->engine();
if (!callData->argc || callData->args[0].isUndefined() || callData->args[0].isNull()) {
- ScopedObject obj(scope, v4->newObject());
- ScopedObject proto(scope, ctor->get(v4->id_prototype()));
+ ScopedObject obj(scope, scope.engine->newObject());
+ ScopedObject proto(scope, ctor->get(scope.engine->id_prototype()));
if (!!proto)
obj->setPrototype(proto);
scope.result = obj.asReturnedValue();
} else {
- scope.result = RuntimeHelpers::toObject(scope.engine, callData->args[0]);
+ scope.result = callData->args[0].toObject(scope.engine);
}
}
-void ObjectCtor::call(const Managed *m, Scope &scope, CallData *callData)
+void ObjectCtor::call(const Managed *, Scope &scope, CallData *callData)
{
- const ObjectCtor *ctor = static_cast<const ObjectCtor *>(m);
- ExecutionEngine *v4 = ctor->engine();
+ ExecutionEngine *v4 = scope.engine;
if (!callData->argc || callData->args[0].isUndefined() || callData->args[0].isNull()) {
scope.result = v4->newObject()->asReturnedValue();
} else {
- scope.result = RuntimeHelpers::toObject(v4, callData->args[0]);
+ scope.result = callData->args[0].toObject(v4);
}
}
@@ -398,7 +396,7 @@ ReturnedValue ObjectPrototype::method_toString(CallContext *ctx)
} else if (ctx->thisObject().isNull()) {
return ctx->d()->engine->newString(QStringLiteral("[object Null]"))->asReturnedValue();
} else {
- ScopedObject obj(scope, RuntimeHelpers::toObject(scope.engine, ctx->thisObject()));
+ ScopedObject obj(scope, ctx->thisObject().toObject(scope.engine));
QString className = obj->className();
return ctx->d()->engine->newString(QStringLiteral("[object %1]").arg(className))->asReturnedValue();
}
diff --git a/src/qml/jsruntime/qv4profiling_p.h b/src/qml/jsruntime/qv4profiling_p.h
index e06cb64a61..d27e853343 100644
--- a/src/qml/jsruntime/qv4profiling_p.h
+++ b/src/qml/jsruntime/qv4profiling_p.h
@@ -86,7 +86,7 @@ QT_END_NAMESPACE
engine->profiler()->trackDealloc(size, type) : false)
#define Q_V4_PROFILE(engine, function)\
- (engine->profiler() &&\
+ (Q_UNLIKELY(engine->profiler()) &&\
(engine->profiler()->featuresEnabled & (1 << Profiling::FeatureFunctionCall)) ?\
Profiling::FunctionCallProfiler::profileCall(engine->profiler(), engine, function) :\
function->code(engine, function->codeData))
diff --git a/src/qml/jsruntime/qv4property_p.h b/src/qml/jsruntime/qv4property_p.h
index 50e8f0ae7f..5069d7690b 100644
--- a/src/qml/jsruntime/qv4property_p.h
+++ b/src/qml/jsruntime/qv4property_p.h
@@ -87,8 +87,8 @@ struct Property {
inline bool isSubset(const PropertyAttributes &attrs, const Property *other, PropertyAttributes otherAttrs) const;
inline void merge(PropertyAttributes &attrs, const Property *other, PropertyAttributes otherAttrs);
- inline Heap::FunctionObject *getter() const { return value.isManaged() ? reinterpret_cast<Heap::FunctionObject *>(value.heapObject()) : 0; }
- inline Heap::FunctionObject *setter() const { return set.isManaged() ? reinterpret_cast<Heap::FunctionObject *>(set.heapObject()) : 0; }
+ inline Heap::FunctionObject *getter() const { return reinterpret_cast<Heap::FunctionObject *>(value.heapObject()); }
+ inline Heap::FunctionObject *setter() const { return reinterpret_cast<Heap::FunctionObject *>(set.heapObject()); }
inline void setGetter(FunctionObject *g) { value = reinterpret_cast<Managed *>(g); }
inline void setSetter(FunctionObject *s) { set = (s ? reinterpret_cast<Managed *>(s) : 0); }
diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/jsruntime/qv4qmlcontext.cpp
index 2418003519..889f4ea288 100644
--- a/src/qml/qml/qqmlcontextwrapper.cpp
+++ b/src/qml/jsruntime/qv4qmlcontext.cpp
@@ -37,7 +37,7 @@
**
****************************************************************************/
-#include "qqmlcontextwrapper_p.h"
+#include "qv4qmlcontext_p.h"
#include <private/qv8engine_p.h>
#include <private/qqmlengine_p.h>
@@ -60,6 +60,7 @@ QT_BEGIN_NAMESPACE
using namespace QV4;
DEFINE_OBJECT_VTABLE(QmlContextWrapper);
+DEFINE_MANAGED_VTABLE(QmlContext);
void Heap::QmlContextWrapper::init(QQmlContextData *context, QObject *scopeObject, bool ownsContext)
{
@@ -80,29 +81,6 @@ void Heap::QmlContextWrapper::destroy()
Object::destroy();
}
-ReturnedValue QmlContextWrapper::qmlScope(ExecutionEngine *v4, QQmlContextData *ctxt, QObject *scope)
-{
- Scope valueScope(v4);
-
- Scoped<QmlContextWrapper> w(valueScope, v4->memoryManager->allocObject<QmlContextWrapper>(ctxt, scope));
- return w.asReturnedValue();
-}
-
-ReturnedValue QmlContextWrapper::urlScope(ExecutionEngine *v4, const QUrl &url)
-{
- Scope scope(v4);
-
- QQmlContextData *context = new QQmlContextData;
- context->baseUrl = url;
- context->baseUrlString = url.toString();
- context->isInternal = true;
- context->isJSContext = true;
-
- Scoped<QmlContextWrapper> w(scope, v4->memoryManager->allocObject<QmlContextWrapper>(context, (QObject*)0, true));
- w->d()->isNullWrapper = true;
- return w.asReturnedValue();
-}
-
ReturnedValue QmlContextWrapper::get(const Managed *m, String *name, bool *hasProperty)
{
Q_ASSERT(m->as<QmlContextWrapper>());
@@ -320,4 +298,49 @@ void QmlContextWrapper::put(Managed *m, String *name, const Value &value)
Object::put(m, name, value);
}
+void Heap::QmlContext::init(QV4::ExecutionContext *outerContext, QV4::QmlContextWrapper *qml)
+{
+ Heap::ExecutionContext::init(outerContext->engine(), Heap::ExecutionContext::Type_QmlContext);
+ outer = outerContext->d();
+ strictMode = false;
+ callData = outer->callData;
+ lookups = outer->lookups;
+ constantTable = outer->constantTable;
+ compilationUnit = outer->compilationUnit;
+
+ this->qml = qml->d();
+}
+
+Heap::QmlContext *QmlContext::createWorkerContext(ExecutionContext *parent, const QUrl &source, Value *sendFunction)
+{
+ Scope scope(parent);
+
+ QQmlContextData *context = new QQmlContextData;
+ context->baseUrl = source;
+ context->baseUrlString = source.toString();
+ context->isInternal = true;
+ context->isJSContext = true;
+
+ Scoped<QmlContextWrapper> qml(scope, scope.engine->memoryManager->allocObject<QmlContextWrapper>(context, (QObject*)0, true));
+ qml->d()->isNullWrapper = true;
+
+ qml->setReadOnly(false);
+ QV4::ScopedObject api(scope, scope.engine->newObject());
+ api->put(QV4::ScopedString(scope, scope.engine->newString(QStringLiteral("sendMessage"))), *sendFunction);
+ qml->QV4::Object::put(QV4::ScopedString(scope, scope.engine->newString(QStringLiteral("WorkerScript"))), api);
+ qml->setReadOnly(true);
+
+ Heap::QmlContext *c = parent->d()->engine->memoryManager->alloc<QmlContext>(parent, qml);
+ return c;
+}
+
+Heap::QmlContext *QmlContext::create(ExecutionContext *parent, QQmlContextData *context, QObject *scopeObject)
+{
+ Scope scope(parent);
+
+ Scoped<QmlContextWrapper> qml(scope, scope.engine->memoryManager->allocObject<QmlContextWrapper>(context, scopeObject));
+ Heap::QmlContext *c = parent->d()->engine->memoryManager->alloc<QmlContext>(parent, qml);
+ return c;
+}
+
QT_END_NAMESPACE
diff --git a/src/qml/qml/qqmlcontextwrapper_p.h b/src/qml/jsruntime/qv4qmlcontext_p.h
index 126ffecf0d..9aec7467da 100644
--- a/src/qml/qml/qqmlcontextwrapper_p.h
+++ b/src/qml/jsruntime/qv4qmlcontext_p.h
@@ -37,8 +37,8 @@
**
****************************************************************************/
-#ifndef QQMLCONTEXTWRAPPER_P_H
-#define QQMLCONTEXTWRAPPER_P_H
+#ifndef QV4QMLCONTEXT_P_H
+#define QV4QMLCONTEXT_P_H
//
// W A R N I N G
@@ -55,12 +55,15 @@
#include <private/qtqmlglobal_p.h>
#include <private/qv4object_p.h>
+#include <private/qv4context_p.h>
#include <private/qqmlcontext_p.h>
QT_BEGIN_NAMESPACE
namespace QV4 {
+struct QmlContextWrapper;
+
namespace Heap {
struct QmlContextWrapper : Object {
@@ -74,6 +77,12 @@ struct QmlContextWrapper : Object {
QQmlQPointer<QObject> scopeObject;
};
+struct QmlContext : ExecutionContext {
+ void init(QV4::ExecutionContext *outerContext, QV4::QmlContextWrapper *qml);
+
+ Pointer<QmlContextWrapper> qml;
+};
+
}
struct Q_QML_EXPORT QmlContextWrapper : Object
@@ -81,9 +90,6 @@ struct Q_QML_EXPORT QmlContextWrapper : Object
V4_OBJECT2(QmlContextWrapper, Object)
V4_NEEDS_DESTROY
- static ReturnedValue qmlScope(ExecutionEngine *e, QQmlContextData *ctxt, QObject *scope);
- static ReturnedValue urlScope(ExecutionEngine *v4, const QUrl &);
-
void takeContextOwnership() {
d()->ownsContext = true;
}
@@ -97,9 +103,28 @@ struct Q_QML_EXPORT QmlContextWrapper : Object
static void put(Managed *m, String *name, const Value &value);
};
+struct Q_QML_EXPORT QmlContext : public ExecutionContext
+{
+ V4_MANAGED(QmlContext, ExecutionContext)
+
+ static Heap::QmlContext *createWorkerContext(QV4::ExecutionContext *parent, const QUrl &source, Value *sendFunction);
+ static Heap::QmlContext *create(QV4::ExecutionContext *parent, QQmlContextData *context, QObject *scopeObject);
+
+ QObject *qmlScope() const {
+ return d()->qml->scopeObject;
+ }
+ QQmlContextData *qmlContext() const {
+ return *d()->qml->context;
+ }
+
+ void takeContextOwnership() {
+ d()->qml->ownsContext = true;
+ }
+};
+
}
QT_END_NAMESPACE
-#endif // QV8CONTEXTWRAPPER_P_H
+#endif
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 6b87f282cf..77dbb18b50 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -48,7 +48,6 @@
#include <private/qqmlglobal_p.h>
#include <private/qqmltypewrapper_p.h>
#include <private/qqmlvaluetypewrapper_p.h>
-#include <private/qqmlcontextwrapper_p.h>
#include <private/qqmllistwrapper_p.h>
#include <private/qqmlbuiltinfunctions_p.h>
#include <private/qv8engine_p.h>
@@ -392,9 +391,10 @@ void QObjectWrapper::setProperty(ExecutionEngine *engine, QObject *object, QQmlP
QQmlContextData *callingQmlContext = scope.engine->callingQmlContext();
QV4::Scoped<QQmlBindingFunction> bindingFunction(scope, (const Value &)f);
- bindingFunction->initBindingLocation();
- newBinding = QQmlBinding::create(property, value, object, callingQmlContext);
+ QV4::ScopedContext ctx(scope, bindingFunction->scope());
+ newBinding = QQmlBinding::create(property, bindingFunction->function(), object, callingQmlContext, ctx);
+ newBinding->setSourceLocation(bindingFunction->currentLocation());
newBinding->setTarget(object, *property, nullptr);
}
}
@@ -493,8 +493,7 @@ void QObjectWrapper::setProperty(ExecutionEngine *engine, QObject *object, QQmlP
ReturnedValue QObjectWrapper::wrap_slowPath(ExecutionEngine *engine, QObject *object)
{
- if (QQmlData::wasDeleted(object))
- return QV4::Encode::null();
+ Q_ASSERT(!QQmlData::wasDeleted(object));
QQmlData *ddata = QQmlData::get(object, true);
if (!ddata)
diff --git a/src/qml/jsruntime/qv4qobjectwrapper_p.h b/src/qml/jsruntime/qv4qobjectwrapper_p.h
index 504f6a69b8..c7c4f4dd77 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper_p.h
+++ b/src/qml/jsruntime/qv4qobjectwrapper_p.h
@@ -206,14 +206,15 @@ private:
inline ReturnedValue QObjectWrapper::wrap(ExecutionEngine *engine, QObject *object)
{
- if (Q_LIKELY(!QQmlData::wasDeleted(object))) {
- QObjectPrivate *priv = QObjectPrivate::get(const_cast<QObject *>(object));
- if (Q_LIKELY(priv->declarativeData)) {
- auto ddata = static_cast<QQmlData *>(priv->declarativeData);
- if (Q_LIKELY(ddata->jsEngineId == engine->m_engineId && !ddata->jsWrapper.isUndefined())) {
- // We own the JS object
- return ddata->jsWrapper.value();
- }
+ if (Q_UNLIKELY(QQmlData::wasDeleted(object)))
+ return QV4::Encode::null();
+
+ QObjectPrivate *priv = QObjectPrivate::get(const_cast<QObject *>(object));
+ if (Q_LIKELY(priv->declarativeData)) {
+ auto ddata = static_cast<QQmlData *>(priv->declarativeData);
+ if (Q_LIKELY(ddata->jsEngineId == engine->m_engineId && !ddata->jsWrapper.isUndefined())) {
+ // We own the JS object
+ return ddata->jsWrapper.value();
}
}
diff --git a/src/qml/jsruntime/qv4regexpobject.cpp b/src/qml/jsruntime/qv4regexpobject.cpp
index 4022d98c3f..218695624b 100644
--- a/src/qml/jsruntime/qv4regexpobject.cpp
+++ b/src/qml/jsruntime/qv4regexpobject.cpp
@@ -262,12 +262,12 @@ void RegExpCtor::construct(const Managed *, Scope &scope, CallData *callData)
bool ignoreCase = false;
bool multiLine = false;
if (!f->isUndefined()) {
- f = RuntimeHelpers::toString(scope.engine, f);
+ ScopedString s(scope, f->toString(scope.engine));
if (scope.hasException()) {
scope.result = Encode::undefined();
return;
}
- QString str = f->stringValue()->toQString();
+ QString str = s->toQString();
for (int i = 0; i < str.length(); ++i) {
if (str.at(i) == QLatin1Char('g') && !global) {
global = true;
@@ -356,10 +356,10 @@ ReturnedValue RegExpPrototype::method_exec(CallContext *ctx)
return ctx->engine()->throwTypeError();
ScopedValue arg(scope, ctx->argument(0));
- arg = RuntimeHelpers::toString(scope.engine, arg);
+ ScopedString str(scope, arg->toString(scope.engine));
if (scope.hasException())
return Encode::undefined();
- QString s = arg->stringValue()->toQString();
+ QString s = str->toQString();
int offset = r->global() ? r->lastIndexProperty()->toInt32() : 0;
if (offset < 0 || offset > s.length()) {
@@ -391,11 +391,11 @@ ReturnedValue RegExpPrototype::method_exec(CallContext *ctx)
}
array->setArrayLengthUnchecked(len);
*array->propertyData(Index_ArrayIndex) = Primitive::fromInt32(result);
- *array->propertyData(Index_ArrayInput) = arg;
+ *array->propertyData(Index_ArrayInput) = str;
RegExpCtor::Data *dd = regExpCtor->d();
dd->lastMatch = array;
- dd->lastInput = arg->stringValue()->d();
+ dd->lastInput = str->d();
dd->lastMatchStart = matchOffsets[0];
dd->lastMatchEnd = matchOffsets[1];
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index 9c20133a26..d6c55926b1 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -53,7 +53,7 @@
#include "qv4numberobject_p.h"
#include "private/qlocale_tools_p.h"
#include "qv4scopedvalue_p.h"
-#include <private/qqmlcontextwrapper_p.h>
+#include <private/qv4qmlcontext_p.h>
#include <private/qqmltypewrapper_p.h>
#include <private/qqmlengine_p.h>
#include <private/qqmljavascriptexpression_p.h>
@@ -345,28 +345,29 @@ ReturnedValue Runtime::method_deleteName(ExecutionEngine *engine, int nameIndex)
QV4::ReturnedValue Runtime::method_instanceof(ExecutionEngine *engine, const Value &left, const Value &right)
{
- Scope scope(engine);
- ScopedFunctionObject f(scope, right.as<FunctionObject>());
- if (!f)
+ const FunctionObject *function = right.as<FunctionObject>();
+ if (!function)
return engine->throwTypeError();
- if (f->isBoundFunction())
- f = static_cast<BoundFunction *>(f.getPointer())->target();
+ Heap::FunctionObject *f = function->d();
+ if (function->isBoundFunction())
+ f = function->cast<BoundFunction>()->target();
- ScopedObject v(scope, left.as<Object>());
- if (!v)
+ const Object *o = left.as<Object>();
+ if (!o)
return Encode(false);
+ Heap::Object *v = o->d();
- ScopedObject o(scope, f->protoProperty());
+ o = f->protoProperty();
if (!o)
return engine->throwTypeError();
while (v) {
- v = v->prototype();
+ v = v->prototype;
if (!v)
break;
- else if (o->d() == v->d())
+ else if (o->d() == v)
return Encode(true);
}
@@ -375,13 +376,14 @@ QV4::ReturnedValue Runtime::method_instanceof(ExecutionEngine *engine, const Val
QV4::ReturnedValue Runtime::method_in(ExecutionEngine *engine, const Value &left, const Value &right)
{
- if (!right.isObject())
+ Object *ro = right.objectValue();
+ if (!ro)
return engine->throwTypeError();
Scope scope(engine);
ScopedString s(scope, left.toString(engine));
if (scope.hasException())
return Encode::undefined();
- bool r = right.objectValue()->hasProperty(s);
+ bool r = ro->hasProperty(s);
return Encode(r);
}
@@ -492,8 +494,8 @@ Heap::String *RuntimeHelpers::convertToString(ExecutionEngine *engine, const Val
else
return engine->id_false()->d();
case Value::Managed_Type:
- if (value.isString())
- return value.stringValue()->d();
+ if (String *s = value.stringValue())
+ return s->d();
{
Scope scope(engine);
ScopedValue prim(scope, RuntimeHelpers::toPrimitive(value, STRING_HINT));
@@ -523,8 +525,8 @@ static Heap::String *convert_to_string_add(ExecutionEngine *engine, const Value
else
return engine->id_false()->d();
case Value::Managed_Type:
- if (value.isString())
- return value.stringValue()->d();
+ if (String *s = value.stringValue())
+ return s->d();
{
Scope scope(engine);
ScopedValue prim(scope, RuntimeHelpers::toPrimitive(value, PREFERREDTYPE_HINT));
@@ -543,19 +545,25 @@ QV4::ReturnedValue RuntimeHelpers::addHelper(ExecutionEngine *engine, const Valu
ScopedValue pleft(scope, RuntimeHelpers::toPrimitive(left, PREFERREDTYPE_HINT));
ScopedValue pright(scope, RuntimeHelpers::toPrimitive(right, PREFERREDTYPE_HINT));
- if (pleft->isString() || pright->isString()) {
- if (!pleft->isString())
+ String *sleft = pleft->stringValue();
+ String *sright = pright->stringValue();
+ if (sleft || sright) {
+ if (!sleft) {
pleft = convert_to_string_add(engine, pleft);
- if (!pright->isString())
+ sleft = static_cast<String *>(pleft.ptr);
+ }
+ if (!sright) {
pright = convert_to_string_add(engine, pright);
+ sright = static_cast<String *>(pright.ptr);
+ }
if (scope.engine->hasException)
return Encode::undefined();
- if (!pleft->stringValue()->d()->length())
- return pright->asReturnedValue();
- if (!pright->stringValue()->d()->length())
- return pleft->asReturnedValue();
+ if (!sleft->d()->length())
+ return sright->asReturnedValue();
+ if (!sright->d()->length())
+ return sleft->asReturnedValue();
MemoryManager *mm = engine->memoryManager;
- return (mm->alloc<String>(mm, pleft->stringValue()->d(), pright->stringValue()->d()))->asReturnedValue();
+ return (mm->alloc<String>(mm, sleft->d(), sright->d()))->asReturnedValue();
}
double x = RuntimeHelpers::toNumber(pleft);
double y = RuntimeHelpers::toNumber(pright);
@@ -566,31 +574,28 @@ QV4::ReturnedValue Runtime::method_addString(ExecutionEngine *engine, const Valu
{
Q_ASSERT(left.isString() || right.isString());
- if (left.isString() && right.isString()) {
- if (!left.stringValue()->d()->length())
- return right.asReturnedValue();
- if (!right.stringValue()->d()->length())
- return left.asReturnedValue();
- MemoryManager *mm = engine->memoryManager;
- return (mm->alloc<String>(mm, left.stringValue()->d(), right.stringValue()->d()))->asReturnedValue();
- }
-
Scope scope(engine);
ScopedValue pleft(scope, left);
ScopedValue pright(scope, right);
+ String *sleft = pleft->stringValue();
+ String *sright = pright->stringValue();
- if (!pleft->isString())
- pleft = convert_to_string_add(engine, left);
- if (!pright->isString())
- pright = convert_to_string_add(engine, right);
+ if (!sleft) {
+ pleft = convert_to_string_add(engine, pleft);
+ sleft = static_cast<String *>(pleft.ptr);
+ }
+ if (!sright) {
+ pright = convert_to_string_add(engine, pright);
+ sright = static_cast<String *>(pright.ptr);
+ }
if (scope.engine->hasException)
return Encode::undefined();
- if (!pleft->stringValue()->d()->length())
+ if (!sleft->d()->length())
return pright->asReturnedValue();
- if (!pright->stringValue()->d()->length())
+ if (!sright->d()->length())
return pleft->asReturnedValue();
MemoryManager *mm = engine->memoryManager;
- return (mm->alloc<String>(mm, pleft->stringValue()->d(), pright->stringValue()->d()))->asReturnedValue();
+ return (mm->alloc<String>(mm, sleft->d(), sright->d()))->asReturnedValue();
}
void Runtime::method_setProperty(ExecutionEngine *engine, const Value &object, int nameIndex, const Value &value)
@@ -750,13 +755,15 @@ uint RuntimeHelpers::equalHelper(const Value &x, const Value &y)
#ifdef V4_BOOTSTRAP
Q_UNIMPLEMENTED();
#else
- if ((x.isNumber() || x.isString()) && y.isObject()) {
- Scope scope(y.objectValue()->engine());
- ScopedValue py(scope, RuntimeHelpers::toPrimitive(y, PREFERREDTYPE_HINT));
+ Object *xo = x.objectValue();
+ Object *yo = y.objectValue();
+ if (yo && (x.isNumber() || x.isString())) {
+ Scope scope(yo->engine());
+ ScopedValue py(scope, RuntimeHelpers::objectDefaultValue(yo, PREFERREDTYPE_HINT));
return Runtime::method_compareEqual(x, py);
- } else if (x.isObject() && (y.isNumber() || y.isString())) {
- Scope scope(x.objectValue()->engine());
- ScopedValue px(scope, RuntimeHelpers::toPrimitive(x, PREFERREDTYPE_HINT));
+ } else if (xo && (y.isNumber() || y.isString())) {
+ Scope scope(xo->engine());
+ ScopedValue px(scope, RuntimeHelpers::objectDefaultValue(xo, PREFERREDTYPE_HINT));
return Runtime::method_compareEqual(px, y);
}
#endif
@@ -787,23 +794,27 @@ QV4::Bool Runtime::method_compareGreaterThan(const Value &l, const Value &r)
return l.integerValue() > r.integerValue();
if (l.isNumber() && r.isNumber())
return l.asDouble() > r.asDouble();
- if (l.isString() && r.isString()) {
+ String *sl = l.stringValue();
+ String *sr = r.stringValue();
+ if (sl && sr) {
#ifdef V4_BOOTSTRAP
Q_UNIMPLEMENTED();
return false;
#else
- return r.stringValue()->compare(l.stringValue());
+ return sr->compare(sl);
#endif
}
- if (l.isObject() || r.isObject()) {
+ Object *ro = r.objectValue();
+ Object *lo = l.objectValue();
+ if (ro || lo) {
#ifdef V4_BOOTSTRAP
Q_UNIMPLEMENTED();
#else
- QV4::ExecutionEngine *e = (l.isObject() ? l.objectValue() : r.objectValue())->engine();
+ QV4::ExecutionEngine *e = (lo ? lo : ro)->engine();
QV4::Scope scope(e);
- QV4::ScopedValue pl(scope, RuntimeHelpers::toPrimitive(l, QV4::NUMBER_HINT));
- QV4::ScopedValue pr(scope, RuntimeHelpers::toPrimitive(r, QV4::NUMBER_HINT));
+ QV4::ScopedValue pl(scope, lo ? RuntimeHelpers::objectDefaultValue(lo, QV4::NUMBER_HINT) : l.asReturnedValue());
+ QV4::ScopedValue pr(scope, ro ? RuntimeHelpers::objectDefaultValue(ro, QV4::NUMBER_HINT) : r.asReturnedValue());
return Runtime::method_compareGreaterThan(pl, pr);
#endif
}
@@ -820,23 +831,27 @@ QV4::Bool Runtime::method_compareLessThan(const Value &l, const Value &r)
return l.integerValue() < r.integerValue();
if (l.isNumber() && r.isNumber())
return l.asDouble() < r.asDouble();
- if (l.isString() && r.isString()) {
+ String *sl = l.stringValue();
+ String *sr = r.stringValue();
+ if (sl && sr) {
#ifdef V4_BOOTSTRAP
Q_UNIMPLEMENTED();
return false;
#else
- return l.stringValue()->compare(r.stringValue());
+ return sl->compare(sr);
#endif
}
- if (l.isObject() || r.isObject()) {
+ Object *ro = r.objectValue();
+ Object *lo = l.objectValue();
+ if (ro || lo) {
#ifdef V4_BOOTSTRAP
Q_UNIMPLEMENTED();
#else
- QV4::ExecutionEngine *e = (l.isObject() ? l.objectValue() : r.objectValue())->engine();
+ QV4::ExecutionEngine *e = (lo ? lo : ro)->engine();
QV4::Scope scope(e);
- QV4::ScopedValue pl(scope, RuntimeHelpers::toPrimitive(l, QV4::NUMBER_HINT));
- QV4::ScopedValue pr(scope, RuntimeHelpers::toPrimitive(r, QV4::NUMBER_HINT));
+ QV4::ScopedValue pl(scope, lo ? RuntimeHelpers::objectDefaultValue(lo, QV4::NUMBER_HINT) : l.asReturnedValue());
+ QV4::ScopedValue pr(scope, ro ? RuntimeHelpers::objectDefaultValue(ro, QV4::NUMBER_HINT) : r.asReturnedValue());
return Runtime::method_compareLessThan(pl, pr);
#endif
}
@@ -853,23 +868,27 @@ QV4::Bool Runtime::method_compareGreaterEqual(const Value &l, const Value &r)
return l.integerValue() >= r.integerValue();
if (l.isNumber() && r.isNumber())
return l.asDouble() >= r.asDouble();
- if (l.isString() && r.isString()) {
+ String *sl = l.stringValue();
+ String *sr = r.stringValue();
+ if (sl && sr) {
#ifdef V4_BOOTSTRAP
Q_UNIMPLEMENTED();
return false;
#else
- return !l.stringValue()->compare(r.stringValue());
+ return !sl->compare(sr);
#endif
}
- if (l.isObject() || r.isObject()) {
+ Object *ro = r.objectValue();
+ Object *lo = l.objectValue();
+ if (ro || lo) {
#ifdef V4_BOOTSTRAP
Q_UNIMPLEMENTED();
#else
- QV4::ExecutionEngine *e = (l.isObject() ? l.objectValue() : r.objectValue())->engine();
+ QV4::ExecutionEngine *e = (lo ? lo : ro)->engine();
QV4::Scope scope(e);
- QV4::ScopedValue pl(scope, RuntimeHelpers::toPrimitive(l, QV4::NUMBER_HINT));
- QV4::ScopedValue pr(scope, RuntimeHelpers::toPrimitive(r, QV4::NUMBER_HINT));
+ QV4::ScopedValue pl(scope, lo ? RuntimeHelpers::objectDefaultValue(lo, QV4::NUMBER_HINT) : l.asReturnedValue());
+ QV4::ScopedValue pr(scope, ro ? RuntimeHelpers::objectDefaultValue(ro, QV4::NUMBER_HINT) : r.asReturnedValue());
return Runtime::method_compareGreaterEqual(pl, pr);
#endif
}
@@ -886,23 +905,27 @@ QV4::Bool Runtime::method_compareLessEqual(const Value &l, const Value &r)
return l.integerValue() <= r.integerValue();
if (l.isNumber() && r.isNumber())
return l.asDouble() <= r.asDouble();
- if (l.isString() && r.isString()) {
+ String *sl = l.stringValue();
+ String *sr = r.stringValue();
+ if (sl && sr) {
#ifdef V4_BOOTSTRAP
Q_UNIMPLEMENTED();
return false;
#else
- return !r.stringValue()->compare(l.stringValue());
+ return !sr->compare(sl);
#endif
}
- if (l.isObject() || r.isObject()) {
+ Object *ro = r.objectValue();
+ Object *lo = l.objectValue();
+ if (ro || lo) {
#ifdef V4_BOOTSTRAP
Q_UNIMPLEMENTED();
#else
- QV4::ExecutionEngine *e = (l.isObject() ? l.objectValue() : r.objectValue())->engine();
+ QV4::ExecutionEngine *e = (lo ? lo : ro)->engine();
QV4::Scope scope(e);
- QV4::ScopedValue pl(scope, RuntimeHelpers::toPrimitive(l, QV4::NUMBER_HINT));
- QV4::ScopedValue pr(scope, RuntimeHelpers::toPrimitive(r, QV4::NUMBER_HINT));
+ QV4::ScopedValue pl(scope, lo ? RuntimeHelpers::objectDefaultValue(lo, QV4::NUMBER_HINT) : l.asReturnedValue());
+ QV4::ScopedValue pr(scope, ro ? RuntimeHelpers::objectDefaultValue(ro, QV4::NUMBER_HINT) : r.asReturnedValue());
return Runtime::method_compareLessEqual(pl, pr);
#endif
}
@@ -1045,13 +1068,13 @@ ReturnedValue Runtime::method_callPropertyLookup(ExecutionEngine *engine, uint i
Lookup *l = engine->current->lookups + index;
Value v;
v = l->getter(l, engine, callData->thisObject);
- if (v.isObject()) {
+ Object *o = v.objectValue();
+ if (Q_LIKELY(o)) {
Scope scope(engine);
- v.objectValue()->call(scope, callData);
+ o->call(scope, callData);
return scope.result.asReturnedValue();
- } else {
- return engine->throwTypeError();
}
+ return engine->throwTypeError();
}
ReturnedValue Runtime::method_callElement(ExecutionEngine *engine, const Value &index, CallData *callData)
@@ -1074,12 +1097,12 @@ ReturnedValue Runtime::method_callElement(ExecutionEngine *engine, const Value &
ReturnedValue Runtime::method_callValue(ExecutionEngine *engine, const Value &func, CallData *callData)
{
- if (!func.isObject())
- return engine->throwTypeError(QStringLiteral("%1 is not a function").arg(func.toQStringNoThrow()));
-
- Scope scope(engine);
- func.objectValue()->call(scope, callData);
- return scope.result.asReturnedValue();
+ if (Object *o = func.objectValue()) {
+ Scope scope(engine);
+ o->call(scope, callData);
+ return scope.result.asReturnedValue();
+ }
+ return engine->throwTypeError(QStringLiteral("%1 is not a function").arg(func.toQStringNoThrow()));
}
@@ -1149,14 +1172,13 @@ ReturnedValue Runtime::method_constructPropertyLookup(ExecutionEngine *engine, u
Lookup *l = engine->current->lookups + index;
Value v;
v = l->getter(l, engine, callData->thisObject);
- if (v.isObject()) {
+ Object *o = v.objectValue();
+ if (Q_LIKELY(o)) {
Scope scope(engine);
- ScopedValue result(scope);
- v.objectValue()->construct(scope, callData);
+ o->construct(scope, callData);
return scope.result.asReturnedValue();
- } else {
- return engine->throwTypeError();
}
+ return engine->throwTypeError();
}
@@ -1367,29 +1389,6 @@ QV4::ReturnedValue Runtime::method_decrement(const Value &value)
}
}
-#ifndef V4_BOOTSTRAP
-
-QV4::ReturnedValue RuntimeHelpers::toString(ExecutionEngine *engine, const Value &value)
-{
- if (value.isString())
- return value.asReturnedValue();
- return RuntimeHelpers::convertToString(engine, value)->asReturnedValue();
-}
-
-QV4::ReturnedValue RuntimeHelpers::toObject(ExecutionEngine *engine, const Value &value)
-{
- if (value.isObject())
- return value.asReturnedValue();
-
- Heap::Object *o = RuntimeHelpers::convertToObject(engine, value);
- if (!o) // type error
- return Encode::undefined();
-
- return Encode(o);
-}
-
-#endif // V4_BOOTSTRAP
-
ReturnedValue Runtime::method_toDouble(const Value &value)
{
TRACE1(value);
diff --git a/src/qml/jsruntime/qv4runtime_p.h b/src/qml/jsruntime/qv4runtime_p.h
index a32b3f1663..0d787714cf 100644
--- a/src/qml/jsruntime/qv4runtime_p.h
+++ b/src/qml/jsruntime/qv4runtime_p.h
@@ -106,10 +106,7 @@ struct Q_QML_PRIVATE_EXPORT RuntimeHelpers {
static double toNumber(const Value &value);
static void numberToString(QString *result, double num, int radix = 10);
- static ReturnedValue toString(ExecutionEngine *engine, const Value &value);
static Heap::String *convertToString(ExecutionEngine *engine, const Value &value);
-
- static ReturnedValue toObject(ExecutionEngine *engine, const Value &value);
static Heap::Object *convertToObject(ExecutionEngine *engine, const Value &value);
static Bool equalHelper(const Value &x, const Value &y);
diff --git a/src/qml/jsruntime/qv4runtimeapi_p.h b/src/qml/jsruntime/qv4runtimeapi_p.h
index e06a3f5ec2..355b7890b6 100644
--- a/src/qml/jsruntime/qv4runtimeapi_p.h
+++ b/src/qml/jsruntime/qv4runtimeapi_p.h
@@ -63,6 +63,11 @@ template <typename T>
struct ExceptionCheck {
enum { NeedsCheck = 1 };
};
+// push_catch and pop context methods shouldn't check for exceptions
+template <>
+struct ExceptionCheck<void (*)(QV4::NoThrowEngine *)> {
+ enum { NeedsCheck = 0 };
+};
template <typename A>
struct ExceptionCheck<void (*)(A, QV4::NoThrowEngine)> {
enum { NeedsCheck = 0 };
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h
index 5022d7c3bc..4e627e003f 100644
--- a/src/qml/jsruntime/qv4scopedvalue_p.h
+++ b/src/qml/jsruntime/qv4scopedvalue_p.h
@@ -97,7 +97,7 @@ struct Scope {
engine->jsStackTop = mark;
}
- Value *alloc(int nValues) const {
+ QML_NEARLY_ALWAYS_INLINE Value *alloc(int nValues) const {
return engine->jsAlloca(nValues);
}
@@ -189,63 +189,70 @@ struct Scoped
{
enum ConvertType { Convert };
- inline void setPointer(const Managed *p) {
+ QML_NEARLY_ALWAYS_INLINE void setPointer(const Managed *p) {
ptr->setM(p ? p->m() : 0);
}
- Scoped(const Scope &scope)
+ QML_NEARLY_ALWAYS_INLINE Scoped(const Scope &scope)
{
ptr = scope.engine->jsAlloca(1);
}
- Scoped(const Scope &scope, const Value &v)
+ QML_NEARLY_ALWAYS_INLINE Scoped(const Scope &scope, const Value &v)
{
ptr = scope.engine->jsAlloca(1);
setPointer(v.as<T>());
}
- Scoped(const Scope &scope, Heap::Base *o)
+ QML_NEARLY_ALWAYS_INLINE Scoped(const Scope &scope, Heap::Base *o)
{
Value v;
v = o;
ptr = scope.engine->jsAlloca(1);
setPointer(v.as<T>());
}
- Scoped(const Scope &scope, const ScopedValue &v)
+ QML_NEARLY_ALWAYS_INLINE Scoped(const Scope &scope, const ScopedValue &v)
{
ptr = scope.engine->jsAlloca(1);
setPointer(v.ptr->as<T>());
}
- Scoped(const Scope &scope, const Value &v, ConvertType)
+ QML_NEARLY_ALWAYS_INLINE Scoped(const Scope &scope, const Value &v, ConvertType)
{
ptr = scope.engine->jsAlloca(1);
ptr->setRawValue(value_convert<T>(scope.engine, v));
}
- Scoped(const Scope &scope, const Value *v)
+ QML_NEARLY_ALWAYS_INLINE Scoped(const Scope &scope, const Value *v)
{
ptr = scope.engine->jsAlloca(1);
setPointer(v ? v->as<T>() : 0);
}
- Scoped(const Scope &scope, T *t)
+ QML_NEARLY_ALWAYS_INLINE Scoped(const Scope &scope, T *t)
{
ptr = scope.engine->jsAlloca(1);
setPointer(t);
}
- Scoped(const Scope &scope, typename T::Data *t)
+
+ QML_NEARLY_ALWAYS_INLINE Scoped(const Scope &scope, const T *t)
+ {
+ ptr = scope.engine->jsAlloca(1);
+ setPointer(t);
+ }
+
+ QML_NEARLY_ALWAYS_INLINE Scoped(const Scope &scope, typename T::Data *t)
{
ptr = scope.engine->jsAlloca(1);
*ptr = t;
}
- Scoped(const Scope &scope, const ReturnedValue &v)
+ QML_NEARLY_ALWAYS_INLINE Scoped(const Scope &scope, const ReturnedValue &v)
{
ptr = scope.engine->jsAlloca(1);
setPointer(QV4::Value::fromReturnedValue(v).as<T>());
}
- Scoped(const Scope &scope, const ReturnedValue &v, ConvertType)
+ QML_NEARLY_ALWAYS_INLINE Scoped(const Scope &scope, const ReturnedValue &v, ConvertType)
{
ptr = scope.engine->jsAlloca(1);
ptr->setRawValue(value_convert<T>(scope.engine, QV4::Value::fromReturnedValue(v)));
@@ -291,11 +298,11 @@ struct Scoped
}
T *operator->() {
- return ptr->cast<T>();
+ return getPointer();
}
const T *operator->() const {
- return ptr->cast<T>();
+ return getPointer();
}
bool operator!() const {
@@ -306,14 +313,19 @@ struct Scoped
}
T *getPointer() {
- return ptr->cast<T>();
+ return reinterpret_cast<T *>(ptr);
+ }
+
+ const T *getPointer() const {
+ return reinterpret_cast<T *>(ptr);
}
+
Value *getRef() {
return ptr;
}
- ReturnedValue asReturnedValue() const {
- return ptr->m() ? ptr->rawValue() : Encode::undefined();
+ QML_NEARLY_ALWAYS_INLINE ReturnedValue asReturnedValue() const {
+ return ptr->rawValue();
}
Value *ptr;
@@ -358,8 +370,6 @@ struct ScopedProperty
ScopedProperty(Scope &scope)
{
property = reinterpret_cast<Property*>(scope.alloc(sizeof(Property) / sizeof(Value)));
- property->value = Encode::undefined();
- property->set = Encode::undefined();
}
Property *operator->() { return property; }
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp
index 552171256f..b54177bee9 100644
--- a/src/qml/jsruntime/qv4script.cpp
+++ b/src/qml/jsruntime/qv4script.cpp
@@ -54,71 +54,12 @@
#include <private/qv4profiling_p.h>
#include <qv4jsir_p.h>
#include <qv4codegen_p.h>
-#include <private/qqmlcontextwrapper_p.h>
#include <QtCore/QDebug>
#include <QtCore/QString>
-QT_BEGIN_NAMESPACE
-
-namespace QV4 {
-namespace Heap {
-
-struct QmlBindingWrapper : FunctionObject {
- void init(QV4::QmlContext *scope, Function *f);
-};
-
-}
-
-struct QmlBindingWrapper : FunctionObject {
- V4_OBJECT2(QmlBindingWrapper, FunctionObject)
-
- static void call(const Managed *that, Scope &scope, CallData *callData);
-};
-
-}
-
-QT_END_NAMESPACE
-
using namespace QV4;
-DEFINE_OBJECT_VTABLE(QmlBindingWrapper);
-
-void Heap::QmlBindingWrapper::init(QV4::QmlContext *scope, Function *f)
-{
- Heap::FunctionObject::init(scope, scope->d()->engine->id_eval(), /*createProto = */ false);
-
- Q_ASSERT(scope->inUse());
-
- function = f;
- if (function)
- function->compilationUnit->addref();
-}
-
-void QmlBindingWrapper::call(const Managed *that, Scope &scope, CallData *callData)
-{
- const QmlBindingWrapper *This = static_cast<const QmlBindingWrapper *>(that);
- ExecutionEngine *v4 = static_cast<const Object *>(that)->engine();
- if (v4->hasException) {
- scope.result = Encode::undefined();
- return;
- }
- CHECK_STACK_LIMITS(v4, scope);
-
- ExecutionContextSaver ctxSaver(scope);
-
- QV4::Function *f = This->function();
- if (!f) {
- scope.result = QV4::Encode::undefined();
- return;
- }
-
- Scoped<CallContext> ctx(scope, v4->currentContext->newCallContext(This, callData));
- v4->pushContext(ctx);
-
- scope.result = Q_V4_PROFILE(v4, f);
-}
-
Script::Script(ExecutionEngine *v4, QmlContext *qml, CompiledData::CompilationUnit *compilationUnit)
: line(0), column(0), scope(v4->rootContext()), strictMode(false), inheritContext(true), parsed(false)
, compilationUnit(compilationUnit), vmFunction(0), parseAsBinding(true)
@@ -230,10 +171,12 @@ ReturnedValue Script::run()
return Q_V4_PROFILE(engine, vmFunction);
} else {
Scoped<QmlContext> qml(valueScope, qmlContext.value());
- ScopedFunctionObject f(valueScope, engine->memoryManager->allocObject<QmlBindingWrapper>(qml, vmFunction));
ScopedCallData callData(valueScope);
callData->thisObject = Primitive::undefinedValue();
- f->call(valueScope, callData);
+ if (vmFunction->canUseSimpleFunction())
+ qml->simpleCall(valueScope, callData, vmFunction);
+ else
+ qml->call(valueScope, callData, vmFunction);
return valueScope.result.asReturnedValue();
}
}
@@ -303,17 +246,6 @@ QQmlRefPointer<QV4::CompiledData::CompilationUnit> Script::precompile(IR::Module
return isel->compile(/*generate unit data*/false);
}
-ReturnedValue Script::qmlBinding()
-{
- if (!parsed)
- parse();
- ExecutionEngine *v4 = scope->engine();
- Scope valueScope(v4);
- Scoped<QmlContext> qml(valueScope, qmlContext.value());
- ScopedObject v(valueScope, v4->memoryManager->allocObject<QmlBindingWrapper>(qml, vmFunction));
- return v.asReturnedValue();
-}
-
QV4::ReturnedValue Script::evaluate(ExecutionEngine *engine, const QString &script, QmlContext *qmlContext)
{
QV4::Scope scope(engine);
diff --git a/src/qml/jsruntime/qv4script_p.h b/src/qml/jsruntime/qv4script_p.h
index 2e87a7692b..f96f0254a5 100644
--- a/src/qml/jsruntime/qv4script_p.h
+++ b/src/qml/jsruntime/qv4script_p.h
@@ -53,7 +53,7 @@
#include "qv4global_p.h"
#include "qv4engine_p.h"
#include "qv4functionobject_p.h"
-#include "qv4context_p.h"
+#include "qv4qmlcontext_p.h"
#include <QQmlError>
@@ -136,7 +136,6 @@ struct Q_QML_EXPORT Script {
void parse();
ReturnedValue run();
- ReturnedValue qmlBinding();
Function *function();
diff --git a/src/qml/jsruntime/qv4string_p.h b/src/qml/jsruntime/qv4string_p.h
index 23ec3349b9..4890a85724 100644
--- a/src/qml/jsruntime/qv4string_p.h
+++ b/src/qml/jsruntime/qv4string_p.h
@@ -267,7 +267,7 @@ public:
template<>
inline const String *Value::as() const {
- return isManaged() && m() && m()->vtable()->isString ? static_cast<const String *>(this) : 0;
+ return isManaged() && m()->vtable()->isString ? static_cast<const String *>(this) : 0;
}
#ifndef V4_BOOTSTRAP
diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp
index 829ada0c1a..6fbf1c3c85 100644
--- a/src/qml/jsruntime/qv4stringobject.cpp
+++ b/src/qml/jsruntime/qv4stringobject.cpp
@@ -218,8 +218,8 @@ static QString getThisString(ExecutionContext *ctx)
{
Scope scope(ctx);
ScopedValue t(scope, ctx->thisObject());
- if (t->isString())
- return t->stringValue()->toQString();
+ if (String *s = t->stringValue())
+ return s->toQString();
if (StringObject *thisString = t->as<StringObject>())
return thisString->d()->string->toQString();
if (t->isUndefined() || t->isNull()) {
@@ -282,13 +282,13 @@ ReturnedValue StringPrototype::method_concat(CallContext *context)
if (scope.engine->hasException)
return Encode::undefined();
- ScopedValue v(scope);
+ ScopedString s(scope);
for (int i = 0; i < context->argc(); ++i) {
- v = RuntimeHelpers::toString(scope.engine, context->args()[i]);
+ s = context->args()[i].toString(scope.engine);
if (scope.hasException())
return Encode::undefined();
- Q_ASSERT(v->isString());
- value += v->stringValue()->toQString();
+ Q_ASSERT(s->isString());
+ value += s->toQString();
}
return context->d()->engine->newString(value)->asReturnedValue();
diff --git a/src/qml/jsruntime/qv4value.cpp b/src/qml/jsruntime/qv4value.cpp
index 95c95b1974..e34ac9c764 100644
--- a/src/qml/jsruntime/qv4value.cpp
+++ b/src/qml/jsruntime/qv4value.cpp
@@ -77,24 +77,24 @@ int Value::toUInt16() const
bool Value::toBoolean() const
{
- switch (type()) {
- case Value::Undefined_Type:
- case Value::Null_Type:
+ if (isInteger() || isBoolean())
+ return static_cast<bool>(int_32());
+
+ if (isUndefined() || isNull())
return false;
- case Value::Boolean_Type:
- case Value::Integer_Type:
- return (bool)int_32();
- case Value::Managed_Type:
+
+ if (isManaged()) {
#ifdef V4_BOOTSTRAP
Q_UNIMPLEMENTED();
#else
- if (isString())
- return stringValue()->toQString().length() > 0;
+ if (String *s = stringValue())
+ return s->toQString().length() > 0;
#endif
return true;
- default: // double
- return doubleValue() && !std::isnan(doubleValue());
}
+
+ // double
+ return doubleValue() && !std::isnan(doubleValue());
}
double Value::toInteger() const
@@ -114,8 +114,8 @@ double Value::toNumberImpl() const
#ifdef V4_BOOTSTRAP
Q_UNIMPLEMENTED();
#else
- if (isString())
- return RuntimeHelpers::stringToNumber(stringValue()->toQString());
+ if (String *s = stringValue())
+ return RuntimeHelpers::stringToNumber(s->toQString());
{
Q_ASSERT(isObject());
Scope scope(objectValue()->engine());
@@ -150,8 +150,8 @@ QString Value::toQStringNoThrow() const
else
return QStringLiteral("false");
case Value::Managed_Type:
- if (isString())
- return stringValue()->toQString();
+ if (String *s = stringValue())
+ return s->toQString();
{
Q_ASSERT(isObject());
Scope scope(objectValue()->engine());
@@ -203,8 +203,8 @@ QString Value::toQString() const
else
return QStringLiteral("false");
case Value::Managed_Type:
- if (isString())
- return stringValue()->toQString();
+ if (String *s = stringValue())
+ return s->toQString();
{
Q_ASSERT(isObject());
Scope scope(objectValue()->engine());
@@ -228,8 +228,10 @@ QString Value::toQString() const
bool Value::sameValue(Value other) const {
if (_val == other._val)
return true;
- if (isString() && other.isString())
- return stringValue()->isEqualTo(other.stringValue());
+ String *s = stringValue();
+ String *os = other.stringValue();
+ if (s && os)
+ return s->isEqualTo(os);
if (isInteger() && other.isDouble())
return int_32() ? (double(int_32()) == other.doubleValue()) : (other._val == 0);
if (isDouble() && other.isInteger())
@@ -298,15 +300,15 @@ double Primitive::toInteger(double number)
#ifndef V4_BOOTSTRAP
Heap::String *Value::toString(ExecutionEngine *e) const
{
- if (isString())
- return stringValue()->d();
+ if (String *s = stringValue())
+ return s->d();
return RuntimeHelpers::convertToString(e, *this);
}
Heap::Object *Value::toObject(ExecutionEngine *e) const
{
- if (isObject())
- return objectValue()->d();
+ if (Object *o = objectValue())
+ return o->d();
return RuntimeHelpers::convertToObject(e, *this);
}
@@ -330,8 +332,8 @@ uint Value::asArrayLength(bool *ok) const
}
return idx;
}
- if (isString())
- return stringValue()->toUInt(ok);
+ if (String *s = stringValue())
+ return s->toUInt(ok);
uint idx = toUInt32();
double d = toNumber();
diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h
index 6d5cff4ecc..816b8fb11b 100644
--- a/src/qml/jsruntime/qv4value_p.h
+++ b/src/qml/jsruntime/qv4value_p.h
@@ -160,9 +160,9 @@ private:
quint64 _val;
public:
- Q_ALWAYS_INLINE quint64 &rawValueRef() { return _val; }
- Q_ALWAYS_INLINE quint64 rawValue() const { return _val; }
- Q_ALWAYS_INLINE void setRawValue(quint64 raw) { _val = raw; }
+ QML_NEARLY_ALWAYS_INLINE quint64 &rawValueRef() { return _val; }
+ QML_NEARLY_ALWAYS_INLINE quint64 rawValue() const { return _val; }
+ QML_NEARLY_ALWAYS_INLINE void setRawValue(quint64 raw) { _val = raw; }
#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
static inline int valueOffset() { return 0; }
@@ -171,23 +171,23 @@ public:
static inline int valueOffset() { return 4; }
static inline int tagOffset() { return 0; }
#endif
- Q_ALWAYS_INLINE void setTagValue(quint32 tag, quint32 value) { _val = quint64(tag) << 32 | value; }
- Q_ALWAYS_INLINE quint32 value() const { return _val & quint64(~quint32(0)); }
- Q_ALWAYS_INLINE quint32 tag() const { return _val >> 32; }
+ QML_NEARLY_ALWAYS_INLINE void setTagValue(quint32 tag, quint32 value) { _val = quint64(tag) << 32 | value; }
+ QML_NEARLY_ALWAYS_INLINE quint32 value() const { return _val & quint64(~quint32(0)); }
+ QML_NEARLY_ALWAYS_INLINE quint32 tag() const { return _val >> 32; }
#if defined(QV4_USE_64_BIT_VALUE_ENCODING)
- Q_ALWAYS_INLINE Heap::Base *m() const
+ QML_NEARLY_ALWAYS_INLINE Heap::Base *m() const
{
Heap::Base *b;
memcpy(&b, &_val, 8);
return b;
}
- Q_ALWAYS_INLINE void setM(Heap::Base *b)
+ QML_NEARLY_ALWAYS_INLINE void setM(Heap::Base *b)
{
memcpy(&_val, &b, 8);
}
#else // !QV4_USE_64_BIT_VALUE_ENCODING
- Q_ALWAYS_INLINE Heap::Base *m() const
+ QML_NEARLY_ALWAYS_INLINE Heap::Base *m() const
{
Q_STATIC_ASSERT(sizeof(Heap::Base*) == sizeof(quint32));
Heap::Base *b;
@@ -195,7 +195,7 @@ public:
memcpy(&b, &v, 4);
return b;
}
- Q_ALWAYS_INLINE void setM(Heap::Base *b)
+ QML_NEARLY_ALWAYS_INLINE void setM(Heap::Base *b)
{
quint32 v;
memcpy(&v, &b, 4);
@@ -203,32 +203,32 @@ public:
}
#endif
- Q_ALWAYS_INLINE int int_32() const
+ QML_NEARLY_ALWAYS_INLINE int int_32() const
{
return int(value());
}
- Q_ALWAYS_INLINE void setInt_32(int i)
+ QML_NEARLY_ALWAYS_INLINE void setInt_32(int i)
{
setTagValue(Integer_Type_Internal, quint32(i));
}
- Q_ALWAYS_INLINE uint uint_32() const { return value(); }
+ QML_NEARLY_ALWAYS_INLINE uint uint_32() const { return value(); }
- Q_ALWAYS_INLINE void setEmpty()
+ QML_NEARLY_ALWAYS_INLINE void setEmpty()
{
setTagValue(Empty_Type_Internal, value());
}
- Q_ALWAYS_INLINE void setEmpty(int i)
+ QML_NEARLY_ALWAYS_INLINE void setEmpty(int i)
{
setTagValue(Empty_Type_Internal, quint32(i));
}
- Q_ALWAYS_INLINE void setEmpty(quint32 i)
+ QML_NEARLY_ALWAYS_INLINE void setEmpty(quint32 i)
{
setTagValue(Empty_Type_Internal, i);
}
- Q_ALWAYS_INLINE quint32 emptyValue()
+ QML_NEARLY_ALWAYS_INLINE quint32 emptyValue()
{
Q_ASSERT(isEmpty());
return quint32(value());
@@ -302,6 +302,7 @@ public:
inline bool isUndefined() const { return _val == 0; }
inline bool isDouble() const { return (_val >> IsDouble_Shift); }
inline bool isManaged() const { return !isUndefined() && ((_val >> IsManagedOrUndefined_Shift) == 0); }
+ inline bool isManagedOrUndefined() const { return ((_val >> IsManagedOrUndefined_Shift) == 0); }
inline bool integerCompatible() const {
return (_val >> IsIntegerConvertible_Shift) == 3;
@@ -317,6 +318,7 @@ public:
inline bool isUndefined() const { return tag() == Managed_Type_Internal && value() == 0; }
inline bool isDouble() const { return (tag() & NotDouble_Mask) != NotDouble_Mask; }
inline bool isManaged() const { return tag() == Managed_Type_Internal && !isUndefined(); }
+ inline bool isManagedOrUndefined() const { return tag() == Managed_Type_Internal; }
inline bool integerCompatible() const { return (tag() & ConvertibleToInt) == ConvertibleToInt; }
static inline bool integerCompatible(Value a, Value b) {
return ((a.tag() & b.tag()) & ConvertibleToInt) == ConvertibleToInt;
@@ -326,7 +328,7 @@ public:
}
inline bool isNaN() const { return (tag() & QV4::Value::NotDouble_Mask) == QV4::Value::NaN_Mask; }
#endif
- Q_ALWAYS_INLINE double doubleValue() const {
+ QML_NEARLY_ALWAYS_INLINE double doubleValue() const {
Q_ASSERT(isDouble());
double d;
quint64 v = _val;
@@ -336,7 +338,7 @@ public:
memcpy(&d, &v, 8);
return d;
}
- Q_ALWAYS_INLINE void setDouble(double d) {
+ QML_NEARLY_ALWAYS_INLINE void setDouble(double d) {
memcpy(&_val, &d, 8);
#ifdef QV4_USE_64_BIT_VALUE_ENCODING
_val ^= NaNEncodeMask;
@@ -371,23 +373,23 @@ public:
return int_32();
}
- Q_ALWAYS_INLINE String *stringValue() const {
+ QML_NEARLY_ALWAYS_INLINE String *stringValue() const {
if (!isString())
return nullptr;
- return m() ? reinterpret_cast<String*>(const_cast<Value *>(this)) : 0;
+ return reinterpret_cast<String*>(const_cast<Value *>(this));
}
- Q_ALWAYS_INLINE Object *objectValue() const {
+ QML_NEARLY_ALWAYS_INLINE Object *objectValue() const {
if (!isObject())
return nullptr;
- return m() ? reinterpret_cast<Object*>(const_cast<Value *>(this)) : 0;
+ return reinterpret_cast<Object*>(const_cast<Value *>(this));
}
- Q_ALWAYS_INLINE Managed *managed() const {
+ QML_NEARLY_ALWAYS_INLINE Managed *managed() const {
if (!isManaged())
return nullptr;
- return m() ? reinterpret_cast<Managed*>(const_cast<Value *>(this)) : 0;
+ return reinterpret_cast<Managed*>(const_cast<Value *>(this));
}
- Q_ALWAYS_INLINE Heap::Base *heapObject() const {
- return isManaged() ? m() : nullptr;
+ QML_NEARLY_ALWAYS_INLINE Heap::Base *heapObject() const {
+ return isManagedOrUndefined() ? m() : nullptr;
}
static inline Value fromHeapObject(Heap::Base *m)
@@ -420,7 +422,7 @@ public:
template <typename T>
const T *as() const {
- if (!m() || !isManaged())
+ if (!isManaged())
return 0;
Q_ASSERT(m()->vtable());
@@ -451,6 +453,7 @@ public:
}
inline uint asArrayIndex() const;
+ inline bool asArrayIndex(uint &idx) const;
#ifndef V4_BOOTSTRAP
uint asArrayLength(bool *ok) const;
#endif
@@ -485,15 +488,13 @@ V4_ASSERT_IS_TRIVIAL(Value)
inline bool Value::isString() const
{
- if (!isManaged())
- return false;
- return m() && m()->vtable()->isString;
+ Heap::Base *b = heapObject();
+ return b && b->vtable()->isString;
}
inline bool Value::isObject() const
{
- if (!isManaged())
- return false;
- return m() && m()->vtable()->isObject;
+ Heap::Base *b = heapObject();
+ return b && b->vtable()->isObject;
}
inline bool Value::isPrimitive() const
@@ -531,6 +532,20 @@ inline uint Value::asArrayIndex() const
return UINT_MAX;
return idx;
}
+
+inline bool Value::asArrayIndex(uint &idx) const
+{
+ if (!isDouble()) {
+ if (isInteger() && int_32() >= 0) {
+ idx = (uint)int_32();
+ return true;
+ }
+ return false;
+ }
+ double d = doubleValue();
+ idx = (uint)d;
+ return (idx == d);
+}
#endif
inline
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index b19c36a5bd..622359a7d9 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -169,10 +169,8 @@ static Breakpoint qt_v4LastStop;
static QV4::Function *qt_v4ExtractFunction(QV4::ExecutionContext *context)
{
- QV4::Scope scope(context->engine());
- QV4::ScopedFunctionObject function(scope, context->getFunctionObject());
- if (function)
- return function->function();
+ if (QV4::Function *function = context->getFunction())
+ return function;
else
return context->d()->engine->globalCode;
}
diff --git a/src/qml/memory/qv4mm.cpp b/src/qml/memory/qv4mm.cpp
index 6ef2380561..606d3ec162 100644
--- a/src/qml/memory/qv4mm.cpp
+++ b/src/qml/memory/qv4mm.cpp
@@ -421,11 +421,9 @@ void MemoryManager::mark()
// managed objects in the loop down there doesn't make then end up as leftovers
// on the stack and thus always get collected.
for (PersistentValueStorage::Iterator it = m_weakValues->begin(); it != m_weakValues->end(); ++it) {
- if (!(*it).isManaged())
+ QObjectWrapper *qobjectWrapper = (*it).as<QObjectWrapper>();
+ if (!qobjectWrapper)
continue;
- if (!(*it).as<QObjectWrapper>())
- continue;
- QObjectWrapper *qobjectWrapper = static_cast<QObjectWrapper*>((*it).managed());
QObject *qobject = qobjectWrapper->object();
if (!qobject)
continue;
@@ -453,10 +451,8 @@ void MemoryManager::mark()
void MemoryManager::sweep(bool lastSweep)
{
for (PersistentValueStorage::Iterator it = m_weakValues->begin(); it != m_weakValues->end(); ++it) {
- if (!(*it).isManaged())
- continue;
Managed *m = (*it).managed();
- if (m->markBit())
+ if (!m || m->markBit())
continue;
// we need to call destroyObject on qobjectwrappers now, so that they can emit the destroyed
// signal before we start sweeping the heap
@@ -469,10 +465,8 @@ void MemoryManager::sweep(bool lastSweep)
// onDestruction handlers may have accessed other QObject wrappers and reset their value, so ensure
// that they are all set to undefined.
for (PersistentValueStorage::Iterator it = m_weakValues->begin(); it != m_weakValues->end(); ++it) {
- if (!(*it).isManaged())
- continue;
- Managed *m = (*it).as<Managed>();
- if (m->markBit())
+ Managed *m = (*it).managed();
+ if (!m || m->markBit())
continue;
(*it) = Primitive::undefinedValue();
}
diff --git a/src/qml/parser/qqmljs.g b/src/qml/parser/qqmljs.g
index a3ca9c44d0..9cd212015e 100644
--- a/src/qml/parser/qqmljs.g
+++ b/src/qml/parser/qqmljs.g
@@ -916,8 +916,40 @@ case $rule_number:
./
UiPropertyType: T_VAR ;
+/.
+case $rule_number: {
+ AST::UiQualifiedId *node = new (pool) AST::UiQualifiedId(stringRef(1));
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
UiPropertyType: T_RESERVED_WORD ;
+/.
+case $rule_number: {
+ AST::UiQualifiedId *node = new (pool) AST::UiQualifiedId(stringRef(1));
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
UiPropertyType: T_IDENTIFIER ;
+/.
+case $rule_number: {
+ AST::UiQualifiedId *node = new (pool) AST::UiQualifiedId(stringRef(1));
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+./
+
+UiPropertyType: UiPropertyType T_DOT T_IDENTIFIER ;
+/.
+case $rule_number: {
+ AST::UiQualifiedId *node = new (pool) AST::UiQualifiedId(sym(1).UiQualifiedId, stringRef(3));
+ node->identifierToken = loc(3);
+ sym(1).Node = node;
+} break;
+./
UiParameterListOpt: ;
/.
@@ -936,7 +968,7 @@ case $rule_number: {
UiParameterList: UiPropertyType JsIdentifier ;
/.
case $rule_number: {
- AST::UiParameterList *node = new (pool) AST::UiParameterList(stringRef(1), stringRef(2));
+ AST::UiParameterList *node = new (pool) AST::UiParameterList(sym(1).UiQualifiedId->finish(), stringRef(2));
node->propertyTypeToken = loc(1);
node->identifierToken = loc(2);
sym(1).Node = node;
@@ -946,7 +978,7 @@ case $rule_number: {
UiParameterList: UiParameterList T_COMMA UiPropertyType JsIdentifier ;
/.
case $rule_number: {
- AST::UiParameterList *node = new (pool) AST::UiParameterList(sym(1).UiParameterList, stringRef(3), stringRef(4));
+ AST::UiParameterList *node = new (pool) AST::UiParameterList(sym(1).UiParameterList, sym(3).UiQualifiedId->finish(), stringRef(4));
node->propertyTypeToken = loc(3);
node->commaToken = loc(2);
node->identifierToken = loc(4);
@@ -958,7 +990,7 @@ UiObjectMember: T_SIGNAL T_IDENTIFIER T_LPAREN UiParameterListOpt T_RPAREN T_AUT
UiObjectMember: T_SIGNAL T_IDENTIFIER T_LPAREN UiParameterListOpt T_RPAREN T_SEMICOLON ;
/.
case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(QStringRef(), stringRef(2));
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(nullptr, stringRef(2));
node->type = AST::UiPublicMember::Signal;
node->propertyToken = loc(1);
node->typeToken = loc(2);
@@ -973,7 +1005,7 @@ UiObjectMember: T_SIGNAL T_IDENTIFIER T_AUTOMATIC_SEMICOLON ;
UiObjectMember: T_SIGNAL T_IDENTIFIER T_SEMICOLON ;
/.
case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(QStringRef(), stringRef(2));
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(nullptr, stringRef(2));
node->type = AST::UiPublicMember::Signal;
node->propertyToken = loc(1);
node->typeToken = loc(2);
@@ -987,7 +1019,7 @@ UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT JsIdentifier T_
UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT JsIdentifier T_SEMICOLON ;
/.
case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(4), stringRef(6));
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(4).UiQualifiedId->finish(), stringRef(6));
node->typeModifier = stringRef(2);
node->propertyToken = loc(1);
node->typeModifierToken = loc(2);
@@ -1002,7 +1034,7 @@ UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_AUTOMATIC_SEMICOLON ;
UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_SEMICOLON ;
/.
case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(2), stringRef(3));
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(2).UiQualifiedId->finish(), stringRef(3));
node->propertyToken = loc(1);
node->typeToken = loc(2);
node->identifierToken = loc(3);
@@ -1015,7 +1047,7 @@ UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType JsIdentifier T_AUTOMATIC_SEM
UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType JsIdentifier T_SEMICOLON ;
/.
case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4));
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(3).UiQualifiedId->finish(), stringRef(4));
node->isDefaultMember = true;
node->defaultToken = loc(1);
node->propertyToken = loc(2);
@@ -1030,7 +1062,7 @@ UiObjectMember: T_DEFAULT T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT JsIde
UiObjectMember: T_DEFAULT T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT JsIdentifier T_SEMICOLON ;
/.
case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(5), stringRef(7));
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(5).UiQualifiedId->finish(), stringRef(7));
node->isDefaultMember = true;
node->defaultToken = loc(1);
node->typeModifier = stringRef(3);
@@ -1046,7 +1078,7 @@ case $rule_number: {
UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_COLON UiScriptStatement ;
/.
case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(2), stringRef(3),
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(2).UiQualifiedId->finish(), stringRef(3),
sym(5).Statement);
node->propertyToken = loc(1);
node->typeToken = loc(2);
@@ -1059,7 +1091,7 @@ case $rule_number: {
UiObjectMember: T_READONLY T_PROPERTY UiPropertyType JsIdentifier T_COLON UiScriptStatement ;
/.
case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4),
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(3).UiQualifiedId->finish(), stringRef(4),
sym(6).Statement);
node->isReadonlyMember = true;
node->readonlyToken = loc(1);
@@ -1074,7 +1106,7 @@ case $rule_number: {
UiObjectMember: T_DEFAULT T_PROPERTY UiPropertyType JsIdentifier T_COLON UiScriptStatement ;
/.
case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4),
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(3).UiQualifiedId->finish(), stringRef(4),
sym(6).Statement);
node->isDefaultMember = true;
node->defaultToken = loc(1);
@@ -1089,7 +1121,7 @@ case $rule_number: {
UiObjectMember: T_PROPERTY T_IDENTIFIER T_LT UiPropertyType T_GT JsIdentifier T_COLON T_LBRACKET UiArrayMemberList T_RBRACKET ;
/.
case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(4), stringRef(6));
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(4).UiQualifiedId->finish(), stringRef(6));
node->typeModifier = stringRef(2);
node->propertyToken = loc(1);
node->typeModifierToken = loc(2);
@@ -1116,7 +1148,7 @@ case $rule_number: {
UiObjectMember: T_PROPERTY UiPropertyType JsIdentifier T_COLON UiQualifiedId UiObjectInitializer ;
/.
case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(2), stringRef(3));
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(2).UiQualifiedId->finish(), stringRef(3));
node->propertyToken = loc(1);
node->typeToken = loc(2);
node->identifierToken = loc(3);
@@ -1139,7 +1171,7 @@ case $rule_number: {
UiObjectMember: T_READONLY T_PROPERTY UiPropertyType JsIdentifier T_COLON UiQualifiedId UiObjectInitializer ;
/.
case $rule_number: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4));
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(3).UiQualifiedId->finish(), stringRef(4));
node->isReadonlyMember = true;
node->readonlyToken = loc(1);
node->propertyToken = loc(2);
diff --git a/src/qml/parser/qqmljsast_p.h b/src/qml/parser/qqmljsast_p.h
index d31e464e99..9b06bf3d31 100644
--- a/src/qml/parser/qqmljsast_p.h
+++ b/src/qml/parser/qqmljsast_p.h
@@ -2537,11 +2537,11 @@ class QML_PARSER_EXPORT UiParameterList: public Node
public:
QQMLJS_DECLARE_AST_NODE(UiParameterList)
- UiParameterList(const QStringRef &t, const QStringRef &n):
+ UiParameterList(UiQualifiedId *t, const QStringRef &n):
type (t), name (n), next (this)
{ kind = K; }
- UiParameterList(UiParameterList *previous, const QStringRef &t, const QStringRef &n):
+ UiParameterList(UiParameterList *previous, UiQualifiedId *t, const QStringRef &n):
type (t), name (n)
{
kind = K;
@@ -2565,7 +2565,7 @@ public:
}
// attributes
- QStringRef type;
+ UiQualifiedId *type;
QStringRef name;
UiParameterList *next;
SourceLocation commaToken;
@@ -2578,12 +2578,12 @@ class QML_PARSER_EXPORT UiPublicMember: public UiObjectMember
public:
QQMLJS_DECLARE_AST_NODE(UiPublicMember)
- UiPublicMember(const QStringRef &memberType,
+ UiPublicMember(UiQualifiedId *memberType,
const QStringRef &name)
: type(Property), memberType(memberType), name(name), statement(0), binding(0), isDefaultMember(false), isReadonlyMember(false), parameters(0)
{ kind = K; }
- UiPublicMember(const QStringRef &memberType,
+ UiPublicMember(UiQualifiedId *memberType,
const QStringRef &name,
Statement *statement)
: type(Property), memberType(memberType), name(name), statement(statement), binding(0), isDefaultMember(false), isReadonlyMember(false), parameters(0)
@@ -2614,7 +2614,7 @@ public:
// attributes
enum { Signal, Property } type;
QStringRef typeModifier;
- QStringRef memberType;
+ UiQualifiedId *memberType;
QStringRef name;
Statement *statement; // initialized with a JS expression
UiObjectMember *binding; // initialized with a QML object or array.
diff --git a/src/qml/parser/qqmljsgrammar.cpp b/src/qml/parser/qqmljsgrammar.cpp
index fdcd94b472..b27f4af080 100644
--- a/src/qml/parser/qqmljsgrammar.cpp
+++ b/src/qml/parser/qqmljsgrammar.cpp
@@ -61,37 +61,38 @@ const short QQmlJSGrammar::lhs [] = {
118, 118, 118, 118, 118, 122, 123, 115, 114, 126,
126, 127, 127, 128, 128, 125, 111, 111, 111, 111,
130, 130, 130, 130, 130, 130, 130, 111, 138, 138,
- 138, 139, 139, 140, 140, 111, 111, 111, 111, 111,
+ 138, 138, 139, 139, 140, 140, 111, 111, 111, 111,
111, 111, 111, 111, 111, 111, 111, 111, 111, 111,
- 111, 111, 111, 111, 111, 124, 124, 124, 124, 124,
- 124, 124, 143, 143, 143, 143, 143, 143, 143, 143,
+ 111, 111, 111, 111, 111, 111, 124, 124, 124, 124,
+ 124, 124, 124, 143, 143, 143, 143, 143, 143, 143,
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
- 129, 145, 145, 145, 145, 144, 144, 149, 149, 149,
- 147, 147, 150, 150, 150, 150, 153, 153, 153, 153,
+ 143, 129, 145, 145, 145, 145, 144, 144, 149, 149,
+ 149, 147, 147, 150, 150, 150, 150, 153, 153, 153,
153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
- 153, 153, 153, 153, 153, 153, 153, 154, 154, 120,
- 120, 120, 120, 120, 157, 157, 158, 158, 158, 158,
- 156, 156, 159, 159, 160, 160, 161, 161, 161, 162,
- 162, 162, 162, 162, 162, 162, 162, 162, 162, 163,
- 163, 163, 163, 164, 164, 164, 165, 165, 165, 165,
- 166, 166, 166, 166, 166, 166, 166, 167, 167, 167,
- 167, 167, 167, 168, 168, 168, 168, 168, 169, 169,
- 169, 169, 169, 170, 170, 171, 171, 172, 172, 173,
- 173, 174, 174, 175, 175, 176, 176, 177, 177, 178,
- 178, 179, 179, 180, 180, 181, 181, 148, 148, 182,
- 182, 183, 183, 183, 183, 183, 183, 183, 183, 183,
- 183, 183, 183, 109, 109, 184, 184, 185, 185, 186,
- 186, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 131, 195, 195, 194,
- 194, 142, 142, 196, 196, 197, 197, 199, 199, 198,
- 200, 203, 201, 201, 204, 202, 202, 132, 133, 133,
- 134, 134, 187, 187, 187, 187, 187, 187, 187, 187,
- 188, 188, 188, 188, 189, 189, 189, 189, 190, 190,
- 135, 136, 205, 205, 208, 208, 206, 206, 209, 207,
- 191, 192, 192, 137, 137, 137, 210, 211, 193, 193,
- 212, 141, 155, 155, 213, 213, 152, 152, 151, 151,
- 214, 112, 112, 215, 215, 110, 110, 146, 146, 216};
+ 153, 153, 153, 153, 153, 153, 153, 153, 154, 154,
+ 120, 120, 120, 120, 120, 157, 157, 158, 158, 158,
+ 158, 156, 156, 159, 159, 160, 160, 161, 161, 161,
+ 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
+ 163, 163, 163, 163, 164, 164, 164, 165, 165, 165,
+ 165, 166, 166, 166, 166, 166, 166, 166, 167, 167,
+ 167, 167, 167, 167, 168, 168, 168, 168, 168, 169,
+ 169, 169, 169, 169, 170, 170, 171, 171, 172, 172,
+ 173, 173, 174, 174, 175, 175, 176, 176, 177, 177,
+ 178, 178, 179, 179, 180, 180, 181, 181, 148, 148,
+ 182, 182, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 109, 109, 184, 184, 185, 185,
+ 186, 186, 108, 108, 108, 108, 108, 108, 108, 108,
+ 108, 108, 108, 108, 108, 108, 108, 131, 195, 195,
+ 194, 194, 142, 142, 196, 196, 197, 197, 199, 199,
+ 198, 200, 203, 201, 201, 204, 202, 202, 132, 133,
+ 133, 134, 134, 187, 187, 187, 187, 187, 187, 187,
+ 187, 188, 188, 188, 188, 189, 189, 189, 189, 190,
+ 190, 135, 136, 205, 205, 208, 208, 206, 206, 209,
+ 207, 191, 192, 192, 137, 137, 137, 210, 211, 193,
+ 193, 212, 141, 155, 155, 213, 213, 152, 152, 151,
+ 151, 214, 112, 112, 215, 215, 110, 110, 146, 146,
+ 216};
const short QQmlJSGrammar::rhs [] = {
2, 2, 2, 2, 2, 2, 2, 1, 1, 1,
@@ -99,113 +100,114 @@ const short QQmlJSGrammar::rhs [] = {
3, 5, 5, 4, 4, 2, 2, 0, 1, 1,
2, 1, 3, 2, 3, 2, 1, 5, 4, 4,
1, 1, 1, 1, 1, 1, 1, 3, 1, 1,
- 1, 0, 1, 2, 4, 6, 6, 3, 3, 7,
- 7, 4, 4, 5, 5, 8, 8, 5, 6, 6,
- 10, 6, 7, 1, 1, 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, 7, 8,
- 1, 3, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 3, 0, 1, 2, 4, 6, 6, 3, 3,
+ 7, 7, 4, 4, 5, 5, 8, 8, 5, 6,
+ 6, 10, 6, 7, 1, 1, 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, 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, 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};
+ 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, 28, 0, 0, 0, 28, 0, 187, 254,
- 218, 226, 222, 166, 238, 214, 3, 151, 84, 167,
- 230, 234, 155, 184, 165, 170, 150, 204, 191, 0,
- 91, 92, 87, 0, 81, 76, 358, 0, 0, 0,
- 0, 89, 0, 0, 85, 88, 80, 0, 0, 77,
- 79, 82, 78, 90, 83, 0, 86, 0, 0, 180,
- 0, 0, 167, 186, 169, 168, 0, 0, 0, 182,
- 183, 181, 185, 0, 215, 0, 0, 0, 0, 205,
- 0, 0, 0, 0, 0, 0, 195, 0, 0, 0,
- 189, 190, 188, 193, 197, 196, 194, 192, 207, 206,
- 208, 0, 223, 0, 219, 0, 0, 161, 148, 160,
- 149, 117, 118, 119, 144, 120, 145, 121, 122, 123,
- 124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
- 146, 134, 135, 136, 137, 138, 139, 140, 141, 142,
- 143, 147, 0, 0, 159, 255, 162, 0, 163, 0,
- 164, 158, 0, 251, 244, 242, 249, 250, 248, 247,
- 253, 246, 245, 243, 252, 239, 0, 227, 0, 0,
- 231, 0, 0, 235, 0, 0, 161, 153, 0, 152,
- 0, 157, 171, 0, 347, 347, 348, 0, 345, 0,
- 346, 0, 349, 262, 269, 268, 276, 264, 0, 265,
- 0, 350, 0, 357, 266, 267, 84, 272, 270, 354,
- 351, 356, 273, 0, 284, 0, 0, 0, 0, 341,
- 0, 358, 256, 298, 0, 0, 0, 285, 0, 0,
- 274, 275, 0, 263, 271, 299, 300, 0, 347, 0,
- 0, 349, 0, 342, 343, 0, 331, 355, 0, 315,
- 316, 317, 318, 0, 311, 312, 313, 314, 339, 340,
- 0, 0, 0, 0, 0, 303, 304, 305, 260, 258,
- 220, 228, 224, 240, 216, 261, 0, 167, 232, 236,
- 209, 198, 0, 0, 217, 0, 0, 0, 0, 210,
- 0, 0, 0, 0, 0, 202, 200, 203, 201, 199,
- 212, 211, 213, 0, 225, 0, 221, 0, 259, 167,
- 0, 241, 256, 257, 0, 256, 0, 0, 307, 0,
- 0, 0, 309, 0, 229, 0, 0, 233, 0, 0,
- 237, 296, 0, 288, 297, 291, 0, 295, 0, 256,
- 289, 0, 256, 0, 0, 308, 0, 0, 0, 310,
- 0, 0, 0, 302, 0, 301, 84, 111, 359, 0,
- 0, 116, 278, 281, 0, 117, 284, 120, 145, 122,
- 123, 87, 127, 128, 81, 129, 132, 85, 88, 256,
- 82, 90, 135, 83, 137, 86, 139, 140, 285, 142,
- 143, 147, 0, 113, 112, 115, 99, 114, 98, 0,
- 108, 279, 277, 0, 0, 0, 349, 0, 109, 155,
- 156, 161, 0, 154, 0, 319, 320, 0, 347, 0,
- 0, 349, 0, 110, 0, 0, 0, 322, 327, 325,
- 328, 0, 0, 326, 327, 0, 323, 0, 324, 280,
- 330, 0, 280, 329, 0, 332, 333, 0, 280, 334,
- 335, 0, 0, 336, 0, 0, 0, 337, 338, 173,
- 172, 0, 0, 0, 306, 0, 0, 0, 321, 293,
- 286, 0, 294, 290, 0, 292, 282, 0, 283, 287,
- 0, 0, 349, 0, 344, 102, 0, 0, 106, 93,
- 0, 95, 104, 0, 96, 105, 107, 97, 103, 94,
- 0, 100, 177, 175, 179, 176, 174, 178, 352, 6,
- 353, 4, 2, 74, 101, 0, 0, 77, 79, 78,
- 37, 5, 0, 75, 0, 51, 50, 49, 0, 0,
- 51, 0, 0, 0, 66, 67, 0, 64, 0, 65,
- 41, 42, 43, 44, 46, 47, 70, 45, 0, 51,
- 0, 0, 0, 0, 0, 60, 0, 61, 0, 0,
- 32, 0, 0, 71, 33, 0, 36, 34, 30, 0,
- 35, 31, 0, 62, 0, 63, 155, 0, 68, 72,
- 0, 0, 0, 0, 155, 280, 0, 69, 84, 117,
- 284, 120, 145, 122, 123, 87, 127, 128, 129, 132,
- 85, 88, 256, 90, 135, 83, 137, 86, 139, 140,
- 285, 142, 143, 147, 73, 0, 58, 52, 59, 53,
- 0, 0, 0, 0, 55, 0, 56, 57, 54, 0,
- 0, 0, 0, 48, 0, 38, 39, 0, 40, 8,
- 0, 0, 9, 0, 11, 0, 10, 0, 1, 27,
- 15, 14, 26, 13, 12, 29, 7, 0, 18, 0,
- 19, 0, 24, 25, 0, 20, 21, 0, 22, 23,
- 16, 17, 360};
+ 0, 0, 28, 0, 0, 0, 28, 0, 188, 255,
+ 219, 227, 223, 167, 239, 215, 3, 152, 85, 168,
+ 231, 235, 156, 185, 166, 171, 151, 205, 192, 0,
+ 92, 93, 88, 0, 82, 77, 359, 0, 0, 0,
+ 0, 90, 0, 0, 86, 89, 81, 0, 0, 78,
+ 80, 83, 79, 91, 84, 0, 87, 0, 0, 181,
+ 0, 0, 168, 187, 170, 169, 0, 0, 0, 183,
+ 184, 182, 186, 0, 216, 0, 0, 0, 0, 206,
+ 0, 0, 0, 0, 0, 0, 196, 0, 0, 0,
+ 190, 191, 189, 194, 198, 197, 195, 193, 208, 207,
+ 209, 0, 224, 0, 220, 0, 0, 162, 149, 161,
+ 150, 118, 119, 120, 145, 121, 146, 122, 123, 124,
+ 125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
+ 147, 135, 136, 137, 138, 139, 140, 141, 142, 143,
+ 144, 148, 0, 0, 160, 256, 163, 0, 164, 0,
+ 165, 159, 0, 252, 245, 243, 250, 251, 249, 248,
+ 254, 247, 246, 244, 253, 240, 0, 228, 0, 0,
+ 232, 0, 0, 236, 0, 0, 162, 154, 0, 153,
+ 0, 158, 172, 0, 348, 348, 349, 0, 346, 0,
+ 347, 0, 350, 263, 270, 269, 277, 265, 0, 266,
+ 0, 351, 0, 358, 267, 268, 85, 273, 271, 355,
+ 352, 357, 274, 0, 285, 0, 0, 0, 0, 342,
+ 0, 359, 257, 299, 0, 0, 0, 286, 0, 0,
+ 275, 276, 0, 264, 272, 300, 301, 0, 348, 0,
+ 0, 350, 0, 343, 344, 0, 332, 356, 0, 316,
+ 317, 318, 319, 0, 312, 313, 314, 315, 340, 341,
+ 0, 0, 0, 0, 0, 304, 305, 306, 261, 259,
+ 221, 229, 225, 241, 217, 262, 0, 168, 233, 237,
+ 210, 199, 0, 0, 218, 0, 0, 0, 0, 211,
+ 0, 0, 0, 0, 0, 203, 201, 204, 202, 200,
+ 213, 212, 214, 0, 226, 0, 222, 0, 260, 168,
+ 0, 242, 257, 258, 0, 257, 0, 0, 308, 0,
+ 0, 0, 310, 0, 230, 0, 0, 234, 0, 0,
+ 238, 297, 0, 289, 298, 292, 0, 296, 0, 257,
+ 290, 0, 257, 0, 0, 309, 0, 0, 0, 311,
+ 0, 0, 0, 303, 0, 302, 85, 112, 360, 0,
+ 0, 117, 279, 282, 0, 118, 285, 121, 146, 123,
+ 124, 88, 128, 129, 82, 130, 133, 86, 89, 257,
+ 83, 91, 136, 84, 138, 87, 140, 141, 286, 143,
+ 144, 148, 0, 114, 113, 116, 100, 115, 99, 0,
+ 109, 280, 278, 0, 0, 0, 350, 0, 110, 156,
+ 157, 162, 0, 155, 0, 320, 321, 0, 348, 0,
+ 0, 350, 0, 111, 0, 0, 0, 323, 328, 326,
+ 329, 0, 0, 327, 328, 0, 324, 0, 325, 281,
+ 331, 0, 281, 330, 0, 333, 334, 0, 281, 335,
+ 336, 0, 0, 337, 0, 0, 0, 338, 339, 174,
+ 173, 0, 0, 0, 307, 0, 0, 0, 322, 294,
+ 287, 0, 295, 291, 0, 293, 283, 0, 284, 288,
+ 0, 0, 350, 0, 345, 103, 0, 0, 107, 94,
+ 0, 96, 105, 0, 97, 106, 108, 98, 104, 95,
+ 0, 101, 178, 176, 180, 177, 175, 179, 353, 6,
+ 354, 4, 2, 75, 102, 0, 0, 78, 80, 79,
+ 37, 5, 0, 76, 0, 51, 50, 49, 0, 0,
+ 51, 0, 0, 0, 52, 0, 67, 68, 0, 65,
+ 0, 66, 41, 42, 43, 44, 46, 47, 71, 45,
+ 0, 51, 0, 0, 0, 0, 0, 61, 0, 62,
+ 0, 0, 32, 0, 0, 72, 33, 0, 36, 34,
+ 30, 0, 35, 31, 0, 63, 0, 64, 156, 0,
+ 69, 73, 0, 0, 0, 0, 156, 281, 0, 70,
+ 85, 118, 285, 121, 146, 123, 124, 88, 128, 129,
+ 130, 133, 86, 89, 257, 91, 136, 84, 138, 87,
+ 140, 141, 286, 143, 144, 148, 74, 0, 59, 53,
+ 60, 54, 0, 0, 0, 0, 56, 0, 57, 58,
+ 55, 0, 0, 0, 0, 48, 0, 38, 39, 0,
+ 40, 8, 0, 0, 9, 0, 11, 0, 10, 0,
+ 1, 27, 15, 14, 26, 13, 12, 29, 7, 0,
+ 18, 0, 19, 0, 24, 25, 0, 20, 21, 0,
+ 22, 23, 16, 17, 361};
const short QQmlJSGrammar::goto_default [] = {
- 7, 648, 211, 198, 209, 521, 509, 643, 656, 508,
- 642, 646, 644, 652, 22, 649, 647, 645, 18, 520,
- 569, 559, 566, 561, 546, 193, 197, 199, 204, 234,
- 212, 231, 550, 620, 619, 203, 233, 26, 487, 486,
+ 7, 650, 211, 198, 209, 521, 509, 645, 658, 508,
+ 644, 648, 646, 654, 22, 651, 649, 647, 18, 520,
+ 571, 561, 568, 563, 548, 193, 197, 199, 204, 234,
+ 212, 231, 552, 622, 621, 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,
@@ -216,896 +218,874 @@ const short QQmlJSGrammar::goto_default [] = {
0};
const short QQmlJSGrammar::action_index [] = {
- 282, 1392, 2773, 2773, 2875, 1105, 102, 105, 129, -106,
- -1, 23, -23, 224, -106, 378, 26, -106, -106, 718,
- 39, 87, 207, 222, -106, -106, -106, 342, 290, 1392,
- -106, -106, -106, 502, -106, -106, 2569, 1880, 1392, 1392,
- 1392, -106, 1009, 1392, -106, -106, -106, 1392, 1392, -106,
- -106, -106, -106, -106, -106, 1392, -106, 1392, 1392, -106,
- 1392, 1392, 97, 236, -106, -106, 1392, 1392, 1392, -106,
- -106, -106, 233, 1392, 378, 1392, 1392, 1392, 1392, 461,
- 1392, 1392, 1392, 1392, 1392, 1392, 290, 1392, 1392, 1392,
- 144, 124, 115, 290, 290, 290, 290, 290, 461, 461,
- 363, 1392, -78, 1392, 81, 2365, 1392, 1392, -106, -106,
+ 246, 1285, 2768, 2768, 2666, 998, 98, 198, 86, -106,
+ 26, -15, -39, 234, -106, 314, 54, -106, -106, 714,
+ 89, 151, 212, 219, -106, -106, -106, 412, 279, 1285,
+ -106, -106, -106, 525, -106, -106, 2360, 1675, 1285, 1285,
+ 1285, -106, 902, 1285, -106, -106, -106, 1285, 1285, -106,
+ -106, -106, -106, -106, -106, 1285, -106, 1285, 1285, -106,
+ 1285, 1285, 103, 197, -106, -106, 1285, 1285, 1285, -106,
+ -106, -106, 214, 1285, 297, 1285, 1285, 1285, 1285, 392,
+ 1285, 1285, 1285, 1285, 1285, 1285, 213, 1285, 1285, 1285,
+ 96, 100, 101, 279, 279, 195, 190, 181, 402, 372,
+ 382, 1285, -10, 1285, 106, 2258, 1285, 1285, -106, -106,
-106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
-106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
-106, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- -106, -106, 143, 1392, -106, -106, 78, 60, -106, 1392,
- -106, -106, 1392, -106, -106, -106, -106, -106, -106, -106,
- -106, -106, -106, -106, -106, -106, 1392, -25, 1392, 1392,
- 92, 85, 1392, -106, 2365, 1392, 1392, -106, 146, -106,
- 46, -106, -106, 52, 359, 362, 104, 86, -106, 438,
- -106, 56, 2773, -106, -106, -106, -106, -106, 164, -106,
- 393, -106, 41, -106, -106, -106, 53, -106, -106, -106,
- 2773, -106, -106, 600, -106, 597, 147, 2875, 64, 82,
- 48, 3079, 1392, -106, 90, 1392, 66, -106, 33, 68,
- -106, -106, 538, -106, -106, -106, -106, 88, 538, 35,
- 40, 2773, 47, -106, -106, 2875, -106, -106, 151, -106,
- -106, -106, -106, 145, -106, -106, -106, -106, -106, -106,
- 72, 65, 1392, 107, 155, -106, -106, -106, 1586, -106,
- 58, 59, 50, -106, 279, 75, 62, 821, 89, 93,
- 295, 234, 447, 1392, 291, 1392, 1392, 1392, 1392, 316,
- 1392, 1392, 1392, 1392, 1392, 290, 290, 290, 290, 290,
- 322, 326, 332, 1392, 50, 1392, 74, 1392, -106, 718,
- 1392, -106, 1392, 55, 42, 1392, 38, 2875, -106, 1392,
- 132, 2875, -106, 1392, 84, 1392, 1392, 209, 106, 1392,
- -106, 80, 130, 77, -106, -106, 1392, -106, 407, 1392,
- -106, -48, 1392, -43, 2875, -106, 1392, 126, 2875, -106,
- 1392, 128, 2875, 3, 2875, -106, 8, -106, 6, -34,
- 15, -106, -106, 2875, -31, 615, 18, 546, 100, 1392,
- 2875, 19, -8, 493, 2467, -16, 707, 5, 4, 1491,
- 2467, 2, -28, 0, 1392, -2, -30, 1392, -5, 1392,
- -32, -26, 2671, -106, -106, -106, -106, -106, -106, 1392,
- -106, -106, -106, 21, -17, 22, 2773, -6, -106, 206,
- -106, 1392, -10, -106, 91, -106, -106, 17, 538, 30,
- 31, 2773, -3, -106, 1392, 111, 34, -106, 24, -106,
- 25, 101, 1392, -106, 27, 28, -106, -22, -106, 2875,
- -106, 120, 2875, -106, 227, -106, -106, 125, 2875, 16,
- -106, 12, 13, -106, 453, -20, 14, -106, -106, -106,
- -106, 1392, 160, 2875, -106, 1392, 113, 2875, -106, 37,
- -106, 171, -106, -106, 1392, -106, -106, 441, -106, -106,
- -33, -27, 2773, -4, -106, -106, 109, 1684, -106, -106,
- 1978, -106, -106, 1782, -106, -106, -106, -106, -106, -106,
- 127, -106, -106, -106, -106, -106, -106, -106, -106, -106,
- 2773, -106, -106, -106, 148, -24, 915, 176, -29, 10,
- -106, -106, 240, -106, 208, 1, -106, -106, 349, 195,
- -106, 20, 339, 135, -106, -106, 191, -106, 2073, -106,
- -106, -106, -106, -106, -106, -106, -106, -106, 221, 29,
- 538, 152, 7, 538, 167, -106, 11, -106, 915, 114,
- -106, 32, 915, -106, -106, 1201, -106, -106, -106, 1297,
- -106, -106, 169, -106, 2073, -106, 280, -15, -106, -106,
- 181, 457, 9, 2263, 271, 2977, 83, -106, 103, 615,
- 67, 557, 116, 1392, 2875, 61, 43, 526, 45, 1009,
- 51, 73, 1491, 71, 49, 69, 1392, 63, 44, 1392,
- 54, 1392, 36, 57, -106, 213, -106, 217, -106, 79,
- 70, 343, 194, 346, -106, 96, -106, -106, -106, 2168,
- 799, 1880, 76, -106, 134, -106, -106, -15, -106, -106,
- 915, 915, 112, 915, -106, 259, -106, 153, -106, -106,
- 110, 99, -106, -106, -106, -106, -106, 450, -106, 157,
- -106, 98, -106, -106, 538, -106, -106, 139, -106, -106,
- -106, -106, -106,
+ -106, -106, 136, 1285, -106, -106, 65, 29, -106, 1285,
+ -106, -106, 1285, -106, -106, -106, -106, -106, -106, -106,
+ -106, -106, -106, -106, -106, -106, 1285, -46, 1285, 1285,
+ 30, 27, 1285, -106, 2258, 1285, 1285, -106, 130, -106,
+ -31, -106, -106, -16, 520, 520, 71, 21, -106, 421,
+ -106, 38, 2768, -106, -106, -106, -106, -106, 237, -106,
+ 520, -106, -52, -106, -106, -106, 23, -106, -106, -106,
+ 2768, -106, -106, 596, -106, 588, 141, 2666, 2, 1,
+ -1, 2972, 1285, -106, 13, 1285, 28, -106, -28, -30,
+ -106, -106, 435, -106, -106, -106, -106, 60, 520, 52,
+ 67, 2768, 64, -106, -106, 2666, -106, -106, 126, -106,
+ -106, -106, -106, 73, -106, -106, -106, -106, -106, -106,
+ -18, 34, 1285, 156, 168, -106, -106, -106, 1479, -106,
+ 79, 40, 48, -106, 312, 75, 42, 672, 80, 143,
+ 331, 279, 442, 1285, 316, 1285, 1285, 1285, 1285, 341,
+ 1285, 1285, 1285, 1285, 1285, 279, 360, 360, 196, 225,
+ 443, 357, 351, 1285, -4, 1285, 63, 1285, -106, 714,
+ 1285, -106, 1285, 102, 68, 1285, 62, 2666, -106, 1285,
+ 147, 2666, -106, 1285, 56, 1285, 1285, 91, 87, 1285,
+ -106, 81, 149, 74, -106, -106, 1285, -106, 439, 1285,
+ -106, -44, 1285, -42, 2666, -106, 1285, 153, 2666, -106,
+ 1285, 154, 2666, 10, 2666, -106, 0, -106, 15, -54,
+ 92, -106, -106, 2666, -50, 539, -7, 536, 121, 1285,
+ 2666, 5, -8, 445, 2462, 24, 902, 51, 50, 1384,
+ 2462, 47, 20, 46, 1285, 44, 19, 1285, 41, 1285,
+ 3, -5, 2564, -106, -106, -106, -106, -106, -106, 1285,
+ -106, -106, -106, 6, -17, 11, 2768, -9, -106, 249,
+ -106, 1285, -13, -106, 105, -106, -106, -12, 520, -41,
+ -20, 2768, -45, -106, 1285, 115, 12, -106, 36, -106,
+ 31, 122, 1285, -106, 58, 4, -106, -51, -106, 2666,
+ -106, 146, 2666, -106, 235, -106, -106, 140, 2666, 93,
+ -106, 84, 76, -106, 520, 17, 33, -106, -106, -106,
+ -106, 1285, 134, 2666, -106, 1285, 125, 2666, -106, 55,
+ -106, 163, -106, -106, 1285, -106, -106, 520, -106, -106,
+ 7, 45, 2768, 32, -106, -106, 120, 1773, -106, -106,
+ 1577, -106, -106, 1871, -106, -106, -106, -106, -106, -106,
+ 113, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ 2768, -106, -106, -106, 109, 35, 808, 206, 49, 61,
+ -106, -106, 229, -106, 203, 37, -106, -106, 611, 183,
+ -106, 124, 39, 389, -106, 97, -106, -106, 252, -106,
+ 2061, -106, -106, -106, -106, -106, -106, -106, -106, -106,
+ 269, -23, 611, 243, 180, 424, 232, -106, 16, -106,
+ 808, 162, -106, 22, 808, -106, -106, 1190, -106, -106,
+ -106, 1094, -106, -106, 248, -106, 2061, -106, 305, -24,
+ -106, -106, 215, 457, 18, 2156, 292, 2870, -11, -106,
+ 14, 599, 9, 528, 119, 1285, 2666, 8, 70, 514,
+ 72, 902, 95, 90, 1384, 85, 59, 77, 1285, 110,
+ 83, 1285, 104, 1285, 82, 78, -106, 205, -106, 236,
+ -106, 57, 25, 611, 167, 517, -106, 107, -106, -106,
+ -106, 1966, 808, 1675, 43, -106, 155, -106, -106, 53,
+ -106, -106, 808, 808, 108, 808, -106, 289, -106, 117,
+ -106, -106, 150, 157, -106, -106, -106, -106, -106, 364,
+ -106, 226, -106, 69, -106, -106, 432, -106, -106, 88,
+ -106, -106, -106, -106, -106,
- -111, 6, 66, 84, 80, 306, 43, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -23,
+ -111, 8, 65, 83, 84, 317, 1, -111, -111, -111,
+ -111, -111, -111, -111, -111, -111, -111, -111, -111, -77,
-111, -111, -111, -111, -111, -111, -111, -111, -111, 96,
- -111, -111, -111, 51, -111, -111, 60, 35, 61, 95,
- 92, -111, 93, 72, -111, -111, -111, 86, 85, -111,
- -111, -111, -111, -111, -111, 82, -111, 81, 136, -111,
- 77, 76, -111, -111, -111, -111, 73, 89, 127, -111,
- -111, -111, -111, 125, -111, 124, 54, 120, 99, -111,
- 113, 111, 110, 109, 107, 103, -111, 102, 100, 119,
- -111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, 52, -111, 49, -111, 62, 44, 28, -111, -111,
+ -111, -111, -111, 2, -111, -111, -5, -28, 12, 106,
+ 95, -111, 61, 55, -111, -111, -111, 63, 70, -111,
+ -111, -111, -111, -111, -111, 54, -111, 172, 177, -111,
+ 180, 191, -111, -111, -111, -111, 197, 202, 203, -111,
+ -111, -111, -111, 210, -111, 209, 195, 109, 116, -111,
+ 146, 125, 126, 127, 135, 138, -111, 141, 144, 110,
-111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
+ -111, 150, -111, 155, -111, 192, 4, -33, -111, -111,
-111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
-111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, 25, -111, -111, -111, -111, -111, 18,
- -111, -111, 16, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, 57, -111, 40, 13,
- -111, -111, 4, -111, 269, 42, 70, -111, -111, -111,
- -111, -111, -111, -111, 26, 69, -111, -111, -111, 22,
- -111, -111, 15, -111, -111, -111, -111, -111, -111, -111,
- 14, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- 75, -111, -111, 10, -111, 32, -111, 74, -111, 24,
- -111, 225, 46, -111, -111, 50, 41, -111, -111, -111,
- -111, -111, 47, -111, -111, -111, -111, -111, 214, -111,
- -111, 224, -111, -111, -111, 246, -111, -111, -111, -111,
-111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, 27, -111, -111, -111, -111, -111, 117, -111,
+ -111, -111, -111, -9, -111, -111, -111, -111, -111, 7,
+ -111, -111, 40, -111, -111, -111, -111, -111, -111, -111,
+ -111, -111, -111, -111, -111, -111, 99, -111, 52, 31,
+ -111, -111, 30, -111, 253, 44, 87, -111, -111, -111,
+ -111, -111, -111, -111, 45, 86, -111, -111, -111, 41,
+ -111, -111, 5, -111, -111, -111, -111, -111, -111, -111,
+ 50, -111, -111, -111, -111, -111, -111, -111, -111, -111,
+ 154, -111, -111, 26, -111, 49, -111, 330, -111, 28,
+ -111, 248, 27, -111, -111, 124, 51, -111, -111, -111,
+ -111, -111, 46, -111, -111, -111, -111, -111, 196, -111,
+ -111, 185, -111, -111, -111, 194, -111, -111, -111, -111,
-111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- -111, -111, 17, 236, -111, 239, 242, 250, 254, -111,
- 199, 171, 200, 202, 203, -111, -111, -111, -111, -111,
- -111, -111, -111, 264, -111, 265, -111, 213, -111, -111,
- 267, -111, 260, -111, -111, 262, -111, 253, -111, 45,
- -111, 83, -111, 222, -111, 223, 226, -111, -111, 229,
- -111, -111, -111, -111, -111, -111, 238, -111, 105, 118,
- -111, -111, 129, -111, 87, -111, 36, -111, 183, -111,
- 34, -111, 187, -111, 192, -111, -111, -111, -111, -111,
- -111, -111, -111, 193, -111, 9, -111, 23, -111, 144,
- 195, -111, -111, 20, 184, -111, 189, -111, -111, 31,
- 164, -111, -111, -111, 21, -111, 11, 158, -111, 161,
- -111, -111, 188, -111, -111, -111, -111, -111, -111, 33,
- -111, -111, -111, -111, -111, -111, 191, -111, -111, -111,
- -111, 176, -111, -111, -111, -111, -111, -111, 198, -111,
- -111, 201, -111, -111, 65, -111, -111, -111, -111, -111,
- -29, -111, 58, -111, -27, -111, -111, -111, -111, 268,
- -111, -111, 266, -111, -111, -111, -111, -111, 219, -46,
- -111, -111, 38, -111, 39, -111, 37, -111, -111, -111,
- -111, 53, -111, 220, -111, 48, -111, 221, -111, -111,
- -111, -111, -111, -111, 30, -111, -111, 137, -111, -111,
- -111, -111, 206, -111, -111, -111, -111, 29, -111, -111,
- 207, -111, -111, 1, -111, -111, -111, -111, -111, -111,
+ -111, -111, 15, -111, -111, -111, -111, -111, 74, -111,
-111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- 216, -111, -111, -111, -111, -111, 0, -111, -111, -111,
- -111, -111, -111, -111, -30, -111, -111, -111, -11, -13,
- -111, -111, 5, -111, -111, -111, -111, -111, 336, -111,
+ -111, -111, -16, 230, -111, 233, 269, 251, 265, -111,
+ 80, 81, 82, 88, 89, -111, -111, -111, -111, -111,
+ -111, -111, -111, 216, -111, 255, -111, 259, -111, -111,
+ 223, -111, 68, -111, -111, 217, -111, 236, -111, 24,
+ -111, 244, -111, 227, -111, 226, 257, -111, -111, 263,
+ -111, -111, -111, -111, -111, -111, 249, -111, 113, 163,
+ -111, -111, 212, -111, 173, -111, 48, -111, 211, -111,
+ 53, -111, 206, -111, 204, -111, -111, -111, -111, -111,
+ -111, -111, -111, 199, -111, 23, -111, 25, -111, 134,
+ 175, -111, -111, 37, 200, -111, 222, -111, -111, 57,
+ 56, -111, -111, -111, 124, -111, 32, 43, -111, 105,
+ -111, -111, 139, -111, -111, -111, -111, -111, -111, 38,
+ -111, -111, -111, -111, -111, -111, 75, -111, -111, -111,
+ -111, 71, -111, -111, -111, -111, -111, -111, 72, -111,
+ -111, 85, -111, -111, 59, -111, -111, -111, -111, -111,
+ -37, -111, 62, -111, -58, -111, -111, -111, -111, 286,
+ -111, -111, 250, -111, -111, -111, -111, -111, 153, -57,
+ -111, -111, 33, -111, 34, -111, 36, -111, -111, -111,
+ -111, 47, -111, 77, -111, 29, -111, 67, -111, -111,
+ -111, -111, -111, -111, 42, -111, -111, 214, -111, -111,
+ -111, -111, 229, -111, -111, -111, -111, 35, -111, -111,
+ 145, -111, -111, 3, -111, -111, -111, -111, -111, -111,
-111, -111, -111, -111, -111, -111, -111, -111, -111, -111,
- 7, -3, -111, -8, -111, -111, -111, -111, 174, -111,
- -111, -111, 172, -111, -111, 323, -111, -111, -111, 334,
- -111, -111, -111, -111, 372, -111, -111, -5, -111, -111,
- -24, -7, -111, 439, -111, 248, -9, -111, -111, 8,
- -111, -17, -111, 179, 342, -111, -111, 2, -111, 190,
- -111, -111, 19, -111, -111, -111, 12, -111, -20, 68,
- -111, 63, -111, -111, -111, -111, -111, -26, -111, -111,
- -111, 3, -1, 79, -111, -111, -111, -111, -111, 354,
- 67, 313, -4, -111, -111, -111, -111, -19, -111, -111,
- -14, -10, 88, 233, -111, -111, -111, -111, -111, -111,
- -111, -111, -111, -111, -111, -111, -111, -6, -111, -111,
- -111, -111, -111, -111, -2, -111, -111, -111, -111, -111,
- -111, -111, -111};
+ 207, -111, -111, -111, -111, -111, 39, -111, -111, -111,
+ -111, -111, -111, -111, -24, -111, -111, -111, -12, -27,
+ -111, -111, -111, -14, -111, -111, -111, -111, -111, -111,
+ 333, -111, -111, -111, -111, -111, -111, -111, -111, -111,
+ -111, -111, 6, 22, -111, 20, -111, -111, -111, -111,
+ 159, -111, -111, -111, 246, -111, -111, 332, -111, -111,
+ -111, 436, -111, -111, -111, -111, 388, -111, -111, 18,
+ -111, -111, -6, 19, -111, 352, -111, 225, 14, -111,
+ -111, 13, -111, 11, -111, 167, 136, -111, -111, 10,
+ -111, 64, -111, -111, 9, -111, -111, -111, 124, -111,
+ 0, 69, -111, 60, -111, -111, -111, -111, -111, -10,
+ -111, -111, -111, -1, -11, -2, -111, -111, -111, -111,
+ -111, 370, 142, 315, -3, -111, -111, -111, -111, 17,
+ -111, -111, -13, 21, 133, 221, -111, -111, -111, -111,
+ -111, -111, -111, -111, -111, -111, -111, -111, -111, 16,
+ -111, -111, -111, -111, -111, -111, -15, -111, -111, -111,
+ -111, -111, -111, -111, -111};
const short QQmlJSGrammar::action_info [] = {
- 73, 103, -141, 448, 461, -138, 482, -136, 424, -114,
- 465, -115, -133, 342, 392, 245, 583, 344, 565, 354,
- 350, 398, 399, 101, 402, -144, -125, 481, 268, 432,
- 432, 553, 432, 438, 143, 439, 452, 580, 529, 615,
- 456, 166, 524, 405, 532, 558, 448, 448, 454, 408,
- 413, 484, 423, 418, 474, 406, 103, 404, -133, 283,
- 245, -141, 0, 143, 421, 565, 551, 428, -125, 461,
- -138, 101, 461, 241, -144, 283, -136, 448, -114, 268,
- -115, 350, 73, 307, 350, 424, 149, 622, 185, 192,
- 420, 323, 172, 465, 166, 240, 244, 336, 317, 448,
- 268, 262, 243, 315, 465, 672, 181, 303, 346, 565,
- 245, 435, 189, 329, 174, 143, 565, 490, 184, 143,
- 151, 143, 562, 312, 238, 174, 424, 442, 143, 305,
- 625, 451, 303, 175, 143, 143, 143, 168, 338, 64,
- 143, 169, 562, 325, 175, 452, 191, 326, 0, 261,
- 65, 143, 416, 415, 143, 60, 436, 627, 626, 663,
- 662, 259, 258, 174, 60, 491, 61, 264, 143, 60,
- 563, 426, 143, 467, 556, 61, 574, 259, 258, 477,
- 61, 530, 175, 0, 60, 0, 348, 501, 352, 0,
- 635, 339, 321, 640, 641, 61, 535, 534, 538, 144,
- 669, 668, 179, 640, 641, 549, 257, 256, 259, 258,
- 530, 323, 252, 251, 671, 670, 267, 265, 666, 665,
- 463, 174, 174, 530, 530, 236, 235, 527, 557, 555,
- 575, 573, 478, 476, 66, 143, 174, 525, 526, 105,
- 175, 175, 411, 176, 266, 66, 530, 629, 66, 617,
- 664, 527, 539, 537, 0, 175, 527, 411, 106, 87,
- 107, 88, 526, 0, 0, 0, 0, 526, 0, 527,
- 527, 0, 89, 565, 618, 616, 0, 0, 0, 67,
- 526, 526, 0, 527, 0, 68, 174, 0, 446, 445,
- 67, 0, 527, 67, 526, 174, 68, 285, 286, 68,
- 0, 0, 0, 526, -101, 175, 659, 176, 0, 285,
- 286, 0, 0, -101, 175, 87, 176, 88, 290, 291,
- 660, 658, 0, 0, 287, 288, 0, 292, 89, 0,
- 293, 0, 294, 0, 630, 0, 287, 288, 0, 290,
- 291, 0, 0, 0, 0, 290, 291, 0, 292, 290,
- 291, 293, 657, 294, 292, 290, 291, 293, 292, 294,
- 0, 293, 0, 294, 292, 80, 81, 293, 35, 294,
- 0, 0, 35, 82, 83, 35, 0, 84, 35, 85,
- 6, 5, 4, 1, 3, 2, 80, 81, 35, 0,
- 0, 35, 0, 0, 82, 83, 75, 76, 84, 0,
- 85, 0, 0, 0, 0, 49, 52, 50, 0, 49,
- 52, 50, 49, 52, 50, 49, 52, 50, 0, 0,
- 0, 0, 35, 77, 78, 49, 52, 50, 49, 52,
- 50, 0, 0, 46, 34, 51, 35, 46, 34, 51,
+ -145, 398, 101, 244, 438, 402, 465, 245, 461, 567,
+ 423, 439, -126, 421, 553, -126, -145, 342, 344, 420,
+ 185, 245, 567, 392, 418, 585, 354, 73, 268, 181,
+ 245, 465, 166, 101, 172, 350, 432, 184, 268, 461,
+ 103, 432, 404, 405, 406, 428, 408, 413, -142, 424,
+ 560, -139, 448, -137, -115, 567, 424, -116, -134, 261,
+ 350, 448, 143, 432, 283, 624, 448, 481, 534, 103,
+ 262, 192, 474, 149, 529, 305, 567, 456, 482, 189,
+ 283, 191, 323, 307, -137, 627, 567, 484, 303, 151,
+ 617, 166, -115, 323, 329, 424, 238, -116, 336, 399,
+ 241, 524, -134, 312, 303, 346, 268, 73, 350, 448,
+ 143, -142, 240, 452, 465, 582, 448, -139, 461, 243,
+ 454, 143, 317, 143, 174, 0, 60, 305, 490, 315,
+ 665, 664, 435, 143, 257, 256, 60, 61, 143, 532,
+ 60, 60, 143, 175, 143, 64, 451, 61, 533, 671,
+ 670, 61, 61, 442, 143, 143, 65, 338, 537, 536,
+ 452, 143, 143, 564, 143, 174, 416, 415, 629, 628,
+ 564, 477, 174, 501, 0, 426, 491, 436, 673, 672,
+ 259, 258, 259, 258, 175, 467, 179, 252, 251, 642,
+ 643, 175, 144, 325, 463, 532, 530, 326, 674, 642,
+ 643, 168, 259, 258, 555, 169, 87, 321, 88, 66,
+ 339, 637, 530, 348, 352, 87, 264, 88, 565, 89,
+ 87, 87, 88, 88, 478, 476, 66, 174, 89, 267,
+ 265, 66, 525, 89, 89, 551, 631, 0, 87, 558,
+ 88, 619, 527, 143, 530, 143, 175, 0, 176, 105,
+ 87, 89, 88, 526, 67, 576, 0, 266, 527, 540,
+ 68, 0, 567, 89, 174, 530, 620, 618, 106, 526,
+ 107, 67, 530, 0, 0, 0, 67, 68, 527, 0,
+ 0, 527, 68, 175, 174, 411, 0, 668, 667, 526,
+ 527, 0, 526, 559, 557, 0, 446, 445, 236, 235,
+ 0, 526, 0, 175, 87, 411, 88, 174, 0, 577,
+ 575, 527, 0, 541, 539, 75, 76, 89, 527, 666,
+ 174, 0, 526, 632, 0, -102, 175, 0, 176, 526,
+ 285, 286, 75, 76, 285, 286, 661, 0, -102, 175,
+ 0, 176, 77, 78, 6, 5, 4, 1, 3, 2,
+ 662, 660, 0, 0, 290, 291, 0, 287, 288, 77,
+ 78, 287, 288, 292, 290, 291, 293, 0, 294, 0,
+ 0, 0, 0, 292, 290, 291, 293, 0, 294, 0,
+ 290, 291, 659, 292, 0, 87, 293, 88, 294, 292,
+ 0, 0, 293, 35, 294, 80, 81, 0, 89, 0,
+ 0, 0, 0, 82, 83, 80, 81, 84, 0, 85,
+ 0, 0, 0, 82, 83, 80, 81, 84, 35, 85,
+ 0, 0, 0, 82, 83, 80, 81, 84, 0, 85,
+ 49, 52, 50, 82, 83, 80, 81, 84, 0, 85,
+ 0, 0, 0, 82, 83, 0, 0, 84, 0, 85,
+ 35, 0, 0, 35, 0, 49, 52, 50, 46, 34,
+ 51, 35, 0, 0, 35, 0, 290, 291, 35, 0,
+ 0, 35, 532, 0, 35, 292, 0, 0, 293, 0,
+ 294, 184, 0, 46, 34, 51, 35, 49, 52, 50,
+ 49, 52, 50, 0, 0, 0, 0, 0, 49, 52,
+ 50, 49, 52, 50, 0, 49, 52, 50, 49, 52,
+ 50, 49, 52, 50, 0, 46, 34, 51, 46, 34,
+ 51, 0, 0, 49, 52, 50, 46, 34, 51, 46,
+ 34, 51, 532, 46, 34, 51, 46, 34, 51, 46,
+ 34, 51, 0, 35, 0, 0, 35, 0, 0, 35,
+ 184, 46, 34, 51, 35, 0, 0, 35, 0, 0,
+ 0, 184, 0, 0, 0, 35, 0, 0, 35, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 49, 52, 50, 49, 52, 50, 49, 52, 50, 255,
+ 254, 49, 52, 50, 49, 52, 50, 255, 254, 0,
+ 250, 249, 49, 52, 50, 49, 52, 50, 46, 34,
+ 51, 46, 34, 51, 46, 34, 51, 35, 0, 46,
+ 34, 51, 46, 34, 51, 35, 532, 0, 35, 0,
46, 34, 51, 46, 34, 51, 0, 0, 0, 0,
- 0, 0, 0, 46, 34, 51, 46, 34, 51, 49,
- 52, 50, 0, 0, 0, 0, 0, 35, 0, 0,
- 35, 0, 0, 49, 52, 50, 35, 0, 0, 35,
- 0, 0, 35, 0, 80, 81, 35, 46, 34, 51,
- 0, 0, 82, 83, 0, 0, 84, 0, 85, 0,
- 0, 46, 34, 51, 49, 52, 50, 49, 52, 50,
- 0, 0, 0, 49, 52, 50, 49, 52, 50, 49,
- 52, 50, 35, 49, 52, 50, 0, 0, 0, 184,
- 0, 35, 46, 34, 51, 46, 34, 51, 184, 0,
- 0, 46, 34, 51, 46, 34, 51, 46, 34, 51,
- 0, 46, 34, 51, 0, 35, 0, 0, 0, 49,
- 52, 50, 184, 0, 0, 0, 0, 35, 49, 52,
- 50, 0, 0, 0, 0, 35, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 35, 46, 34, 51,
- 0, 0, 49, 52, 50, 0, 46, 34, 51, 0,
- 0, 0, 0, 0, 49, 52, 50, 255, 254, 0,
- 0, 0, 49, 52, 50, 0, 0, 0, 255, 254,
- 46, 34, 51, 49, 52, 50, 35, 0, 0, 35,
+ 35, 0, 0, 0, 0, 0, 0, 0, 0, 255,
+ 254, 0, 0, 0, 49, 52, 50, 250, 249, 0,
+ 250, 249, 49, 52, 50, 49, 52, 50, 0, 0,
+ 0, 0, 0, 0, 0, 153, 0, 49, 52, 50,
+ 0, 0, 46, 34, 51, 154, 0, 0, 0, 155,
+ 46, 34, 51, 46, 34, 51, 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, 164, 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,
+ 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, 516, 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, 0, 46, 34, 51, 0, 0, 0, 0, 0,
- 46, 34, 51, 0, 35, 0, 0, 0, 0, 0,
- 0, 46, 34, 51, 0, 0, 0, 0, 255, 254,
- 0, 250, 249, 49, 52, 50, 49, 52, 50, 0,
- 0, 0, 0, 0, 0, 0, 250, 249, 0, 0,
- 0, 49, 52, 50, 0, 0, 0, 0, 0, 0,
- 0, 46, 34, 51, 46, 34, 51, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 46,
- 34, 51, 0, 0, 0, 0, 0, 0, 0, 30,
- 31, 153, 0, 0, 0, 0, 0, 0, 0, 33,
- 0, 154, 0, 0, 0, 155, 35, 0, 0, 0,
- 36, 37, 0, 38, 156, 0, 157, 0, 0, 0,
- 42, 0, 0, 0, 45, 0, 0, 158, 0, 159,
- 64, 0, 0, 0, 0, 0, 0, 160, 0, 0,
- 161, 65, 53, 49, 52, 50, 162, 54, 0, 0,
- 0, 0, 163, 0, 0, 0, 0, 0, 44, 56,
- 32, 0, 0, 0, 41, 0, 0, 0, 164, 0,
- 0, 46, 34, 51, 0, 0, 0, 0, 0, 0,
- 0, 30, 31, 0, 0, 0, 0, 0, 0, 0,
- 0, 33, 0, 0, 153, 0, 0, 0, 35, 0,
- 0, 0, 36, 37, 154, 38, 0, 0, 155, 0,
- 0, 0, 516, 0, 0, 0, 45, 156, 0, 157,
- 0, 0, 319, 0, 0, 0, 0, 0, 0, 0,
- 158, 0, 159, 64, 53, 49, 52, 50, 0, 54,
- 160, 0, 0, 161, 65, 0, 0, 0, 0, 162,
- 44, 56, 32, 0, 0, 163, 41, 0, 0, 0,
- 0, 0, 0, 46, 34, 51, 0, 0, 0, 0,
- 0, 164, 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, 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, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 30, 31, 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, 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, 572,
+ 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, 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, 569, 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, 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, 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, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 44, 56, 32, 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, 0, 46,
34, 51, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 30, 31, 0, 0, 0, 0, 0, 0, 0,
+ 0, -135, 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, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 55, 0, 57, 282, 58, 0, 0, 0, 0,
44, 56, 32, 0, 0, 0, 41, 0, 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, 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,
+ 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, 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,
- 53, 517, 519, 518, 0, 54, 0, 0, 0, 0,
- 227, 0, 0, 0, 0, 0, 44, 56, 32, 214,
+ 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, 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, 567, 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, 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, 570, 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,
- 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, 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, 0, 46, 34, 51, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, -134, 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, 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, 0, 0, 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, 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, 0, 0, 0, 36,
+ 0, 0, 0, 0, 0, 35, 220, 0, 0, 587,
+ 633, 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, 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, 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, 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, 587,
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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 585, 631, 0, 38, 0, 0, 0, 39, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 585, 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, 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, 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,
- 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, 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, 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, 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, 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, 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, 0, 46,
- 34, 51, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 589, 112, 113, 0, 0, 591, 117, 593, 30,
- 31, 594, 0, 120, 0, 0, 0, 122, 596, 597,
- 0, 0, 0, 0, 0, 0, 35, 598, 126, 127,
- 221, 37, 0, 38, 0, 0, 0, 39, 0, 40,
- 599, 43, 0, 0, 601, 0, 0, 0, 47, 0,
- 48, 0, 0, 0, 0, 0, 602, 0, 223, 0,
- 0, 0, 603, 49, 52, 50, 604, 605, 606, 55,
- 608, 609, 610, 611, 612, 613, 0, 0, 600, 607,
- 595, 590, 592, 130, 41, 0, 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, -280, 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, 0, 46, 374, 380, 0, 0, 0, 0,
- 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 591, 112, 113, 0, 0, 593,
+ 117, 595, 30, 31, 596, 0, 120, 0, 0, 0,
+ 122, 598, 599, 0, 0, 0, 0, 0, 0, 35,
+ 600, 126, 127, 221, 37, 0, 38, 0, 0, 0,
+ 39, 0, 40, 601, 43, 0, 0, 603, 0, 0,
+ 0, 47, 0, 48, 0, 0, 0, 0, 0, 604,
+ 0, 223, 0, 0, 0, 605, 49, 52, 50, 606,
+ 607, 608, 55, 610, 611, 612, 613, 614, 615, 0,
+ 0, 602, 609, 597, 592, 594, 130, 41, 0, 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, -281, 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, 0, 46, 374, 380, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
- 650, 253, 528, 638, 651, 447, 621, 536, 581, 16,
- 554, 582, 661, 614, 548, 444, 667, 579, 636, 531,
- 183, 628, 313, 533, 444, 572, 248, 248, 248, 552,
- 263, 623, 237, 206, 313, 331, 447, 351, 183, 347,
- 190, 253, 183, 495, 188, 178, 173, 142, 320, 313,
- 253, 466, 639, 444, 152, 171, 462, 455, 165, 453,
- 150, 441, 457, 458, 500, 469, 447, 145, 425, 183,
- 148, 498, 475, 437, 433, 400, 260, 485, 393, 247,
- 108, 514, 512, 0, 206, 322, 0, 188, 511, 345,
- 637, 0, 206, 206, 62, 0, 0, 624, 206, 654,
- 653, 206, 206, 62, 0, 206, 62, 409, 62, 110,
- 170, 62, 148, 104, 98, 187, 0, 62, 102, 460,
- 180, 313, 62, 331, 459, 167, 62, 62, 504, 69,
- 62, 62, 313, 72, 63, 62, 62, 459, 507, 62,
- 62, 506, 505, 62, 410, 70, 62, 0, 503, 62,
- 62, 502, 182, 62, 62, 469, 62, 62, 91, 100,
- 90, 62, 97, 62, 62, 62, 96, 62, 95, 94,
- 93, 277, 86, 62, 62, 510, 281, 92, 62, 62,
- 99, 62, 393, 71, 79, 349, 514, 74, 514, 353,
- 62, 564, 460, 560, 355, 401, 341, 260, 62, 340,
- 182, 206, 393, 409, 409, 206, 393, 343, 417, 206,
- 206, 206, 62, 206, 459, 62, 188, 460, 148, 206,
- 247, 362, 464, 468, 206, 62, 412, 362, 403, 479,
- 296, 394, 188, 62, 206, 182, 407, 206, 206, 206,
- 410, 410, 206, 356, 419, 493, 422, 514, 246, 492,
- 362, 483, 655, 62, 62, 318, 62, 62, 295, 297,
- 239, 298, 299, 313, 206, 313, 588, 309, 362, 242,
- 362, 206, 281, 0, 0, 0, 62, 62, 0, 0,
- 309, 281, 281, 309, 206, 281, 206, 108, 281, 308,
- 62, 324, 309, 62, 327, 281, 62, 281, 281, 284,
- 289, 281, 328, 300, 62, 330, 0, 0, 62, 281,
- 0, 301, 0, 281, 337, 302, 110, 177, 62, 62,
- 514, 309, 0, 281, 281, 0, 281, 576, 568, 522,
- 306, 304, 560, 0, 634, 0, 0, 514, 314, 571,
- 316, 513, 523, 311, 260, 0, 522, 0, 514, 0,
- 0, 0, 0, 0, 443, 485, 440, 522, 513, 523,
- 206, 540, 541, 542, 543, 547, 544, 545, 584, 513,
- 523, 0, 0, 0, 0, 0, 0, 632, 633, 540,
- 541, 542, 543, 547, 544, 545, 576, 0, 0, 0,
- 0, 0, 0, 0, 0, 577, 578, 540, 541, 542,
- 543, 547, 544, 545, 0, 0, 0, 0, 0, 0,
+ 152, 652, 331, 669, 535, 531, 538, 142, 528, 148,
+ 641, 16, 313, 393, 485, 500, 626, 630, 263, 638,
+ 183, 625, 623, 206, 574, 447, 583, 320, 183, 253,
+ 313, 248, 466, 145, 663, 653, 616, 584, 556, 640,
+ 581, 248, 437, 253, 248, 495, 183, 178, 453, 150,
+ 462, 347, 455, 550, 554, 183, 351, 447, 458, 190,
+ 313, 457, 425, 188, 469, 441, 433, 253, 237, 468,
+ 0, 313, 173, 171, 393, 409, 447, 498, 409, 464,
+ 400, 0, 165, 206, 475, 206, 512, 511, 0, 0,
+ 188, 0, 0, 206, 0, 206, 0, 62, 0, 459,
+ 417, 206, 206, 206, 188, 0, 62, 0, 62, 62,
+ 507, 504, 410, 148, 62, 410, 460, 62, 419, 505,
+ 407, 412, 170, 62, 62, 459, 506, 444, 277, 148,
+ 422, 331, 187, 281, 62, 62, 62, 180, 260, 295,
+ 296, 297, 62, 62, 656, 655, 314, 298, 299, 62,
+ 62, 503, 182, 62, 206, 362, 514, 393, 247, 62,
+ 62, 460, 502, 62, 62, 639, 313, 167, 92, 99,
+ 62, 206, 206, 514, 510, 345, 100, 260, 562, 62,
+ 62, 62, 394, 493, 93, 94, 95, 492, 62, 62,
+ 182, 206, 62, 206, 96, 62, 246, 97, 62, 90,
+ 62, 401, 91, 206, 62, 86, 355, 340, 353, 62,
+ 108, 247, 206, 349, 188, 313, 102, 206, 393, 104,
+ 313, 62, 206, 182, 206, 206, 62, 362, 459, 206,
+ 242, 62, 469, 460, 62, 514, 409, 63, 318, 110,
+ 657, 341, 239, 590, 403, 62, 322, 206, 72, 62,
+ 362, 62, 362, 69, 206, 98, 62, 62, 70, 71,
+ 514, 0, 206, 62, 62, 566, 356, 0, 206, 79,
+ 62, 108, 74, 410, 483, 281, 0, 309, 0, 0,
+ 62, 62, 281, 304, 62, 281, 281, 62, 362, 281,
+ 343, 0, 281, 284, 289, 316, 324, 327, 0, 311,
+ 110, 177, 0, 309, 206, 62, 479, 0, 281, 62,
+ 281, 309, 301, 309, 281, 0, 281, 309, 281, 62,
+ 306, 0, 281, 62, 281, 337, 302, 0, 281, 578,
+ 300, 514, 260, 328, 562, 308, 636, 570, 443, 330,
+ 522, 0, 0, 0, 0, 0, 514, 0, 206, 0,
+ 0, 0, 513, 523, 0, 522, 0, 485, 542, 543,
+ 544, 545, 549, 546, 547, 0, 586, 513, 523, 0,
+ 0, 0, 0, 0, 440, 588, 589, 542, 543, 544,
+ 545, 549, 546, 547, 586, 0, 0, 0, 0, 0,
+ 0, 0, 0, 634, 635, 542, 543, 544, 545, 549,
+ 546, 547, 578, 0, 0, 0, 0, 0, 0, 0,
+ 0, 579, 580, 542, 543, 544, 545, 549, 546, 547,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 573, 0, 0, 0, 0, 0, 0, 0, 0,
+ 514, 0, 0, 0, 0, 0, 0, 0, 0, 522,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 513, 523, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 584, 0, 0, 0, 0, 0, 0,
- 0, 0, 586, 587, 540, 541, 542, 543, 547, 544,
- 545, 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,
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, 0};
+ 0, 0, 0, 0, 0, 0, 0};
const short QQmlJSGrammar::action_check [] = {
- 1, 79, 7, 33, 36, 7, 33, 7, 36, 7,
- 36, 7, 7, 61, 8, 7, 7, 60, 33, 16,
- 36, 55, 7, 48, 55, 7, 7, 60, 36, 5,
- 5, 24, 5, 55, 8, 7, 20, 66, 37, 29,
- 60, 2, 66, 60, 24, 34, 33, 33, 36, 55,
- 60, 55, 55, 36, 17, 33, 79, 36, 7, 1,
- 7, 7, -1, 8, 33, 33, 37, 33, 7, 36,
- 7, 48, 36, 33, 7, 1, 7, 33, 7, 36,
- 7, 36, 1, 8, 36, 36, 8, 8, 36, 33,
- 60, 2, 7, 36, 2, 60, 55, 17, 60, 33,
- 36, 36, 55, 61, 36, 0, 60, 48, 31, 33,
- 7, 10, 8, 7, 15, 8, 33, 8, 36, 8,
- 60, 8, 8, 61, 36, 15, 36, 7, 8, 79,
- 60, 6, 48, 34, 8, 8, 8, 50, 8, 42,
- 8, 54, 8, 50, 34, 20, 60, 54, -1, 77,
- 53, 8, 61, 62, 8, 40, 55, 61, 62, 61,
- 62, 61, 62, 15, 40, 56, 51, 60, 8, 40,
- 56, 60, 8, 60, 7, 51, 7, 61, 62, 8,
- 51, 29, 34, -1, 40, -1, 60, 60, 60, -1,
- 56, 61, 60, 91, 92, 51, 61, 62, 7, 56,
- 61, 62, 56, 91, 92, 29, 61, 62, 61, 62,
- 29, 2, 61, 62, 61, 62, 61, 62, 61, 62,
- 60, 15, 15, 29, 29, 61, 62, 75, 61, 62,
- 61, 62, 61, 62, 12, 8, 15, 29, 86, 15,
- 34, 34, 36, 36, 89, 12, 29, 7, 12, 36,
- 93, 75, 61, 62, -1, 34, 75, 36, 34, 25,
- 36, 27, 86, -1, -1, -1, -1, 86, -1, 75,
- 75, -1, 38, 33, 61, 62, -1, -1, -1, 57,
- 86, 86, -1, 75, -1, 63, 15, -1, 61, 62,
- 57, -1, 75, 57, 86, 15, 63, 18, 19, 63,
- -1, -1, -1, 86, 33, 34, 47, 36, -1, 18,
- 19, -1, -1, 33, 34, 25, 36, 27, 23, 24,
- 61, 62, -1, -1, 45, 46, -1, 32, 38, -1,
- 35, -1, 37, -1, 94, -1, 45, 46, -1, 23,
- 24, -1, -1, -1, -1, 23, 24, -1, 32, 23,
- 24, 35, 93, 37, 32, 23, 24, 35, 32, 37,
- -1, 35, -1, 37, 32, 23, 24, 35, 29, 37,
- -1, -1, 29, 31, 32, 29, -1, 35, 29, 37,
- 98, 99, 100, 101, 102, 103, 23, 24, 29, -1,
- -1, 29, -1, -1, 31, 32, 18, 19, 35, -1,
- 37, -1, -1, -1, -1, 66, 67, 68, -1, 66,
- 67, 68, 66, 67, 68, 66, 67, 68, -1, -1,
- -1, -1, 29, 45, 46, 66, 67, 68, 66, 67,
- 68, -1, -1, 94, 95, 96, 29, 94, 95, 96,
+ 7, 55, 48, 55, 55, 55, 36, 7, 36, 33,
+ 55, 7, 7, 33, 37, 7, 7, 61, 60, 60,
+ 36, 7, 33, 8, 36, 7, 16, 1, 36, 60,
+ 7, 36, 2, 48, 7, 36, 5, 36, 36, 36,
+ 79, 5, 36, 60, 33, 33, 55, 60, 7, 36,
+ 34, 7, 33, 7, 7, 33, 36, 7, 7, 77,
+ 36, 33, 8, 5, 1, 8, 33, 60, 29, 79,
+ 36, 33, 17, 8, 37, 79, 33, 60, 33, 8,
+ 1, 60, 2, 8, 7, 60, 33, 55, 48, 60,
+ 29, 2, 7, 2, 7, 36, 36, 7, 17, 7,
+ 33, 66, 7, 61, 48, 31, 36, 1, 36, 33,
+ 8, 7, 60, 20, 36, 66, 33, 7, 36, 55,
+ 36, 8, 60, 8, 15, -1, 40, 79, 8, 61,
+ 61, 62, 10, 8, 61, 62, 40, 51, 8, 15,
+ 40, 40, 8, 34, 8, 42, 6, 51, 24, 61,
+ 62, 51, 51, 7, 8, 8, 53, 8, 61, 62,
+ 20, 8, 8, 8, 8, 15, 61, 62, 61, 62,
+ 8, 8, 15, 60, -1, 60, 56, 55, 61, 62,
+ 61, 62, 61, 62, 34, 60, 56, 61, 62, 91,
+ 92, 34, 56, 50, 60, 15, 29, 54, 0, 91,
+ 92, 50, 61, 62, 24, 54, 25, 60, 27, 12,
+ 61, 56, 29, 60, 60, 25, 60, 27, 56, 38,
+ 25, 25, 27, 27, 61, 62, 12, 15, 38, 61,
+ 62, 12, 29, 38, 38, 29, 7, -1, 25, 7,
+ 27, 36, 75, 8, 29, 8, 34, -1, 36, 15,
+ 25, 38, 27, 86, 57, 7, -1, 89, 75, 7,
+ 63, -1, 33, 38, 15, 29, 61, 62, 34, 86,
+ 36, 57, 29, -1, -1, -1, 57, 63, 75, -1,
+ -1, 75, 63, 34, 15, 36, -1, 61, 62, 86,
+ 75, -1, 86, 61, 62, -1, 61, 62, 61, 62,
+ -1, 86, -1, 34, 25, 36, 27, 15, -1, 61,
+ 62, 75, -1, 61, 62, 18, 19, 38, 75, 93,
+ 15, -1, 86, 94, -1, 33, 34, -1, 36, 86,
+ 18, 19, 18, 19, 18, 19, 47, -1, 33, 34,
+ -1, 36, 45, 46, 98, 99, 100, 101, 102, 103,
+ 61, 62, -1, -1, 23, 24, -1, 45, 46, 45,
+ 46, 45, 46, 32, 23, 24, 35, -1, 37, -1,
+ -1, -1, -1, 32, 23, 24, 35, -1, 37, -1,
+ 23, 24, 93, 32, -1, 25, 35, 27, 37, 32,
+ -1, -1, 35, 29, 37, 23, 24, -1, 38, -1,
+ -1, -1, -1, 31, 32, 23, 24, 35, -1, 37,
+ -1, -1, -1, 31, 32, 23, 24, 35, 29, 37,
+ -1, -1, -1, 31, 32, 23, 24, 35, -1, 37,
+ 66, 67, 68, 31, 32, 23, 24, 35, -1, 37,
+ -1, -1, -1, 31, 32, -1, -1, 35, -1, 37,
+ 29, -1, -1, 29, -1, 66, 67, 68, 94, 95,
+ 96, 29, -1, -1, 29, -1, 23, 24, 29, -1,
+ -1, 29, 15, -1, 29, 32, -1, -1, 35, -1,
+ 37, 36, -1, 94, 95, 96, 29, 66, 67, 68,
+ 66, 67, 68, -1, -1, -1, -1, -1, 66, 67,
+ 68, 66, 67, 68, -1, 66, 67, 68, 66, 67,
+ 68, 66, 67, 68, -1, 94, 95, 96, 94, 95,
+ 96, -1, -1, 66, 67, 68, 94, 95, 96, 94,
+ 95, 96, 15, 94, 95, 96, 94, 95, 96, 94,
+ 95, 96, -1, 29, -1, -1, 29, -1, -1, 29,
+ 36, 94, 95, 96, 29, -1, -1, 29, -1, -1,
+ -1, 36, -1, -1, -1, 29, -1, -1, 29, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 66, 67, 68, 66, 67, 68, 66, 67, 68, 61,
+ 62, 66, 67, 68, 66, 67, 68, 61, 62, -1,
+ 61, 62, 66, 67, 68, 66, 67, 68, 94, 95,
+ 96, 94, 95, 96, 94, 95, 96, 29, -1, 94,
+ 95, 96, 94, 95, 96, 29, 15, -1, 29, -1,
94, 95, 96, 94, 95, 96, -1, -1, -1, -1,
- -1, -1, -1, 94, 95, 96, 94, 95, 96, 66,
- 67, 68, -1, -1, -1, -1, -1, 29, -1, -1,
- 29, -1, -1, 66, 67, 68, 29, -1, -1, 29,
- -1, -1, 29, -1, 23, 24, 29, 94, 95, 96,
- -1, -1, 31, 32, -1, -1, 35, -1, 37, -1,
- -1, 94, 95, 96, 66, 67, 68, 66, 67, 68,
- -1, -1, -1, 66, 67, 68, 66, 67, 68, 66,
- 67, 68, 29, 66, 67, 68, -1, -1, -1, 36,
- -1, 29, 94, 95, 96, 94, 95, 96, 36, -1,
- -1, 94, 95, 96, 94, 95, 96, 94, 95, 96,
- -1, 94, 95, 96, -1, 29, -1, -1, -1, 66,
- 67, 68, 36, -1, -1, -1, -1, 29, 66, 67,
- 68, -1, -1, -1, -1, 29, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 29, 94, 95, 96,
- -1, -1, 66, 67, 68, -1, 94, 95, 96, -1,
- -1, -1, -1, -1, 66, 67, 68, 61, 62, -1,
- -1, -1, 66, 67, 68, -1, -1, -1, 61, 62,
- 94, 95, 96, 66, 67, 68, 29, -1, -1, 29,
+ 29, -1, -1, -1, -1, -1, -1, -1, -1, 61,
+ 62, -1, -1, -1, 66, 67, 68, 61, 62, -1,
+ 61, 62, 66, 67, 68, 66, 67, 68, -1, -1,
+ -1, -1, -1, -1, -1, 3, -1, 66, 67, 68,
+ -1, -1, 94, 95, 96, 13, -1, -1, -1, 17,
+ 94, 95, 96, 94, 95, 96, -1, -1, 26, -1,
+ 28, -1, -1, 31, -1, 94, 95, 96, -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, 80, -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,
+ 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, -1, -1, -1, -1, -1, -1, 81,
+ 82, 83, -1, -1, -1, 87, -1, -1, -1, -1,
-1, -1, 94, 95, 96, -1, -1, -1, -1, -1,
- 94, 95, 96, -1, 29, -1, -1, -1, -1, -1,
- -1, 94, 95, 96, -1, -1, -1, -1, 61, 62,
- -1, 61, 62, 66, 67, 68, 66, 67, 68, -1,
- -1, -1, -1, -1, -1, -1, 61, 62, -1, -1,
- -1, 66, 67, 68, -1, -1, -1, -1, -1, -1,
- -1, 94, 95, 96, 94, 95, 96, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 94,
- 95, 96, -1, -1, -1, -1, -1, -1, -1, 12,
- 13, 3, -1, -1, -1, -1, -1, -1, -1, 22,
- -1, 13, -1, -1, -1, 17, 29, -1, -1, -1,
- 33, 34, -1, 36, 26, -1, 28, -1, -1, -1,
- 43, -1, -1, -1, 47, -1, -1, 39, -1, 41,
- 42, -1, -1, -1, -1, -1, -1, 49, -1, -1,
- 52, 53, 65, 66, 67, 68, 58, 70, -1, -1,
- -1, -1, 64, -1, -1, -1, -1, -1, 81, 82,
- 83, -1, -1, -1, 87, -1, -1, -1, 80, -1,
- -1, 94, 95, 96, -1, -1, -1, -1, -1, -1,
- -1, 12, 13, -1, -1, -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, -1, 94, 95, 96, -1, -1, -1, -1,
- -1, 80, -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, -1,
+ -1, -1, -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, -1, 94, 95, 96, -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, -1, -1, -1, -1, 12, 13, -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, -1, 94, 95, 96, -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, -1, 94, 95,
+ 96, -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, -1, 94, 95, 96, -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,
+ -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,
- -1, -1, -1, -1, -1, -1, 81, 82, 83, -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, -1, 94,
95, 96, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 12, 13, -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, 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, -1, 94, 95,
+ 96, -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, -1, -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, -1, -1, -1, -1, -1, -1,
+ -1, 72, -1, 74, 75, 76, -1, -1, -1, -1,
81, 82, 83, -1, -1, -1, 87, -1, -1, -1,
-1, -1, -1, 94, 95, 96, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 10, -1, 12, 13, -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,
+ -1, 94, 95, 96, -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, -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, 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, -1, 94,
95, 96, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 10, -1, 12, 13, -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, -1, 94, 95, 96,
+ -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, -1, -1, -1, 43, -1, -1, -1, 47, -1,
- -1, -1, -1, -1, -1, -1, 55, -1, -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, -1, -1, -1, 75, -1, -1, -1,
- -1, -1, 81, 82, 83, 84, -1, -1, 87, -1,
+ -1, 70, -1, 72, -1, 74, -1, 76, -1, -1,
+ -1, -1, 81, 82, 83, -1, -1, -1, 87, -1,
-1, -1, -1, -1, -1, 94, 95, 96, -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,
- -1, 94, 95, 96, -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, -1, 94, 95, 96, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 7, -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, -1,
+ 94, 95, 96, -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,
+ 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, -1, -1, -1, -1, 65, 66, 67, 68,
- -1, 70, -1, 72, -1, 74, -1, 76, -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, -1, 94, 95, 96, -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,
+ -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, -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, -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, -1,
94, 95, 96, -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, -1, 94, 95,
- 96, -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, -1, 94, 95, 96, -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, -1, 94, 95, 96, -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, -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, -1, 94, 95, 96, -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, -1, 94, 95, 96,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 11,
- 12, 13, -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, -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, -1, 94, 95, 96, -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, -1, 94, 95, 96, -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, 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, -1, 94, 95,
+ 96, -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, -1,
+ 94, 95, 96, -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, -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, 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, -1, 94, 95, 96, -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, -1, 94, 95, 96,
- -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, -1, 94,
- 95, 96, -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,
- -1, 94, 95, 96, -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, -1, 94, 95, 96, -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, 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, -1, 94, 95, 96, -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, -1, 94, 95, 96,
- -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, -1, 94,
- 95, 96, -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,
- -1, 94, 95, 96, -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, -1, 94, 95, 96, -1, -1, -1, -1,
- -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, -1, 94, 95, 96, -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, -1, 94, 95, 96, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
- 14, 18, 32, 22, 14, 25, 32, 18, 32, 3,
- 18, 18, 18, 22, 14, 3, 18, 22, 22, 32,
- 18, 18, 3, 18, 3, 18, 18, 18, 18, 32,
- 3, 32, 18, 18, 3, 18, 25, 3, 18, 3,
- 18, 18, 18, 42, 18, 3, 42, 3, 3, 3,
- 18, 3, 9, 3, 77, 42, 3, 18, 42, 105,
- 42, 3, 25, 25, 3, 18, 25, 42, 3, 18,
- 42, 42, 42, 100, 103, 42, 2, 42, 18, 4,
- 18, 14, 2, -1, 18, 2, -1, 18, 4, 2,
- 23, -1, 18, 18, 54, -1, -1, 18, 18, 11,
- 12, 18, 18, 54, -1, 18, 54, 14, 54, 47,
- 70, 54, 42, 64, 60, 46, -1, 54, 66, 56,
- 50, 3, 54, 18, 56, 68, 54, 54, 56, 56,
- 54, 54, 3, 57, 57, 54, 54, 56, 56, 54,
- 54, 56, 56, 54, 51, 56, 54, -1, 56, 54,
- 54, 56, 56, 54, 54, 18, 54, 54, 58, 60,
- 58, 54, 59, 54, 54, 54, 59, 54, 59, 59,
- 59, 54, 59, 54, 54, 109, 59, 58, 54, 54,
- 60, 54, 18, 56, 60, 2, 14, 62, 14, 2,
- 54, 19, 56, 19, 2, 2, 78, 2, 54, 94,
- 56, 18, 18, 14, 14, 18, 18, 78, 44, 18,
- 18, 18, 54, 18, 56, 54, 18, 56, 42, 18,
- 4, 2, 2, 2, 18, 54, 50, 2, 44, 92,
- 59, 43, 18, 54, 18, 56, 45, 18, 18, 18,
- 51, 51, 18, 18, 46, 38, 45, 14, 2, 42,
- 2, 45, 19, 54, 54, 2, 54, 54, 59, 59,
- 46, 59, 59, 3, 18, 3, 18, 54, 2, 45,
- 2, 18, 59, -1, -1, -1, 54, 54, -1, -1,
- 54, 59, 59, 54, 18, 59, 18, 18, 59, 76,
- 54, 69, 54, 54, 71, 59, 54, 59, 59, 63,
- 61, 59, 76, 61, 54, 76, -1, -1, 54, 59,
- -1, 61, -1, 59, 76, 61, 47, 48, 54, 54,
- 14, 54, -1, 59, 59, -1, 59, 14, 5, 23,
- 65, 67, 19, -1, 21, -1, -1, 14, 78, 5,
- 78, 35, 36, 76, 2, -1, 23, -1, 14, -1,
- -1, -1, -1, -1, 88, 42, 88, 23, 35, 36,
- 18, 25, 26, 27, 28, 29, 30, 31, 14, 35,
- 36, -1, -1, -1, -1, -1, -1, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 14, -1, -1, -1,
- -1, -1, -1, -1, -1, 23, 24, 25, 26, 27,
- 28, 29, 30, 31, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 77, 14, 18, 18, 18, 32, 18, 3, 32, 42,
+ 9, 3, 3, 18, 42, 3, 18, 18, 3, 22,
+ 18, 32, 32, 18, 18, 25, 32, 3, 18, 18,
+ 3, 18, 3, 42, 18, 14, 22, 18, 18, 22,
+ 22, 18, 100, 18, 18, 42, 18, 3, 105, 42,
+ 3, 3, 18, 14, 32, 18, 3, 25, 25, 18,
+ 3, 25, 3, 18, 18, 3, 103, 18, 18, 2,
+ -1, 3, 42, 42, 18, 14, 25, 42, 14, 2,
+ 42, -1, 42, 18, 42, 18, 2, 4, -1, -1,
+ 18, -1, -1, 18, -1, 18, -1, 54, -1, 56,
+ 44, 18, 18, 18, 18, -1, 54, -1, 54, 54,
+ 56, 56, 51, 42, 54, 51, 56, 54, 46, 56,
+ 45, 50, 70, 54, 54, 56, 56, 3, 54, 42,
+ 45, 18, 46, 59, 54, 54, 54, 50, 2, 59,
+ 59, 59, 54, 54, 11, 12, 78, 59, 59, 54,
+ 54, 56, 56, 54, 18, 2, 14, 18, 4, 54,
+ 54, 56, 56, 54, 54, 23, 3, 68, 58, 60,
+ 54, 18, 18, 14, 109, 2, 60, 2, 19, 54,
+ 54, 54, 43, 38, 59, 59, 59, 42, 54, 54,
+ 56, 18, 54, 18, 59, 54, 2, 59, 54, 58,
+ 54, 2, 58, 18, 54, 59, 2, 94, 2, 54,
+ 18, 4, 18, 2, 18, 3, 66, 18, 18, 64,
+ 3, 54, 18, 56, 18, 18, 54, 2, 56, 18,
+ 45, 54, 18, 56, 54, 14, 14, 57, 2, 47,
+ 19, 78, 46, 18, 44, 54, 2, 18, 57, 54,
+ 2, 54, 2, 56, 18, 60, 54, 54, 56, 56,
+ 14, -1, 18, 54, 54, 19, 18, -1, 18, 60,
+ 54, 18, 62, 51, 45, 59, -1, 54, -1, -1,
+ 54, 54, 59, 67, 54, 59, 59, 54, 2, 59,
+ 78, -1, 59, 63, 61, 78, 69, 71, -1, 76,
+ 47, 48, -1, 54, 18, 54, 92, -1, 59, 54,
+ 59, 54, 61, 54, 59, -1, 59, 54, 59, 54,
+ 65, -1, 59, 54, 59, 76, 61, -1, 59, 14,
+ 61, 14, 2, 76, 19, 76, 21, 5, 88, 76,
+ 23, -1, -1, -1, -1, -1, 14, -1, 18, -1,
+ -1, -1, 35, 36, -1, 23, -1, 42, 25, 26,
+ 27, 28, 29, 30, 31, -1, 14, 35, 36, -1,
+ -1, -1, -1, -1, 88, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 14, -1, -1, -1, -1, -1,
+ -1, -1, -1, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, 14, -1, -1, -1, -1, -1, -1, -1,
+ -1, 23, 24, 25, 26, 27, 28, 29, 30, 31,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 5, -1, -1, -1, -1, -1, -1, -1, -1,
+ 14, -1, -1, -1, -1, -1, -1, -1, -1, 23,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 14, -1, -1, -1, -1, -1, -1,
- -1, -1, 23, 24, 25, 26, 27, 28, 29, 30,
- 31, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 35, 36, -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, -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/parser/qqmljsgrammar_p.h b/src/qml/parser/qqmljsgrammar_p.h
index 244a807f24..050ef6c288 100644
--- a/src/qml/parser/qqmljsgrammar_p.h
+++ b/src/qml/parser/qqmljsgrammar_p.h
@@ -167,15 +167,15 @@ public:
T_XOR = 79,
T_XOR_EQ = 80,
- ACCEPT_STATE = 672,
- RULE_COUNT = 360,
- STATE_COUNT = 673,
+ ACCEPT_STATE = 674,
+ RULE_COUNT = 361,
+ STATE_COUNT = 675,
TERMINAL_COUNT = 106,
NON_TERMINAL_COUNT = 111,
- GOTO_INDEX_OFFSET = 673,
- GOTO_INFO_OFFSET = 3185,
- GOTO_CHECK_OFFSET = 3185
+ GOTO_INDEX_OFFSET = 675,
+ GOTO_INFO_OFFSET = 3078,
+ GOTO_CHECK_OFFSET = 3078
};
static const char *const spell [];
diff --git a/src/qml/parser/qqmljsmemorypool_p.h b/src/qml/parser/qqmljsmemorypool_p.h
index 08609e2961..536f5d4239 100644
--- a/src/qml/parser/qqmljsmemorypool_p.h
+++ b/src/qml/parser/qqmljsmemorypool_p.h
@@ -122,6 +122,7 @@ private:
_allocatedBlocks *= 2;
_blocks = (char **) realloc(_blocks, sizeof(char *) * _allocatedBlocks);
+ Q_CHECK_PTR(_blocks);
for (int index = _blockCount; index < _allocatedBlocks; ++index)
_blocks[index] = 0;
@@ -129,8 +130,10 @@ private:
char *&block = _blocks[_blockCount];
- if (! block)
+ if (! block) {
block = (char *) malloc(BLOCK_SIZE);
+ Q_CHECK_PTR(block);
+ }
_ptr = block;
_end = _ptr + BLOCK_SIZE;
diff --git a/src/qml/parser/qqmljsparser.cpp b/src/qml/parser/qqmljsparser.cpp
index ca5a09d22d..50518a92ee 100644
--- a/src/qml/parser/qqmljsparser.cpp
+++ b/src/qml/parser/qqmljsparser.cpp
@@ -436,31 +436,55 @@ case 47:
sym(1).Node = node;
} break;
+case 48: {
+ AST::UiQualifiedId *node = new (pool) AST::UiQualifiedId(stringRef(1));
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 49: {
+ AST::UiQualifiedId *node = new (pool) AST::UiQualifiedId(stringRef(1));
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+
+case 50: {
+ AST::UiQualifiedId *node = new (pool) AST::UiQualifiedId(stringRef(1));
+ node->identifierToken = loc(1);
+ sym(1).Node = node;
+} break;
+
case 51: {
- sym(1).Node = 0;
+ AST::UiQualifiedId *node = new (pool) AST::UiQualifiedId(sym(1).UiQualifiedId, stringRef(3));
+ node->identifierToken = loc(3);
+ sym(1).Node = node;
} break;
case 52: {
- sym(1).Node = sym(1).UiParameterList->finish ();
+ sym(1).Node = 0;
} break;
case 53: {
- AST::UiParameterList *node = new (pool) AST::UiParameterList(stringRef(1), stringRef(2));
+ sym(1).Node = sym(1).UiParameterList->finish ();
+} break;
+
+case 54: {
+ AST::UiParameterList *node = new (pool) AST::UiParameterList(sym(1).UiQualifiedId->finish(), stringRef(2));
node->propertyTypeToken = loc(1);
node->identifierToken = loc(2);
sym(1).Node = node;
} break;
-case 54: {
- AST::UiParameterList *node = new (pool) AST::UiParameterList(sym(1).UiParameterList, stringRef(3), stringRef(4));
+case 55: {
+ AST::UiParameterList *node = new (pool) AST::UiParameterList(sym(1).UiParameterList, sym(3).UiQualifiedId->finish(), stringRef(4));
node->propertyTypeToken = loc(3);
node->commaToken = loc(2);
node->identifierToken = loc(4);
sym(1).Node = node;
} break;
-case 56: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(QStringRef(), stringRef(2));
+case 57: {
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(nullptr, stringRef(2));
node->type = AST::UiPublicMember::Signal;
node->propertyToken = loc(1);
node->typeToken = loc(2);
@@ -470,8 +494,8 @@ case 56: {
sym(1).Node = node;
} break;
-case 58: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(QStringRef(), stringRef(2));
+case 59: {
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(nullptr, stringRef(2));
node->type = AST::UiPublicMember::Signal;
node->propertyToken = loc(1);
node->typeToken = loc(2);
@@ -480,8 +504,8 @@ case 58: {
sym(1).Node = node;
} break;
-case 60: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(4), stringRef(6));
+case 61: {
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(4).UiQualifiedId->finish(), stringRef(6));
node->typeModifier = stringRef(2);
node->propertyToken = loc(1);
node->typeModifierToken = loc(2);
@@ -491,8 +515,8 @@ case 60: {
sym(1).Node = node;
} break;
-case 62: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(2), stringRef(3));
+case 63: {
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(2).UiQualifiedId->finish(), stringRef(3));
node->propertyToken = loc(1);
node->typeToken = loc(2);
node->identifierToken = loc(3);
@@ -500,8 +524,8 @@ case 62: {
sym(1).Node = node;
} break;
-case 64: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4));
+case 65: {
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(3).UiQualifiedId->finish(), stringRef(4));
node->isDefaultMember = true;
node->defaultToken = loc(1);
node->propertyToken = loc(2);
@@ -511,8 +535,8 @@ case 64: {
sym(1).Node = node;
} break;
-case 66: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(5), stringRef(7));
+case 67: {
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(5).UiQualifiedId->finish(), stringRef(7));
node->isDefaultMember = true;
node->defaultToken = loc(1);
node->typeModifier = stringRef(3);
@@ -524,8 +548,8 @@ case 66: {
sym(1).Node = node;
} break;
-case 67: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(2), stringRef(3),
+case 68: {
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(2).UiQualifiedId->finish(), stringRef(3),
sym(5).Statement);
node->propertyToken = loc(1);
node->typeToken = loc(2);
@@ -534,8 +558,8 @@ case 67: {
sym(1).Node = node;
} break;
-case 68: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4),
+case 69: {
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(3).UiQualifiedId->finish(), stringRef(4),
sym(6).Statement);
node->isReadonlyMember = true;
node->readonlyToken = loc(1);
@@ -546,8 +570,8 @@ case 68: {
sym(1).Node = node;
} break;
-case 69: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4),
+case 70: {
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(3).UiQualifiedId->finish(), stringRef(4),
sym(6).Statement);
node->isDefaultMember = true;
node->defaultToken = loc(1);
@@ -558,8 +582,8 @@ case 69: {
sym(1).Node = node;
} break;
-case 70: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(4), stringRef(6));
+case 71: {
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(4).UiQualifiedId->finish(), stringRef(6));
node->typeModifier = stringRef(2);
node->propertyToken = loc(1);
node->typeModifierToken = loc(2);
@@ -582,8 +606,8 @@ case 70: {
sym(1).Node = node;
} break;
-case 71: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(2), stringRef(3));
+case 72: {
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(2).UiQualifiedId->finish(), stringRef(3));
node->propertyToken = loc(1);
node->typeToken = loc(2);
node->identifierToken = loc(3);
@@ -602,8 +626,8 @@ case 71: {
sym(1).Node = node;
} break;
-case 72: {
- AST::UiPublicMember *node = new (pool) AST::UiPublicMember(stringRef(3), stringRef(4));
+case 73: {
+ AST::UiPublicMember *node = new (pool) AST::UiPublicMember(sym(3).UiQualifiedId->finish(), stringRef(4));
node->isReadonlyMember = true;
node->readonlyToken = loc(1);
node->propertyToken = loc(2);
@@ -624,57 +648,57 @@ case 72: {
sym(1).Node = node;
} break;
-case 73: {
+case 74: {
sym(1).Node = new (pool) AST::UiSourceElement(sym(1).Node);
} break;
-case 74: {
+case 75: {
sym(1).Node = new (pool) AST::UiSourceElement(sym(1).Node);
} break;
-case 82: {
+case 83: {
AST::ThisExpression *node = new (pool) AST::ThisExpression();
node->thisToken = loc(1);
sym(1).Node = node;
} break;
-case 83: {
+case 84: {
AST::IdentifierExpression *node = new (pool) AST::IdentifierExpression(stringRef(1));
node->identifierToken = loc(1);
sym(1).Node = node;
} break;
-case 84: {
+case 85: {
AST::NullExpression *node = new (pool) AST::NullExpression();
node->nullToken = loc(1);
sym(1).Node = node;
} break;
-case 85: {
+case 86: {
AST::TrueLiteral *node = new (pool) AST::TrueLiteral();
node->trueToken = loc(1);
sym(1).Node = node;
} break;
-case 86: {
+case 87: {
AST::FalseLiteral *node = new (pool) AST::FalseLiteral();
node->falseToken = loc(1);
sym(1).Node = node;
} break;
-case 87: {
+case 88: {
AST::NumericLiteral *node = new (pool) AST::NumericLiteral(sym(1).dval);
node->literalToken = loc(1);
sym(1).Node = node;
} break;
-case 88:
-case 89: {
+case 89:
+case 90: {
AST::StringLiteral *node = new (pool) AST::StringLiteral(stringRef(1));
node->literalToken = loc(1);
sym(1).Node = node;
} break;
-case 90: {
+case 91: {
bool rx = lexer->scanRegExp(Lexer::NoPrefix);
if (!rx) {
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
@@ -690,7 +714,7 @@ case 90: {
sym(1).Node = node;
} break;
-case 91: {
+case 92: {
bool rx = lexer->scanRegExp(Lexer::EqualPrefix);
if (!rx) {
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, location(lexer), lexer->errorMessage()));
@@ -706,28 +730,28 @@ case 91: {
sym(1).Node = node;
} break;
-case 92: {
+case 93: {
AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral((AST::Elision *) 0);
node->lbracketToken = loc(1);
node->rbracketToken = loc(2);
sym(1).Node = node;
} break;
-case 93: {
+case 94: {
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 94: {
+case 95: {
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 95: {
+case 96: {
AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).ElementList->finish (),
(AST::Elision *) 0);
node->lbracketToken = loc(1);
@@ -736,7 +760,7 @@ case 95: {
sym(1).Node = node;
} break;
-case 96: {
+case 97: {
AST::ArrayLiteral *node = new (pool) AST::ArrayLiteral(sym(2).ElementList->finish (),
sym(4).Elision->finish());
node->lbracketToken = loc(1);
@@ -745,7 +769,7 @@ case 96: {
sym(1).Node = node;
} break;
-case 97: {
+case 98: {
AST::ObjectLiteral *node = 0;
if (sym(2).Node)
node = new (pool) AST::ObjectLiteral(
@@ -757,7 +781,7 @@ case 97: {
sym(1).Node = node;
} break;
-case 98: {
+case 99: {
AST::ObjectLiteral *node = new (pool) AST::ObjectLiteral(
sym(2).PropertyAssignmentList->finish ());
node->lbraceToken = loc(1);
@@ -765,14 +789,14 @@ case 98: {
sym(1).Node = node;
} break;
-case 99: {
+case 100: {
AST::NestedExpression *node = new (pool) AST::NestedExpression(sym(2).Expression);
node->lparenToken = loc(1);
node->rparenToken = loc(3);
sym(1).Node = node;
} break;
-case 100: {
+case 101: {
if (AST::ArrayMemberExpression *mem = AST::cast<AST::ArrayMemberExpression *>(sym(1).Expression)) {
diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Warning, mem->lbracketToken,
QLatin1String("Ignored annotation")));
@@ -792,48 +816,48 @@ case 100: {
}
} break;
-case 101: {
+case 102: {
sym(1).Node = new (pool) AST::ElementList((AST::Elision *) 0, sym(1).Expression);
} break;
-case 102: {
+case 103: {
sym(1).Node = new (pool) AST::ElementList(sym(1).Elision->finish(), sym(2).Expression);
} break;
-case 103: {
+case 104: {
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 104: {
+case 105: {
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 105: {
+case 106: {
AST::Elision *node = new (pool) AST::Elision();
node->commaToken = loc(1);
sym(1).Node = node;
} break;
-case 106: {
+case 107: {
AST::Elision *node = new (pool) AST::Elision(sym(1).Elision);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 107: {
+case 108: {
AST::PropertyNameAndValue *node = new (pool) AST::PropertyNameAndValue(
sym(1).PropertyName, sym(3).Expression);
node->colonToken = loc(2);
sym(1).Node = node;
} break;
-case 108: {
+case 109: {
AST::PropertyGetterSetter *node = new (pool) AST::PropertyGetterSetter(
sym(2).PropertyName, sym(6).FunctionBody);
node->getSetToken = loc(1);
@@ -844,7 +868,7 @@ case 108: {
sym(1).Node = node;
} break;
-case 109: {
+case 110: {
AST::PropertyGetterSetter *node = new (pool) AST::PropertyGetterSetter(
sym(2).PropertyName, sym(4).FormalParameterList, sym(7).FunctionBody);
node->getSetToken = loc(1);
@@ -855,56 +879,56 @@ case 109: {
sym(1).Node = node;
} break;
-case 110: {
+case 111: {
sym(1).Node = new (pool) AST::PropertyAssignmentList(sym(1).PropertyAssignment);
} break;
-case 111: {
+case 112: {
AST::PropertyAssignmentList *node = new (pool) AST::PropertyAssignmentList(
sym(1).PropertyAssignmentList, sym(3).PropertyAssignment);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 112: {
+case 113: {
AST::IdentifierPropertyName *node = new (pool) AST::IdentifierPropertyName(stringRef(1));
node->propertyNameToken = loc(1);
sym(1).Node = node;
} break;
-case 113: {
+case 114: {
AST::StringLiteralPropertyName *node = new (pool) AST::StringLiteralPropertyName(stringRef(1));
node->propertyNameToken = loc(1);
sym(1).Node = node;
} break;
-case 114: {
+case 115: {
AST::NumericLiteralPropertyName *node = new (pool) AST::NumericLiteralPropertyName(sym(1).dval);
node->propertyNameToken = loc(1);
sym(1).Node = node;
} break;
-case 115: {
+case 116: {
AST::IdentifierPropertyName *node = new (pool) AST::IdentifierPropertyName(stringRef(1));
node->propertyNameToken = loc(1);
sym(1).Node = node;
} break;
-case 151: {
+case 152: {
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 152: {
+case 153: {
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 153: {
+case 154: {
AST::NewMemberExpression *node = new (pool) AST::NewMemberExpression(sym(2).Expression, sym(4).ArgumentList);
node->newToken = loc(1);
node->lparenToken = loc(3);
@@ -912,384 +936,384 @@ case 153: {
sym(1).Node = node;
} break;
-case 155: {
+case 156: {
AST::NewExpression *node = new (pool) AST::NewExpression(sym(2).Expression);
node->newToken = loc(1);
sym(1).Node = node;
} break;
-case 156: {
+case 157: {
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 157: {
+case 158: {
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 158: {
+case 159: {
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 159: {
+case 160: {
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 160: {
+case 161: {
sym(1).Node = 0;
} break;
-case 161: {
+case 162: {
sym(1).Node = sym(1).ArgumentList->finish();
} break;
-case 162: {
+case 163: {
sym(1).Node = new (pool) AST::ArgumentList(sym(1).Expression);
} break;
-case 163: {
+case 164: {
AST::ArgumentList *node = new (pool) AST::ArgumentList(sym(1).ArgumentList, sym(3).Expression);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 167: {
+case 168: {
AST::PostIncrementExpression *node = new (pool) AST::PostIncrementExpression(sym(1).Expression);
node->incrementToken = loc(2);
sym(1).Node = node;
} break;
-case 168: {
+case 169: {
AST::PostDecrementExpression *node = new (pool) AST::PostDecrementExpression(sym(1).Expression);
node->decrementToken = loc(2);
sym(1).Node = node;
} break;
-case 170: {
+case 171: {
AST::DeleteExpression *node = new (pool) AST::DeleteExpression(sym(2).Expression);
node->deleteToken = loc(1);
sym(1).Node = node;
} break;
-case 171: {
+case 172: {
AST::VoidExpression *node = new (pool) AST::VoidExpression(sym(2).Expression);
node->voidToken = loc(1);
sym(1).Node = node;
} break;
-case 172: {
+case 173: {
AST::TypeOfExpression *node = new (pool) AST::TypeOfExpression(sym(2).Expression);
node->typeofToken = loc(1);
sym(1).Node = node;
} break;
-case 173: {
+case 174: {
AST::PreIncrementExpression *node = new (pool) AST::PreIncrementExpression(sym(2).Expression);
node->incrementToken = loc(1);
sym(1).Node = node;
} break;
-case 174: {
+case 175: {
AST::PreDecrementExpression *node = new (pool) AST::PreDecrementExpression(sym(2).Expression);
node->decrementToken = loc(1);
sym(1).Node = node;
} break;
-case 175: {
+case 176: {
AST::UnaryPlusExpression *node = new (pool) AST::UnaryPlusExpression(sym(2).Expression);
node->plusToken = loc(1);
sym(1).Node = node;
} break;
-case 176: {
+case 177: {
AST::UnaryMinusExpression *node = new (pool) AST::UnaryMinusExpression(sym(2).Expression);
node->minusToken = loc(1);
sym(1).Node = node;
} break;
-case 177: {
+case 178: {
AST::TildeExpression *node = new (pool) AST::TildeExpression(sym(2).Expression);
node->tildeToken = loc(1);
sym(1).Node = node;
} break;
-case 178: {
+case 179: {
AST::NotExpression *node = new (pool) AST::NotExpression(sym(2).Expression);
node->notToken = loc(1);
sym(1).Node = node;
} break;
-case 180: {
+case 181: {
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 181: {
+case 182: {
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 182: {
+case 183: {
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 184: {
+case 185: {
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 185: {
+case 186: {
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 187: {
+case 188: {
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 188: {
+case 189: {
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 189: {
+case 190: {
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 191: {
+case 192: {
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 192: {
+case 193: {
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 193: {
+case 194: {
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 194: {
+case 195: {
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 195: {
+case 196: {
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 196: {
+case 197: {
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 198: {
+case 199: {
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 199: {
+case 200: {
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 200: {
+case 201: {
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 201: {
+case 202: {
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 202: {
+case 203: {
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 204: {
+case 205: {
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 205: {
+case 206: {
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 206: {
+case 207: {
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 207: {
+case 208: {
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 209: {
+case 210: {
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 210: {
+case 211: {
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 211: {
+case 212: {
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 212: {
+case 213: {
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 214: {
+case 215: {
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 216: {
+case 217: {
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 218: {
+case 219: {
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 220: {
+case 221: {
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 222: {
+case 223: {
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 224: {
+case 225: {
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 226: {
+case 227: {
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 228: {
+case 229: {
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 230: {
+case 231: {
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 232: {
+case 233: {
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 234: {
+case 235: {
AST::ConditionalExpression *node = new (pool) AST::ConditionalExpression(sym(1).Expression,
sym(3).Expression, sym(5).Expression);
node->questionToken = loc(2);
@@ -1297,7 +1321,7 @@ case 234: {
sym(1).Node = node;
} break;
-case 236: {
+case 237: {
AST::ConditionalExpression *node = new (pool) AST::ConditionalExpression(sym(1).Expression,
sym(3).Expression, sym(5).Expression);
node->questionToken = loc(2);
@@ -1305,112 +1329,112 @@ case 236: {
sym(1).Node = node;
} break;
-case 238: {
+case 239: {
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 240: {
+case 241: {
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 241: {
+case 242: {
sym(1).ival = QSOperator::Assign;
} break;
-case 242: {
+case 243: {
sym(1).ival = QSOperator::InplaceMul;
} break;
-case 243: {
+case 244: {
sym(1).ival = QSOperator::InplaceDiv;
} break;
-case 244: {
+case 245: {
sym(1).ival = QSOperator::InplaceMod;
} break;
-case 245: {
+case 246: {
sym(1).ival = QSOperator::InplaceAdd;
} break;
-case 246: {
+case 247: {
sym(1).ival = QSOperator::InplaceSub;
} break;
-case 247: {
+case 248: {
sym(1).ival = QSOperator::InplaceLeftShift;
} break;
-case 248: {
+case 249: {
sym(1).ival = QSOperator::InplaceRightShift;
} break;
-case 249: {
+case 250: {
sym(1).ival = QSOperator::InplaceURightShift;
} break;
-case 250: {
+case 251: {
sym(1).ival = QSOperator::InplaceAnd;
} break;
-case 251: {
+case 252: {
sym(1).ival = QSOperator::InplaceXor;
} break;
-case 252: {
+case 253: {
sym(1).ival = QSOperator::InplaceOr;
} break;
-case 254: {
+case 255: {
AST::Expression *node = new (pool) AST::Expression(sym(1).Expression, sym(3).Expression);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 255: {
+case 256: {
sym(1).Node = 0;
} break;
-case 258: {
+case 259: {
AST::Expression *node = new (pool) AST::Expression(sym(1).Expression, sym(3).Expression);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 259: {
+case 260: {
sym(1).Node = 0;
} break;
-case 276: {
+case 277: {
AST::Block *node = new (pool) AST::Block(sym(2).StatementList);
node->lbraceToken = loc(1);
node->rbraceToken = loc(3);
sym(1).Node = node;
} break;
-case 277: {
+case 278: {
sym(1).Node = new (pool) AST::StatementList(sym(1).Statement);
} break;
-case 278: {
+case 279: {
sym(1).Node = new (pool) AST::StatementList(sym(1).StatementList, sym(2).Statement);
} break;
-case 279: {
+case 280: {
sym(1).Node = 0;
} break;
-case 280: {
+case 281: {
sym(1).Node = sym(1).StatementList->finish ();
} break;
-case 282: {
+case 283: {
AST::VariableStatement *node = new (pool) AST::VariableStatement(
sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST));
node->declarationKindToken = loc(1);
@@ -1418,76 +1442,76 @@ case 282: {
sym(1).Node = node;
} break;
-case 283: {
+case 284: {
sym(1).ival = T_CONST;
} break;
-case 284: {
+case 285: {
sym(1).ival = T_VAR;
} break;
-case 285: {
+case 286: {
sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclaration);
} break;
-case 286: {
+case 287: {
AST::VariableDeclarationList *node = new (pool) AST::VariableDeclarationList(
sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
node->commaToken = loc(2);
sym(1).Node = node;
} break;
-case 287: {
+case 288: {
sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclaration);
} break;
-case 288: {
+case 289: {
sym(1).Node = new (pool) AST::VariableDeclarationList(sym(1).VariableDeclarationList, sym(3).VariableDeclaration);
} break;
-case 289: {
+case 290: {
AST::VariableDeclaration *node = new (pool) AST::VariableDeclaration(stringRef(1), sym(2).Expression);
node->identifierToken = loc(1);
sym(1).Node = node;
} break;
-case 290: {
+case 291: {
AST::VariableDeclaration *node = new (pool) AST::VariableDeclaration(stringRef(1), sym(2).Expression);
node->identifierToken = loc(1);
sym(1).Node = node;
} break;
-case 291: {
+case 292: {
// ### TODO: AST for initializer
sym(1) = sym(2);
} break;
-case 292: {
+case 293: {
sym(1).Node = 0;
} break;
-case 294: {
+case 295: {
// ### TODO: AST for initializer
sym(1) = sym(2);
} break;
-case 295: {
+case 296: {
sym(1).Node = 0;
} break;
-case 297: {
+case 298: {
AST::EmptyStatement *node = new (pool) AST::EmptyStatement();
node->semicolonToken = loc(1);
sym(1).Node = node;
} break;
-case 299: {
+case 300: {
AST::ExpressionStatement *node = new (pool) AST::ExpressionStatement(sym(1).Expression);
node->semicolonToken = loc(2);
sym(1).Node = node;
} break;
-case 300: {
+case 301: {
AST::IfStatement *node = new (pool) AST::IfStatement(sym(3).Expression, sym(5).Statement, sym(7).Statement);
node->ifToken = loc(1);
node->lparenToken = loc(2);
@@ -1496,7 +1520,7 @@ case 300: {
sym(1).Node = node;
} break;
-case 301: {
+case 302: {
AST::IfStatement *node = new (pool) AST::IfStatement(sym(3).Expression, sym(5).Statement);
node->ifToken = loc(1);
node->lparenToken = loc(2);
@@ -1504,7 +1528,7 @@ case 301: {
sym(1).Node = node;
} break;
-case 304: {
+case 305: {
AST::DoWhileStatement *node = new (pool) AST::DoWhileStatement(sym(2).Statement, sym(5).Expression);
node->doToken = loc(1);
node->whileToken = loc(3);
@@ -1514,7 +1538,7 @@ case 304: {
sym(1).Node = node;
} break;
-case 305: {
+case 306: {
AST::WhileStatement *node = new (pool) AST::WhileStatement(sym(3).Expression, sym(5).Statement);
node->whileToken = loc(1);
node->lparenToken = loc(2);
@@ -1522,7 +1546,7 @@ case 305: {
sym(1).Node = node;
} break;
-case 306: {
+case 307: {
AST::ForStatement *node = new (pool) AST::ForStatement(sym(3).Expression,
sym(5).Expression, sym(7).Expression, sym(9).Statement);
node->forToken = loc(1);
@@ -1533,7 +1557,7 @@ case 306: {
sym(1).Node = node;
} break;
-case 307: {
+case 308: {
AST::LocalForStatement *node = new (pool) AST::LocalForStatement(
sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression,
sym(8).Expression, sym(10).Statement);
@@ -1546,7 +1570,7 @@ case 307: {
sym(1).Node = node;
} break;
-case 308: {
+case 309: {
AST:: ForEachStatement *node = new (pool) AST::ForEachStatement(sym(3).Expression,
sym(5).Expression, sym(7).Statement);
node->forToken = loc(1);
@@ -1556,7 +1580,7 @@ case 308: {
sym(1).Node = node;
} break;
-case 309: {
+case 310: {
AST::LocalForEachStatement *node = new (pool) AST::LocalForEachStatement(
sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement);
node->forToken = loc(1);
@@ -1567,14 +1591,14 @@ case 309: {
sym(1).Node = node;
} break;
-case 311: {
+case 312: {
AST::ContinueStatement *node = new (pool) AST::ContinueStatement();
node->continueToken = loc(1);
node->semicolonToken = loc(2);
sym(1).Node = node;
} break;
-case 313: {
+case 314: {
AST::ContinueStatement *node = new (pool) AST::ContinueStatement(stringRef(2));
node->continueToken = loc(1);
node->identifierToken = loc(2);
@@ -1582,14 +1606,14 @@ case 313: {
sym(1).Node = node;
} break;
-case 315: {
+case 316: {
AST::BreakStatement *node = new (pool) AST::BreakStatement(QStringRef());
node->breakToken = loc(1);
node->semicolonToken = loc(2);
sym(1).Node = node;
} break;
-case 317: {
+case 318: {
AST::BreakStatement *node = new (pool) AST::BreakStatement(stringRef(2));
node->breakToken = loc(1);
node->identifierToken = loc(2);
@@ -1597,14 +1621,14 @@ case 317: {
sym(1).Node = node;
} break;
-case 319: {
+case 320: {
AST::ReturnStatement *node = new (pool) AST::ReturnStatement(sym(2).Expression);
node->returnToken = loc(1);
node->semicolonToken = loc(3);
sym(1).Node = node;
} break;
-case 320: {
+case 321: {
AST::WithStatement *node = new (pool) AST::WithStatement(sym(3).Expression, sym(5).Statement);
node->withToken = loc(1);
node->lparenToken = loc(2);
@@ -1612,7 +1636,7 @@ case 320: {
sym(1).Node = node;
} break;
-case 321: {
+case 322: {
AST::SwitchStatement *node = new (pool) AST::SwitchStatement(sym(3).Expression, sym(5).CaseBlock);
node->switchToken = loc(1);
node->lparenToken = loc(2);
@@ -1620,83 +1644,83 @@ case 321: {
sym(1).Node = node;
} break;
-case 322: {
+case 323: {
AST::CaseBlock *node = new (pool) AST::CaseBlock(sym(2).CaseClauses);
node->lbraceToken = loc(1);
node->rbraceToken = loc(3);
sym(1).Node = node;
} break;
-case 323: {
+case 324: {
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 324: {
+case 325: {
sym(1).Node = new (pool) AST::CaseClauses(sym(1).CaseClause);
} break;
-case 325: {
+case 326: {
sym(1).Node = new (pool) AST::CaseClauses(sym(1).CaseClauses, sym(2).CaseClause);
} break;
-case 326: {
+case 327: {
sym(1).Node = 0;
} break;
-case 327: {
+case 328: {
sym(1).Node = sym(1).CaseClauses->finish ();
} break;
-case 328: {
+case 329: {
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 329: {
+case 330: {
AST::DefaultClause *node = new (pool) AST::DefaultClause(sym(3).StatementList);
node->defaultToken = loc(1);
node->colonToken = loc(2);
sym(1).Node = node;
} break;
-case 330: {
+case 331: {
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 332: {
+case 333: {
AST::ThrowStatement *node = new (pool) AST::ThrowStatement(sym(2).Expression);
node->throwToken = loc(1);
node->semicolonToken = loc(3);
sym(1).Node = node;
} break;
-case 333: {
+case 334: {
AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Catch);
node->tryToken = loc(1);
sym(1).Node = node;
} break;
-case 334: {
+case 335: {
AST::TryStatement *node = new (pool) AST::TryStatement(sym(2).Statement, sym(3).Finally);
node->tryToken = loc(1);
sym(1).Node = node;
} break;
-case 335: {
+case 336: {
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 336: {
+case 337: {
AST::Catch *node = new (pool) AST::Catch(stringRef(3), sym(5).Block);
node->catchToken = loc(1);
node->lparenToken = loc(2);
@@ -1705,20 +1729,20 @@ case 336: {
sym(1).Node = node;
} break;
-case 337: {
+case 338: {
AST::Finally *node = new (pool) AST::Finally(sym(2).Block);
node->finallyToken = loc(1);
sym(1).Node = node;
} break;
-case 339: {
+case 340: {
AST::DebuggerStatement *node = new (pool) AST::DebuggerStatement();
node->debuggerToken = loc(1);
node->semicolonToken = loc(2);
sym(1).Node = node;
} break;
-case 341: {
+case 342: {
AST::FunctionDeclaration *node = new (pool) AST::FunctionDeclaration(stringRef(2), sym(4).FormalParameterList, sym(7).FunctionBody);
node->functionToken = loc(1);
node->identifierToken = loc(2);
@@ -1729,7 +1753,7 @@ case 341: {
sym(1).Node = node;
} break;
-case 342: {
+case 343: {
AST::FunctionExpression *node = new (pool) AST::FunctionExpression(stringRef(2), sym(4).FormalParameterList, sym(7).FunctionBody);
node->functionToken = loc(1);
if (! stringRef(2).isNull())
@@ -1741,7 +1765,7 @@ case 342: {
sym(1).Node = node;
} break;
-case 343: {
+case 344: {
AST::FunctionExpression *node = new (pool) AST::FunctionExpression(QStringRef(), sym(3).FormalParameterList, sym(6).FunctionBody);
node->functionToken = loc(1);
node->lparenToken = loc(2);
@@ -1751,56 +1775,56 @@ case 343: {
sym(1).Node = node;
} break;
-case 344: {
+case 345: {
AST::FormalParameterList *node = new (pool) AST::FormalParameterList(stringRef(1));
node->identifierToken = loc(1);
sym(1).Node = node;
} break;
-case 345: {
+case 346: {
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 346: {
+case 347: {
sym(1).Node = 0;
} break;
-case 347: {
+case 348: {
sym(1).Node = sym(1).FormalParameterList->finish ();
} break;
-case 348: {
+case 349: {
sym(1).Node = 0;
} break;
-case 350: {
+case 351: {
sym(1).Node = new (pool) AST::FunctionBody(sym(1).SourceElements->finish ());
} break;
-case 352: {
+case 353: {
sym(1).Node = new (pool) AST::Program(sym(1).SourceElements->finish ());
} break;
-case 353: {
+case 354: {
sym(1).Node = new (pool) AST::SourceElements(sym(1).SourceElement);
} break;
-case 354: {
+case 355: {
sym(1).Node = new (pool) AST::SourceElements(sym(1).SourceElements, sym(2).SourceElement);
} break;
-case 355: {
+case 356: {
sym(1).Node = new (pool) AST::StatementSourceElement(sym(1).Statement);
} break;
-case 356: {
+case 357: {
sym(1).Node = new (pool) AST::FunctionSourceElement(sym(1).FunctionDeclaration);
} break;
-case 357: {
+case 358: {
sym(1).Node = 0;
} break;
diff --git a/src/qml/parser/qqmljsparser_p.h b/src/qml/parser/qqmljsparser_p.h
index 7533750a53..f382cd7563 100644
--- a/src/qml/parser/qqmljsparser_p.h
+++ b/src/qml/parser/qqmljsparser_p.h
@@ -246,9 +246,9 @@ protected:
-#define J_SCRIPT_REGEXPLITERAL_RULE1 90
+#define J_SCRIPT_REGEXPLITERAL_RULE1 91
-#define J_SCRIPT_REGEXPLITERAL_RULE2 91
+#define J_SCRIPT_REGEXPLITERAL_RULE2 92
QT_QML_END_NAMESPACE
diff --git a/src/qml/qml/qml.pri b/src/qml/qml/qml.pri
index 8d8da3742d..412dc6cba2 100644
--- a/src/qml/qml/qml.pri
+++ b/src/qml/qml/qml.pri
@@ -42,7 +42,6 @@ SOURCES += \
$$PWD/qqmlabstracturlinterceptor.cpp \
$$PWD/qqmlapplicationengine.cpp \
$$PWD/qqmllistwrapper.cpp \
- $$PWD/qqmlcontextwrapper.cpp \
$$PWD/qqmlvaluetypewrapper.cpp \
$$PWD/qqmltypewrapper.cpp \
$$PWD/qqmlfileselector.cpp \
@@ -113,8 +112,6 @@ HEADERS += \
$$PWD/qqmlapplicationengine_p.h \
$$PWD/qqmlapplicationengine.h \
$$PWD/qqmllistwrapper_p.h \
- $$PWD/qqmlcontextwrapper_p.h \
- $$PWD/qqmlvaluetypewrapper_p.h \
$$PWD/qqmltypewrapper_p.h \
$$PWD/qqmlfileselector_p.h \
$$PWD/qqmlfileselector.h \
diff --git a/src/qml/qml/qqmlapplicationengine.cpp b/src/qml/qml/qqmlapplicationengine.cpp
index 1a912d53e6..8a97b7eba7 100644
--- a/src/qml/qml/qqmlapplicationengine.cpp
+++ b/src/qml/qml/qqmlapplicationengine.cpp
@@ -58,7 +58,7 @@ QQmlApplicationEnginePrivate::~QQmlApplicationEnginePrivate()
void QQmlApplicationEnginePrivate::cleanUp()
{
qDeleteAll(objects);
-#ifndef QT_NO_TRANSLATION
+#if QT_CONFIG(translation)
qDeleteAll(translators);
#endif
}
@@ -70,7 +70,7 @@ void QQmlApplicationEnginePrivate::init()
q, SLOT(_q_finishLoad(QObject*)));
q->connect(q, SIGNAL(quit()), QCoreApplication::instance(), SLOT(quit()));
q->connect(q, &QQmlApplicationEngine::exit, QCoreApplication::instance(), &QCoreApplication::exit);
-#ifndef QT_NO_TRANSLATION
+#if QT_CONFIG(translation)
QTranslator* qtTranslator = new QTranslator;
if (qtTranslator->load(QLatin1String("qt_") + QLocale::system().name(), QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
QCoreApplication::installTranslator(qtTranslator);
@@ -82,7 +82,7 @@ void QQmlApplicationEnginePrivate::init()
void QQmlApplicationEnginePrivate::loadTranslations(const QUrl &rootFile)
{
-#ifndef QT_NO_TRANSLATION
+#if QT_CONFIG(translation)
if (rootFile.scheme() != QLatin1String("file") && rootFile.scheme() != QLatin1String("qrc"))
return;
diff --git a/src/qml/qml/qqmlapplicationengine_p.h b/src/qml/qml/qqmlapplicationengine_p.h
index e1d1b4a7bb..8c342a43a9 100644
--- a/src/qml/qml/qqmlapplicationengine_p.h
+++ b/src/qml/qml/qqmlapplicationengine_p.h
@@ -78,7 +78,7 @@ public:
QSignalMapper statusMapper;
QObject *appObj;
-#ifndef QT_NO_TRANSLATIONS
+#if QT_CONFIG(translation)
QList<QTranslator *> translators;
#endif
};
diff --git a/src/qml/qml/qqmlbinding.cpp b/src/qml/qml/qqmlbinding.cpp
index 4fe76ddf29..284ae1f36f 100644
--- a/src/qml/qml/qqmlbinding.cpp
+++ b/src/qml/qml/qqmlbinding.cpp
@@ -46,7 +46,6 @@
#include <private/qqmlprofiler_p.h>
#include <private/qqmlexpression_p.h>
#include <private/qqmlscriptstring_p.h>
-#include <private/qqmlcontextwrapper_p.h>
#include <private/qqmlbuiltinfunctions_p.h>
#include <private/qqmlvmemetaobject_p.h>
#include <private/qqmlvaluetypewrapper_p.h>
@@ -58,18 +57,6 @@
QT_BEGIN_NAMESPACE
-QQmlBinding *QQmlBinding::create(const QQmlPropertyData *property, const QString &str, QObject *obj, QQmlContext *ctxt)
-{
- QQmlBinding *b = newBinding(QQmlEnginePrivate::get(ctxt), property);
- b->setNotifyOnValueChanged(true);
- b->QQmlJavaScriptExpression::setContext(QQmlContextData::get(ctxt));
- b->setScopeObject(obj);
-
- b->createQmlBinding(b->context(), obj, str, QString(), 0);
-
- return b;
-}
-
QQmlBinding *QQmlBinding::create(const QQmlPropertyData *property, const QQmlScriptString &script, QObject *obj, QQmlContext *ctxt)
{
QQmlBinding *b = newBinding(QQmlEnginePrivate::get(ctxt), property);
@@ -98,7 +85,9 @@ QQmlBinding *QQmlBinding::create(const QQmlPropertyData *property, const QQmlScr
QV4::ExecutionEngine *v4 = QQmlEnginePrivate::get(b->context()->engine)->v4engine();
if (runtimeFunction) {
- b->m_function.set(v4, QV4::FunctionObject::createQmlFunction(ctxtdata, b->scopeObject(), runtimeFunction));
+ QV4::Scope scope(v4);
+ QV4::Scoped<QV4::QmlContext> qmlContext(scope, QV4::QmlContext::create(v4->rootContext(), ctxtdata, b->scopeObject()));
+ b->setupFunction(qmlContext, runtimeFunction);
} else {
QString code = scriptPrivate->script;
b->createQmlBinding(b->context(), b->scopeObject(), code, url, scriptPrivate->lineNumber);
@@ -107,26 +96,11 @@ QQmlBinding *QQmlBinding::create(const QQmlPropertyData *property, const QQmlScr
return b;
}
-QQmlBinding *QQmlBinding::create(const QQmlPropertyData *property, const QString &str, QObject *obj, QQmlContextData *ctxt)
-{
- QQmlBinding *b = newBinding(QQmlEnginePrivate::get(ctxt), property);
-
- b->setNotifyOnValueChanged(true);
- b->QQmlJavaScriptExpression::setContext(ctxt);
- b->setScopeObject(obj);
-
- b->createQmlBinding(ctxt, obj, str, QString(), 0);
-
- return b;
-}
-
QQmlBinding *QQmlBinding::create(const QQmlPropertyData *property, const QString &str, QObject *obj,
- QQmlContextData *ctxt, const QString &url, quint16 lineNumber,
- quint16 columnNumber)
+ QQmlContextData *ctxt, const QString &url, quint16 lineNumber)
{
QQmlBinding *b = newBinding(QQmlEnginePrivate::get(ctxt), property);
- Q_UNUSED(columnNumber);
b->setNotifyOnValueChanged(true);
b->QQmlJavaScriptExpression::setContext(ctxt);
b->setScopeObject(obj);
@@ -136,7 +110,8 @@ QQmlBinding *QQmlBinding::create(const QQmlPropertyData *property, const QString
return b;
}
-QQmlBinding *QQmlBinding::create(const QQmlPropertyData *property, const QV4::Value &functionPtr, QObject *obj, QQmlContextData *ctxt)
+QQmlBinding *QQmlBinding::create(const QQmlPropertyData *property, QV4::Function *function,
+ QObject *obj, QQmlContextData *ctxt, QV4::ExecutionContext *scope)
{
QQmlBinding *b = newBinding(QQmlEnginePrivate::get(ctxt), property);
@@ -144,7 +119,8 @@ QQmlBinding *QQmlBinding::create(const QQmlPropertyData *property, const QV4::Va
b->QQmlJavaScriptExpression::setContext(ctxt);
b->setScopeObject(obj);
- b->m_function.set(functionPtr.as<QV4::Object>()->engine(), functionPtr);
+ Q_ASSERT(scope);
+ b->setupFunction(scope, function);
return b;
}
@@ -183,14 +159,12 @@ void QQmlBinding::update(QQmlPropertyData::WriteFlags flags)
QQmlEnginePrivate *ep = QQmlEnginePrivate::get(context()->engine);
QV4::Scope scope(ep->v4engine());
- QV4::ScopedFunctionObject f(scope, m_function.value());
- Q_ASSERT(f);
if (canUseAccessor())
flags.setFlag(QQmlPropertyData::BypassInterceptor);
- QQmlBindingProfiler prof(ep->profiler, this, f);
- doUpdate(watcher, flags, scope, f);
+ QQmlBindingProfiler prof(ep->profiler, this, function());
+ doUpdate(watcher, flags, scope);
if (!watcher.wasDeleted())
setUpdatingFlag(false);
@@ -205,8 +179,7 @@ class QQmlBindingBinding: public QQmlBinding
{
protected:
void doUpdate(const DeleteWatcher &,
- QQmlPropertyData::WriteFlags flags, QV4::Scope &,
- const QV4::ScopedFunctionObject &) Q_DECL_OVERRIDE Q_DECL_FINAL
+ QQmlPropertyData::WriteFlags flags, QV4::Scope &) Q_DECL_OVERRIDE Q_DECL_FINAL
{
Q_ASSERT(!m_targetIndex.hasValueTypeIndex());
QQmlPropertyData *pd = nullptr;
@@ -222,8 +195,7 @@ class QQmlNonbindingBinding: public QQmlBinding
{
protected:
void doUpdate(const DeleteWatcher &watcher,
- QQmlPropertyData::WriteFlags flags, QV4::Scope &scope,
- const QV4::ScopedFunctionObject &f) Q_DECL_OVERRIDE Q_DECL_FINAL
+ QQmlPropertyData::WriteFlags flags, QV4::Scope &scope) Q_DECL_OVERRIDE Q_DECL_FINAL
{
auto ep = QQmlEnginePrivate::get(scope.engine);
ep->referenceScarceResources();
@@ -240,7 +212,7 @@ protected:
if (!watcher.wasDeleted()) {
if (error) {
- delayedError()->setErrorLocation(f->sourceLocation());
+ delayedError()->setErrorLocation(sourceLocation());
delayedError()->setErrorObject(m_target.data());
}
@@ -250,10 +222,9 @@ protected:
clearError();
}
+ cancelPermanentGuards();
}
- cancelPermanentGuards();
-
ep->dereferenceScarceResources();
}
@@ -451,14 +422,10 @@ QVariant QQmlBinding::evaluate()
QString QQmlBinding::expressionIdentifier() const
{
- QQmlEnginePrivate *ep = QQmlEnginePrivate::get(context()->engine);
- QV4::Scope scope(ep->v4engine());
- QV4::ScopedValue f(scope, m_function.value());
- QV4::Function *function = f->as<QV4::FunctionObject>()->function();
-
- QString url = function->sourceFile();
- quint16 lineNumber = function->compiledFunction->location.line;
- quint16 columnNumber = function->compiledFunction->location.column;
+ auto f = function();
+ QString url = f->sourceFile();
+ quint16 lineNumber = f->compiledFunction->location.line;
+ quint16 columnNumber = f->compiledFunction->location.column;
return url + QString::asprintf(":%u:%u", uint(lineNumber), uint(columnNumber));
}
@@ -489,9 +456,7 @@ void QQmlBinding::setEnabled(bool e, QQmlPropertyData::WriteFlags flags)
QString QQmlBinding::expression() const
{
- QV4::Scope scope(QQmlEnginePrivate::get(context()->engine)->v4engine());
- QV4::ScopedValue v(scope, m_function.value());
- return v->toQStringNoThrow();
+ return QStringLiteral("function() { [code] }");
}
void QQmlBinding::setTarget(const QQmlProperty &prop)
diff --git a/src/qml/qml/qqmlbinding_p.h b/src/qml/qml/qqmlbinding_p.h
index be23a96d01..0f2fb329f5 100644
--- a/src/qml/qml/qqmlbinding_p.h
+++ b/src/qml/qml/qqmlbinding_p.h
@@ -72,12 +72,11 @@ class Q_QML_PRIVATE_EXPORT QQmlBinding : public QQmlJavaScriptExpression,
{
friend class QQmlAbstractBinding;
public:
- static QQmlBinding *create(const QQmlPropertyData *, const QString &, QObject *, QQmlContext *);
static QQmlBinding *create(const QQmlPropertyData *, const QQmlScriptString &, QObject *, QQmlContext *);
- static QQmlBinding *create(const QQmlPropertyData *, const QString &, QObject *, QQmlContextData *);
static QQmlBinding *create(const QQmlPropertyData *, const QString &, QObject *, QQmlContextData *,
- const QString &url, quint16 lineNumber, quint16 columnNumber);
- static QQmlBinding *create(const QQmlPropertyData *, const QV4::Value &, QObject *, QQmlContextData *);
+ const QString &url = QString(), quint16 lineNumber = 0);
+ static QQmlBinding *create(const QQmlPropertyData *property, QV4::Function *function,
+ QObject *obj, QQmlContextData *ctxt, QV4::ExecutionContext *scope);
~QQmlBinding();
void setTarget(const QQmlProperty &);
@@ -103,8 +102,7 @@ public:
protected:
virtual void doUpdate(const DeleteWatcher &watcher,
- QQmlPropertyData::WriteFlags flags, QV4::Scope &scope,
- const QV4::ScopedFunctionObject &f) = 0;
+ QQmlPropertyData::WriteFlags flags, QV4::Scope &scope) = 0;
void getPropertyData(QQmlPropertyData **propertyData, QQmlPropertyData *valueTypeData) const;
int getPropertyType() const;
diff --git a/src/qml/qml/qqmlboundsignal.cpp b/src/qml/qml/qqmlboundsignal.cpp
index dfb1b98ca0..254d5e1907 100644
--- a/src/qml/qml/qqmlboundsignal.cpp
+++ b/src/qml/qml/qqmlboundsignal.cpp
@@ -98,20 +98,20 @@ QQmlBoundSignalExpression::QQmlBoundSignalExpression(QObject *target, int index,
function += parameterString;
function += QLatin1String(") { ") + expression + QLatin1String(" })");
- m_function.set(v4, evalFunction(context(), scopeObject(), function, fileName, line));
-
- if (m_function.isNullOrUndefined())
- return; // could not evaluate function. Not valid.
-
+ QV4::Scope valueScope(v4);
+ QV4::ScopedFunctionObject f(valueScope, evalFunction(context(), scopeObject(), function, fileName, line));
+ QV4::ScopedContext context(valueScope, f->scope());
+ setupFunction(context, f->function());
}
-QQmlBoundSignalExpression::QQmlBoundSignalExpression(QObject *target, int index, QQmlContextData *ctxt, QObject *scope, const QV4::Value &function)
+QQmlBoundSignalExpression::QQmlBoundSignalExpression(QObject *target, int index, QQmlContextData *ctxt, QObject *scopeObject,
+ QV4::Function *function, QV4::ExecutionContext *scope)
: QQmlJavaScriptExpression(),
m_index(index),
m_target(target)
{
- m_function.set(function.as<QV4::Object>()->engine(), function);
- init(ctxt, scope);
+ setupFunction(scope, function);
+ init(ctxt, scopeObject);
}
QQmlBoundSignalExpression::QQmlBoundSignalExpression(QObject *target, int index, QQmlContextData *ctxt, QObject *scope, QV4::Function *runtimeFunction)
@@ -122,14 +122,22 @@ QQmlBoundSignalExpression::QQmlBoundSignalExpression(QObject *target, int index,
// It's important to call init first, because m_index gets remapped in case of cloned signals.
init(ctxt, scope);
- QMetaMethod signal = QMetaObjectPrivate::signal(m_target->metaObject(), m_index);
- QString error;
QV4::ExecutionEngine *engine = QQmlEnginePrivate::getV4Engine(ctxt->engine);
- m_function.set(engine, QV4::FunctionObject::createQmlFunction(ctxt, scope, runtimeFunction, signal.parameterNames(), &error));
- if (!error.isEmpty()) {
- qmlInfo(scopeObject()) << error;
- m_function.clear();
+
+ QList<QByteArray> signalParameters = QMetaObjectPrivate::signal(m_target->metaObject(), m_index).parameterNames();
+ if (!signalParameters.isEmpty()) {
+ QString error;
+ QQmlPropertyCache::signalParameterStringForJS(engine, signalParameters, &error);
+ if (!error.isEmpty()) {
+ qmlInfo(scopeObject()) << error;
+ return;
+ }
+ runtimeFunction->updateInternalClass(engine, signalParameters);
}
+
+ QV4::Scope valueScope(engine);
+ QV4::Scoped<QV4::QmlContext> qmlContext(valueScope, QV4::QmlContext::create(engine->rootContext(), ctxt, scope));
+ setupFunction(qmlContext, runtimeFunction);
}
void QQmlBoundSignalExpression::init(QQmlContextData *ctxt, QObject *scope)
@@ -157,41 +165,13 @@ void QQmlBoundSignalExpression::expressionChanged()
// bound signals do not notify on change.
}
-QQmlSourceLocation QQmlBoundSignalExpression::sourceLocation() const
-{
- QV4::Function *f = function();
- if (f) {
- QQmlSourceLocation loc;
- loc.sourceFile = f->sourceFile();
- loc.line = f->compiledFunction->location.line;
- loc.column = f->compiledFunction->location.column;
- return loc;
- }
- return QQmlSourceLocation();
-}
-
QString QQmlBoundSignalExpression::expression() const
{
- if (expressionFunctionValid()) {
- Q_ASSERT (context() && engine());
- QV4::Scope scope(QQmlEnginePrivate::get(engine())->v4engine());
- QV4::ScopedValue v(scope, m_function.value());
- return v->toQStringNoThrow();
- }
+ if (expressionFunctionValid())
+ return QStringLiteral("function() { [code] }");
return QString();
}
-QV4::Function *QQmlBoundSignalExpression::function() const
-{
- if (expressionFunctionValid()) {
- Q_ASSERT (context() && engine());
- QV4::Scope scope(QQmlEnginePrivate::get(engine())->v4engine());
- QV4::ScopedFunctionObject v(scope, m_function.value());
- return v ? v->function() : 0;
- }
- return 0;
-}
-
// Parts of this function mirror code in QQmlExpressionPrivate::value() and v8value().
// Changes made here may need to be made there and vice versa.
void QQmlBoundSignalExpression::evaluate(void **a)
diff --git a/src/qml/qml/qqmlboundsignal_p.h b/src/qml/qml/qqmlboundsignal_p.h
index 4356c6cbfa..3a0b8aed59 100644
--- a/src/qml/qml/qqmlboundsignal_p.h
+++ b/src/qml/qml/qqmlboundsignal_p.h
@@ -73,7 +73,7 @@ public:
const QString &parameterString = QString());
QQmlBoundSignalExpression(QObject *target, int index,
- QQmlContextData *ctxt, QObject *scope, const QV4::Value &function);
+ QQmlContextData *ctxt, QObject *scopeObject, QV4::Function *function, QV4::ExecutionContext *scope);
QQmlBoundSignalExpression(QObject *target, int index,
QQmlContextData *ctxt, QObject *scope, QV4::Function *runtimeFunction);
@@ -86,9 +86,7 @@ public:
void evaluate(void **a);
void evaluate(const QList<QVariant> &args);
- QQmlSourceLocation sourceLocation() const;
QString expression() const;
- QV4::Function *function() const;
QObject *target() const { return m_target; }
QQmlEngine *engine() const { return context() ? context()->engine : 0; }
@@ -98,7 +96,7 @@ private:
void init(QQmlContextData *ctxt, QObject *scope);
- bool expressionFunctionValid() const { return !m_function.isNullOrUndefined(); }
+ bool expressionFunctionValid() const { return function() != 0; }
int m_index;
QObject *m_target;
diff --git a/src/qml/qml/qqmldelayedcallqueue.cpp b/src/qml/qml/qqmldelayedcallqueue.cpp
index d10a8c7718..7552e1e82b 100644
--- a/src/qml/qml/qqmldelayedcallqueue.cpp
+++ b/src/qml/qml/qqmldelayedcallqueue.cpp
@@ -43,7 +43,6 @@
#include <private/qqmljavascriptexpression_p.h>
#include <private/qv4value_p.h>
#include <private/qv4qobjectwrapper_p.h>
-#include <private/qqmlcontextwrapper_p.h>
#include <QQmlError>
diff --git a/src/qml/qml/qqmlerror.cpp b/src/qml/qml/qqmlerror.cpp
index b309550ca8..0a6c7b4960 100644
--- a/src/qml/qml/qqmlerror.cpp
+++ b/src/qml/qml/qqmlerror.cpp
@@ -285,7 +285,7 @@ QDebug operator<<(QDebug debug, const QQmlError &error)
if (f.open(QIODevice::ReadOnly)) {
QByteArray data = f.readAll();
QTextStream stream(data, QIODevice::ReadOnly);
-#ifndef QT_NO_TEXTCODEC
+#if QT_CONFIG(textcodec)
stream.setCodec("UTF-8");
#endif
const QString code = stream.readAll();
diff --git a/src/qml/qml/qqmlexpression.cpp b/src/qml/qml/qqmlexpression.cpp
index 01d4722ca6..1e1fbcf448 100644
--- a/src/qml/qml/qqmlexpression.cpp
+++ b/src/qml/qml/qqmlexpression.cpp
@@ -75,7 +75,9 @@ void QQmlExpressionPrivate::init(QQmlContextData *ctxt, QV4::Function *runtimeFu
{
expressionFunctionValid = true;
QV4::ExecutionEngine *engine = QQmlEnginePrivate::getV4Engine(ctxt->engine);
- m_function.set(engine, QV4::FunctionObject::createQmlFunction(ctxt, me, runtimeFunction));
+ QV4::Scope scope(engine);
+ QV4::Scoped<QV4::QmlContext> qmlContext(scope, QV4::QmlContext::create(engine->rootContext(), ctxt, me));
+ setupFunction(qmlContext, runtimeFunction);
QQmlJavaScriptExpression::setContext(ctxt);
setScopeObject(me);
diff --git a/src/qml/qml/qqmlglobal.cpp b/src/qml/qml/qqmlglobal.cpp
index 722527a546..f967dacd34 100644
--- a/src/qml/qml/qqmlglobal.cpp
+++ b/src/qml/qml/qqmlglobal.cpp
@@ -326,7 +326,6 @@ QObject *QQmlGuiProvider::application(QObject *) { return new QQmlApplication();
QStringList QQmlGuiProvider::fontFamilies() { return QStringList(); }
bool QQmlGuiProvider::openUrlExternally(QUrl &) { return false; }
-#ifndef QT_NO_IM
QObject *QQmlGuiProvider::inputMethod()
{
// We don't have any input method code by default
@@ -335,7 +334,6 @@ QObject *QQmlGuiProvider::inputMethod()
QQmlEngine::setObjectOwnership(o, QQmlEngine::JavaScriptOwnership);
return o;
}
-#endif
QObject *QQmlGuiProvider::styleHints()
{
diff --git a/src/qml/qml/qqmlglobal_p.h b/src/qml/qml/qqmlglobal_p.h
index 0f5cf3a392..707814e781 100644
--- a/src/qml/qml/qqmlglobal_p.h
+++ b/src/qml/qml/qqmlglobal_p.h
@@ -307,9 +307,7 @@ class Q_QML_PRIVATE_EXPORT QQmlGuiProvider
public:
virtual ~QQmlGuiProvider();
virtual QObject *application(QObject *parent);
-#ifndef QT_NO_IM
virtual QObject *inputMethod();
-#endif
virtual QObject *styleHints();
virtual QStringList fontFamilies();
virtual bool openUrlExternally(QUrl &);
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index 4ded0f93bb..8712b638c5 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -177,7 +177,7 @@ QQmlType *getTypeForUrl(const QString &urlString, const QHashedStringRef& typeNa
} // namespace
-#ifndef QT_NO_LIBRARY
+#if QT_CONFIG(library)
struct RegisteredPlugin {
QString uri;
QPluginLoader* loader;
@@ -302,7 +302,7 @@ public:
const QString &uri, const QString &url,
int vmaj, int vmin, QV4::CompiledData::Import::ImportType type,
QList<QQmlError> *errors, bool lowPrecedence = false);
-#ifndef QT_NO_LIBRARY
+#if QT_CONFIG(library)
bool populatePluginPairVector(QVector<StaticPluginPair> &result, const QString &uri, const QStringList &versionUris,
const QString &qmldirPath, QList<QQmlError> *errors);
#endif
@@ -897,7 +897,7 @@ static QStringList versionUriList(const QString &uri, int vmaj, int vmin)
return result;
}
-#ifndef QT_NO_LIBRARY
+#if QT_CONFIG(library)
static QVector<QStaticPlugin> makePlugins()
{
QVector<QStaticPlugin> plugins;
@@ -966,7 +966,7 @@ bool QQmlImportsPrivate::importExtension(const QString &qmldirFilePath,
const QQmlTypeLoader::QmldirContent *qmldir,
QList<QQmlError> *errors)
{
-#if !defined(QT_NO_LIBRARY)
+#if QT_CONFIG(library)
Q_ASSERT(qmldir);
if (qmlImportTrace())
@@ -1094,7 +1094,7 @@ bool QQmlImportsPrivate::importExtension(const QString &qmldirFilePath,
}
return false;
-#endif // QT_NO_LIBRARY
+#endif // library
return true;
}
@@ -1950,7 +1950,7 @@ bool QQmlImportDatabase::registerPluginTypes(QObject *instance, const QString &b
bool QQmlImportDatabase::importStaticPlugin(QObject *instance, const QString &basePath,
const QString &uri, const QString &typeNamespace, int vmaj, QList<QQmlError> *errors)
{
-#ifndef QT_NO_LIBRARY
+#if QT_CONFIG(library)
// Dynamic plugins are differentiated by their filepath. For static plugins we
// don't have that information so we use their address as key instead.
const QString uniquePluginID = QString::asprintf("%p", instance);
@@ -2003,7 +2003,7 @@ bool QQmlImportDatabase::importStaticPlugin(QObject *instance, const QString &ba
bool QQmlImportDatabase::importDynamicPlugin(const QString &filePath, const QString &uri,
const QString &typeNamespace, int vmaj, QList<QQmlError> *errors)
{
-#ifndef QT_NO_LIBRARY
+#if QT_CONFIG(library)
QFileInfo fileInfo(filePath);
const QString absoluteFilePath = fileInfo.absoluteFilePath();
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp
index 8020bdb2be..17cccc0bbd 100644
--- a/src/qml/qml/qqmljavascriptexpression.cpp
+++ b/src/qml/qml/qqmljavascriptexpression.cpp
@@ -48,6 +48,7 @@
#include <private/qv4scopedvalue_p.h>
#include <private/qqmlglobal_p.h>
#include <private/qv4qobjectwrapper_p.h>
+#include <private/qqmlbuiltinfunctions_p.h>
QT_BEGIN_NAMESPACE
@@ -94,7 +95,9 @@ QQmlJavaScriptExpression::QQmlJavaScriptExpression()
: m_error(0),
m_context(0),
m_prevExpression(0),
- m_nextExpression(0)
+ m_nextExpression(0),
+ m_v4Function(0),
+ m_sourceLocation(0)
{
}
@@ -110,6 +113,8 @@ QQmlJavaScriptExpression::~QQmlJavaScriptExpression()
clearPermanentGuards();
if (m_scopeObject.isT2()) // notify DeleteWatcher of our deletion.
m_scopeObject.asT2()->_s = 0;
+
+ delete m_sourceLocation;
}
void QQmlJavaScriptExpression::setNotifyOnValueChanged(bool v)
@@ -128,6 +133,22 @@ void QQmlJavaScriptExpression::resetNotifyOnValueChanged()
setNotifyOnValueChanged(false);
}
+QQmlSourceLocation QQmlJavaScriptExpression::sourceLocation() const
+{
+ if (m_sourceLocation)
+ return *m_sourceLocation;
+ if (m_v4Function)
+ return m_v4Function->sourceLocation();
+ return QQmlSourceLocation();
+}
+
+void QQmlJavaScriptExpression::setSourceLocation(const QQmlSourceLocation &location)
+{
+ if (m_sourceLocation)
+ delete m_sourceLocation;
+ m_sourceLocation = new QQmlSourceLocation(location);
+}
+
void QQmlJavaScriptExpression::setContext(QQmlContextData *context)
{
if (m_prevExpression) {
@@ -149,6 +170,11 @@ void QQmlJavaScriptExpression::setContext(QQmlContextData *context)
}
}
+QV4::Function *QQmlJavaScriptExpression::function() const
+{
+ return m_v4Function;
+}
+
void QQmlJavaScriptExpression::refresh()
{
}
@@ -159,8 +185,8 @@ void QQmlJavaScriptExpression::evaluate(QV4::CallData *callData, bool *isUndefin
{
Q_ASSERT(m_context && m_context->engine);
- QV4::Value *f = m_function.valueRef();
- if (!f || f->isUndefined()) {
+ QV4::Function *v4Function = function();
+ if (!v4Function) {
if (isUndefined)
*isUndefined = true;
return;
@@ -191,7 +217,13 @@ void QQmlJavaScriptExpression::evaluate(QV4::CallData *callData, bool *isUndefin
callData->thisObject = value;
}
- f->as<QV4::FunctionObject>()->call(scope, callData);
+ QV4::ExecutionContext *outer = static_cast<QV4::ExecutionContext *>(m_qmlScope.valueRef());
+ if (v4Function->canUseSimpleFunction()) {
+ outer->simpleCall(scope, callData, v4Function);
+ } else {
+ outer->call(scope, callData, v4Function);
+ }
+
if (scope.hasException()) {
if (watcher.wasDeleted())
scope.engine->catchException(); // ignore exception
@@ -374,7 +406,7 @@ QQmlJavaScriptExpression::evalFunction(QQmlContextData *ctxt, QObject *scopeObje
QV4::ExecutionEngine *v4 = QV8Engine::getV4(ep->v8engine());
QV4::Scope scope(v4);
- QV4::Scoped<QV4::QmlContext> qmlContext(scope, v4->rootContext()->newQmlContext(ctxt, scopeObject));
+ QV4::Scoped<QV4::QmlContext> qmlContext(scope, QV4::QmlContext::create(v4->rootContext(), ctxt, scopeObject));
QV4::Script script(v4, qmlContext, code, filename, line);
QV4::ScopedValue result(scope);
script.parse();
@@ -404,12 +436,9 @@ void QQmlJavaScriptExpression::createQmlBinding(QQmlContextData *ctxt, QObject *
QV4::ExecutionEngine *v4 = QV8Engine::getV4(ep->v8engine());
QV4::Scope scope(v4);
- QV4::Scoped<QV4::QmlContext> qmlContext(scope, v4->rootContext()->newQmlContext(ctxt, qmlScope));
+ QV4::Scoped<QV4::QmlContext> qmlContext(scope, QV4::QmlContext::create(v4->rootContext(), ctxt, qmlScope));
QV4::Script script(v4, qmlContext, code, filename, line);
- QV4::ScopedValue result(scope);
script.parse();
- if (!v4->hasException)
- result = script.qmlBinding();
if (v4->hasException) {
QQmlError error = v4->catchExceptionAsQmlError();
if (error.description().isEmpty())
@@ -420,11 +449,19 @@ void QQmlJavaScriptExpression::createQmlBinding(QQmlContextData *ctxt, QObject *
error.setUrl(QUrl::fromLocalFile(filename));
error.setObject(qmlScope);
ep->warning(error);
- result = QV4::Encode::undefined();
+ return;
}
- m_function.set(v4, result);
+ setupFunction(qmlContext, script.vmFunction);
}
+void QQmlJavaScriptExpression::setupFunction(QV4::ExecutionContext *qmlContext, QV4::Function *f)
+{
+ if (!qmlContext || !f)
+ return;
+ m_qmlScope.set(qmlContext->engine(), *qmlContext);
+ m_v4Function = f;
+ m_compilationUnit = m_v4Function->compilationUnit;
+}
void QQmlJavaScriptExpression::clearActiveGuards()
{
diff --git a/src/qml/qml/qqmljavascriptexpression_p.h b/src/qml/qml/qqmljavascriptexpression_p.h
index a0735d91de..646cc5ab3d 100644
--- a/src/qml/qml/qqmljavascriptexpression_p.h
+++ b/src/qml/qml/qqmljavascriptexpression_p.h
@@ -113,11 +113,16 @@ public:
inline QObject *scopeObject() const;
inline void setScopeObject(QObject *v);
+ QQmlSourceLocation sourceLocation() const;
+ void setSourceLocation(const QQmlSourceLocation &location);
+
bool isValid() const { return context() != 0; }
QQmlContextData *context() const { return m_context; }
void setContext(QQmlContextData *context);
+ QV4::Function *function() const;
+
virtual void refresh();
class DeleteWatcher {
@@ -154,6 +159,8 @@ protected:
}
}
+ void setupFunction(QV4::ExecutionContext *qmlContext, QV4::Function *f);
+
private:
friend class QQmlContextData;
friend class QQmlPropertyCapture;
@@ -173,8 +180,10 @@ private:
QQmlJavaScriptExpression *m_nextExpression;
bool m_permanentDependenciesRegistered = false;
-protected:
- QV4::PersistentValue m_function;
+ QV4::PersistentValue m_qmlScope;
+ QQmlRefPointer<QV4::CompiledData::CompilationUnit> m_compilationUnit;
+ QV4::Function *m_v4Function;
+ QQmlSourceLocation *m_sourceLocation; // used for Qt.binding() created functions
};
class QQmlPropertyCapture
diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp
index 6f66475aa5..3876e774c3 100644
--- a/src/qml/qml/qqmllocale.cpp
+++ b/src/qml/qml/qqmllocale.cpp
@@ -107,8 +107,8 @@ QV4::ReturnedValue QQmlDateExtension::method_toLocaleString(QV4::CallContext *ct
QLocale::FormatType enumFormat = QLocale::LongFormat;
QString formattedDt;
if (ctx->argc() == 2) {
- if (ctx->args()[1].isString()) {
- QString format = ctx->args()[1].stringValue()->toQString();
+ if (String *s = ctx->args()[1].stringValue()) {
+ QString format = s->toQString();
formattedDt = r->d()->locale->toString(dt, format);
} else if (ctx->args()[1].isNumber()) {
quint32 intFormat = ctx->args()[1].toNumber();
@@ -152,8 +152,8 @@ QV4::ReturnedValue QQmlDateExtension::method_toLocaleTimeString(QV4::CallContext
QLocale::FormatType enumFormat = QLocale::LongFormat;
QString formattedTime;
if (ctx->argc() == 2) {
- if (ctx->args()[1].isString()) {
- QString format = ctx->args()[1].stringValue()->toQString();
+ if (String *s = ctx->args()[1].stringValue()) {
+ QString format = s->toQString();
formattedTime = r->d()->locale->toString(time, format);
} else if (ctx->args()[1].isNumber()) {
quint32 intFormat = ctx->args()[1].toNumber();
@@ -197,8 +197,8 @@ QV4::ReturnedValue QQmlDateExtension::method_toLocaleDateString(QV4::CallContext
QLocale::FormatType enumFormat = QLocale::LongFormat;
QString formattedDate;
if (ctx->argc() == 2) {
- if (ctx->args()[1].isString()) {
- QString format = ctx->args()[1].stringValue()->toQString();
+ if (String *s = ctx->args()[1].stringValue()) {
+ QString format = s->toQString();
formattedDate = r->d()->locale->toString(date, format);
} else if (ctx->args()[1].isNumber()) {
quint32 intFormat = ctx->args()[1].toNumber();
@@ -217,11 +217,13 @@ QV4::ReturnedValue QQmlDateExtension::method_toLocaleDateString(QV4::CallContext
QV4::ReturnedValue QQmlDateExtension::method_fromLocaleString(QV4::CallContext *ctx)
{
QV4::ExecutionEngine * const engine = ctx->d()->engine;
- if (ctx->argc() == 1 && ctx->args()[0].isString()) {
- QLocale locale;
- QString dateString = ctx->args()[0].stringValue()->toQString();
- QDateTime dt = locale.toDateTime(dateString);
- return QV4::Encode(engine->newDateObject(dt));
+ if (ctx->argc() == 1) {
+ if (String *s = ctx->args()[0].stringValue()) {
+ QLocale locale;
+ QString dateString = s->toQString();
+ QDateTime dt = locale.toDateTime(dateString);
+ return QV4::Encode(engine->newDateObject(dt));
+ }
}
QV4::Scope scope(ctx);
@@ -235,8 +237,8 @@ QV4::ReturnedValue QQmlDateExtension::method_fromLocaleString(QV4::CallContext *
QDateTime dt;
QString dateString = ctx->args()[1].toQStringNoThrow();
if (ctx->argc() == 3) {
- if (ctx->args()[2].isString()) {
- QString format = ctx->args()[2].stringValue()->toQString();
+ if (String *s = ctx->args()[2].stringValue()) {
+ QString format = s->toQString();
dt = r->d()->locale->toDateTime(dateString, format);
} else if (ctx->args()[2].isNumber()) {
quint32 intFormat = ctx->args()[2].toNumber();
@@ -256,13 +258,15 @@ QV4::ReturnedValue QQmlDateExtension::method_fromLocaleTimeString(QV4::CallConte
{
QV4::ExecutionEngine * const engine = ctx->d()->engine;
- if (ctx->argc() == 1 && ctx->args()[0].isString()) {
- QLocale locale;
- QString timeString = ctx->args()[0].stringValue()->toQString();
- QTime time = locale.toTime(timeString);
- QDateTime dt = QDateTime::currentDateTime();
- dt.setTime(time);
- return QV4::Encode(engine->newDateObject(dt));
+ if (ctx->argc() == 1) {
+ if (String *s = ctx->args()[0].stringValue()) {
+ QLocale locale;
+ QString timeString = s->toQString();
+ QTime time = locale.toTime(timeString);
+ QDateTime dt = QDateTime::currentDateTime();
+ dt.setTime(time);
+ return QV4::Encode(engine->newDateObject(dt));
+ }
}
if (ctx->argc() < 1 || ctx->argc() > 3 || !isLocaleObject(ctx->args()[0]))
@@ -276,8 +280,8 @@ QV4::ReturnedValue QQmlDateExtension::method_fromLocaleTimeString(QV4::CallConte
QTime tm;
QString dateString = ctx->args()[1].toQStringNoThrow();
if (ctx->argc() == 3) {
- if (ctx->args()[2].isString()) {
- QString format = ctx->args()[2].stringValue()->toQString();
+ if (String *s = ctx->args()[2].stringValue()) {
+ QString format = s->toQString();
tm = r->d()->locale->toTime(dateString, format);
} else if (ctx->args()[2].isNumber()) {
quint32 intFormat = ctx->args()[2].toNumber();
@@ -303,11 +307,13 @@ QV4::ReturnedValue QQmlDateExtension::method_fromLocaleDateString(QV4::CallConte
{
QV4::ExecutionEngine * const engine = ctx->d()->engine;
- if (ctx->argc() == 1 && ctx->args()[0].isString()) {
- QLocale locale;
- QString dateString = ctx->args()[0].stringValue()->toQString();
- QDate date = locale.toDate(dateString);
- return QV4::Encode(engine->newDateObject(QDateTime(date)));
+ if (ctx->argc() == 1) {
+ if (String *s = ctx->args()[0].stringValue()) {
+ QLocale locale;
+ QString dateString = s->toQString();
+ QDate date = locale.toDate(dateString);
+ return QV4::Encode(engine->newDateObject(QDateTime(date)));
+ }
}
if (ctx->argc() < 1 || ctx->argc() > 3 || !isLocaleObject(ctx->args()[0]))
@@ -321,8 +327,8 @@ QV4::ReturnedValue QQmlDateExtension::method_fromLocaleDateString(QV4::CallConte
QDate dt;
QString dateString = ctx->args()[1].toQStringNoThrow();
if (ctx->argc() == 3) {
- if (ctx->args()[2].isString()) {
- QString format = ctx->args()[2].stringValue()->toQString();
+ if (String *s = ctx->args()[2].stringValue()) {
+ QString format = s->toQString();
dt = r->d()->locale->toDate(dateString, format);
} else if (ctx->args()[2].isNumber()) {
quint32 intFormat = ctx->args()[2].toNumber();
diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp
index 6a1a90f031..520c44f4da 100644
--- a/src/qml/qml/qqmlmetatype.cpp
+++ b/src/qml/qml/qqmlmetatype.cpp
@@ -1158,7 +1158,7 @@ void qmlClearTypeRegistrations() // Declared in qqml.h
data->uriToModule.clear();
QQmlEnginePrivate::baseModulesUninitialized = true; //So the engine re-registers its types
-#ifndef QT_NO_LIBRARY
+#if QT_CONFIG(library)
qmlClearEnginePlugins();
#endif
}
diff --git a/src/qml/qml/qqmlnotifier.cpp b/src/qml/qml/qqmlnotifier.cpp
index 19f03eae80..185f9687fb 100644
--- a/src/qml/qml/qqmlnotifier.cpp
+++ b/src/qml/qml/qqmlnotifier.cpp
@@ -71,6 +71,12 @@ namespace {
};
}
+void QQmlNotifier::notify(QQmlData *ddata, int notifierIndex)
+{
+ if (QQmlNotifierEndpoint *ep = ddata->notify(notifierIndex))
+ emitNotify(ep, Q_NULLPTR);
+}
+
void QQmlNotifier::emitNotify(QQmlNotifierEndpoint *endpoint, void **a)
{
QVarLengthArray<NotifyListTraversalData> stack;
diff --git a/src/qml/qml/qqmlnotifier_p.h b/src/qml/qml/qqmlnotifier_p.h
index 4db0dd038a..dad79e0e55 100644
--- a/src/qml/qml/qqmlnotifier_p.h
+++ b/src/qml/qml/qqmlnotifier_p.h
@@ -65,6 +65,8 @@ public:
inline ~QQmlNotifier();
inline void notify();
+ static void notify(QQmlData *ddata, int notifierIndex);
+
private:
friend class QQmlData;
friend class QQmlNotifierEndpoint;
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index 2218f277d6..2e2a3fb303 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -44,7 +44,6 @@
#include <private/qv4function_p.h>
#include <private/qv4functionobject_p.h>
#include <private/qv4qobjectwrapper_p.h>
-#include <private/qqmlcontextwrapper_p.h>
#include <private/qqmlbinding_p.h>
#include <private/qqmlstringconverters_p.h>
#include <private/qqmlboundsignal_p.h>
@@ -402,7 +401,7 @@ void QQmlObjectCreator::setPropertyValue(const QQmlPropertyData *property, const
}
}
break;
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
case QVariant::Date: {
bool ok = false;
QDate value = QQmlStringConverters::dateFromString(binding->valueAsString(qmlUnit), &ok);
@@ -430,7 +429,7 @@ void QQmlObjectCreator::setPropertyValue(const QQmlPropertyData *property, const
property->writeProperty(_qobject, &value, propertyWriteFlags);
}
break;
-#endif // QT_NO_DATESTRING
+#endif // datestring
case QVariant::Point: {
bool ok = false;
QPoint value = QQmlStringConverters::pointFFromString(binding->valueAsString(qmlUnit), &ok).toPoint();
@@ -793,14 +792,13 @@ bool QQmlObjectCreator::setPropertyBinding(const QQmlPropertyData *property, con
QV4::Function *runtimeFunction = compilationUnit->runtimeFunctions[binding->value.compiledScriptIndex];
QV4::Scope scope(v4);
- QV4::ScopedContext qmlContext(scope, currentQmlContext());
- QV4::ScopedFunctionObject function(scope, QV4::FunctionObject::createScriptFunction(qmlContext, runtimeFunction, /*createProto*/ false));
+ QV4::Scoped<QV4::QmlContext> qmlContext(scope, currentQmlContext());
if (binding->flags & QV4::CompiledData::Binding::IsSignalHandlerExpression) {
int signalIndex = _propertyCache->methodIndexToSignalIndex(property->coreIndex());
QQmlBoundSignal *bs = new QQmlBoundSignal(_bindingTarget, signalIndex, _scopeObject, engine);
QQmlBoundSignalExpression *expr = new QQmlBoundSignalExpression(_bindingTarget, signalIndex,
- context, _scopeObject, function);
+ context, _scopeObject, runtimeFunction, qmlContext);
bs->takeExpression(expr);
} else {
@@ -810,13 +808,14 @@ bool QQmlObjectCreator::setPropertyBinding(const QQmlPropertyData *property, con
// the result is written to a value type virtual property, that contains the sub-index
// of the "x" property.
QQmlBinding *qmlBinding;
+ const QQmlPropertyData *prop = property;
+ const QQmlPropertyData *subprop = nullptr;
if (_valueTypeProperty) {
- qmlBinding = QQmlBinding::create(_valueTypeProperty, function, _scopeObject, context);
- qmlBinding->setTarget(_bindingTarget, *_valueTypeProperty, property);
- } else {
- qmlBinding = QQmlBinding::create(property, function, _scopeObject, context);
- qmlBinding->setTarget(_bindingTarget, *property, nullptr);
+ prop = _valueTypeProperty;
+ subprop = property;
}
+ qmlBinding = QQmlBinding::create(prop, runtimeFunction, _scopeObject, context, qmlContext);
+ qmlBinding->setTarget(_bindingTarget, *prop, subprop);
sharedState->allCreatedBindings.push(QQmlAbstractBinding::Ptr(qmlBinding));
@@ -1016,8 +1015,8 @@ void QQmlObjectCreator::registerObjectWithContextById(const QV4::CompiledData::O
QV4::Heap::QmlContext *QQmlObjectCreator::currentQmlContext()
{
- if (!_qmlContext->objectValue())
- _qmlContext->setM(v4->rootContext()->newQmlContext(context, _scopeObject));
+ if (!_qmlContext->isManaged())
+ _qmlContext->setM(QV4::QmlContext::create(v4->rootContext(), context, _scopeObject));
return _qmlContext->d();
}
diff --git a/src/qml/qml/qqmlproperty_p.h b/src/qml/qml/qqmlproperty_p.h
index 2565ec0ce6..53062a2f13 100644
--- a/src/qml/qml/qqmlproperty_p.h
+++ b/src/qml/qml/qqmlproperty_p.h
@@ -115,30 +115,26 @@ public:
};
Q_DECLARE_FLAGS(BindingFlags, BindingFlag)
- static void setBinding(QQmlAbstractBinding *binding, BindingFlags flags = None, QQmlPropertyData::WriteFlags writeFlags = QQmlPropertyData::DontRemoveBinding);
+ static void setBinding(QQmlAbstractBinding *binding, BindingFlags flags = None,
+ QQmlPropertyData::WriteFlags writeFlags = QQmlPropertyData::DontRemoveBinding);
static void removeBinding(const QQmlProperty &that);
static void removeBinding(QObject *o, QQmlPropertyIndex index);
static void removeBinding(QQmlAbstractBinding *b);
static QQmlAbstractBinding *binding(QObject *, QQmlPropertyIndex index);
- static QQmlProperty restore(QObject *, const QQmlPropertyData &, const QQmlPropertyData *,
- QQmlContextData *);
+ static QQmlProperty restore(QObject *, const QQmlPropertyData &, const QQmlPropertyData *, QQmlContextData *);
int signalIndex() const;
- static inline QQmlPropertyPrivate *get(const QQmlProperty &p) {
- return p.d;
- }
+ static inline QQmlPropertyPrivate *get(const QQmlProperty &p) { return p.d; }
// "Public" (to QML) methods
static QQmlAbstractBinding *binding(const QQmlProperty &that);
static void setBinding(const QQmlProperty &that, QQmlAbstractBinding *);
static QQmlBoundSignalExpression *signalExpression(const QQmlProperty &that);
- static void setSignalExpression(const QQmlProperty &that,
- QQmlBoundSignalExpression *);
- static void takeSignalExpression(const QQmlProperty &that,
- QQmlBoundSignalExpression *);
+ static void setSignalExpression(const QQmlProperty &that, QQmlBoundSignalExpression *);
+ static void takeSignalExpression(const QQmlProperty &that, QQmlBoundSignalExpression *);
static bool write(const QQmlProperty &that, const QVariant &, QQmlPropertyData::WriteFlags);
static QQmlPropertyIndex propertyIndex(const QQmlProperty &that);
static QMetaMethod findSignalByName(const QMetaObject *mo, const QByteArray &);
diff --git a/src/qml/qml/qqmlstringconverters.cpp b/src/qml/qml/qqmlstringconverters.cpp
index d2b3577a1f..e53f90b45b 100644
--- a/src/qml/qml/qqmlstringconverters.cpp
+++ b/src/qml/qml/qqmlstringconverters.cpp
@@ -71,14 +71,14 @@ QVariant QQmlStringConverters::variantFromString(const QString &s, int preferred
return QVariant(int(qRound(s.toDouble(ok))));
case QMetaType::UInt:
return QVariant(uint(qRound(s.toDouble(ok))));
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
case QMetaType::QDate:
return QVariant::fromValue(dateFromString(s, ok));
case QMetaType::QTime:
return QVariant::fromValue(timeFromString(s, ok));
case QMetaType::QDateTime:
return QVariant::fromValue(dateTimeFromString(s, ok));
-#endif // QT_NO_DATESTRING
+#endif // datestring
case QMetaType::QPointF:
return QVariant::fromValue(pointFFromString(s, ok));
case QMetaType::QPoint:
@@ -106,7 +106,7 @@ unsigned QQmlStringConverters::rgbaFromString(const QString &s, bool *ok)
return QQml_colorProvider()->rgbaFromString(s, ok);
}
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
QDate QQmlStringConverters::dateFromString(const QString &s, bool *ok)
{
QDate d = QDate::fromString(s, Qt::ISODate);
@@ -130,7 +130,7 @@ QDateTime QQmlStringConverters::dateTimeFromString(const QString &s, bool *ok)
d.setTimeSpec(Qt::UTC);
return d;
}
-#endif // QT_NO_DATESTRING
+#endif // datestring
//expects input of "x,y"
QPointF QQmlStringConverters::pointFFromString(const QString &s, bool *ok)
@@ -229,7 +229,7 @@ bool QQmlStringConverters::createFromString(int type, const QString &s, void *da
*p = uint(qRound(s.toDouble(&ok)));
return ok;
}
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
case QMetaType::QDate:
{
Q_ASSERT(n >= sizeof(QDate));
@@ -251,7 +251,7 @@ bool QQmlStringConverters::createFromString(int type, const QString &s, void *da
*p = dateTimeFromString(s, &ok);
return ok;
}
-#endif // QT_NO_DATESTRING
+#endif // datestring
case QMetaType::QPointF:
{
Q_ASSERT(n >= sizeof(QPointF));
diff --git a/src/qml/qml/qqmlstringconverters_p.h b/src/qml/qml/qqmlstringconverters_p.h
index b67cefaf35..af344e3344 100644
--- a/src/qml/qml/qqmlstringconverters_p.h
+++ b/src/qml/qml/qqmlstringconverters_p.h
@@ -72,7 +72,7 @@ namespace QQmlStringConverters
Q_QML_PRIVATE_EXPORT QVariant colorFromString(const QString &, bool *ok = 0);
Q_QML_PRIVATE_EXPORT unsigned rgbaFromString(const QString &, bool *ok = 0);
-#ifndef QT_NO_DATESTRING
+#if QT_CONFIG(datestring)
Q_QML_PRIVATE_EXPORT QDate dateFromString(const QString &, bool *ok = 0);
Q_QML_PRIVATE_EXPORT QTime timeFromString(const QString &, bool *ok = 0);
Q_QML_PRIVATE_EXPORT QDateTime dateTimeFromString(const QString &, bool *ok = 0);
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 3885e6ea0b..76ac15e2f1 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -39,7 +39,6 @@
#include "qqmltypeloader_p.h"
#include "qqmlabstracturlinterceptor.h"
-#include "qqmlcontextwrapper_p.h"
#include "qqmlexpression_p.h"
#include <private/qqmlengine_p.h>
@@ -2836,7 +2835,7 @@ QV4::ReturnedValue QQmlScriptData::scriptValueForContext(QQmlContextData *parent
return QV4::Encode::undefined();
}
- QV4::Scoped<QV4::QmlContext> qmlContext(scope, v4->rootContext()->newQmlContext(ctxt, 0));
+ QV4::Scoped<QV4::QmlContext> qmlContext(scope, QV4::QmlContext::create(v4->rootContext(), ctxt, 0));
qmlContext->takeContextOwnership();
m_program->qmlContext.set(scope.engine, qmlContext);
diff --git a/src/qml/qml/qqmltypewrapper.cpp b/src/qml/qml/qqmltypewrapper.cpp
index 5c3ad6b2a6..fd1e9cc2be 100644
--- a/src/qml/qml/qqmltypewrapper.cpp
+++ b/src/qml/qml/qqmltypewrapper.cpp
@@ -38,7 +38,6 @@
****************************************************************************/
#include "qqmltypewrapper_p.h"
-#include <private/qqmlcontextwrapper_p.h>
#include <private/qv8engine_p.h>
#include <private/qqmlengine_p.h>
diff --git a/src/qml/qml/qqmlvaluetypewrapper.cpp b/src/qml/qml/qqmlvaluetypewrapper.cpp
index 43b9e4bd3b..6ce52bb9e5 100644
--- a/src/qml/qml/qqmlvaluetypewrapper.cpp
+++ b/src/qml/qml/qqmlvaluetypewrapper.cpp
@@ -43,7 +43,6 @@
#include <private/qqmlvaluetype_p.h>
#include <private/qqmlbinding_p.h>
#include <private/qqmlglobal_p.h>
-#include <private/qqmlcontextwrapper_p.h>
#include <private/qqmlbuiltinfunctions_p.h>
#include <private/qv4engine_p.h>
@@ -390,6 +389,7 @@ ReturnedValue QQmlValueTypeWrapper::get(const Managed *m, String *name, bool *ha
// These four types are the most common used by the value type wrappers
VALUE_TYPE_LOAD(QMetaType::QReal, qreal, qreal);
+ VALUE_TYPE_LOAD(QMetaType::Int || result->isEnum(), int, int);
VALUE_TYPE_LOAD(QMetaType::Int, int, int);
VALUE_TYPE_LOAD(QMetaType::QString, QString, v4->newString);
VALUE_TYPE_LOAD(QMetaType::Bool, bool, bool);
@@ -453,9 +453,10 @@ void QQmlValueTypeWrapper::put(Managed *m, String *name, const Value &value)
cacheData.setCoreIndex(reference->d()->property);
QV4::Scoped<QQmlBindingFunction> bindingFunction(scope, (const Value &)f);
- bindingFunction->initBindingLocation();
- QQmlBinding *newBinding = QQmlBinding::create(&cacheData, value, reference->d()->object, context);
+ QV4::ScopedContext ctx(scope, bindingFunction->scope());
+ QQmlBinding *newBinding = QQmlBinding::create(&cacheData, bindingFunction->function(), reference->d()->object, context, ctx);
+ newBinding->setSourceLocation(bindingFunction->currentLocation());
newBinding->setTarget(reference->d()->object, cacheData, pd);
QQmlPropertyPrivate::setBinding(newBinding);
return;
diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp
index 01c4f476d6..72d4ab7e8f 100644
--- a/src/qml/qml/qqmlvme.cpp
+++ b/src/qml/qml/qqmlvme.cpp
@@ -62,7 +62,6 @@
#include "qqmlpropertyvalueinterceptor_p.h"
#include "qqmlvaluetypeproxybinding_p.h"
#include "qqmlexpression_p.h"
-#include "qqmlcontextwrapper_p.h"
#include <QStack>
#include <QPointF>
diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp
index 791870b831..545daa96f8 100644
--- a/src/qml/qml/qqmlvmemetaobject.cpp
+++ b/src/qml/qml/qqmlvmemetaobject.cpp
@@ -489,9 +489,9 @@ QString QQmlVMEMetaObject::readPropertyAsString(int id) const
QV4::Scope scope(cache->engine);
QV4::ScopedValue sv(scope, *(md->data() + id));
- if (!sv->isString())
- return QString();
- return sv->stringValue()->toQString();
+ if (QV4::String *s = sv->stringValue())
+ return s->toQString();
+ return QString();
}
QUrl QQmlVMEMetaObject::readPropertyAsUrl(int id) const
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp
index b4be709b37..22c3c49c58 100644
--- a/src/qml/qml/qqmlxmlhttprequest.cpp
+++ b/src/qml/qml/qqmlxmlhttprequest.cpp
@@ -50,7 +50,6 @@
#include <private/qv4domerrors_p.h>
#include <private/qv4engine_p.h>
#include <private/qv4functionobject_p.h>
-#include <private/qqmlcontextwrapper_p.h>
#include <private/qv4scopedvalue_p.h>
#include <QtCore/qobject.h>
@@ -70,7 +69,7 @@
using namespace QV4;
-#if !defined(QT_NO_XMLSTREAMREADER) && QT_CONFIG(qml_network)
+#if QT_CONFIG(xmlstreamreader) && QT_CONFIG(qml_network)
#define V4THROW_REFERENCE(string) { \
ScopedObject error(scope, ctx->engine()->newReferenceErrorObject(QStringLiteral(string))); \
@@ -1069,7 +1068,7 @@ private:
QByteArray m_mime;
QByteArray m_charset;
QTextCodec *m_textCodec;
-#ifndef QT_NO_TEXTCODEC
+#if QT_CONFIG(textcodec)
QTextCodec* findTextCodec() const;
#endif
void readEncoding();
@@ -1511,7 +1510,7 @@ QV4::ReturnedValue QQmlXMLHttpRequest::xmlResponseBody(QV4::ExecutionEngine* eng
return m_parsedDocument.value();
}
-#ifndef QT_NO_TEXTCODEC
+#if QT_CONFIG(textcodec)
QTextCodec* QQmlXMLHttpRequest::findTextCodec() const
{
QTextCodec *codec = 0;
@@ -1540,7 +1539,7 @@ QTextCodec* QQmlXMLHttpRequest::findTextCodec() const
QString QQmlXMLHttpRequest::responseBody()
{
-#ifndef QT_NO_TEXTCODEC
+#if QT_CONFIG(textcodec)
if (!m_textCodec)
m_textCodec = findTextCodec();
if (m_textCodec)
@@ -2057,6 +2056,6 @@ void *qt_add_qmlxmlhttprequest(ExecutionEngine *v4)
QT_END_NAMESPACE
-#endif // QT_NO_XMLSTREAMREADER && qml_network
+#endif // xmlstreamreader && qml_network
#include <qqmlxmlhttprequest.moc>
diff --git a/src/qml/qml/qqmlxmlhttprequest_p.h b/src/qml/qml/qqmlxmlhttprequest_p.h
index fdb6194537..f2836d8301 100644
--- a/src/qml/qml/qqmlxmlhttprequest_p.h
+++ b/src/qml/qml/qqmlxmlhttprequest_p.h
@@ -55,7 +55,7 @@
#include <QtCore/qglobal.h>
#include <private/qqmlglobal_p.h>
-#if !defined(QT_NO_XMLSTREAMREADER) && QT_CONFIG(qml_network)
+#if QT_CONFIG(xmlstreamreader) && QT_CONFIG(qml_network)
QT_BEGIN_NAMESPACE
@@ -64,7 +64,7 @@ void qt_rem_qmlxmlhttprequest(QV4::ExecutionEngine *engine, void *);
QT_END_NAMESPACE
-#endif // QT_NO_XMLSTREAMREADER && qml_network
+#endif // xmlstreamreader && qml_network
#endif // QQMLXMLHTTPREQUEST_P_H
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
index cf0fd57773..19dc100f40 100644
--- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
+++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
@@ -148,9 +148,7 @@ void Heap::QtObject::init(QQmlEngine *qmlEngine)
o->defineAccessorProperty(QStringLiteral("platform"), QV4::QtObject::method_get_platform, 0);
o->defineAccessorProperty(QStringLiteral("application"), QV4::QtObject::method_get_application, 0);
-#ifndef QT_NO_IM
o->defineAccessorProperty(QStringLiteral("inputMethod"), QV4::QtObject::method_get_inputMethod, 0);
-#endif
o->defineAccessorProperty(QStringLiteral("styleHints"), QV4::QtObject::method_get_styleHints, 0);
o->defineDefaultProperty(QStringLiteral("callLater"), QV4::QtObject::method_callLater);
@@ -1031,7 +1029,7 @@ ReturnedValue QtObject::method_exit(CallContext *ctx)
/*!
\qmlmethod object Qt::createQmlObject(string qml, object parent, string filepath)
-Returns a new object created from the given \a string of QML which will have the specified \a parent,
+Returns a new object created from the given \a qml string which will have the specified \a parent,
or \c null if there was an error in creating the object.
If \a filepath is specified, it will be used for error reporting for the created object.
@@ -1305,30 +1303,15 @@ ReturnedValue QtObject::method_locale(CallContext *ctx)
void Heap::QQmlBindingFunction::init(const QV4::FunctionObject *originalFunction)
{
- QV4::Heap::FunctionObject::init(originalFunction->scope(), originalFunction->name());
- bindingLocation = new QQmlSourceLocation;
- this->originalFunction = originalFunction->d();
+ Scope scope(originalFunction->engine());
+ ScopedContext context(scope, originalFunction->scope());
+ FunctionObject::init(context, originalFunction->function());
}
-void QQmlBindingFunction::initBindingLocation()
+QQmlSourceLocation QQmlBindingFunction::currentLocation() const
{
QV4::StackFrame frame = engine()->currentStackFrame();
- d()->bindingLocation->sourceFile = frame.source;
- d()->bindingLocation->line = frame.line;
-}
-
-void QQmlBindingFunction::call(const Managed *that, Scope &scope, CallData *callData)
-{
- ScopedFunctionObject function(scope, static_cast<const QQmlBindingFunction*>(that)->d()->originalFunction);
- function->call(scope, callData);
-}
-
-void QQmlBindingFunction::markObjects(Heap::Base *that, ExecutionEngine *e)
-{
- QQmlBindingFunction::Data *This = static_cast<QQmlBindingFunction::Data *>(that);
- if (This->originalFunction)
- This->originalFunction->mark(e);
- QV4::FunctionObject::markObjects(that, e);
+ return QQmlSourceLocation(frame.source, frame.line, 0);
}
DEFINE_OBJECT_VTABLE(QQmlBindingFunction);
@@ -1423,13 +1406,11 @@ ReturnedValue QtObject::method_get_application(CallContext *ctx)
return QV4::QObjectWrapper::wrap(ctx->d()->engine, qt->d()->application);
}
-#ifndef QT_NO_IM
ReturnedValue QtObject::method_get_inputMethod(CallContext *ctx)
{
QObject *o = QQml_guiProvider()->inputMethod();
return QV4::QObjectWrapper::wrap(ctx->d()->engine, o);
}
-#endif
ReturnedValue QtObject::method_get_styleHints(CallContext *ctx)
{
@@ -1740,7 +1721,7 @@ void QV4::GlobalExtensions::init(Object *globalObject, QJSEngine::Extensions ext
Scope scope(v4);
if (extensions.testFlag(QJSEngine::TranslationExtension)) {
- #ifndef QT_NO_TRANSLATION
+ #if QT_CONFIG(translation)
globalObject->defineDefaultProperty(QStringLiteral("qsTranslate"), QV4::GlobalExtensions::method_qsTranslate);
globalObject->defineDefaultProperty(QStringLiteral("QT_TRANSLATE_NOOP"), QV4::GlobalExtensions::method_qsTranslateNoOp);
globalObject->defineDefaultProperty(QStringLiteral("qsTr"), QV4::GlobalExtensions::method_qsTr);
@@ -1767,7 +1748,7 @@ void QV4::GlobalExtensions::init(Object *globalObject, QJSEngine::Extensions ext
}
-#ifndef QT_NO_TRANSLATION
+#if QT_CONFIG(translation)
/*!
\qmlmethod string Qt::qsTranslate(string context, string sourceText, string disambiguation, int n)
@@ -2015,7 +1996,7 @@ ReturnedValue GlobalExtensions::method_qsTrIdNoOp(CallContext *ctx)
return QV4::Encode::undefined();
return ctx->args()[0].asReturnedValue();
}
-#endif // QT_NO_TRANSLATION
+#endif // translation
QV4::ReturnedValue GlobalExtensions::method_gc(CallContext *ctx)
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions_p.h b/src/qml/qml/v8/qqmlbuiltinfunctions_p.h
index f428e377d7..fe43532647 100644
--- a/src/qml/qml/v8/qqmlbuiltinfunctions_p.h
+++ b/src/qml/qml/v8/qqmlbuiltinfunctions_p.h
@@ -82,13 +82,6 @@ struct ConsoleObject : Object {
struct QQmlBindingFunction : FunctionObject {
void init(const QV4::FunctionObject *originalFunction);
- void destroy() {
- delete bindingLocation;
- Object::destroy();
- }
- Pointer<FunctionObject> originalFunction;
- // Set when the binding is created later
- QQmlSourceLocation *bindingLocation;
};
}
@@ -135,9 +128,7 @@ struct QtObject : Object
static ReturnedValue method_get_platform(CallContext *ctx);
static ReturnedValue method_get_application(CallContext *ctx);
-#ifndef QT_NO_IM
static ReturnedValue method_get_inputMethod(CallContext *ctx);
-#endif
static ReturnedValue method_get_styleHints(CallContext *ctx);
static ReturnedValue method_callLater(CallContext *ctx);
@@ -169,7 +160,7 @@ struct ConsoleObject : Object
struct Q_QML_PRIVATE_EXPORT GlobalExtensions {
static void init(Object *globalObject, QJSEngine::Extensions extensions);
-#ifndef QT_NO_TRANSLATION
+#if QT_CONFIG(translation)
static ReturnedValue method_qsTranslate(CallContext *ctx);
static ReturnedValue method_qsTranslateNoOp(CallContext *ctx);
static ReturnedValue method_qsTr(CallContext *ctx);
@@ -187,13 +178,8 @@ struct Q_QML_PRIVATE_EXPORT GlobalExtensions {
struct QQmlBindingFunction : public QV4::FunctionObject
{
V4_OBJECT2(QQmlBindingFunction, FunctionObject)
- V4_NEEDS_DESTROY
-
- void initBindingLocation(); // from caller stack trace
-
- static void call(const Managed *that, Scope &scope, CallData *callData);
- static void markObjects(Heap::Base *that, ExecutionEngine *e);
+ QQmlSourceLocation currentLocation() const; // from caller stack trace
};
}
diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp
index b0599dd0a2..dadff819cf 100644
--- a/src/qml/qml/v8/qv8engine.cpp
+++ b/src/qml/qml/v8/qv8engine.cpp
@@ -52,7 +52,6 @@
#include <private/qqmlplatform_p.h>
#include <private/qjsvalue_p.h>
#include <private/qqmltypewrapper_p.h>
-#include <private/qqmlcontextwrapper_p.h>
#include <private/qqmlvaluetypewrapper_p.h>
#include <private/qqmllistwrapper_p.h>
#include <private/qv4scopedvalue_p.h>
@@ -160,7 +159,7 @@ QV8Engine::~QV8Engine()
qDeleteAll(m_extensionData);
m_extensionData.clear();
-#if !defined(QT_NO_XMLSTREAMREADER) && QT_CONFIG(qml_network)
+#if QT_CONFIG(xmlstreamreader) && QT_CONFIG(qml_network)
qt_rem_qmlxmlhttprequest(m_v4Engine, m_xmlHttpRequestData);
m_xmlHttpRequestData = 0;
#endif
@@ -195,7 +194,7 @@ void QV8Engine::initializeGlobal()
QQmlDateExtension::registerExtension(m_v4Engine);
QQmlNumberExtension::registerExtension(m_v4Engine);
-#if !defined(QT_NO_XMLSTREAMREADER) && QT_CONFIG(qml_network)
+#if QT_CONFIG(xmlstreamreader) && QT_CONFIG(qml_network)
qt_add_domexceptions(m_v4Engine);
m_xmlHttpRequestData = qt_add_qmlxmlhttprequest(m_v4Engine);
#endif
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index c4fabbedcc..be10b270ae 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -213,6 +213,7 @@ QQmlDelegateModelPrivate::QQmlDelegateModelPrivate(QQmlContext *ctxt)
, m_reset(false)
, m_transaction(false)
, m_incubatorCleanupScheduled(false)
+ , m_waitingToFetchMore(false)
, m_cacheItems(0)
, m_items(0)
, m_persistedItems(0)
@@ -227,6 +228,15 @@ QQmlDelegateModelPrivate::~QQmlDelegateModelPrivate()
m_cacheMetaType->release();
}
+void QQmlDelegateModelPrivate::requestMoreIfNecessary()
+{
+ Q_Q(QQmlDelegateModel);
+ if (!m_waitingToFetchMore && m_adaptorModel.canFetchMore()) {
+ m_waitingToFetchMore = true;
+ QCoreApplication::postEvent(q, new QEvent(QEvent::UpdateRequest));
+ }
+}
+
void QQmlDelegateModelPrivate::init()
{
Q_Q(QQmlDelegateModel);
@@ -334,9 +344,7 @@ void QQmlDelegateModel::componentComplete()
&inserts);
d->itemsInserted(inserts);
d->emitChanges();
-
- if (d->m_adaptorModel.canFetchMore())
- QCoreApplication::postEvent(this, new QEvent(QEvent::UpdateRequest));
+ d->requestMoreIfNecessary();
}
/*!
@@ -375,8 +383,7 @@ void QQmlDelegateModel::setModel(const QVariant &model)
if (d->m_complete) {
_q_itemsInserted(0, d->m_adaptorModel.count());
- if (d->m_adaptorModel.canFetchMore())
- QCoreApplication::postEvent(this, new QEvent(QEvent::UpdateRequest));
+ d->requestMoreIfNecessary();
}
}
@@ -922,7 +929,6 @@ void QQmlDelegateModelPrivate::setInitialState(QQDMIncubationTask *incubationTas
QObject *QQmlDelegateModelPrivate::object(Compositor::Group group, int index, bool asynchronous)
{
- Q_Q(QQmlDelegateModel);
if (!m_delegate || index < 0 || index >= m_compositor.count(group)) {
qWarning() << "DelegateModel::item: index out range" << index << m_compositor.count(group);
return 0;
@@ -989,8 +995,8 @@ QObject *QQmlDelegateModelPrivate::object(Compositor::Group group, int index, bo
QQmlContextData::get(m_context));
}
- if (index == m_compositor.count(group) - 1 && m_adaptorModel.canFetchMore())
- QCoreApplication::postEvent(q, new QEvent(QEvent::UpdateRequest));
+ if (index == m_compositor.count(group) - 1)
+ requestMoreIfNecessary();
// Remove the temporary reference count.
cacheItem->scriptRef -= 1;
@@ -1110,6 +1116,7 @@ bool QQmlDelegateModel::event(QEvent *e)
{
Q_D(QQmlDelegateModel);
if (e->type() == QEvent::UpdateRequest) {
+ d->m_waitingToFetchMore = false;
d->m_adaptorModel.fetchMore();
} else if (e->type() == QEvent::User) {
d->m_incubatorCleanupScheduled = false;
diff --git a/src/qml/types/qqmldelegatemodel_p_p.h b/src/qml/types/qqmldelegatemodel_p_p.h
index 07e35d3fd7..4c2841b8ba 100644
--- a/src/qml/types/qqmldelegatemodel_p_p.h
+++ b/src/qml/types/qqmldelegatemodel_p_p.h
@@ -149,7 +149,6 @@ public:
int groups;
int index;
-
Q_SIGNALS:
void modelIndexChanged();
@@ -261,6 +260,7 @@ public:
void init();
void connectModel(QQmlAdaptorModel *model);
+ void requestMoreIfNecessary();
QObject *object(Compositor::Group group, int index, bool asynchronous);
QQmlDelegateModel::ReleaseFlags release(QObject *object);
QString stringValue(Compositor::Group group, int index, const QString &name);
@@ -329,6 +329,7 @@ public:
bool m_reset : 1;
bool m_transaction : 1;
bool m_incubatorCleanupScheduled : 1;
+ bool m_waitingToFetchMore : 1;
union {
struct {
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
index 062f7a2a74..1a2e4c7f6f 100644
--- a/src/qml/types/qqmllistmodel.cpp
+++ b/src/qml/types/qqmllistmodel.cpp
@@ -45,10 +45,12 @@
#include <private/qqmlcustomparser_p.h>
#include <private/qqmlengine_p.h>
+#include <private/qqmlnotifier_p.h>
#include <private/qv4object_p.h>
#include <private/qv4dateobject_p.h>
#include <private/qv4objectiterator_p.h>
+#include <private/qv4alloca_p.h>
#include <qqmlcontext.h>
#include <qqmlinfo.h>
@@ -57,6 +59,7 @@
#include <QtCore/qstack.h>
#include <QXmlStreamReader>
#include <QtCore/qdatetime.h>
+#include <QScopedValueRollback>
QT_BEGIN_NAMESPACE
@@ -502,10 +505,10 @@ void ListModel::set(int elementIndex, QV4::Object *object)
break;
// Add the value now
- if (propertyValue->isString()) {
+ if (QV4::String *s = propertyValue->stringValue()) {
const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::String);
if (r.type == ListLayout::Role::String)
- e->setStringPropertyFast(r, propertyValue->stringValue()->toQString());
+ e->setStringPropertyFast(r, s->toQString());
} else if (propertyValue->isNumber()) {
const ListLayout::Role &r = m_layout->getRoleOrCreate(propertyName, ListLayout::Role::Number);
if (r.type == ListLayout::Role::Number) {
@@ -1262,9 +1265,14 @@ ModelNodeMetaObject *ModelNodeMetaObject::get(QObject *obj)
void ModelNodeMetaObject::updateValues()
{
- if (!m_initialized)
+ const int roleCount = m_model->m_listModel->roleCount();
+ if (!m_initialized) {
+ int *changedRoles = reinterpret_cast<int *>(alloca(roleCount * sizeof(int)));
+ for (int i = 0; i < roleCount; ++i)
+ changedRoles[i] = i;
+ emitDirectNotifies(changedRoles, roleCount);
return;
- int roleCount = m_model->m_listModel->roleCount();
+ }
for (int i=0 ; i < roleCount ; ++i) {
const ListLayout::Role &role = m_model->m_listModel->getExistingRole(i);
QByteArray name = role.name.toUtf8();
@@ -1275,8 +1283,10 @@ void ModelNodeMetaObject::updateValues()
void ModelNodeMetaObject::updateValues(const QVector<int> &roles)
{
- if (!m_initialized)
+ if (!m_initialized) {
+ emitDirectNotifies(roles.constData(), roles.count());
return;
+ }
int roleCount = roles.count();
for (int i=0 ; i < roleCount ; ++i) {
int roleIndex = roles.at(i);
@@ -1303,6 +1313,22 @@ void ModelNodeMetaObject::propertyWritten(int index)
m_model->emitItemsChanged(m_elementIndex, 1, QVector<int>(1, roleIndex));
}
+// Does the emission of the notifiers when we haven't created the meta-object yet
+void ModelNodeMetaObject::emitDirectNotifies(const int *changedRoles, int roleCount)
+{
+ Q_ASSERT(!m_initialized);
+ QQmlData *ddata = QQmlData::get(object(), /*create*/false);
+ if (!ddata)
+ return;
+ QQmlEnginePrivate *ep = QQmlEnginePrivate::get(qmlEngine(m_model));
+ if (!ep)
+ return;
+ for (int i = 0; i < roleCount; ++i) {
+ const int changedRole = changedRoles[i];
+ QQmlNotifier::notify(ddata, changedRole);
+ }
+}
+
namespace QV4 {
void ModelObject::put(Managed *m, String *name, const Value &value)
@@ -1329,6 +1355,18 @@ ReturnedValue ModelObject::get(const Managed *m, String *name, bool *hasProperty
return QObjectWrapper::get(m, name, hasProperty);
if (hasProperty)
*hasProperty = true;
+
+ if (QQmlEngine *qmlEngine = that->engine()->qmlEngine()) {
+ QQmlEnginePrivate *ep = QQmlEnginePrivate::get(qmlEngine);
+ if (ep && ep->propertyCapture) {
+ QObjectPrivate *op = QObjectPrivate::get(that->object());
+ // Temporarily hide the dynamic meta-object, to prevent it from being created when the capture
+ // triggers a QObject::connectNotify() by calling obj->metaObject().
+ QScopedValueRollback<QDynamicMetaObjectData*> metaObjectBlocker(op->metaObject, 0);
+ ep->propertyCapture->captureProperty(that->object(), -1, role->index);
+ }
+ }
+
const int elementIndex = that->d()->m_elementIndex;
QVariant value = that->d()->m_model->data(elementIndex, role->index);
return that->engine()->fromVariant(value);
diff --git a/src/qml/types/qqmllistmodel_p_p.h b/src/qml/types/qqmllistmodel_p_p.h
index ddf77e52c0..cdce78e542 100644
--- a/src/qml/types/qqmllistmodel_p_p.h
+++ b/src/qml/types/qqmllistmodel_p_p.h
@@ -153,6 +153,8 @@ private:
setValue(name, val);
}
+ void emitDirectNotifies(const int *changedRoles, int roleCount);
+
void initialize();
bool m_initialized;
};
diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp
index cdcc894da9..5f716da17a 100644
--- a/src/qml/types/qquickworkerscript.cpp
+++ b/src/qml/types/qquickworkerscript.cpp
@@ -42,7 +42,6 @@
#include "qqmllistmodelworkeragent_p.h"
#include <private/qqmlengine_p.h>
#include <private/qqmlexpression_p.h>
-#include <private/qqmlcontextwrapper_p.h>
#include <QtCore/qcoreevent.h>
#include <QtCore/qcoreapplication.h>
@@ -318,19 +317,8 @@ QV4::ReturnedValue QQuickWorkerScriptEnginePrivate::getWorker(WorkerScript *scri
QV4::ExecutionEngine *v4 = QV8Engine::getV4(workerEngine);
QV4::Scope scope(v4);
-
- QV4::Scoped<QV4::QmlContextWrapper> w(scope, QV4::QmlContextWrapper::urlScope(v4, script->source));
- Q_ASSERT(!!w);
- w->setReadOnly(false);
-
- QV4::ScopedObject api(scope, v4->newObject());
- api->put(QV4::ScopedString(scope, v4->newString(QStringLiteral("sendMessage"))), QV4::ScopedValue(scope, workerEngine->sendFunction(script->id)));
-
- w->QV4::Object::put(QV4::ScopedString(scope, v4->newString(QStringLiteral("WorkerScript"))), api);
-
- w->setReadOnly(true);
-
- script->qmlContext.set(v4, v4->rootContext()->newQmlContext(w));
+ QV4::ScopedValue v(scope, workerEngine->sendFunction(script->id));
+ script->qmlContext.set(v4, QV4::QmlContext::createWorkerContext(v4->rootContext(), script->source, v));
}
return script->qmlContext.value();
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp
index 0e348eee11..70733da121 100644
--- a/src/qmltest/quicktest.cpp
+++ b/src/qmltest/quicktest.cpp
@@ -266,7 +266,7 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD
QuickTestResult::parseArgs(testArgC, testArgV.data());
-#ifndef QT_NO_TRANSLATION
+#if QT_CONFIG(translation)
QTranslator translator;
if (!translationFile.isEmpty()) {
if (translator.load(translationFile)) {
diff --git a/src/qmltest/quicktestevent.cpp b/src/qmltest/quicktestevent.cpp
index 4b8ade761f..4b1adf5a90 100644
--- a/src/qmltest/quicktestevent.cpp
+++ b/src/qmltest/quicktestevent.cpp
@@ -198,7 +198,7 @@ namespace QtQuickTest
}
}
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
static void mouseWheel(QWindow* window, QObject* item, Qt::MouseButtons buttons,
Qt::KeyboardModifiers stateKey,
QPointF _pos, int xDelta, int yDelta, int delay = -1)
@@ -242,7 +242,7 @@ bool QuickTestEvent::mousePress
return true;
}
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
bool QuickTestEvent::mouseWheel(
QObject *item, qreal x, qreal y, int buttons,
int modifiers, int xDelta, int yDelta, int delay)
diff --git a/src/qmltest/quicktestevent_p.h b/src/qmltest/quicktestevent_p.h
index c37d03ad0f..89065b8880 100644
--- a/src/qmltest/quicktestevent_p.h
+++ b/src/qmltest/quicktestevent_p.h
@@ -106,7 +106,7 @@ public Q_SLOTS:
int modifiers, int delay);
bool mouseMove(QObject *item, qreal x, qreal y, int delay, int buttons);
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
bool mouseWheel(QObject *item, qreal x, qreal y, int buttons,
int modifiers, int xDelta, int yDelta, int delay);
#endif
diff --git a/src/quick/accessible/qaccessiblequickitem.cpp b/src/quick/accessible/qaccessiblequickitem.cpp
index 03236ce2f7..fbde5d354d 100644
--- a/src/quick/accessible/qaccessiblequickitem.cpp
+++ b/src/quick/accessible/qaccessiblequickitem.cpp
@@ -47,7 +47,7 @@
#include "QtQuick/qquicktextdocument.h"
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
QAccessibleQuickItem::QAccessibleQuickItem(QQuickItem *item)
: QAccessibleObject(item), m_doc(textDocument())
@@ -591,6 +591,6 @@ void QAccessibleQuickItem::setSelection(int /* selectionIndex */, int /* startOf
}
-#endif // QT_NO_ACCESSIBILITY
+#endif // accessibility
QT_END_NAMESPACE
diff --git a/src/quick/accessible/qaccessiblequickitem_p.h b/src/quick/accessible/qaccessiblequickitem_p.h
index 7445fd1400..577a105627 100644
--- a/src/quick/accessible/qaccessiblequickitem_p.h
+++ b/src/quick/accessible/qaccessiblequickitem_p.h
@@ -57,7 +57,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
class QTextDocument;
@@ -141,7 +141,7 @@ private:
QRect itemScreenRect(QQuickItem *item);
QList<QQuickItem *> accessibleUnignoredChildren(QQuickItem *item, bool paintOrder = false);
-#endif // QT_NO_ACCESSIBILITY
+#endif // accessibility
QT_END_NAMESPACE
diff --git a/src/quick/accessible/qaccessiblequickview.cpp b/src/quick/accessible/qaccessiblequickview.cpp
index edd39ed9db..222690e4f2 100644
--- a/src/quick/accessible/qaccessiblequickview.cpp
+++ b/src/quick/accessible/qaccessiblequickview.cpp
@@ -46,7 +46,7 @@
#include "qaccessiblequickitem_p.h"
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
QT_BEGIN_NAMESPACE
@@ -145,4 +145,4 @@ int QAccessibleQuickWindow::indexOfChild(const QAccessibleInterface *iface) cons
QT_END_NAMESPACE
-#endif // QT_NO_ACCESSIBILITY
+#endif // accessibility
diff --git a/src/quick/accessible/qaccessiblequickview_p.h b/src/quick/accessible/qaccessiblequickview_p.h
index e9c150ac22..7c103380cb 100644
--- a/src/quick/accessible/qaccessiblequickview_p.h
+++ b/src/quick/accessible/qaccessiblequickview_p.h
@@ -56,7 +56,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
class QAccessibleQuickWindow : public QAccessibleObject
{
@@ -80,7 +80,7 @@ private:
QList<QQuickItem *> rootItems() const;
};
-#endif // QT_NO_ACCESSIBILITY
+#endif // accessibility
QT_END_NAMESPACE
diff --git a/src/quick/accessible/qquickaccessiblefactory.cpp b/src/quick/accessible/qquickaccessiblefactory.cpp
index 69a74f2b3d..a1fa695e5a 100644
--- a/src/quick/accessible/qquickaccessiblefactory.cpp
+++ b/src/quick/accessible/qquickaccessiblefactory.cpp
@@ -44,7 +44,7 @@
#include <QtQuick/private/qquickitem_p.h>
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
QAccessibleInterface *qQuickAccessibleFactory(const QString &classname, QObject *object)
{
diff --git a/src/quick/accessible/qquickaccessiblefactory_p.h b/src/quick/accessible/qquickaccessiblefactory_p.h
index 6407b70223..ab8eb12ca4 100644
--- a/src/quick/accessible/qquickaccessiblefactory_p.h
+++ b/src/quick/accessible/qquickaccessiblefactory_p.h
@@ -54,7 +54,7 @@
#include <QtGui/qaccessible.h>
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
QAccessibleInterface *qQuickAccessibleFactory(const QString &classname, QObject *object);
diff --git a/src/quick/designer/qquickdesignercustomobjectdata.cpp b/src/quick/designer/qquickdesignercustomobjectdata.cpp
index e37254d165..ca9c1259fd 100644
--- a/src/quick/designer/qquickdesignercustomobjectdata.cpp
+++ b/src/quick/designer/qquickdesignercustomobjectdata.cpp
@@ -258,7 +258,7 @@ void QQuickDesignerCustomObjectData::setPropertyBinding(QQmlContext *context,
if (property.isProperty()) {
QQmlBinding *binding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core,
- expression, object(), context);
+ expression, object(), QQmlContextData::get(context));
binding->setTarget(property);
binding->setNotifyOnValueChanged(true);
diff --git a/src/quick/designer/qquickdesignersupport.cpp b/src/quick/designer/qquickdesignersupport.cpp
index 3ff5a3ce96..749ece8221 100644
--- a/src/quick/designer/qquickdesignersupport.cpp
+++ b/src/quick/designer/qquickdesignersupport.cpp
@@ -95,7 +95,7 @@ void QQuickDesignerSupport::refFromEffectItem(QQuickItem *referencedItem, bool h
texture->setRect(referencedItem->boundingRect());
texture->setSize(referencedItem->boundingRect().size().toSize());
texture->setRecursive(true);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#ifndef QT_OPENGL_ES
if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL)
texture->setFormat(GL_RGBA8);
diff --git a/src/quick/designer/qquickdesignerwindowmanager.cpp b/src/quick/designer/qquickdesignerwindowmanager.cpp
index 2d37db08e7..e2d7b98c33 100644
--- a/src/quick/designer/qquickdesignerwindowmanager.cpp
+++ b/src/quick/designer/qquickdesignerwindowmanager.cpp
@@ -39,7 +39,7 @@
#include "qquickdesignerwindowmanager_p.h"
#include "private/qquickwindow_p.h"
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QtQuick/private/qsgdefaultrendercontext_p.h>
#endif
#include <QtQuick/QQuickWindow>
@@ -67,7 +67,7 @@ void QQuickDesignerWindowManager::windowDestroyed(QQuickWindow *)
void QQuickDesignerWindowManager::makeOpenGLContext(QQuickWindow *window)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (!m_openGlContext) {
m_openGlContext.reset(new QOpenGLContext());
m_openGlContext->setFormat(window->requestedFormat());
diff --git a/src/quick/designer/qquickdesignerwindowmanager_p.h b/src/quick/designer/qquickdesignerwindowmanager_p.h
index 209d703d0a..5322b6c421 100644
--- a/src/quick/designer/qquickdesignerwindowmanager_p.h
+++ b/src/quick/designer/qquickdesignerwindowmanager_p.h
@@ -57,7 +57,7 @@
#include <private/qtquickglobal_p.h>
#include <QtQuick/private/qsgcontext_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QtGui/QOpenGLContext>
#endif
@@ -97,7 +97,7 @@ public:
static void createOpenGLContext(QQuickWindow *window);
private:
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QScopedPointer<QOpenGLContext> m_openGlContext;
#endif
QScopedPointer<QSGContext> m_sgContext;
diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp
index dcad719ef0..78db92ba8a 100644
--- a/src/quick/items/context2d/qquickcanvasitem.cpp
+++ b/src/quick/items/context2d/qquickcanvasitem.cpp
@@ -802,7 +802,7 @@ QSGTextureProvider *QQuickCanvasItem::textureProvider() const
return QQuickItem::textureProvider();
Q_D(const QQuickCanvasItem);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QQuickWindow *w = window();
if (!w || !w->isSceneGraphInitialized()
|| QThread::currentThread() != QQuickWindowPrivate::get(w)->context->thread()) {
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index 2483a8eadb..bcaedd67b4 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -75,7 +75,7 @@
#include <private/qguiapplication_p.h>
#include <qpa/qplatformintegration.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <private/qsgdefaultrendercontext_p.h>
#endif
@@ -3997,7 +3997,7 @@ public:
~QQuickContext2DThreadCleanup()
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
context->makeCurrent(surface);
delete texture;
context->doneCurrent();
@@ -4038,7 +4038,7 @@ QQuickContext2D::~QQuickContext2D()
delete m_buffer;
if (m_renderTarget == QQuickCanvasItem::FramebufferObject) {
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_renderStrategy == QQuickCanvasItem::Immediate && m_glContext) {
Q_ASSERT(QThread::currentThread() == m_glContext->thread());
m_glContext->makeCurrent(m_surface.data());
@@ -4115,7 +4115,7 @@ void QQuickContext2D::init(QQuickCanvasItem *canvasItem, const QVariantMap &args
m_texture = new QQuickContext2DImageTexture;
break;
case QQuickCanvasItem::FramebufferObject:
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
m_texture = new QQuickContext2DFBOTexture;
#else
// It shouldn't be possible to use a FramebufferObject without OpenGL
@@ -4134,7 +4134,7 @@ void QQuickContext2D::init(QQuickCanvasItem *canvasItem, const QVariantMap &args
m_thread = QThread::currentThread();
QThread *renderThread = m_thread;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QQuickWindow *window = canvasItem->window();
QQuickWindowPrivate *wd = QQuickWindowPrivate::get(window);
QThread *sceneGraphThread = wd->context->thread();
@@ -4151,7 +4151,7 @@ void QQuickContext2D::init(QQuickCanvasItem *canvasItem, const QVariantMap &args
if (renderThread && renderThread != QThread::currentThread())
m_texture->moveToThread(renderThread);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_renderTarget == QQuickCanvasItem::FramebufferObject && renderThread != sceneGraphThread) {
auto openglRenderContext = static_cast<const QSGDefaultRenderContext *>(QQuickWindowPrivate::get(window)->context);
QOpenGLContext *cc = openglRenderContext->openglContext();
@@ -4212,7 +4212,7 @@ QImage QQuickContext2D::toImage(const QRectF& bounds)
flush();
m_texture->grabImage(bounds);
} else {
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QQuickWindow *window = m_canvas->window();
QOpenGLContext *ctx = window ? window->openglContext() : 0;
if (ctx && ctx->isValid()) {
diff --git a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp
index 8d659040b3..b985cb0ccc 100644
--- a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp
+++ b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp
@@ -43,7 +43,7 @@
#include <QtCore/QMutex>
#include <QtQuick/qsgtexture.h>
#include <QtGui/QPaintEngine>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QtGui/QOpenGLContext>
# include <QtGui/private/qopenglpaintengine_p.h>
#endif
diff --git a/src/quick/items/context2d/qquickcontext2dtexture.cpp b/src/quick/items/context2d/qquickcontext2dtexture.cpp
index 4435c0c37b..38b5f054bf 100644
--- a/src/quick/items/context2d/qquickcontext2dtexture.cpp
+++ b/src/quick/items/context2d/qquickcontext2dtexture.cpp
@@ -44,7 +44,7 @@
#include <QtQuick/private/qsgtexture_p.h>
#include "qquickcontext2dcommandbuffer_p.h"
#include <QOpenGLPaintDevice>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <QOpenGLFramebufferObject>
#include <QOpenGLFramebufferObjectFormat>
#include <QOpenGLFunctions>
@@ -53,7 +53,7 @@
#include <QtGui/QGuiApplication>
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#define QT_MINIMUM_FBO_SIZE 64
static inline int qt_next_power_of_two(int v)
@@ -90,7 +90,7 @@ struct GLAcquireContext {
#endif
QQuickContext2DTexture::QQuickContext2DTexture()
: m_context(0)
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
, m_gl(0)
#endif
, m_surface(0)
@@ -254,7 +254,7 @@ void QQuickContext2DTexture::paint(QQuickContext2DCommandBuffer *ccb)
return;
}
QQuickContext2D::mutex.unlock();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
GLAcquireContext currentContext(m_gl, m_surface);
#endif
if (!m_tiledCanvas) {
@@ -383,7 +383,7 @@ bool QQuickContext2DTexture::event(QEvent *e)
}
return QObject::event(e);
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
static inline QSize npotAdjustedSize(const QSize &size)
{
static bool checked = false;
diff --git a/src/quick/items/context2d/qquickcontext2dtexture_p.h b/src/quick/items/context2d/qquickcontext2dtexture_p.h
index 678e33826d..97135816a2 100644
--- a/src/quick/items/context2d/qquickcontext2dtexture_p.h
+++ b/src/quick/items/context2d/qquickcontext2dtexture_p.h
@@ -58,7 +58,7 @@ QT_REQUIRE_CONFIG(quick_canvas);
#include <QtQuick/qsgtexture.h>
#include "qquickcanvasitem_p.h"
#include "qquickcontext2d_p.h"
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QOpenGLContext>
# include <QOpenGLFramebufferObject>
#endif
@@ -125,7 +125,7 @@ public:
// Called during sync() on the scene graph thread while GUI is blocked.
virtual QSGTexture *textureForNextFrame(QSGTexture *lastFrame, QQuickWindow *window) = 0;
bool event(QEvent *e) override;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void initializeOpenGL(QOpenGLContext *gl, QOffscreenSurface *s) {
m_gl = gl;
m_surface = s;
@@ -157,7 +157,7 @@ protected:
QList<QQuickContext2DTile*> m_tiles;
QQuickContext2D *m_context;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QOpenGLContext *m_gl;
#endif
QSurface *m_surface;
@@ -180,7 +180,7 @@ protected:
uint m_painting : 1;
uint m_onCustomThread : 1; // Not GUI and not SGRender
};
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
class QQuickContext2DFBOTexture : public QQuickContext2DTexture
{
Q_OBJECT
diff --git a/src/quick/items/context2d/qquickcontext2dtile.cpp b/src/quick/items/context2d/qquickcontext2dtile.cpp
index 95b6c9d961..d31fee7f91 100644
--- a/src/quick/items/context2d/qquickcontext2dtile.cpp
+++ b/src/quick/items/context2d/qquickcontext2dtile.cpp
@@ -38,7 +38,7 @@
****************************************************************************/
#include "qquickcontext2dtile_p.h"
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QOpenGLFramebufferObject>
# include <QOpenGLFramebufferObjectFormat>
# include <QOpenGLPaintDevice>
@@ -97,7 +97,7 @@ QPainter* QQuickContext2DTile::createPainter(bool smooth, bool antialiasing)
return 0;
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QQuickContext2DFBOTile::QQuickContext2DFBOTile()
: QQuickContext2DTile()
, m_fbo(0)
diff --git a/src/quick/items/context2d/qquickcontext2dtile_p.h b/src/quick/items/context2d/qquickcontext2dtile_p.h
index 02238a882b..d5255edcfc 100644
--- a/src/quick/items/context2d/qquickcontext2dtile_p.h
+++ b/src/quick/items/context2d/qquickcontext2dtile_p.h
@@ -56,7 +56,7 @@
QT_REQUIRE_CONFIG(quick_canvas);
#include "qquickcontext2d_p.h"
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QOpenGLFramebufferObject>
#endif
QT_BEGIN_NAMESPACE
@@ -87,7 +87,7 @@ protected:
QPainter m_painter;
};
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
class QQuickContext2DFBOTile : public QQuickContext2DTile
{
public:
diff --git a/src/quick/items/qquickaccessibleattached.cpp b/src/quick/items/qquickaccessibleattached.cpp
index 41c036c7a8..4e918802d1 100644
--- a/src/quick/items/qquickaccessibleattached.cpp
+++ b/src/quick/items/qquickaccessibleattached.cpp
@@ -39,7 +39,7 @@
#include "qquickaccessibleattached_p.h"
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
#include "private/qquickitem_p.h"
diff --git a/src/quick/items/qquickaccessibleattached_p.h b/src/quick/items/qquickaccessibleattached_p.h
index 7054d9d9c9..215a1e5db6 100644
--- a/src/quick/items/qquickaccessibleattached_p.h
+++ b/src/quick/items/qquickaccessibleattached_p.h
@@ -56,7 +56,7 @@
#include <QtCore/qobject.h>
#include <QtCore/qstring.h>
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
#include <QtGui/qaccessible.h>
#include <private/qtquickglobal_p.h>
@@ -265,6 +265,6 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickAccessibleAttached)
QML_DECLARE_TYPEINFO(QQuickAccessibleAttached, QML_HAS_ATTACHED_PROPERTIES)
-#endif // QT_NO_ACCESSIBILITY
+#endif // accessibility
#endif
diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp
index cbb052856e..7a112e840a 100644
--- a/src/quick/items/qquickdrag.cpp
+++ b/src/quick/items/qquickdrag.cpp
@@ -55,7 +55,7 @@
#include <QtGui/qstylehints.h>
#include <QtGui/qguiapplication.h>
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QT_BEGIN_NAMESPACE
@@ -995,4 +995,4 @@ QQuickDragAttached *QQuickDrag::qmlAttachedProperties(QObject *obj)
QT_END_NAMESPACE
-#endif // QT_NO_DRAGANDDROP
+#endif // draganddrop
diff --git a/src/quick/items/qquickdrag_p.h b/src/quick/items/qquickdrag_p.h
index 06239c7193..357f72b3e7 100644
--- a/src/quick/items/qquickdrag_p.h
+++ b/src/quick/items/qquickdrag_p.h
@@ -60,7 +60,7 @@
#include <QtCore/qstringlist.h>
#include <QtCore/qurl.h>
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QT_BEGIN_NAMESPACE
@@ -318,6 +318,6 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickDrag)
QML_DECLARE_TYPEINFO(QQuickDrag, QML_HAS_ATTACHED_PROPERTIES)
-#endif // QT_NO_DRAGANDDROP
+#endif // draganddrop
#endif
diff --git a/src/quick/items/qquickdroparea.cpp b/src/quick/items/qquickdroparea.cpp
index 70d76c99a1..b314390915 100644
--- a/src/quick/items/qquickdroparea.cpp
+++ b/src/quick/items/qquickdroparea.cpp
@@ -43,7 +43,7 @@
#include <private/qv4arraybuffer_p.h>
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QT_BEGIN_NAMESPACE
@@ -618,4 +618,4 @@ void QQuickDropEvent::accept(QQmlV4Function *args)
QT_END_NAMESPACE
-#endif // QT_NO_DRAGANDDROP
+#endif // draganddrop
diff --git a/src/quick/items/qquickdroparea_p.h b/src/quick/items/qquickdroparea_p.h
index ecd4da4367..0c4c072db7 100644
--- a/src/quick/items/qquickdroparea_p.h
+++ b/src/quick/items/qquickdroparea_p.h
@@ -55,7 +55,7 @@
#include <QtGui/qevent.h>
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QT_BEGIN_NAMESPACE
@@ -190,6 +190,6 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickDropEvent)
QML_DECLARE_TYPE(QQuickDropArea)
-#endif // QT_NO_DRAGANDDROP
+#endif // draganddrop
#endif // QQUICKDROPAREA_P_H
diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp
index 2fad9f5a8d..42588fd058 100644
--- a/src/quick/items/qquickevents.cpp
+++ b/src/quick/items/qquickevents.cpp
@@ -552,7 +552,7 @@ void QQuickEventTouchPoint::reset(const QTouchEvent::TouchPoint &tp, ulong times
QQuickEventPoint::reset(tp.state(), tp.scenePos(), tp.id(), timestamp);
m_rotation = tp.rotation();
m_pressure = tp.pressure();
- m_uniqueId = tp.uniqueId();
+// m_uniqueId = tp.uniqueId();
}
/*!
diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h
index 61bbb4ecda..6179791413 100644
--- a/src/quick/items/qquickevents_p_p.h
+++ b/src/quick/items/qquickevents_p_p.h
@@ -302,7 +302,8 @@ class Q_QUICK_PRIVATE_EXPORT QQuickEventTouchPoint : public QQuickEventPoint
Q_OBJECT
Q_PROPERTY(qreal rotation READ rotation)
Q_PROPERTY(qreal pressure READ pressure)
- Q_PROPERTY(QPointerUniqueId uniqueId READ uniqueId)
+// TODO rename to QPointingDeviceUniqueId
+// Q_PROPERTY(QPointerUniqueId uniqueId READ uniqueId)
public:
QQuickEventTouchPoint(QQuickPointerTouchEvent *parent);
@@ -311,12 +312,12 @@ public:
qreal rotation() const { return m_rotation; }
qreal pressure() const { return m_pressure; }
- QPointerUniqueId uniqueId() const { return m_uniqueId; }
+// QPointerUniqueId uniqueId() const { return m_uniqueId; }
private:
qreal m_rotation;
qreal m_pressure;
- QPointerUniqueId m_uniqueId;
+// QPointerUniqueId m_uniqueId;
Q_DISABLE_COPY(QQuickEventTouchPoint)
};
@@ -554,7 +555,7 @@ QML_DECLARE_TYPE(QQuickMouseEvent)
QML_DECLARE_TYPE(QQuickWheelEvent)
QML_DECLARE_TYPE(QQuickCloseEvent)
QML_DECLARE_TYPE(QQuickPointerDevice)
-QML_DECLARE_TYPE(QPointerUniqueId)
+//QML_DECLARE_TYPE(QPointerUniqueId)
QML_DECLARE_TYPE(QQuickPointerEvent)
#endif // QQUICKEVENTS_P_P_H
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index 26959ef584..00a1306627 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -1404,7 +1404,7 @@ void QQuickFlickable::mouseReleaseEvent(QMouseEvent *event)
}
}
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void QQuickFlickable::wheelEvent(QWheelEvent *event)
{
Q_D(QQuickFlickable);
diff --git a/src/quick/items/qquickflickable_p.h b/src/quick/items/qquickflickable_p.h
index 2da4781f37..7384c7271a 100644
--- a/src/quick/items/qquickflickable_p.h
+++ b/src/quick/items/qquickflickable_p.h
@@ -249,7 +249,7 @@ protected:
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
#endif
void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
diff --git a/src/quick/items/qquickgraphicsinfo.cpp b/src/quick/items/qquickgraphicsinfo.cpp
index 761d0c3cad..f735f17a4d 100644
--- a/src/quick/items/qquickgraphicsinfo.cpp
+++ b/src/quick/items/qquickgraphicsinfo.cpp
@@ -257,7 +257,7 @@ void QQuickGraphicsInfo::updateInfo()
}
QSurfaceFormat format = QSurfaceFormat::defaultFormat();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_window && m_window->isSceneGraphInitialized()) {
QOpenGLContext *context = m_window->openglContext();
if (context)
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 274bfbf6d4..ca8ef7ba2e 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -73,7 +73,7 @@
#include <private/qv4qobjectwrapper_p.h>
#include <private/qdebug_p.h>
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
# include <QtGui/qcursor.h>
#endif
@@ -317,7 +317,7 @@ void QQuickItemKeyFilter::keyReleased(QKeyEvent *event, bool post)
if (m_next) m_next->keyReleased(event, post);
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void QQuickItemKeyFilter::inputMethodEvent(QInputMethodEvent *event, bool post)
{
if (m_next)
@@ -331,7 +331,7 @@ QVariant QQuickItemKeyFilter::inputMethodQuery(Qt::InputMethodQuery query) const
if (m_next) return m_next->inputMethodQuery(query);
return QVariant();
}
-#endif // QT_NO_IM
+#endif // im
void QQuickItemKeyFilter::componentComplete()
{
@@ -1298,7 +1298,7 @@ void QQuickKeysAttached::setPriority(Priority order)
void QQuickKeysAttached::componentComplete()
{
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Q_D(QQuickKeysAttached);
if (d->item) {
for (QQuickItem *targetItem : qAsConst(d->targets)) {
@@ -1387,7 +1387,7 @@ void QQuickKeysAttached::keyReleased(QKeyEvent *event, bool post)
if (!event->isAccepted()) QQuickItemKeyFilter::keyReleased(event, post);
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void QQuickKeysAttached::inputMethodEvent(QInputMethodEvent *event, bool post)
{
Q_D(QQuickKeysAttached);
@@ -1424,7 +1424,7 @@ QVariant QQuickKeysAttached::inputMethodQuery(Qt::InputMethodQuery query) const
}
return QQuickItemKeyFilter::inputMethodQuery(query);
}
-#endif // QT_NO_IM
+#endif // im
QQuickKeysAttached *QQuickKeysAttached::qmlAttachedProperties(QObject *obj)
{
@@ -1675,7 +1675,7 @@ void QQuickEnterKeyAttached::setType(Qt::EnterKeyType type)
{
if (keyType != type) {
keyType = type;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (itemPrivate && itemPrivate->activeFocus)
QGuiApplication::inputMethod()->update(Qt::ImEnterKeyType);
#endif
@@ -2366,7 +2366,7 @@ bool QQuickItemPrivate::canAcceptTabFocus(QQuickItem *item)
if (item == item->window()->contentItem())
return true;
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
if (QObject *acc = qmlAttachedPropertiesObject<QQuickAccessibleAttached>(item, false)) {
int role = acc->property("role").toInt();
if (role == QAccessible::EditableText
@@ -2855,7 +2855,7 @@ void QQuickItemPrivate::addChild(QQuickItem *child)
childItems.append(child);
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
QQuickItemPrivate *childPrivate = QQuickItemPrivate::get(child);
// if the added child has a cursor and we do not currently have any children
@@ -2883,7 +2883,7 @@ void QQuickItemPrivate::removeChild(QQuickItem *child)
childItems.removeOne(child);
Q_ASSERT(!childItems.contains(child));
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
QQuickItemPrivate *childPrivate = QQuickItemPrivate::get(child);
// turn it off, if nothing else is using it
@@ -2958,7 +2958,7 @@ void QQuickItemPrivate::derefWindow()
if (polishScheduled)
c->itemsToPolish.removeOne(q);
c->removeGrabber(q);
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
if (c->cursorItem == q) {
c->cursorItem = 0;
window->unsetCursor();
@@ -3842,7 +3842,7 @@ void QQuickItem::keyReleaseEvent(QKeyEvent *event)
event->ignore();
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
/*!
This event handler can be reimplemented in a subclass to receive input
method events for an item. The event information is provided by the
@@ -3852,7 +3852,7 @@ void QQuickItem::inputMethodEvent(QInputMethodEvent *event)
{
event->ignore();
}
-#endif // QT_NO_IM
+#endif // im
/*!
This event handler can be reimplemented in a subclass to receive focus-in
@@ -3861,7 +3861,7 @@ void QQuickItem::inputMethodEvent(QInputMethodEvent *event)
*/
void QQuickItem::focusInEvent(QFocusEvent * /*event*/)
{
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
if (QAccessible::isActive()) {
if (QObject *acc = QQuickAccessibleAttached::findAccessible(this)) {
QAccessibleEvent ev(acc, QAccessible::Focus);
@@ -3939,7 +3939,7 @@ void QQuickItem::touchUngrabEvent()
// XXX todo
}
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
/*!
This event handler can be reimplemented in a subclass to receive
wheel events for an item. The event information is provided by the
@@ -3997,7 +3997,7 @@ void QQuickItem::hoverLeaveEvent(QHoverEvent *event)
Q_UNUSED(event);
}
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
/*!
This event handler can be reimplemented in a subclass to receive drag-enter
events for an item. The event information is provided by the
@@ -4057,7 +4057,7 @@ void QQuickItem::dropEvent(QDropEvent *event)
{
Q_UNUSED(event);
}
-#endif // QT_NO_DRAGANDDROP
+#endif // draganddrop
/*!
Reimplement this method to filter the mouse events that are received by
@@ -4088,7 +4088,7 @@ void QQuickItem::windowDeactivateEvent()
}
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
/*!
This method is only relevant for input items.
@@ -4146,7 +4146,7 @@ QVariant QQuickItem::inputMethodQuery(Qt::InputMethodQuery query) const
return v;
}
-#endif // QT_NO_IM
+#endif // im
QQuickAnchorLine QQuickItemPrivate::left() const
{
@@ -4991,7 +4991,7 @@ void QQuickItemPrivate::deliverKeyEvent(QKeyEvent *e)
}
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void QQuickItemPrivate::deliverInputMethodEvent(QInputMethodEvent *e)
{
Q_Q(QQuickItem);
@@ -5017,7 +5017,7 @@ void QQuickItemPrivate::deliverInputMethodEvent(QInputMethodEvent *e)
extra->keyHandler->inputMethodEvent(e, true);
}
}
-#endif // QT_NO_IM
+#endif // im
/*!
Called when \a change occurs for this item.
@@ -5038,7 +5038,7 @@ void QQuickItem::itemChange(ItemChange change, const ItemChangeData &value)
emit windowChanged(value.window);
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
/*!
Notify input method on updated query values if needed. \a queries indicates
the changed attributes.
@@ -5048,7 +5048,7 @@ void QQuickItem::updateInputMethod(Qt::InputMethodQueries queries)
if (hasActiveFocus())
QGuiApplication::inputMethod()->update(queries);
}
-#endif // QT_NO_IM
+#endif // im
/*! \internal */
// XXX todo - do we want/need this anymore?
@@ -5790,7 +5790,7 @@ bool QQuickItemPrivate::setEffectiveVisibleRecur(bool newEffectiveVisible)
}
itemChange(QQuickItem::ItemVisibleHasChanged, effectiveVisible);
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
if (isAccessible) {
QAccessibleEvent ev(q, effectiveVisible ? QAccessible::ObjectShow : QAccessible::ObjectHide);
QAccessible::updateAccessibility(&ev);
@@ -7074,7 +7074,7 @@ void QQuickItem::setAcceptHoverEvents(bool enabled)
void QQuickItemPrivate::setHasCursorInChild(bool hasCursor)
{
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
Q_Q(QQuickItem);
// if we're asked to turn it off (because of an unsetcursor call, or a node
@@ -7123,7 +7123,7 @@ void QQuickItemPrivate::setHasHoverInChild(bool hasHover)
}
}
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
/*!
Returns the cursor shape for this item.
@@ -7609,7 +7609,7 @@ bool QQuickItem::event(QEvent *ev)
updatePolish();
break;
#endif
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
case QEvent::InputMethodQuery: {
QInputMethodQueryEvent *query = static_cast<QInputMethodQueryEvent *>(ev);
Qt::InputMethodQueries queries = query->queries();
@@ -7626,7 +7626,7 @@ bool QQuickItem::event(QEvent *ev)
case QEvent::InputMethod:
inputMethodEvent(static_cast<QInputMethodEvent *>(ev));
break;
-#endif // QT_NO_IM
+#endif // im
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
@@ -7670,12 +7670,12 @@ bool QQuickItem::event(QEvent *ev)
case QEvent::MouseButtonDblClick:
mouseDoubleClickEvent(static_cast<QMouseEvent*>(ev));
break;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
wheelEvent(static_cast<QWheelEvent*>(ev));
break;
#endif
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
case QEvent::DragEnter:
dragEnterEvent(static_cast<QDragEnterEvent*>(ev));
break;
@@ -7688,12 +7688,12 @@ bool QQuickItem::event(QEvent *ev)
case QEvent::Drop:
dropEvent(static_cast<QDropEvent*>(ev));
break;
-#endif // QT_NO_DRAGANDDROP
-#ifndef QT_NO_GESTURES
+#endif // draganddrop
+#if QT_CONFIG(gestures)
case QEvent::NativeGesture:
ev->ignore();
break;
-#endif // QT_NO_GESTURES
+#endif // gestures
default:
return QObject::event(ev);
}
@@ -8291,7 +8291,7 @@ QQuickItemPrivate::ExtraData::ExtraData()
}
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
QAccessible::Role QQuickItemPrivate::accessibleRole() const
{
Q_Q(const QQuickItem);
diff --git a/src/quick/items/qquickitem.h b/src/quick/items/qquickitem.h
index b1b1d627b1..c9494d91bd 100644
--- a/src/quick/items/qquickitem.h
+++ b/src/quick/items/qquickitem.h
@@ -153,7 +153,7 @@ class Q_QUICK_EXPORT QQuickItem : public QObject, public QQmlParserStatus
public:
enum Flag {
ItemClipsChildrenToShape = 0x01,
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
ItemAcceptsInputMethod = 0x02,
#endif
ItemIsFocusScope = 0x04,
@@ -292,7 +292,7 @@ public:
bool acceptHoverEvents() const;
void setAcceptHoverEvents(bool enabled);
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
QCursor cursor() const;
void setCursor(const QCursor &cursor);
void unsetCursor();
@@ -340,7 +340,7 @@ public:
Q_REVISION(1) Q_INVOKABLE QQuickItem *nextItemInFocusChain(bool forward = true);
Q_INVOKABLE QQuickItem *childAt(qreal x, qreal y) const;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
#endif
@@ -393,7 +393,7 @@ protected:
bool isComponentComplete() const;
virtual void itemChange(ItemChange, const ItemChangeData &);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void updateInputMethod(Qt::InputMethodQueries queries = Qt::ImQueryInput);
#endif
@@ -406,7 +406,7 @@ protected:
virtual void keyPressEvent(QKeyEvent *event);
virtual void keyReleaseEvent(QKeyEvent *event);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
virtual void inputMethodEvent(QInputMethodEvent *);
#endif
virtual void focusInEvent(QFocusEvent *);
@@ -417,14 +417,14 @@ protected:
virtual void mouseDoubleClickEvent(QMouseEvent *event);
virtual void mouseUngrabEvent(); // XXX todo - params?
virtual void touchUngrabEvent();
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
virtual void wheelEvent(QWheelEvent *event);
#endif
virtual void touchEvent(QTouchEvent *event);
virtual void hoverEnterEvent(QHoverEvent *event);
virtual void hoverMoveEvent(QHoverEvent *event);
virtual void hoverLeaveEvent(QHoverEvent *event);
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
virtual void dragEnterEvent(QDragEnterEvent *);
virtual void dragMoveEvent(QDragMoveEvent *);
virtual void dragLeaveEvent(QDragLeaveEvent *);
diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h
index 7781c94f95..3002b73a8c 100644
--- a/src/quick/items/qquickitem_p.h
+++ b/src/quick/items/qquickitem_p.h
@@ -347,7 +347,7 @@ public:
#if QT_CONFIG(quick_shadereffect)
mutable QQuickItemLayer *layer;
#endif
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
QCursor cursor;
#endif
QPointF userTransformOriginPoint;
@@ -534,7 +534,7 @@ public:
virtual void implicitWidthChanged();
virtual void implicitHeightChanged();
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
virtual QAccessible::Role accessibleRole() const;
#endif
@@ -556,7 +556,7 @@ public:
virtual void transformChanged();
void deliverKeyEvent(QKeyEvent *);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void deliverInputMethodEvent(QInputMethodEvent *);
#endif
@@ -618,7 +618,7 @@ public:
virtual void keyPressed(QKeyEvent *event, bool post);
virtual void keyReleased(QKeyEvent *event, bool post);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
virtual void inputMethodEvent(QInputMethodEvent *event, bool post);
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
#endif
@@ -857,7 +857,7 @@ Q_SIGNALS:
private:
void keyPressed(QKeyEvent *event, bool post) Q_DECL_OVERRIDE;
void keyReleased(QKeyEvent *event, bool post) Q_DECL_OVERRIDE;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void inputMethodEvent(QInputMethodEvent *, bool post) Q_DECL_OVERRIDE;
QVariant inputMethodQuery(Qt::InputMethodQuery query) const Q_DECL_OVERRIDE;
#endif
diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp
index 0705d9b504..8dd4a96b62 100644
--- a/src/quick/items/qquickitemsmodule.cpp
+++ b/src/quick/items/qquickitemsmodule.cpp
@@ -96,7 +96,7 @@
#include "qquickspritesequence_p.h"
#include "qquickanimatedsprite_p.h"
#endif
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include "qquickopenglinfo_p.h"
#endif
#include "qquickgraphicsinfo_p.h"
@@ -278,7 +278,7 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor)
qmlRegisterType<QQuickPathInterpolator>("QtQuick",2,0,"PathInterpolator");
#endif
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
qmlRegisterType<QQuickDropArea>("QtQuick", 2, 0, "DropArea");
qmlRegisterType<QQuickDropEvent>();
qmlRegisterType<QQuickDropAreaDrag>();
@@ -289,7 +289,7 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor)
qmlRegisterType<QQuickTouchPoint>("QtQuick", 2, 0, "TouchPoint");
qmlRegisterType<QQuickGrabGestureEvent>();
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
qmlRegisterUncreatableType<QQuickAccessibleAttached>("QtQuick", 2, 0, "Accessible",QQuickAccessibleAttached::tr("Accessible is only available via attached properties"));
#endif
@@ -325,7 +325,7 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor)
qmlRegisterType<QQuickShaderEffect, 1>(uri, 2, 4, "ShaderEffect");
#endif
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
qmlRegisterUncreatableType<QQuickOpenGLInfo>(uri, 2, 4,"OpenGLInfo", QQuickOpenGLInfo::tr("OpenGLInfo is only available via attached properties"));
#endif
qmlRegisterType<QQuickPinchArea, 1>(uri, 2, 5,"PinchArea");
diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp
index 6bd83dd808..5e30bf9e0a 100644
--- a/src/quick/items/qquickmousearea.cpp
+++ b/src/quick/items/qquickmousearea.cpp
@@ -61,10 +61,10 @@ QQuickMouseAreaPrivate::QQuickMouseAreaPrivate()
: enabled(true), scrollGestureEnabled(true), hovered(false), longPress(false),
moved(false), stealMouse(false), doubleClick(false), preventStealing(false),
propagateComposedEvents(false), overThreshold(false), pressed(0)
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
, drag(0)
#endif
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
, cursor(0)
#endif
{
@@ -72,10 +72,10 @@ QQuickMouseAreaPrivate::QQuickMouseAreaPrivate()
QQuickMouseAreaPrivate::~QQuickMouseAreaPrivate()
{
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
delete drag;
#endif
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
delete cursor;
#endif
}
@@ -435,7 +435,7 @@ QQuickMouseArea::QQuickMouseArea(QQuickItem *parent)
{
Q_D(QQuickMouseArea);
d->init();
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
// Explcitly call setCursor on QQuickItem since
// it internally keeps a boolean hasCursor that doesn't
// get set to true unless you call setCursor
@@ -679,7 +679,7 @@ void QQuickMouseArea::mousePressEvent(QMouseEvent *event)
} else {
d->longPress = false;
d->saveEvent(event);
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
if (d->drag)
d->drag->setActive(false);
#endif
@@ -705,7 +705,7 @@ void QQuickMouseArea::mouseMoveEvent(QMouseEvent *event)
// ### can GV handle this for us?
setHovered(contains(d->lastPos));
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
if (d->drag && d->drag->target()) {
if (!d->moved) {
d->targetStartPos = d->drag->target()->parentItem()
@@ -788,7 +788,7 @@ void QQuickMouseArea::mouseReleaseEvent(QMouseEvent *event)
setPressed(event->button(), false, event->source());
if (!d->pressed) {
// no other buttons are pressed
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
if (d->drag)
d->drag->setActive(false);
#endif
@@ -866,7 +866,7 @@ void QQuickMouseArea::hoverLeaveEvent(QHoverEvent *event)
setHovered(false);
}
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void QQuickMouseArea::wheelEvent(QWheelEvent *event)
{
Q_D(QQuickMouseArea);
@@ -897,7 +897,7 @@ void QQuickMouseArea::ungrabMouse()
d->overThreshold = false;
setKeepMouseGrab(false);
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
if (d->drag)
d->drag->setActive(false);
#endif
@@ -980,7 +980,7 @@ bool QQuickMouseArea::childMouseEventFilter(QQuickItem *i, QEvent *e)
Q_D(QQuickMouseArea);
if (!d->pressed &&
(!d->enabled || !isVisible()
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
|| !d->drag || !d->drag->filterChildren()
#endif
)
@@ -1003,7 +1003,7 @@ void QQuickMouseArea::timerEvent(QTimerEvent *event)
Q_D(QQuickMouseArea);
if (event->timerId() == d->pressAndHoldTimer.timerId()) {
d->pressAndHoldTimer.stop();
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
bool dragged = d->drag && d->drag->active();
#else
bool dragged = false;
@@ -1179,7 +1179,7 @@ bool QQuickMouseArea::setPressed(Qt::MouseButton button, bool p, Qt::MouseEventS
{
Q_D(QQuickMouseArea);
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
bool dragged = d->drag && d->drag->active();
#else
bool dragged = false;
@@ -1276,7 +1276,7 @@ bool QQuickMouseArea::setPressed(Qt::MouseButton button, bool p, Qt::MouseEventS
\sa Qt::CursorShape
*/
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
Qt::CursorShape QQuickMouseArea::cursorShape() const
{
return cursor().shape();
@@ -1343,7 +1343,7 @@ void QQuickMouseArea::setCursorShape(Qt::CursorShape shape)
*/
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QQuickDrag *QQuickMouseArea::drag()
{
Q_D(QQuickMouseArea);
diff --git a/src/quick/items/qquickmousearea_p.h b/src/quick/items/qquickmousearea_p.h
index 5cd86541d4..d90c8e1baa 100644
--- a/src/quick/items/qquickmousearea_p.h
+++ b/src/quick/items/qquickmousearea_p.h
@@ -75,12 +75,12 @@ class Q_QUICK_PRIVATE_EXPORT QQuickMouseArea : public QQuickItem
Q_PROPERTY(Qt::MouseButtons pressedButtons READ pressedButtons NOTIFY pressedButtonsChanged)
Q_PROPERTY(Qt::MouseButtons acceptedButtons READ acceptedButtons WRITE setAcceptedButtons NOTIFY acceptedButtonsChanged)
Q_PROPERTY(bool hoverEnabled READ hoverEnabled WRITE setHoverEnabled NOTIFY hoverEnabledChanged)
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
Q_PROPERTY(QQuickDrag *drag READ drag CONSTANT) //### add flicking to QQuickDrag or add a QQuickFlick ???
#endif
Q_PROPERTY(bool preventStealing READ preventStealing WRITE setPreventStealing NOTIFY preventStealingChanged)
Q_PROPERTY(bool propagateComposedEvents READ propagateComposedEvents WRITE setPropagateComposedEvents NOTIFY propagateComposedEventsChanged)
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
Q_PROPERTY(Qt::CursorShape cursorShape READ cursorShape WRITE setCursorShape RESET unsetCursor NOTIFY cursorShapeChanged)
#endif
Q_PROPERTY(bool containsPress READ containsPress NOTIFY containsPressChanged REVISION 1)
@@ -110,7 +110,7 @@ public:
bool hoverEnabled() const;
void setHoverEnabled(bool h);
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QQuickDrag *drag();
#endif
@@ -120,7 +120,7 @@ public:
bool propagateComposedEvents() const;
void setPropagateComposedEvents(bool propagate);
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
Qt::CursorShape cursorShape() const;
void setCursorShape(Qt::CursorShape shape);
#endif
@@ -133,7 +133,7 @@ Q_SIGNALS:
void pressedButtonsChanged();
void acceptedButtonsChanged();
void hoverEnabledChanged();
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
void cursorShapeChanged();
#endif
void positionChanged(QQuickMouseEvent *mouse);
@@ -166,7 +166,7 @@ protected:
void hoverEnterEvent(QHoverEvent *event) Q_DECL_OVERRIDE;
void hoverMoveEvent(QHoverEvent *event) Q_DECL_OVERRIDE;
void hoverLeaveEvent(QHoverEvent *event) Q_DECL_OVERRIDE;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
#endif
bool childMouseEventFilter(QQuickItem *i, QEvent *e) Q_DECL_OVERRIDE;
diff --git a/src/quick/items/qquickmousearea_p_p.h b/src/quick/items/qquickmousearea_p_p.h
index b59e02910f..456b1866a3 100644
--- a/src/quick/items/qquickmousearea_p_p.h
+++ b/src/quick/items/qquickmousearea_p_p.h
@@ -95,7 +95,7 @@ public:
bool propagateComposedEvents : 1;
bool overThreshold : 1;
Qt::MouseButtons pressed;
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QQuickDrag *drag;
#endif
QPointF startScene;
@@ -106,7 +106,7 @@ public:
Qt::MouseButtons lastButtons;
Qt::KeyboardModifiers lastModifiers;
QBasicTimer pressAndHoldTimer;
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
QCursor *cursor;
#endif
QQuickMouseEvent quickMouseEvent;
diff --git a/src/quick/items/qquickpainteditem.cpp b/src/quick/items/qquickpainteditem.cpp
index e565fceab8..3911bb0f28 100644
--- a/src/quick/items/qquickpainteditem.cpp
+++ b/src/quick/items/qquickpainteditem.cpp
@@ -662,7 +662,7 @@ QSGTextureProvider *QQuickPaintedItem::textureProvider() const
return QQuickItem::textureProvider();
Q_D(const QQuickPaintedItem);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QQuickWindow *w = window();
if (!w || !w->openglContext() || QThread::currentThread() != w->openglContext()->thread()) {
qWarning("QQuickPaintedItem::textureProvider: can only be queried on the rendering thread of an exposed window");
diff --git a/src/quick/items/qquickpincharea.cpp b/src/quick/items/qquickpincharea.cpp
index fd8971c845..6295aa1932 100644
--- a/src/quick/items/qquickpincharea.cpp
+++ b/src/quick/items/qquickpincharea.cpp
@@ -682,7 +682,7 @@ bool QQuickPinchArea::event(QEvent *event)
return QQuickItem::event(event);
switch (event->type()) {
-#ifndef QT_NO_GESTURES
+#if QT_CONFIG(gestures)
case QEvent::NativeGesture: {
QNativeGestureEvent *gesture = static_cast<QNativeGestureEvent *>(event);
switch (gesture->gestureType()) {
@@ -775,7 +775,7 @@ bool QQuickPinchArea::event(QEvent *event)
return QQuickItem::event(event);
}
} break;
-#endif // QT_NO_GESTURES
+#endif // gestures
case QEvent::Wheel:
event->ignore();
return false;
diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp
index 74aa2da9e0..13e13890b7 100644
--- a/src/quick/items/qquickrendercontrol.cpp
+++ b/src/quick/items/qquickrendercontrol.cpp
@@ -44,7 +44,7 @@
#include <QtCore/QTime>
#include <QtQuick/private/qquickanimatorcontroller_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QtGui/QOpenGLContext>
# include <QtQuick/private/qsgdefaultrendercontext_p.h>
#if QT_CONFIG(quick_shadereffect)
@@ -62,7 +62,7 @@
#include <QtCore/private/qobject_p.h>
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha);
#endif
/*!
@@ -227,7 +227,7 @@ void QQuickRenderControl::initialize(QOpenGLContext *gl)
{
Q_D(QQuickRenderControl);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (!d->window) {
qWarning("QQuickRenderControl::initialize called with no associated window");
return;
@@ -379,7 +379,7 @@ QImage QQuickRenderControl::grab()
QImage grabContent;
if (d->window->rendererInterface()->graphicsApi() == QSGRendererInterface::OpenGL) {
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
render();
grabContent = qt_gl_read_framebuffer(d->window->size() * d->window->effectiveDevicePixelRatio(), false, false);
#endif
diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp
index 5670696ce2..7926607e33 100644
--- a/src/quick/items/qquickshadereffect.cpp
+++ b/src/quick/items/qquickshadereffect.cpp
@@ -40,7 +40,7 @@
#include <private/qquickshadereffect_p.h>
#include <private/qsgcontextplugin_p.h>
#include <private/qquickitem_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <private/qquickopenglshadereffect_p.h>
#endif
#include <private/qquickgenericshadereffect_p.h>
@@ -499,14 +499,14 @@ QSGContextFactoryInterface::Flags qsg_backend_flags();
QQuickShaderEffect::QQuickShaderEffect(QQuickItem *parent)
: QQuickItem(*new QQuickShaderEffectPrivate, parent),
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
m_glImpl(nullptr),
#endif
m_impl(nullptr)
{
setFlag(QQuickItem::ItemHasContents);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (!qsg_backend_flags().testFlag(QSGContextFactoryInterface::SupportsShaderEffectNode))
m_glImpl = new QQuickOpenGLShaderEffect(this, this);
@@ -539,7 +539,7 @@ QQuickShaderEffect::QQuickShaderEffect(QQuickItem *parent)
QByteArray QQuickShaderEffect::fragmentShader() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->fragmentShader();
#endif
@@ -548,7 +548,7 @@ QByteArray QQuickShaderEffect::fragmentShader() const
void QQuickShaderEffect::setFragmentShader(const QByteArray &code)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->setFragmentShader(code);
return;
@@ -578,7 +578,7 @@ void QQuickShaderEffect::setFragmentShader(const QByteArray &code)
QByteArray QQuickShaderEffect::vertexShader() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->vertexShader();
#endif
@@ -587,7 +587,7 @@ QByteArray QQuickShaderEffect::vertexShader() const
void QQuickShaderEffect::setVertexShader(const QByteArray &code)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->setVertexShader(code);
return;
@@ -607,7 +607,7 @@ void QQuickShaderEffect::setVertexShader(const QByteArray &code)
bool QQuickShaderEffect::blending() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->blending();
#endif
@@ -616,7 +616,7 @@ bool QQuickShaderEffect::blending() const
void QQuickShaderEffect::setBlending(bool enable)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->setBlending(enable);
return;
@@ -640,7 +640,7 @@ void QQuickShaderEffect::setBlending(bool enable)
QVariant QQuickShaderEffect::mesh() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->mesh();
#endif
@@ -649,7 +649,7 @@ QVariant QQuickShaderEffect::mesh() const
void QQuickShaderEffect::setMesh(const QVariant &mesh)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->setMesh(mesh);
return;
@@ -674,7 +674,7 @@ void QQuickShaderEffect::setMesh(const QVariant &mesh)
QQuickShaderEffect::CullMode QQuickShaderEffect::cullMode() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->cullMode();
#endif
@@ -683,7 +683,7 @@ QQuickShaderEffect::CullMode QQuickShaderEffect::cullMode() const
void QQuickShaderEffect::setCullMode(CullMode face)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->setCullMode(face);
return;
@@ -715,7 +715,7 @@ void QQuickShaderEffect::setCullMode(CullMode face)
bool QQuickShaderEffect::supportsAtlasTextures() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->supportsAtlasTextures();
#endif
@@ -724,7 +724,7 @@ bool QQuickShaderEffect::supportsAtlasTextures() const
void QQuickShaderEffect::setSupportsAtlasTextures(bool supports)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->setSupportsAtlasTextures(supports);
return;
@@ -771,7 +771,7 @@ void QQuickShaderEffect::setSupportsAtlasTextures(bool supports)
QString QQuickShaderEffect::log() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->log();
#endif
@@ -780,7 +780,7 @@ QString QQuickShaderEffect::log() const
QQuickShaderEffect::Status QQuickShaderEffect::status() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->status();
#endif
@@ -789,7 +789,7 @@ QQuickShaderEffect::Status QQuickShaderEffect::status() const
bool QQuickShaderEffect::event(QEvent *e)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->handleEvent(e);
return QQuickItem::event(e);
@@ -801,7 +801,7 @@ bool QQuickShaderEffect::event(QEvent *e)
void QQuickShaderEffect::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->handleGeometryChanged(newGeometry, oldGeometry);
QQuickItem::geometryChanged(newGeometry, oldGeometry);
@@ -814,7 +814,7 @@ void QQuickShaderEffect::geometryChanged(const QRectF &newGeometry, const QRectF
QSGNode *QQuickShaderEffect::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->handleUpdatePaintNode(oldNode, updatePaintNodeData);
#endif
@@ -823,7 +823,7 @@ QSGNode *QQuickShaderEffect::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDa
void QQuickShaderEffect::componentComplete()
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->maybeUpdateShaders();
QQuickItem::componentComplete();
@@ -836,7 +836,7 @@ void QQuickShaderEffect::componentComplete()
void QQuickShaderEffect::itemChange(ItemChange change, const ItemChangeData &value)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->handleItemChange(change, value);
QQuickItem::itemChange(change, value);
@@ -854,7 +854,7 @@ bool QQuickShaderEffect::isComponentComplete() const
QString QQuickShaderEffect::parseLog() // for OpenGL-based autotests
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->parseLog();
#endif
@@ -864,7 +864,7 @@ QString QQuickShaderEffect::parseLog() // for OpenGL-based autotests
void QQuickShaderEffectPrivate::updatePolish()
{
Q_Q(QQuickShaderEffect);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (q->m_glImpl) {
q->m_glImpl->maybeUpdateShaders();
return;
diff --git a/src/quick/items/qquickshadereffect_p.h b/src/quick/items/qquickshadereffect_p.h
index 2b7ff4cf6e..7885daffbb 100644
--- a/src/quick/items/qquickshadereffect_p.h
+++ b/src/quick/items/qquickshadereffect_p.h
@@ -135,7 +135,7 @@ protected:
void itemChange(ItemChange change, const ItemChangeData &value) override;
private:
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QQuickOpenGLShaderEffect *m_glImpl;
#endif
QQuickGenericShaderEffect *m_impl;
diff --git a/src/quick/items/qquickspriteengine.cpp b/src/quick/items/qquickspriteengine.cpp
index 74b04a75ad..f54a8911b2 100644
--- a/src/quick/items/qquickspriteengine.cpp
+++ b/src/quick/items/qquickspriteengine.cpp
@@ -664,13 +664,14 @@ uint QQuickStochasticEngine::updateSprites(uint time)//### would returning a lis
//Sprite State Update;
m_timeOffset = time;
m_addAdvance = false;
- while (!m_stateUpdates.isEmpty() && time >= m_stateUpdates.constFirst().first){
- const auto copy = m_stateUpdates.constFirst().second;
+ int i = 0;
+ for (; i < m_stateUpdates.count() && time >= m_stateUpdates.at(i).first; ++i) {
+ const auto copy = m_stateUpdates.at(i).second;
for (int idx : copy)
advance(idx);
- m_stateUpdates.pop_front();
}
+ m_stateUpdates.remove(0, i);
m_advanceTime.start();
m_addAdvance = true;
if (m_stateUpdates.isEmpty())
@@ -760,13 +761,13 @@ void QQuickStochasticEngine::addToUpdateList(uint t, int idx)
m_stateUpdates[i].second << idx;
return;
} else if (m_stateUpdates.at(i).first > t) {
- QList<int> tmpList;
+ QVector<int> tmpList;
tmpList << idx;
m_stateUpdates.insert(i, qMakePair(t, tmpList));
return;
}
}
- QList<int> tmpList;
+ QVector<int> tmpList;
tmpList << idx;
m_stateUpdates << qMakePair(t, tmpList);
}
diff --git a/src/quick/items/qquickspriteengine_p.h b/src/quick/items/qquickspriteengine_p.h
index 89de9ce4f2..90ee68b2f6 100644
--- a/src/quick/items/qquickspriteengine_p.h
+++ b/src/quick/items/qquickspriteengine_p.h
@@ -254,7 +254,7 @@ protected:
QVector<int> m_goals;
QVector<int> m_duration;
QVector<int> m_startTimes;
- QList<QPair<uint, QList<int> > > m_stateUpdates;//### This could be done faster - priority queue?
+ QVector<QPair<uint, QVector<int> > > m_stateUpdates;//### This could be done faster - priority queue?
QTime m_advanceTime;
uint m_timeOffset;
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index 2bfb4501fc..e37a7e6d5e 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -1819,7 +1819,7 @@ bool QQuickTextPrivate::setHAlign(QQuickText::HAlignment alignment, bool forceAl
bool QQuickTextPrivate::determineHorizontalAlignment()
{
if (hAlignImplicit) {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
bool alignToRight = text.isEmpty() ? QGuiApplication::inputMethod()->inputDirection() == Qt::RightToLeft : rightToLeftText;
#else
bool alignToRight = rightToLeftText;
@@ -2713,12 +2713,12 @@ QString QQuickText::hoveredLink() const
if (d->extra.isAllocated())
return d->extra->hoveredLink;
} else {
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
if (QQuickWindow *wnd = window()) {
QPointF pos = QCursor::pos(wnd->screen()) - wnd->position() - mapToScene(QPointF(0, 0));
return d->anchorAt(pos);
}
-#endif // QT_NO_CURSOR
+#endif // cursor
}
return QString();
}
diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp
index fe29249934..555fd233b3 100644
--- a/src/quick/items/qquicktextcontrol.cpp
+++ b/src/quick/items/qquicktextcontrol.cpp
@@ -79,9 +79,6 @@ const int textCursorWidth = 1;
QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(DBG_HOVER_TRACE)
-#ifndef QT_NO_CONTEXTMENU
-#endif
-
// could go into QTextCursor...
static QTextLine currentTextLine(const QTextCursor &cursor)
{
@@ -99,7 +96,7 @@ static QTextLine currentTextLine(const QTextCursor &cursor)
QQuickTextControlPrivate::QQuickTextControlPrivate()
: doc(0),
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
preeditCursor(0),
#endif
interactionFlags(Qt::TextEditorInteraction),
@@ -123,7 +120,7 @@ QQuickTextControlPrivate::QQuickTextControlPrivate()
bool QQuickTextControlPrivate::cursorMoveKeyEvent(QKeyEvent *e)
{
-#ifdef QT_NO_SHORTCUT
+#if !QT_CONFIG(shortcut)
Q_UNUSED(e);
#endif
@@ -139,7 +136,7 @@ bool QQuickTextControlPrivate::cursorMoveKeyEvent(QKeyEvent *e)
if (false) {
}
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
if (e == QKeySequence::MoveToNextChar) {
op = QTextCursor::Right;
}
@@ -232,7 +229,7 @@ bool QQuickTextControlPrivate::cursorMoveKeyEvent(QKeyEvent *e)
else if (e == QKeySequence::MoveToEndOfDocument) {
op = QTextCursor::End;
}
-#endif // QT_NO_SHORTCUT
+#endif // shortcut
else {
return false;
}
@@ -290,7 +287,7 @@ void QQuickTextControlPrivate::setContent(Qt::TextFormat format, const QString &
{
Q_Q(QQuickTextControl);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
cancelPreedit();
#endif
@@ -326,7 +323,7 @@ void QQuickTextControlPrivate::setContent(Qt::TextFormat format, const QString &
formatCursor.setCharFormat(charFormatForInsertion);
formatCursor.endEditBlock();
} else {
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
doc->setHtml(text);
#else
doc->setPlainText(text);
@@ -407,7 +404,7 @@ void QQuickTextControlPrivate::selectionChanged(bool forceEmitSelectionChanged /
{
Q_Q(QQuickTextControl);
if (forceEmitSelectionChanged) {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (hasFocus)
qGuiApp->inputMethod()->update(Qt::ImCurrentSelection);
#endif
@@ -429,7 +426,7 @@ void QQuickTextControlPrivate::selectionChanged(bool forceEmitSelectionChanged /
lastSelectionEnd = selectionEnd;
if (!forceEmitSelectionChanged) {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (hasFocus)
qGuiApp->inputMethod()->update(Qt::ImCurrentSelection);
#endif
@@ -443,7 +440,7 @@ void QQuickTextControlPrivate::_q_updateCurrentCharFormatAndSelection()
selectionChanged();
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void QQuickTextControlPrivate::setClipboardSelection()
{
QClipboard *clipboard = QGuiApplication::clipboard();
@@ -544,7 +541,7 @@ void QQuickTextControlPrivate::extendWordwiseSelection(int suggestedNewPosition,
}
if (interactionFlags & Qt::TextSelectableByMouse) {
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
setClipboardSelection();
#endif
selectionChanged(true);
@@ -574,7 +571,7 @@ void QQuickTextControlPrivate::extendBlockwiseSelection(int suggestedNewPosition
}
if (interactionFlags & Qt::TextSelectableByMouse) {
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
setClipboardSelection();
#endif
selectionChanged(true);
@@ -611,7 +608,7 @@ void QQuickTextControl::clear()
}
QQuickTextControl::QQuickTextControl(QTextDocument *doc, QObject *parent)
- : QObject(*new QQuickTextControlPrivate, parent)
+ : QInputControl(TextEdit, *new QQuickTextControlPrivate, parent)
{
Q_D(QQuickTextControl);
Q_ASSERT(doc);
@@ -656,7 +653,7 @@ void QQuickTextControl::updateCursorRectangle(bool force)
void QQuickTextControl::setTextCursor(const QTextCursor &cursor)
{
Q_D(QQuickTextControl);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
d->commitPreedit();
#endif
d->cursorIsFocusIndicator = false;
@@ -677,7 +674,7 @@ QTextCursor QQuickTextControl::textCursor() const
return d->cursor;
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void QQuickTextControl::cut()
{
@@ -759,7 +756,7 @@ void QQuickTextControl::processEvent(QEvent *e, const QMatrix &matrix)
QHoverEvent *ev = static_cast<QHoverEvent *>(e);
d->hoverEvent(ev, matrix.map(ev->posF()));
break; }
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
case QEvent::InputMethod:
d->inputMethodEvent(static_cast<QInputMethodEvent *>(e));
break;
@@ -795,7 +792,7 @@ void QQuickTextControl::processEvent(QEvent *e, const QMatrix &matrix)
break;
}
}
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
} else if (ke == QKeySequence::Copy
|| ke == QKeySequence::Paste
|| ke == QKeySequence::Cut
@@ -873,20 +870,20 @@ void QQuickTextControlPrivate::keyPressEvent(QKeyEvent *e)
return;
}
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
if (e == QKeySequence::SelectAll) {
e->accept();
q->selectAll();
return;
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
else if (e == QKeySequence::Copy) {
e->accept();
q->copy();
return;
}
#endif
-#endif // QT_NO_SHORTCUT
+#endif // shortcut
if (interactionFlags & Qt::TextSelectableByKeyboard
&& cursorMoveKeyEvent(e))
@@ -924,7 +921,7 @@ void QQuickTextControlPrivate::keyPressEvent(QKeyEvent *e)
}
goto accept;
}
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
else if (e == QKeySequence::InsertParagraphSeparator) {
cursor.insertBlock();
e->accept();
@@ -937,14 +934,14 @@ void QQuickTextControlPrivate::keyPressEvent(QKeyEvent *e)
#endif
if (false) {
}
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
else if (e == QKeySequence::Undo) {
q->undo();
}
else if (e == QKeySequence::Redo) {
q->redo();
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
else if (e == QKeySequence::Cut) {
q->cut();
}
@@ -975,7 +972,7 @@ void QQuickTextControlPrivate::keyPressEvent(QKeyEvent *e)
cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);
cursor.removeSelectedText();
}
-#endif // QT_NO_SHORTCUT
+#endif // shortcut
else {
goto process;
}
@@ -983,8 +980,7 @@ void QQuickTextControlPrivate::keyPressEvent(QKeyEvent *e)
process:
{
- QString text = e->text();
- if (!text.isEmpty() && (text.at(0).isPrint() || text.at(0) == QLatin1Char('\t'))) {
+ if (q->isAcceptableInput(e)) {
if (overwriteMode
// no need to call deleteChar() if we have a selection, insertText
// does it already
@@ -993,7 +989,7 @@ process:
cursor.deleteChar();
}
- cursor.insertText(text);
+ cursor.insertText(e->text());
selectionChanged();
} else {
e->ignore();
@@ -1019,7 +1015,7 @@ QRectF QQuickTextControlPrivate::rectForPosition(int position) const
const QTextLayout *layout = block.layout();
const QPointF layoutPos = q->blockBoundingRect(block).topLeft();
int relativePos = position - block.position();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (preeditCursor != 0) {
int preeditPos = layout->preeditAreaPosition();
if (relativePos == preeditPos)
@@ -1083,7 +1079,7 @@ void QQuickTextControlPrivate::mousePressEvent(QMouseEvent *e, const QPointF &po
const QTextCursor oldSelection = cursor;
const int oldCursorPos = cursor.position();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
commitPreedit();
#endif
@@ -1157,7 +1153,7 @@ void QQuickTextControlPrivate::mouseMoveEvent(QMouseEvent *e, const QPointF &mou
int newCursorPos = q->hitTest(mousePos, Qt::FuzzyHit);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (isPreediting()) {
// note: oldCursorPos not including preedit
int selectionStartPos = q->hitTest(mousePressPos, Qt::FuzzyHit);
@@ -1183,7 +1179,7 @@ void QQuickTextControlPrivate::mouseMoveEvent(QMouseEvent *e, const QPointF &mou
extendBlockwiseSelection(newCursorPos);
else if (selectedWordOnDoubleClick.hasSelection())
extendWordwiseSelection(newCursorPos, mouseX);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
else if (!isPreediting())
setCursorPosition(newCursorPos, QTextCursor::KeepAnchor);
#endif
@@ -1194,7 +1190,7 @@ void QQuickTextControlPrivate::mouseMoveEvent(QMouseEvent *e, const QPointF &mou
q->updateCursorRectangle(true);
}
_q_updateCurrentCharFormatAndSelection();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (qGuiApp)
qGuiApp->inputMethod()->update(Qt::ImQueryInput);
#endif
@@ -1221,7 +1217,7 @@ void QQuickTextControlPrivate::mouseReleaseEvent(QMouseEvent *e, const QPointF &
if (mousePressed) {
mousePressed = false;
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
setClipboardSelection();
selectionChanged(true);
} else if (e->button() == Qt::MidButton
@@ -1270,7 +1266,7 @@ void QQuickTextControlPrivate::mouseDoubleClickEvent(QMouseEvent *e, const QPoin
Q_Q(QQuickTextControl);
if (e->button() == Qt::LeftButton && (interactionFlags & Qt::TextSelectableByMouse)) {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
commitPreedit();
#endif
@@ -1291,7 +1287,7 @@ void QQuickTextControlPrivate::mouseDoubleClickEvent(QMouseEvent *e, const QPoin
tripleClickTimer.start(QGuiApplication::styleHints()->mouseDoubleClickInterval(), q);
if (doEmit) {
selectionChanged();
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
setClipboardSelection();
#endif
emit q->cursorPositionChanged();
@@ -1304,7 +1300,7 @@ void QQuickTextControlPrivate::mouseDoubleClickEvent(QMouseEvent *e, const QPoin
bool QQuickTextControlPrivate::sendMouseEventToInputContext(QMouseEvent *e, const QPointF &pos)
{
-#if !defined(QT_NO_IM)
+#if QT_CONFIG(im)
Q_Q(QQuickTextControl);
Q_UNUSED(e);
@@ -1328,7 +1324,7 @@ bool QQuickTextControlPrivate::sendMouseEventToInputContext(QMouseEvent *e, cons
return false;
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void QQuickTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
{
Q_Q(QQuickTextControl);
@@ -1481,7 +1477,7 @@ QVariant QQuickTextControl::inputMethodQuery(Qt::InputMethodQuery property, QVar
return QVariant();
}
}
-#endif // QT_NO_IM
+#endif // im
void QQuickTextControlPrivate::focusEvent(QFocusEvent *e)
{
@@ -1611,7 +1607,7 @@ void QQuickTextControl::moveCursor(QTextCursor::MoveOperation op, QTextCursor::M
bool QQuickTextControl::canPaste() const
{
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
Q_D(const QQuickTextControl);
if (d->interactionFlags & Qt::TextEditable) {
const QMimeData *md = QGuiApplication::clipboard()->mimeData();
@@ -1661,7 +1657,7 @@ void QQuickTextControl::insertFromMimeData(const QMimeData *source)
bool hasData = false;
QTextDocumentFragment fragment;
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
if (source->hasFormat(QLatin1String("application/x-qrichtext")) && d->acceptRichText) {
// x-qrichtext is always UTF-8 (taken from Qt3 since we don't use it anymore).
const QString richtext = QLatin1String("<meta name=\"qrichtext\" content=\"1\" />")
@@ -1680,7 +1676,7 @@ void QQuickTextControl::insertFromMimeData(const QMimeData *source)
}
#else
fragment = QTextDocumentFragment::fromPlainText(source->text());
-#endif // QT_NO_TEXTHTMLPARSER
+#endif // texthtmlparser
if (hasData)
d->cursor.insertFragment(fragment);
@@ -1751,7 +1747,7 @@ void QQuickTextControlPrivate::activateLinkUnderCursor(QString href)
emit q_func()->linkActivated(href);
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
bool QQuickTextControlPrivate::isPreediting() const
{
QTextLayout *layout = cursor.block().layout();
@@ -1789,7 +1785,7 @@ void QQuickTextControlPrivate::cancelPreedit()
QInputMethodEvent event;
QCoreApplication::sendEvent(q->parent(), &event);
}
-#endif // QT_NO_IM
+#endif // im
void QQuickTextControl::setTextInteractionFlags(Qt::TextInteractionFlags flags)
{
@@ -1813,7 +1809,7 @@ QString QQuickTextControl::toPlainText() const
return document()->toPlainText();
}
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
QString QQuickTextControl::toHtml() const
{
return document()->toHtml();
@@ -1840,7 +1836,7 @@ QRectF QQuickTextControl::blockBoundingRect(const QTextBlock &block) const
QString QQuickTextControl::preeditText() const
{
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Q_D(const QQuickTextControl);
QTextLayout *layout = d->cursor.block().layout();
if (!layout)
@@ -1857,7 +1853,7 @@ QStringList QQuickTextEditMimeData::formats() const
{
if (!fragment.isEmpty())
return QStringList() << QString::fromLatin1("text/plain") << QString::fromLatin1("text/html")
-#ifndef QT_NO_TEXTODFWRITER
+#if QT_CONFIG(textodfwriter)
<< QString::fromLatin1("application/vnd.oasis.opendocument.text")
#endif
;
@@ -1875,10 +1871,10 @@ QVariant QQuickTextEditMimeData::retrieveData(const QString &mimeType, QVariant:
void QQuickTextEditMimeData::setup() const
{
QQuickTextEditMimeData *that = const_cast<QQuickTextEditMimeData *>(this);
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
that->setData(QLatin1String("text/html"), fragment.toHtml("utf-8").toUtf8());
#endif
-#ifndef QT_NO_TEXTODFWRITER
+#if QT_CONFIG(textodfwriter)
{
QBuffer buffer;
QTextDocumentWriter writer(&buffer, "ODF");
diff --git a/src/quick/items/qquicktextcontrol_p.h b/src/quick/items/qquicktextcontrol_p.h
index e06e3b8b29..70104a97e0 100644
--- a/src/quick/items/qquicktextcontrol_p.h
+++ b/src/quick/items/qquicktextcontrol_p.h
@@ -59,6 +59,7 @@
#include <QtGui/qabstracttextdocumentlayout.h>
#include <QtGui/qtextdocumentfragment.h>
#include <QtGui/qclipboard.h>
+#include <QtGui/private/qinputcontrol_p.h>
#include <QtCore/qmimedata.h>
QT_BEGIN_NAMESPACE
@@ -71,7 +72,7 @@ class QAbstractScrollArea;
class QEvent;
class QTimerEvent;
-class Q_AUTOTEST_EXPORT QQuickTextControl : public QObject
+class Q_AUTOTEST_EXPORT QQuickTextControl : public QInputControl
{
Q_OBJECT
Q_DECLARE_PRIVATE(QQuickTextControl)
@@ -89,7 +90,7 @@ public:
QString toPlainText() const;
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
QString toHtml() const;
#endif
@@ -129,7 +130,7 @@ public Q_SLOTS:
void setPlainText(const QString &text);
void setHtml(const QString &text);
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void cut();
void copy();
void paste(QClipboard::Mode mode = QClipboard::Clipboard);
@@ -164,7 +165,7 @@ public:
virtual void processEvent(QEvent *e, const QMatrix &matrix);
void processEvent(QEvent *e, const QPointF &coordinateOffset = QPointF());
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
virtual QVariant inputMethodQuery(Qt::InputMethodQuery property) const;
Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
#endif
diff --git a/src/quick/items/qquicktextcontrol_p_p.h b/src/quick/items/qquicktextcontrol_p_p.h
index 0f78feb5de..0582e6d113 100644
--- a/src/quick/items/qquicktextcontrol_p_p.h
+++ b/src/quick/items/qquicktextcontrol_p_p.h
@@ -90,7 +90,7 @@ public:
void _q_updateCurrentCharFormatAndSelection();
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void setClipboardSelection();
#endif
@@ -114,14 +114,14 @@ public:
void mouseDoubleClickEvent(QMouseEvent *event, const QPointF &pos);
bool sendMouseEventToInputContext(QMouseEvent *event, const QPointF &pos);
void focusEvent(QFocusEvent *e);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void inputMethodEvent(QInputMethodEvent *);
#endif
void hoverEvent(QHoverEvent *e, const QPointF &pos);
void activateLinkUnderCursor(QString href = QString());
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
bool isPreediting() const;
void commitPreedit();
void cancelPreedit();
@@ -143,7 +143,7 @@ public:
QBasicTimer cursorBlinkTimer;
QBasicTimer tripleClickTimer;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
int preeditCursor;
#endif
diff --git a/src/quick/items/qquicktextdocument.cpp b/src/quick/items/qquicktextdocument.cpp
index 287e07e980..61d75fe99b 100644
--- a/src/quick/items/qquicktextdocument.cpp
+++ b/src/quick/items/qquicktextdocument.cpp
@@ -230,7 +230,7 @@ void QQuickTextDocumentWithImageResources::setText(const QString &text)
{
clearResources();
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
setHtml(text);
#else
setPlainText(text);
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index b53bf064b6..106acf57cf 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -190,7 +190,7 @@ QString QQuickTextEdit::text() const
Q_D(const QQuickTextEdit);
if (!d->textCached && isComponentComplete()) {
QQuickTextEditPrivate *d = const_cast<QQuickTextEditPrivate *>(d_func());
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
if (d->richText)
d->text = d->control->toHtml();
else
@@ -381,7 +381,7 @@ void QQuickTextEdit::setText(const QString &text)
if (!isComponentComplete()) {
d->text = text;
} else if (d->richText) {
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
d->control->setHtml(text);
#else
d->control->setPlainText(text);
@@ -458,7 +458,7 @@ void QQuickTextEdit::setTextFormat(TextFormat format)
bool wasRich = d->richText;
d->richText = format == RichText || (format == AutoText && (wasRich || Qt::mightBeRichText(text())));
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
if (isComponentComplete()) {
if (wasRich && !d->richText) {
d->control->setPlainText(!d->textCached ? d->control->toHtml() : d->text);
@@ -540,7 +540,7 @@ void QQuickTextEdit::setFont(const QFont &font)
}
updateSize();
updateWholeDocument();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
updateInputMethod(Qt::ImCursorRectangle | Qt::ImAnchorRectangle | Qt::ImFont);
#endif
}
@@ -738,7 +738,7 @@ bool QQuickTextEditPrivate::determineHorizontalAlignment()
Q_Q(QQuickTextEdit);
if (hAlignImplicit && q->isComponentComplete()) {
Qt::LayoutDirection direction = contentDirection;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (direction == Qt::LayoutDirectionAuto) {
const QString preeditText = control->textCursor().block().layout()->preeditAreaText();
direction = textDirection(preeditText);
@@ -764,7 +764,7 @@ void QQuickTextEditPrivate::mirrorChange()
}
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Qt::InputMethodHints QQuickTextEditPrivate::effectiveInputMethodHints() const
{
return inputMethodHints | Qt::ImhMultiLine;
@@ -1012,7 +1012,7 @@ int QQuickTextEdit::positionAt(qreal x, qreal y) const
y -= d->yoff;
int r = d->document->documentLayout()->hitTest(QPointF(x, y), Qt::FuzzyHit);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
QTextCursor cursor = d->control->textCursor();
if (r > cursor.position()) {
// The cursor position includes positions within the preedit text, but only positions in the
@@ -1261,7 +1261,7 @@ int QQuickTextEdit::selectionEnd() const
QString QQuickTextEdit::selectedText() const
{
Q_D(const QQuickTextEdit);
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
return d->richText
? d->control->textCursor().selectedText()
: d->control->textCursor().selection().toPlainText();
@@ -1379,17 +1379,17 @@ void QQuickTextEdit::setTextMargin(qreal margin)
Qt::InputMethodHints QQuickTextEdit::inputMethodHints() const
{
-#ifdef QT_NO_IM
+#if !QT_CONFIG(im)
return Qt::ImhNone;
#else
Q_D(const QQuickTextEdit);
return d->inputMethodHints;
-#endif // QT_NO_IM
+#endif // im
}
void QQuickTextEdit::setInputMethodHints(Qt::InputMethodHints hints)
{
-#ifdef QT_NO_IM
+#if !QT_CONFIG(im)
Q_UNUSED(hints);
#else
Q_D(QQuickTextEdit);
@@ -1400,7 +1400,7 @@ void QQuickTextEdit::setInputMethodHints(Qt::InputMethodHints hints)
d->inputMethodHints = hints;
updateInputMethod(Qt::ImHints);
emit inputMethodHintsChanged();
-#endif // QT_NO_IM
+#endif // im
}
void QQuickTextEdit::geometryChanged(const QRectF &newGeometry,
@@ -1427,7 +1427,7 @@ void QQuickTextEdit::componentComplete()
QQuickImplicitSizeItem::componentComplete();
d->document->setBaseUrl(baseUrl());
-#ifndef QT_NO_TEXTHTML_PARSER
+#if QT_CONFIG(texthtmlparser)
if (d->richText)
d->control->setHtml(d->text);
else
@@ -1554,7 +1554,7 @@ void QQuickTextEdit::setReadOnly(bool r)
if (r == isReadOnly())
return;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
setFlag(QQuickItem::ItemAcceptsInputMethod, !r);
#endif
Qt::TextInteractionFlags flags = Qt::LinksAccessibleByMouse;
@@ -1569,7 +1569,7 @@ void QQuickTextEdit::setReadOnly(bool r)
d->control->setTextInteractionFlags(flags);
d->control->moveCursor(QTextCursor::End);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
updateInputMethod(Qt::ImEnabled);
#endif
q_canPasteChanged();
@@ -1748,7 +1748,7 @@ bool QQuickTextEdit::isRightToLeft(int start, int end)
}
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
/*!
\qmlmethod QtQuick::TextEdit::cut()
@@ -1781,7 +1781,7 @@ void QQuickTextEdit::paste()
Q_D(QQuickTextEdit);
d->control->paste();
}
-#endif // QT_NO_CLIPBOARD
+#endif // clipboard
/*!
@@ -1822,7 +1822,7 @@ void QQuickTextEdit::mousePressEvent(QMouseEvent *event)
bool hadActiveFocus = hasActiveFocus();
forceActiveFocus(Qt::MouseFocusReason);
// re-open input panel on press if already focused
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (hasActiveFocus() && hadActiveFocus && !isReadOnly())
qGuiApp->inputMethod()->show();
#else
@@ -1870,7 +1870,7 @@ void QQuickTextEdit::mouseMoveEvent(QMouseEvent *event)
QQuickImplicitSizeItem::mouseMoveEvent(event);
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
/*!
\overload
Handles the given input method \a event.
@@ -1923,7 +1923,7 @@ QVariant QQuickTextEdit::inputMethodQuery(Qt::InputMethodQuery property) const
{
return inputMethodQuery(property, QVariant());
}
-#endif // QT_NO_IM
+#endif // im
void QQuickTextEdit::triggerPreprocess()
{
@@ -2197,12 +2197,12 @@ bool QQuickTextEdit::canRedo() const
*/
bool QQuickTextEdit::isInputMethodComposing() const
{
-#ifdef QT_NO_IM
+#if !QT_CONFIG(im)
return false;
#else
Q_D(const QQuickTextEdit);
return d->control->hasImState();
-#endif // QT_NO_IM
+#endif // im
}
QQuickTextEditPrivate::ExtraData::ExtraData()
@@ -2223,14 +2223,14 @@ void QQuickTextEditPrivate::init()
{
Q_Q(QQuickTextEdit);
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
if (QGuiApplication::clipboard()->supportsSelection())
q->setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton);
else
#endif
q->setAcceptedMouseButtons(Qt::LeftButton);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
q->setFlag(QQuickItem::ItemAcceptsInputMethod);
#endif
q->setFlag(QQuickItem::ItemHasContents);
@@ -2255,7 +2255,7 @@ void QQuickTextEditPrivate::init()
qmlobject_connect(control, QQuickTextControl, SIGNAL(overwriteModeChanged(bool)), q, QQuickTextEdit, SIGNAL(overwriteModeChanged(bool)));
qmlobject_connect(control, QQuickTextControl, SIGNAL(textChanged()), q, QQuickTextEdit, SLOT(q_textChanged()));
qmlobject_connect(control, QQuickTextControl, SIGNAL(preeditTextChanged()), q, QQuickTextEdit, SIGNAL(preeditTextChanged()));
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
qmlobject_connect(QGuiApplication::clipboard(), QClipboard, SIGNAL(dataChanged()), q, QQuickTextEdit, SLOT(q_canPasteChanged()));
#endif
qmlobject_connect(document, QQuickTextDocumentWithImageResources, SIGNAL(undoAvailable(bool)), q, QQuickTextEdit, SIGNAL(canUndoChanged()));
@@ -2341,7 +2341,7 @@ void QQuickTextEdit::q_contentsChange(int pos, int charsRemoved, int charsAdded)
void QQuickTextEdit::moveCursorDelegate()
{
Q_D(QQuickTextEdit);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
updateInputMethod();
#endif
emit cursorRectangleChanged();
@@ -2582,7 +2582,7 @@ void QQuickTextEditPrivate::updateDefaultTextOption()
else
opt.setAlignment(Qt::Alignment(vAlign));
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (contentDirection == Qt::LayoutDirectionAuto) {
opt.setTextDirection(qGuiApp->inputMethod()->inputDirection());
} else
@@ -2627,14 +2627,14 @@ void QQuickTextEditPrivate::handleFocusEvent(QFocusEvent *event)
control->processEvent(event, QPointF(-xoff, -yoff));
if (focus) {
q->q_updateAlignment();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (focusOnPress && !q->isReadOnly())
qGuiApp->inputMethod()->show();
q->connect(QGuiApplication::inputMethod(), SIGNAL(inputDirectionChanged(Qt::LayoutDirection)),
q, SLOT(q_updateAlignment()));
#endif
} else {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
q->disconnect(QGuiApplication::inputMethod(), SIGNAL(inputDirectionChanged(Qt::LayoutDirection)),
q, SLOT(q_updateAlignment()));
#endif
@@ -2685,7 +2685,7 @@ QString QQuickTextEdit::getText(int start, int end) const
QTextCursor cursor(d->document);
cursor.setPosition(start, QTextCursor::MoveAnchor);
cursor.setPosition(end, QTextCursor::KeepAnchor);
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
return d->richText
? cursor.selectedText()
: cursor.selection().toPlainText();
@@ -2714,7 +2714,7 @@ QString QQuickTextEdit::getFormattedText(int start, int end) const
cursor.setPosition(end, QTextCursor::KeepAnchor);
if (d->richText) {
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
return cursor.selection().toHtml();
#else
return cursor.selection().toPlainText();
@@ -2738,7 +2738,7 @@ void QQuickTextEdit::insert(int position, const QString &text)
cursor.setPosition(position);
d->richText = d->richText || (d->format == AutoText && Qt::mightBeRichText(text));
if (d->richText) {
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
cursor.insertHtml(text);
#else
cursor.insertText(text);
@@ -2831,12 +2831,12 @@ QString QQuickTextEdit::hoveredLink() const
if (const_cast<QQuickTextEditPrivate *>(d)->isLinkHoveredConnected()) {
return d->control->hoveredLink();
} else {
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
if (QQuickWindow *wnd = window()) {
QPointF pos = QCursor::pos(wnd->screen()) - wnd->position() - mapToScene(QPointF(0, 0));
return d->control->anchorAt(pos);
}
-#endif // QT_NO_CURSOR
+#endif // cursor
}
return QString();
}
@@ -2881,7 +2881,7 @@ void QQuickTextEdit::append(const QString &text)
if (!d->document->isEmpty())
cursor.insertBlock();
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
if (d->format == RichText || (d->format == AutoText && Qt::mightBeRichText(text))) {
cursor.insertHtml(text);
} else {
@@ -2889,7 +2889,7 @@ void QQuickTextEdit::append(const QString &text)
}
#else
cursor.insertText(text);
-#endif // QT_NO_TEXTHTMLPARSER
+#endif // texthtmlparser
cursor.endEditBlock();
d->control->updateCursorRectangle(false);
diff --git a/src/quick/items/qquicktextedit_p.h b/src/quick/items/qquicktextedit_p.h
index 42c9064860..c8d3515be1 100644
--- a/src/quick/items/qquicktextedit_p.h
+++ b/src/quick/items/qquicktextedit_p.h
@@ -242,7 +242,7 @@ public:
QRectF cursorRectangle() const;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
QVariant inputMethodQuery(Qt::InputMethodQuery property) const Q_DECL_OVERRIDE;
Q_REVISION(4) Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
#endif
@@ -347,7 +347,7 @@ public Q_SLOTS:
void select(int start, int end);
void deselect();
bool isRightToLeft(int start, int end);
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void cut();
void copy();
void paste();
@@ -399,7 +399,7 @@ protected:
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void inputMethodEvent(QInputMethodEvent *e) Q_DECL_OVERRIDE;
#endif
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) Q_DECL_OVERRIDE;
diff --git a/src/quick/items/qquicktextedit_p_p.h b/src/quick/items/qquicktextedit_p_p.h
index 1613dd7676..03bce00cb0 100644
--- a/src/quick/items/qquicktextedit_p_p.h
+++ b/src/quick/items/qquicktextedit_p_p.h
@@ -119,7 +119,7 @@ public:
#endif
, contentDirection(Qt::LayoutDirectionAuto)
, mouseSelectionMode(QQuickTextEdit::SelectCharacters)
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
, inputMethodHints(Qt::ImhNone)
#endif
, updateType(UpdatePaintNode)
@@ -156,7 +156,7 @@ public:
void addCurrentTextNodeToRoot(QQuickTextNodeEngine *, QSGTransformNode *, QQuickTextNode*, TextNodeIterator&, int startPos);
QQuickTextNode* createTextNode();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Qt::InputMethodHints effectiveInputMethodHints() const;
#endif
@@ -208,7 +208,7 @@ public:
QQuickTextEdit::RenderType renderType;
Qt::LayoutDirection contentDirection;
QQuickTextEdit::SelectionMode mouseSelectionMode;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Qt::InputMethodHints inputMethodHints;
#endif
UpdateType updateType;
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index fbfaa0e199..27f3dcecfa 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -57,12 +57,13 @@
#include <QtGui/qinputmethod.h>
#include <QtCore/qmath.h>
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
#include "qaccessible.h"
#include "qquickaccessibleattached_p.h"
#endif
#include <QtGui/private/qtextengine_p.h>
+#include <QtGui/private/qinputcontrol_p.h>
QT_BEGIN_NAMESPACE
@@ -142,7 +143,7 @@ void QQuickTextInput::setText(const QString &s)
if (s == text())
return;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
d->cancelPreedit();
#endif
d->internalSetText(s, -1, false);
@@ -400,7 +401,7 @@ void QQuickTextInput::setFont(const QFont &font)
if (oldFont != d->font) {
d->updateLayout();
updateCursorRectangle();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
updateInputMethod(Qt::ImCursorRectangle | Qt::ImFont | Qt::ImAnchorRectangle);
#endif
}
@@ -575,7 +576,7 @@ bool QQuickTextInputPrivate::setHAlign(QQuickTextInput::HAlignment alignment, bo
Qt::LayoutDirection QQuickTextInputPrivate::textDirection() const
{
QString text = m_text;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (text.isEmpty())
text = m_textLayout.preeditAreaText();
#endif
@@ -602,7 +603,7 @@ Qt::LayoutDirection QQuickTextInputPrivate::layoutDirection() const
Qt::LayoutDirection direction = m_layoutDirection;
if (direction == Qt::LayoutDirectionAuto) {
direction = textDirection();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (direction == Qt::LayoutDirectionAuto)
direction = QGuiApplication::inputMethod()->inputDirection();
#endif
@@ -615,7 +616,7 @@ bool QQuickTextInputPrivate::determineHorizontalAlignment()
if (hAlignImplicit) {
// if no explicit alignment has been set, follow the natural layout direction of the text
Qt::LayoutDirection direction = textDirection();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (direction == Qt::LayoutDirectionAuto)
direction = QGuiApplication::inputMethod()->inputDirection();
#endif
@@ -707,12 +708,12 @@ void QQuickTextInput::setReadOnly(bool ro)
if (d->m_readOnly == ro)
return;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
setFlag(QQuickItem::ItemAcceptsInputMethod, !ro);
#endif
d->m_readOnly = ro;
d->setCursorPosition(d->end());
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
updateInputMethod(Qt::ImEnabled);
#endif
q_canPasteChanged();
@@ -830,7 +831,7 @@ QRectF QQuickTextInput::cursorRectangle() const
Q_D(const QQuickTextInput);
int c = d->m_cursor;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
c += d->m_preeditCursor;
#endif
if (d->m_echoMode == NoEcho)
@@ -994,17 +995,17 @@ void QQuickTextInput::setAutoScroll(bool b)
QValidator* QQuickTextInput::validator() const
{
-#ifdef QT_NO_VALIDATOR
+#if !QT_CONFIG(validator)
return 0;
#else
Q_D(const QQuickTextInput);
return d->m_validator;
-#endif // QT_NO_VALIDATOR
+#endif // validator
}
void QQuickTextInput::setValidator(QValidator* v)
{
-#ifdef QT_NO_VALIDATOR
+#if !QT_CONFIG(validator)
Q_UNUSED(v);
#else
Q_D(QQuickTextInput);
@@ -1029,16 +1030,16 @@ void QQuickTextInput::setValidator(QValidator* v)
d->checkIsValid();
emit validatorChanged();
-#endif // QT_NO_VALIDATOR
+#endif // validator
}
-#ifndef QT_NO_VALIDATOR
+#if QT_CONFIG(validator)
void QQuickTextInput::q_validatorChanged()
{
Q_D(QQuickTextInput);
d->checkIsValid();
}
-#endif // QT_NO_VALIDATOR
+#endif // validator
QRectF QQuickTextInputPrivate::anchorRectangle() const
{
@@ -1056,7 +1057,7 @@ QRectF QQuickTextInputPrivate::anchorRectangle() const
else
a = m_selstart == m_cursor ? m_selend : m_selstart;
if (a >= 0) {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
a += m_preeditCursor;
#endif
if (m_echoMode == QQuickTextInput::NoEcho)
@@ -1151,7 +1152,7 @@ bool QQuickTextInput::hasAcceptableInput() const
The corresponding handler is \c onEditingFinished.
*/
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Qt::InputMethodHints QQuickTextInputPrivate::effectiveInputMethodHints() const
{
Qt::InputMethodHints hints = inputMethodHints;
@@ -1192,7 +1193,7 @@ void QQuickTextInput::setEchoMode(QQuickTextInput::EchoMode echo)
d->cancelPasswordEchoTimer();
d->m_echoMode = echo;
d->m_passwordEchoEditing = false;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
updateInputMethod(Qt::ImHints);
#endif
d->updateDisplayText();
@@ -1249,17 +1250,17 @@ void QQuickTextInput::setEchoMode(QQuickTextInput::EchoMode echo)
Qt::InputMethodHints QQuickTextInput::inputMethodHints() const
{
-#ifdef QT_NO_IM
+#if !QT_CONFIG(im)
return Qt::ImhNone;
#else
Q_D(const QQuickTextInput);
return d->inputMethodHints;
-#endif // QT_NO_IM
+#endif // im
}
void QQuickTextInput::setInputMethodHints(Qt::InputMethodHints hints)
{
-#ifdef QT_NO_IM
+#if !QT_CONFIG(im)
Q_UNUSED(hints);
#else
Q_D(QQuickTextInput);
@@ -1270,7 +1271,7 @@ void QQuickTextInput::setInputMethodHints(Qt::InputMethodHints hints)
d->inputMethodHints = hints;
updateInputMethod(Qt::ImHints);
emit inputMethodHintsChanged();
-#endif // QT_NO_IM
+#endif // im
}
/*!
@@ -1319,7 +1320,7 @@ QRectF QQuickTextInput::positionToRectangle(int pos) const
Q_D(const QQuickTextInput);
if (d->m_echoMode == NoEcho)
pos = 0;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
else if (pos > d->m_cursor)
pos += d->preeditAreaText().length();
#endif
@@ -1389,7 +1390,7 @@ void QQuickTextInput::positionAt(QQmlV4Function *args) const
int pos = d->positionAt(x, y, position);
const int cursor = d->m_cursor;
if (pos > cursor) {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
const int preeditLength = d->preeditAreaText().length();
pos = pos > cursor + preeditLength
? pos - preeditLength
@@ -1470,7 +1471,7 @@ void QQuickTextInput::keyPressEvent(QKeyEvent* ev)
QQuickImplicitSizeItem::keyPressEvent(ev);
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void QQuickTextInput::inputMethodEvent(QInputMethodEvent *ev)
{
Q_D(QQuickTextInput);
@@ -1493,7 +1494,7 @@ void QQuickTextInput::mouseDoubleClickEvent(QMouseEvent *event)
Q_D(QQuickTextInput);
if (d->selectByMouse && event->button() == Qt::LeftButton) {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
d->commitPreedit();
#endif
int cursor = d->positionAt(event->localPos());
@@ -1549,7 +1550,7 @@ void QQuickTextInput::mouseMoveEvent(QMouseEvent *event)
if (qAbs(int(event->localPos().x() - d->pressPos.x())) > QGuiApplication::styleHints()->startDragDistance())
setKeepMouseGrab(true);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (d->composeMode()) {
// start selection
int startPos = d->positionAt(d->pressPos);
@@ -1576,7 +1577,7 @@ void QQuickTextInput::mouseReleaseEvent(QMouseEvent *event)
d->selectPressed = false;
setKeepMouseGrab(false);
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
if (QGuiApplication::clipboard()->supportsSelection()) {
if (event->button() == Qt::LeftButton) {
d->copy(QClipboard::Selection);
@@ -1596,7 +1597,7 @@ void QQuickTextInput::mouseReleaseEvent(QMouseEvent *event)
bool QQuickTextInputPrivate::sendMouseEventToInputContext(QMouseEvent *event)
{
-#if !defined QT_NO_IM
+#if QT_CONFIG(im)
if (composeMode()) {
int tmp_cursor = positionAt(event->localPos());
int mousePos = tmp_cursor - m_cursor;
@@ -1623,7 +1624,7 @@ void QQuickTextInput::mouseUngrabEvent()
bool QQuickTextInput::event(QEvent* ev)
{
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
Q_D(QQuickTextInput);
if (ev->type() == QEvent::ShortcutOverride) {
if (d->m_readOnly)
@@ -1723,7 +1724,7 @@ void QQuickTextInputPrivate::ensureVisible(int position, int preeditCursor, int
// left
hscroll = width - widthUsed;
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (preeditLength > 0) {
// check to ensure long pre-edit text doesn't push the cursor
// off to the left
@@ -1740,7 +1741,7 @@ void QQuickTextInputPrivate::ensureVisible(int position, int preeditCursor, int
void QQuickTextInputPrivate::updateHorizontalScroll()
{
if (autoScroll && m_echoMode != QQuickTextInput::NoEcho) {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
const int preeditLength = m_textLayout.preeditAreaText().length();
ensureVisible(m_cursor, m_preeditCursor, preeditLength);
#else
@@ -1754,7 +1755,7 @@ void QQuickTextInputPrivate::updateHorizontalScroll()
void QQuickTextInputPrivate::updateVerticalScroll()
{
Q_Q(QQuickTextInput);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
const int preeditLength = m_textLayout.preeditAreaText().length();
#endif
const qreal height = qMax<qreal>(0, q->height() - q->topPadding() - q->bottomPadding());
@@ -1766,7 +1767,7 @@ void QQuickTextInputPrivate::updateVerticalScroll()
vscroll = -QQuickTextUtil::alignedY(
heightUsed, height, vAlign & ~(Qt::AlignAbsolute|Qt::AlignHorizontal_Mask));
} else {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
QTextLine currentLine = m_textLayout.lineForTextPosition(m_cursor + preeditLength);
#else
QTextLine currentLine = m_textLayout.lineForTextPosition(m_cursor);
@@ -1786,7 +1787,7 @@ void QQuickTextInputPrivate::updateVerticalScroll()
// right
vscroll = heightUsed - height;
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (preeditLength > 0) {
// check to ensure long pre-edit text doesn't push the cursor
// off the top
@@ -1827,7 +1828,7 @@ void QQuickTextInput::ensureActiveFocus()
{
bool hadActiveFocus = hasActiveFocus();
forceActiveFocus();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Q_D(QQuickTextInput);
// re-open input panel on press if already focused
if (hasActiveFocus() && hadActiveFocus && !d->m_readOnly)
@@ -1877,7 +1878,7 @@ QSGNode *QQuickTextInput::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData
}
if (!d->m_textLayout.text().isEmpty()
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
|| !d->m_textLayout.preeditAreaText().isEmpty()
#endif
) {
@@ -1900,7 +1901,7 @@ QSGNode *QQuickTextInput::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData
return node;
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
QVariant QQuickTextInput::inputMethodQuery(Qt::InputMethodQuery property) const
{
return inputMethodQuery(property, QVariant());
@@ -1957,7 +1958,7 @@ QVariant QQuickTextInput::inputMethodQuery(Qt::InputMethodQuery property, QVaria
return QQuickItem::inputMethodQuery(property);
}
}
-#endif // QT_NO_IM
+#endif // im
/*!
\qmlmethod QtQuick::TextInput::deselect()
@@ -1997,7 +1998,7 @@ bool QQuickTextInput::isRightToLeft(int start, int end)
}
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
/*!
\qmlmethod QtQuick::TextInput::cut()
@@ -2042,7 +2043,7 @@ void QQuickTextInput::paste()
if (!d->m_readOnly)
d->paste();
}
-#endif // QT_NO_CLIPBOARD
+#endif // clipboard
/*!
\qmlmethod QtQuick::TextInput::undo()
@@ -2416,7 +2417,7 @@ void QQuickTextInput::setPersistentSelection(bool on)
*/
bool QQuickTextInput::canPaste() const
{
-#if !defined(QT_NO_CLIPBOARD)
+#if QT_CONFIG(clipboard)
Q_D(const QQuickTextInput);
if (!d->canPasteValid) {
if (const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData())
@@ -2597,7 +2598,7 @@ void QQuickTextInputPrivate::handleFocusEvent(QFocusEvent *event)
}
if (focus) {
q->q_updateAlignment();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (focusOnPress && !m_readOnly)
qGuiApp->inputMethod()->show();
q->connect(QGuiApplication::inputMethod(), SIGNAL(inputDirectionChanged(Qt::LayoutDirection)),
@@ -2617,7 +2618,7 @@ void QQuickTextInputPrivate::handleFocusEvent(QFocusEvent *event)
if (hasAcceptableInput(m_text) == AcceptableInput || fixup())
emit q->editingFinished();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
q->disconnect(QGuiApplication::inputMethod(), SIGNAL(inputDirectionChanged(Qt::LayoutDirection)),
q, SLOT(q_updateAlignment()));
#endif
@@ -2645,7 +2646,7 @@ void QQuickTextInput::focusOutEvent(QFocusEvent *event)
*/
bool QQuickTextInput::isInputMethodComposing() const
{
-#ifdef QT_NO_IM
+#if !QT_CONFIG(im)
return false;
#else
Q_D(const QQuickTextInput);
@@ -2670,21 +2671,21 @@ QQuickTextInputPrivate::ExtraData::ExtraData()
void QQuickTextInputPrivate::init()
{
Q_Q(QQuickTextInput);
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
if (QGuiApplication::clipboard()->supportsSelection())
q->setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton);
else
#endif
q->setAcceptedMouseButtons(Qt::LeftButton);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
q->setFlag(QQuickItem::ItemAcceptsInputMethod);
#endif
q->setFlag(QQuickItem::ItemHasContents);
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
qmlobject_connect(QGuiApplication::clipboard(), QClipboard, SIGNAL(dataChanged()),
q, QQuickTextInput, SLOT(q_canPasteChanged()));
-#endif // QT_NO_CLIPBOARD
+#endif // clipboard
lastSelectionStart = 0;
lastSelectionEnd = 0;
@@ -2695,6 +2696,8 @@ void QQuickTextInputPrivate::init()
option.setUseDesignMetrics(renderType != QQuickTextInput::NativeRendering);
m_textLayout.setTextOption(option);
}
+
+ m_inputControl = new QInputControl(QInputControl::LineEdit, q);
}
void QQuickTextInputPrivate::resetInputMethod()
@@ -2723,7 +2726,7 @@ void QQuickTextInput::updateCursorRectangle(bool scroll)
d->cursorItem->setPosition(r.topLeft());
d->cursorItem->setHeight(r.height());
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
updateInputMethod(Qt::ImCursorRectangle | Qt::ImAnchorRectangle);
#endif
}
@@ -2783,7 +2786,7 @@ void QQuickTextInput::q_canPasteChanged()
{
Q_D(QQuickTextInput);
bool old = d->canPaste;
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
if (const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData())
d->canPaste = !d->m_readOnly && mimeData->hasText();
else
@@ -2877,7 +2880,7 @@ qreal QQuickTextInputPrivate::getImplicitWidth() const
option.setAlignment(Qt::Alignment(q->effectiveHAlign()));
layout.setTextOption(option);
layout.setFont(font);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
layout.setPreeditArea(m_textLayout.preeditAreaPosition(), m_textLayout.preeditAreaText());
#endif
layout.beginLayout();
@@ -3054,7 +3057,7 @@ void QQuickTextInputPrivate::updateBaselineOffset()
q->setBaselineOffset(fm.ascent() + yoff + q->topPadding());
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
/*!
\internal
@@ -3091,9 +3094,9 @@ void QQuickTextInputPrivate::paste(QClipboard::Mode clipboardMode)
}
}
-#endif // !QT_NO_CLIPBOARD
+#endif // clipboard
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
/*!
\internal
*/
@@ -3125,7 +3128,7 @@ void QQuickTextInputPrivate::cancelPreedit()
QInputMethodEvent ev;
QCoreApplication::sendEvent(q, &ev);
}
-#endif // QT_NO_IM
+#endif // im
/*!
\internal
@@ -3225,7 +3228,7 @@ void QQuickTextInputPrivate::clear()
void QQuickTextInputPrivate::setSelection(int start, int length)
{
Q_Q(QQuickTextInput);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
commitPreedit();
#endif
@@ -3257,7 +3260,7 @@ void QQuickTextInputPrivate::setSelection(int start, int length)
}
emit q->selectionChanged();
emitCursorPositionChanged();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
q->updateInputMethod(Qt::ImCursorRectangle | Qt::ImAnchorRectangle | Qt::ImCursorPosition | Qt::ImAnchorPosition
| Qt::ImCurrentSelection);
#endif
@@ -3287,7 +3290,7 @@ void QQuickTextInputPrivate::updatePasswordEchoEditing(bool editing)
*/
bool QQuickTextInputPrivate::fixup() // this function assumes that validate currently returns != Acceptable
{
-#ifndef QT_NO_VALIDATOR
+#if QT_CONFIG(validator)
if (m_validator) {
QString textCopy = m_text;
int cursorCopy = m_cursor;
@@ -3311,7 +3314,7 @@ bool QQuickTextInputPrivate::fixup() // this function assumes that validate curr
void QQuickTextInputPrivate::moveCursor(int pos, bool mark)
{
Q_Q(QQuickTextInput);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
commitPreedit();
#endif
@@ -3339,12 +3342,12 @@ void QQuickTextInputPrivate::moveCursor(int pos, bool mark)
emit q->selectionChanged();
}
emitCursorPositionChanged();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
q->updateInputMethod();
#endif
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
/*!
\internal
@@ -3461,7 +3464,7 @@ void QQuickTextInputPrivate::processInputMethodEvent(QInputMethodEvent *event)
| Qt::ImCurrentSelection);
}
}
-#endif // QT_NO_IM
+#endif // im
/*!
\internal
@@ -3501,7 +3504,7 @@ bool QQuickTextInputPrivate::finishChange(int validateFromState, bool update, bo
Q_Q(QQuickTextInput);
Q_UNUSED(update)
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
bool inputMethodAttributesChanged = m_textDirty || m_selDirty;
#endif
bool alignmentChanged = false;
@@ -3513,7 +3516,7 @@ bool QQuickTextInputPrivate::finishChange(int validateFromState, bool update, bo
bool wasAcceptable = m_acceptableInput;
m_validInput = true;
m_acceptableInput = true;
-#ifndef QT_NO_VALIDATOR
+#if QT_CONFIG(validator)
if (m_validator) {
QString textCopy = m_text;
int cursorCopy = m_cursor;
@@ -3563,7 +3566,7 @@ bool QQuickTextInputPrivate::finishChange(int validateFromState, bool update, bo
if (m_textDirty) {
textChanged = true;
m_textDirty = false;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
m_preeditDirty = false;
#endif
alignmentChanged = determineHorizontalAlignment();
@@ -3575,7 +3578,7 @@ bool QQuickTextInputPrivate::finishChange(int validateFromState, bool update, bo
if (m_acceptableInput != wasAcceptable)
emit q->acceptableInputChanged();
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (m_preeditDirty) {
m_preeditDirty = false;
if (determineHorizontalAlignment()) {
@@ -3590,7 +3593,7 @@ bool QQuickTextInputPrivate::finishChange(int validateFromState, bool update, bo
emit q->selectionChanged();
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
inputMethodAttributesChanged |= (m_cursor != m_lastCursorPos);
if (inputMethodAttributesChanged)
q->updateInputMethod();
@@ -3624,7 +3627,7 @@ void QQuickTextInputPrivate::internalSetText(const QString &txt, int pos, bool e
m_textDirty = (oldText != m_text);
bool changed = finishChange(-1, true, edited);
-#ifdef QT_NO_ACCESSIBILITY
+#if !QT_CONFIG(accessibility)
Q_UNUSED(changed)
#else
Q_Q(QQuickTextInput);
@@ -3970,7 +3973,7 @@ bool QQuickTextInputPrivate::isValidInput(QChar key, QChar mask) const
*/
QQuickTextInputPrivate::ValidatorState QQuickTextInputPrivate::hasAcceptableInput(const QString &str) const
{
-#ifndef QT_NO_VALIDATOR
+#if QT_CONFIG(validator)
QString textCopy = str;
int cursorCopy = m_cursor;
if (m_validator) {
@@ -4280,7 +4283,7 @@ bool QQuickTextInputPrivate::emitCursorPositionChanged()
}
}
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
if (QAccessible::isActive()) {
if (QObject *acc = QQuickAccessibleAttached::findAccessible(q, QAccessible::EditableText)) {
QAccessibleTextCursorEvent ev(acc, m_cursor);
@@ -4391,7 +4394,7 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event)
if (false) {
}
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
else if (event == QKeySequence::Undo) {
q->undo();
}
@@ -4401,7 +4404,7 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event)
else if (event == QKeySequence::SelectAll) {
selectAll();
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
else if (event == QKeySequence::Copy) {
copy();
}
@@ -4418,7 +4421,7 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event)
if (!m_readOnly)
deleteEndOfLine();
}
-#endif //QT_NO_CLIPBOARD
+#endif // clipboard
else if (event == QKeySequence::MoveToStartOfLine || event == QKeySequence::MoveToStartOfBlock) {
home(0);
}
@@ -4490,13 +4493,13 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event)
} else if (event == QKeySequence::DeleteCompleteLine) {
if (!m_readOnly) {
selectAll();
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
copy();
#endif
del();
}
}
-#endif // QT_NO_SHORTCUT
+#endif // shortcut
else {
bool handled = false;
if (event->modifiers() & Qt::ControlModifier) {
@@ -4529,8 +4532,7 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event)
}
if (unknown && !m_readOnly) {
- QString t = event->text();
- if (!t.isEmpty() && t.at(0).isPrint()) {
+ if (m_inputControl->isAcceptableInput(event)) {
if (overwriteMode
// no need to call del() if we have a selection, insert
// does it already
@@ -4539,7 +4541,7 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event)
del();
}
- insert(t);
+ insert(event->text());
event->accept();
return;
}
diff --git a/src/quick/items/qquicktextinput_p.h b/src/quick/items/qquicktextinput_p.h
index d0461f551e..f4545e1574 100644
--- a/src/quick/items/qquicktextinput_p.h
+++ b/src/quick/items/qquicktextinput_p.h
@@ -266,7 +266,7 @@ public:
bool hasAcceptableInput() const;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
QVariant inputMethodQuery(Qt::InputMethodQuery property) const Q_DECL_OVERRIDE;
Q_REVISION(3) Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
#endif
@@ -372,7 +372,7 @@ protected:
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void keyPressEvent(QKeyEvent* ev) Q_DECL_OVERRIDE;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void inputMethodEvent(QInputMethodEvent *) Q_DECL_OVERRIDE;
#endif
void mouseUngrabEvent() Q_DECL_OVERRIDE;
@@ -389,7 +389,7 @@ public Q_SLOTS:
void select(int start, int end);
void deselect();
bool isRightToLeft(int start, int end);
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void cut();
void copy();
void paste();
@@ -409,7 +409,7 @@ private Q_SLOTS:
void q_updateAlignment();
void triggerPreprocess();
-#ifndef QT_NO_VALIDATOR
+#if QT_CONFIG(validator)
void q_validatorChanged();
#endif
diff --git a/src/quick/items/qquicktextinput_p_p.h b/src/quick/items/qquicktextinput_p_p.h
index 93a8778c40..0bf5779a53 100644
--- a/src/quick/items/qquicktextinput_p_p.h
+++ b/src/quick/items/qquicktextinput_p_p.h
@@ -70,6 +70,7 @@
QT_BEGIN_NAMESPACE
class QQuickTextNode;
+class QInputControl;
class Q_QUICK_PRIVATE_EXPORT QQuickTextInputPrivate : public QQuickImplicitSizeItemPrivate
{
@@ -104,7 +105,7 @@ public:
, selectionColor(QRgb(0xFF000080))
, selectedTextColor(QRgb(0xFFFFFFFF))
, m_cursor(0)
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
, m_preeditCursor(0)
#endif
, m_blinkEnabled(false)
@@ -114,7 +115,7 @@ public:
, m_undoState(0)
, m_selstart(0)
, m_selend(0)
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
, inputMethodHints(Qt::ImhNone)
#endif
, hAlign(QQuickTextInput::AlignLeft)
@@ -148,7 +149,7 @@ public:
, m_separator(0)
, m_readOnly(0)
, m_textDirty(0)
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
, m_preeditDirty(0)
#endif
, m_selDirty(0)
@@ -176,7 +177,7 @@ public:
bool setHAlign(QQuickTextInput::HAlignment, bool forceAlign = false);
void mirrorChange() Q_DECL_OVERRIDE;
bool sendMouseEventToInputContext(QMouseEvent *event);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Qt::InputMethodHints effectiveInputMethodHints() const;
#endif
void handleFocusEvent(QFocusEvent *event);
@@ -211,7 +212,7 @@ public:
QPointF tripleClickStartPoint;
QPointer<QQmlComponent> cursorComponent;
-#ifndef QT_NO_VALIDATOR
+#if QT_CONFIG(validator)
QPointer<QValidator> m_validator;
#endif
@@ -228,6 +229,7 @@ public:
QQuickItem *cursorItem;
QQuickTextNode *textNode;
MaskInputData *m_maskData;
+ QInputControl *m_inputControl;
QList<int> m_transactions;
QVector<Command> m_history;
@@ -240,7 +242,7 @@ public:
int lastSelectionStart;
int lastSelectionEnd;
int m_cursor;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
int m_preeditCursor;
#endif
bool m_blinkEnabled;
@@ -257,7 +259,7 @@ public:
UpdatePaintNode
};
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Qt::InputMethodHints inputMethodHints;
#endif
QQuickTextInput::HAlignment hAlign;
@@ -290,7 +292,7 @@ public:
bool m_separator : 1;
bool m_readOnly : 1;
bool m_textDirty : 1;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
bool m_preeditDirty : 1;
#endif
bool m_selDirty : 1;
@@ -362,12 +364,12 @@ public:
QString realText() const;
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void copy(QClipboard::Mode mode = QClipboard::Clipboard) const;
void paste(QClipboard::Mode mode = QClipboard::Clipboard);
#endif
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void commitPreedit();
void cancelPreedit();
#endif
@@ -419,7 +421,7 @@ public:
}
// input methods
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
bool composeMode() const { return !m_textLayout.preeditAreaText().isEmpty(); }
QString preeditAreaText() const { return m_textLayout.preeditAreaText(); }
@@ -441,7 +443,7 @@ public:
}
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void processInputMethodEvent(QInputMethodEvent *event);
#endif
void processKeyEvent(QKeyEvent* ev);
@@ -496,7 +498,7 @@ private:
void deleteEndOfLine();
enum ValidatorState {
-#ifndef QT_NO_VALIDATOR
+#if QT_CONFIG(validator)
InvalidInput = QValidator::Invalid,
IntermediateInput = QValidator::Intermediate,
AcceptableInput = QValidator::Acceptable
diff --git a/src/quick/items/qquicktextnode.cpp b/src/quick/items/qquicktextnode.cpp
index 6cfc1d0313..cf4e71adf5 100644
--- a/src/quick/items/qquicktextnode.cpp
+++ b/src/quick/items/qquicktextnode.cpp
@@ -99,10 +99,12 @@ QSGGlyphNode *QQuickTextNode::addGlyphs(const QPointF &position, const QGlyphRun
bool preferNativeGlyphNode = m_useNativeRenderer;
if (!preferNativeGlyphNode) {
QRawFontPrivate *fontPriv = QRawFontPrivate::get(font);
- if (fontPriv->fontEngine->hasUnreliableGlyphOutline())
+ if (fontPriv->fontEngine->hasUnreliableGlyphOutline()) {
preferNativeGlyphNode = true;
- else
- preferNativeGlyphNode = !QFontDatabase().isSmoothlyScalable(font.familyName(), font.styleName());
+ } else {
+ QFontEngine *fe = QRawFontPrivate::get(font)->fontEngine;
+ preferNativeGlyphNode = !fe->isSmoothlyScalable;
+ }
}
QSGGlyphNode *node = sg->sceneGraphContext()->createGlyphNode(sg, preferNativeGlyphNode);
@@ -235,7 +237,7 @@ void QQuickTextNode::addTextLayout(const QPointF &position, QTextLayout *textLay
engine.setAnchorColor(anchorColor);
engine.setPosition(position);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
int preeditLength = textLayout->preeditAreaText().length();
int preeditPosition = textLayout->preeditAreaPosition();
#endif
@@ -254,7 +256,7 @@ void QQuickTextNode::addTextLayout(const QPointF &position, QTextLayout *textLay
int length = line.textLength();
int end = start + length;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (preeditPosition >= 0
&& preeditPosition >= start
&& preeditPosition < end) {
diff --git a/src/quick/items/qquicktextnodeengine.cpp b/src/quick/items/qquicktextnodeengine.cpp
index 538356e679..c179ab7163 100644
--- a/src/quick/items/qquicktextnodeengine.cpp
+++ b/src/quick/items/qquicktextnodeengine.cpp
@@ -950,7 +950,7 @@ void QQuickTextNodeEngine::mergeFormats(QTextLayout *textLayout, QVarLengthArray
void QQuickTextNodeEngine::addTextBlock(QTextDocument *textDocument, const QTextBlock &block, const QPointF &position, const QColor &textColor, const QColor &anchorColor, int selectionStart, int selectionEnd)
{
Q_ASSERT(textDocument);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
int preeditLength = block.isValid() ? block.layout()->preeditAreaText().length() : 0;
int preeditPosition = block.isValid() ? block.layout()->preeditAreaPosition() : -1;
#endif
@@ -1070,7 +1070,7 @@ void QQuickTextNodeEngine::addTextBlock(QTextDocument *textDocument, const QText
setTextColor(textColor);
int fragmentEnd = textPos + fragment.length();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (preeditPosition >= 0
&& (preeditPosition + block.position()) >= textPos
&& (preeditPosition + block.position()) <= fragmentEnd) {
@@ -1092,7 +1092,7 @@ void QQuickTextNodeEngine::addTextBlock(QTextDocument *textDocument, const QText
++blockIterator;
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (preeditLength >= 0 && textPos <= block.position() + preeditPosition) {
setPosition(blockPosition);
textPos = block.position() + preeditPosition;
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index b0871fc173..07d87989b5 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -62,7 +62,6 @@
#include <QtGui/qpainter.h>
#include <QtGui/qevent.h>
#include <QtGui/qmatrix4x4.h>
-#include <QtGui/qstylehints.h>
#include <QtCore/qvarlengtharray.h>
#include <QtCore/qabstractanimation.h>
#include <QtCore/QLibraryInfo>
@@ -74,7 +73,7 @@
#include <private/qqmlmemoryprofiler_p.h>
#include <private/qqmldebugserviceinterfaces_p.h>
#include <private/qqmldebugconnector_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <private/qopenglvertexarrayobject_p.h>
# include <private/qsgdefaultrendercontext_p.h>
#endif
@@ -95,7 +94,7 @@ bool QQuickWindowPrivate::defaultAlphaBuffer = false;
void QQuickWindowPrivate::updateFocusItemTransform()
{
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Q_Q(QQuickWindow);
QQuickItem *focus = q->activeFocusItem();
if (focus && QGuiApplication::focusObject() == focus) {
@@ -172,7 +171,7 @@ private:
#include "qquickwindow.moc"
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
/*!
Returns an accessibility interface for this window, or 0 if such an
interface cannot be created.
@@ -256,7 +255,7 @@ void QQuickWindow::focusInEvent(QFocusEvent *ev)
d->updateFocusItemTransform();
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
static bool transformDirtyOnItemOrAncestor(const QQuickItem *item)
{
while (item) {
@@ -297,7 +296,7 @@ void QQuickWindowPrivate::polishItems()
if (recursionSafeguard == 0)
qWarning("QQuickWindow: possible QQuickItem::polish() loop");
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (QQuickItem *focusItem = q_func()->activeFocusItem()) {
// If the current focus item, or any of its anchestors, has changed location
// inside the window, we need inform IM about it. This to ensure that overlays
@@ -473,10 +472,10 @@ void QQuickWindowPrivate::renderSceneGraph(const QSize &size)
QQuickWindowPrivate::QQuickWindowPrivate()
: contentItem(0)
, activeFocusItem(0)
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
, cursorItem(0)
#endif
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
, dragGrabber(0)
#endif
, touchMouseId(-1)
@@ -502,7 +501,7 @@ QQuickWindowPrivate::QQuickWindowPrivate()
, vaoHelper(0)
, incubationController(0)
{
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
dragGrabber = new QQuickDragGrabber;
#endif
}
@@ -896,7 +895,7 @@ void QQuickWindowPrivate::setFocusInScope(QQuickItem *scope, QQuickItem *item, Q
}
if (oldActiveFocusItem) {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
QGuiApplication::inputMethod()->commit();
#endif
@@ -1002,7 +1001,7 @@ void QQuickWindowPrivate::clearFocusInScope(QQuickItem *scope, QQuickItem *item,
oldActiveFocusItem = activeFocusItem;
newActiveFocusItem = scope;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
QGuiApplication::inputMethod()->commit();
#endif
@@ -1278,7 +1277,7 @@ QQuickWindow::~QQuickWindow()
}
delete d->incubationController; d->incubationController = 0;
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
delete d->dragGrabber; d->dragGrabber = 0;
#endif
delete d->contentItem; d->contentItem = 0;
@@ -1547,7 +1546,7 @@ bool QQuickWindow::event(QEvent *e)
d->clearHover();
d->lastMousePosition = QPointF();
break;
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
case QEvent::DragEnter:
case QEvent::DragLeave:
case QEvent::DragMove:
@@ -1567,7 +1566,7 @@ bool QQuickWindow::event(QEvent *e)
e->setAccepted(qev.isAccepted());
} break;
case QEvent::FocusAboutToChange:
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (d->activeFocusItem)
qGuiApp->inputMethod()->commit();
#endif
@@ -1579,7 +1578,7 @@ bool QQuickWindow::event(QEvent *e)
d->windowManager->handleUpdateRequest(this);
break;
}
-#ifndef QT_NO_GESTURES
+#if QT_CONFIG(gestures)
case QEvent::NativeGesture:
d->deliverNativeGestureEvent(d->contentItem, static_cast<QNativeGestureEvent*>(e));
break;
@@ -1776,7 +1775,7 @@ bool QQuickWindowPrivate::deliverHoverEvent(QQuickItem *item, const QPointF &sce
return false;
}
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
bool QQuickWindowPrivate::deliverWheelEvent(QQuickItem *item, QWheelEvent *event)
{
QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);
@@ -1830,9 +1829,9 @@ void QQuickWindow::wheelEvent(QWheelEvent *event)
d->deliverWheelEvent(d->contentItem, event);
d->lastWheelEventAccepted = event->isAccepted();
}
-#endif // QT_NO_WHEELEVENT
+#endif // wheelevent
-#ifndef QT_NO_GESTURES
+#if QT_CONFIG(gestures)
bool QQuickWindowPrivate::deliverNativeGestureEvent(QQuickItem *item, QNativeGestureEvent *event)
{
QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);
@@ -1864,7 +1863,7 @@ bool QQuickWindowPrivate::deliverNativeGestureEvent(QQuickItem *item, QNativeGes
return false;
}
-#endif // QT_NO_GESTURES
+#endif // gestures
bool QQuickWindowPrivate::deliverTouchCancelEvent(QTouchEvent *event)
{
@@ -2045,7 +2044,7 @@ void QQuickWindowPrivate::handleMouseEvent(QMouseEvent *event)
qCDebug(DBG_HOVER_TRACE) << this;
- #ifndef QT_NO_CURSOR
+ #if QT_CONFIG(cursor)
updateCursor(event->windowPos());
#endif
@@ -2360,7 +2359,7 @@ bool QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, QQuickPo
return eventAccepted;
}
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
void QQuickWindowPrivate::deliverDragEvent(QQuickDragGrabber *grabber, QEvent *event)
{
grabber->resetTarget();
@@ -2481,9 +2480,9 @@ bool QQuickWindowPrivate::deliverDragEvent(QQuickDragGrabber *grabber, QQuickIte
return accepted;
}
-#endif // QT_NO_DRAGANDDROP
+#endif // draganddrop
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
void QQuickWindowPrivate::updateCursor(const QPointF &scenePos)
{
Q_Q(QQuickWindow);
@@ -2640,15 +2639,6 @@ bool QQuickWindowPrivate::dragOverThreshold(qreal d, Qt::Axis axis, QMouseEvent
return overThreshold;
}
-bool QQuickWindowPrivate::dragOverThreshold(qreal d, Qt::Axis axis, const QTouchEvent::TouchPoint *tp, int startDragThreshold)
-{
- QStyleHints *styleHints = qApp->styleHints();
- bool overThreshold = qAbs(d) > (startDragThreshold >= 0 ? startDragThreshold : styleHints->startDragDistance());
- qreal velocity = axis == Qt::XAxis ? tp->velocity().x() : tp->velocity().y();
- overThreshold |= qAbs(velocity) > styleHints->startDragVelocity();
- return overThreshold;
-}
-
/*!
\qmlproperty list<Object> Window::data
\default
@@ -3186,7 +3176,7 @@ void QQuickWindow::maybeUpdate()
void QQuickWindow::cleanupSceneGraph()
{
Q_D(QQuickWindow);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
delete d->vaoHelper;
d->vaoHelper = 0;
#endif
@@ -3225,7 +3215,7 @@ void QQuickWindow::setTransientParent_helper(QQuickWindow *window)
QOpenGLContext *QQuickWindow::openglContext() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
Q_D(const QQuickWindow);
if (d->context && d->context->isValid()) {
QSGRendererInterface *rif = d->context->sceneGraphContext()->rendererInterface(d->context);
@@ -3353,7 +3343,7 @@ bool QQuickWindow::isSceneGraphInitialized() const
The corresponding handler is \c onClosing.
*/
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
/*!
Sets the render target for this window to be \a fbo.
@@ -3441,7 +3431,7 @@ QSize QQuickWindow::renderTargetSize() const
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
/*!
Returns the render target for this window.
@@ -3480,7 +3470,7 @@ QImage QQuickWindow::grabWindow()
return d->windowManager->grab(this);
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (!isVisible() && !d->renderControl) {
auto openglRenderContext = static_cast<QSGDefaultRenderContext *>(d->context);
if (!openglRenderContext->openglContext()) {
@@ -3838,7 +3828,7 @@ QSGTexture *QQuickWindow::createTextureFromImage(const QImage &image, CreateText
*/
QSGTexture *QQuickWindow::createTextureFromId(uint id, const QSize &size, CreateTextureOptions options) const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (openglContext()) {
QSGPlainTexture *texture = new QSGPlainTexture();
texture->setTextureId(id);
@@ -3921,7 +3911,7 @@ void QQuickWindow::setDefaultAlphaBuffer(bool useAlpha)
{
QQuickWindowPrivate::defaultAlphaBuffer = useAlpha;
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
/*!
\since 5.2
diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h
index 7e1e45f345..27a73988ae 100644
--- a/src/quick/items/qquickwindow.h
+++ b/src/quick/items/qquickwindow.h
@@ -115,19 +115,19 @@ public:
bool sendEvent(QQuickItem *, QEvent *);
QImage grabWindow();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void setRenderTarget(QOpenGLFramebufferObject *fbo);
QOpenGLFramebufferObject *renderTarget() const;
#endif
void setRenderTarget(uint fboId, const QSize &size);
uint renderTargetId() const;
QSize renderTargetSize() const;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void resetOpenGLState();
#endif
QQmlIncubationController *incubationController() const;
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
QAccessibleInterface *accessibleRoot() const Q_DECL_OVERRIDE;
#endif
@@ -209,7 +209,7 @@ protected:
void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
void mouseDoubleClickEvent(QMouseEvent *) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE;
#endif
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h
index 3e146d5440..be915903c6 100644
--- a/src/quick/items/qquickwindow_p.h
+++ b/src/quick/items/qquickwindow_p.h
@@ -66,6 +66,8 @@
#include <qopenglcontext.h>
#include <QtGui/qopenglframebufferobject.h>
#include <QtGui/qevent.h>
+#include <QtGui/qstylehints.h>
+#include <QtGui/qguiapplication.h>
QT_BEGIN_NAMESPACE
@@ -125,10 +127,10 @@ public:
void deliverKeyEvent(QKeyEvent *e);
// Keeps track of the item currently receiving mouse events
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
QQuickItem *cursorItem;
#endif
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QQuickDragGrabber *dragGrabber;
#endif
int touchMouseId;
@@ -146,10 +148,10 @@ public:
static QMouseEvent *cloneMouseEvent(QMouseEvent *event, QPointF *transformedLocalPos = 0);
void deliverMouseEvent(QQuickPointerMouseEvent *pointerEvent);
bool sendFilteredMouseEvent(QQuickItem *, QQuickItem *, QEvent *, QSet<QQuickItem *> *);
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
bool deliverWheelEvent(QQuickItem *, QWheelEvent *);
#endif
-#ifndef QT_NO_GESTURES
+#if QT_CONFIG(gestures)
bool deliverNativeGestureEvent(QQuickItem *, QNativeGestureEvent *);
#endif
@@ -179,11 +181,11 @@ public:
Qt::KeyboardModifiers modifiers, ulong timestamp, bool accepted);
bool clearHover(ulong timestamp = 0);
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
void deliverDragEvent(QQuickDragGrabber *, QEvent *);
bool deliverDragEvent(QQuickDragGrabber *, QQuickItem *, QDragMoveEvent *);
#endif
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
void updateCursor(const QPointF &scenePos);
QQuickItem *findCursorItem(QQuickItem *item, const QPointF &scenePos);
#endif
@@ -270,7 +272,19 @@ public:
static bool defaultAlphaBuffer;
static bool dragOverThreshold(qreal d, Qt::Axis axis, QMouseEvent *event, int startDragThreshold = -1);
- static bool dragOverThreshold(qreal d, Qt::Axis axis, const QTouchEvent::TouchPoint *tp, int startDragThreshold = -1);
+
+ template <typename TEventPoint>
+ static bool dragOverThreshold(qreal d, Qt::Axis axis, const TEventPoint *p, int startDragThreshold = -1)
+ {
+ QStyleHints *styleHints = qApp->styleHints();
+ bool overThreshold = qAbs(d) > (startDragThreshold >= 0 ? startDragThreshold : styleHints->startDragDistance());
+ const bool dragVelocityLimitAvailable = (styleHints->startDragVelocity() > 0);
+ if (!overThreshold && dragVelocityLimitAvailable) {
+ qreal velocity = axis == Qt::XAxis ? p->velocity().x() : p->velocity().y();
+ overThreshold |= qAbs(velocity) > styleHints->startDragVelocity();
+ }
+ return overThreshold;
+ }
// data property
static void data_append(QQmlListProperty<QObject> *, QObject *);
diff --git a/src/quick/qtquick2.cpp b/src/quick/qtquick2.cpp
index 4028c63da5..c6b89fabd3 100644
--- a/src/quick/qtquick2.cpp
+++ b/src/quick/qtquick2.cpp
@@ -130,6 +130,7 @@ void QQmlQtQuick2DebugStatesDelegate::updateBinding(QQmlContext *context,
const QString &fileName, int line, int column,
bool *inBaseState)
{
+ Q_UNUSED(column);
typedef QPointer<QQuickState> QuickStatePointer;
QObject *object = property.object();
QString propertyName = property.name();
@@ -144,7 +145,7 @@ void QQmlQtQuick2DebugStatesDelegate::updateBinding(QQmlContext *context,
newBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core,
expression.toString(), object,
QQmlContextData::get(context), fileName,
- line, column);
+ line);
newBinding->setTarget(property);
}
@@ -196,7 +197,7 @@ void QQmlQtQuick2Module::defineModule()
QQuickValueTypes::registerValueTypes();
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
QAccessible::installFactory(&qQuickAccessibleFactory);
#endif
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp
index 19a963b403..6856d34616 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderloop.cpp
@@ -143,7 +143,8 @@ void QSGSoftwareRenderLoop::renderWindow(QQuickWindow *window)
if (profileFrames)
polishTime = renderTimer.nsecsElapsed();
Q_QUICK_SG_PROFILE_SWITCH(QQuickProfiler::SceneGraphPolishFrame,
- QQuickProfiler::SceneGraphRenderLoopFrame);
+ QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphPolishPolish);
emit window->afterAnimating();
@@ -151,7 +152,8 @@ void QSGSoftwareRenderLoop::renderWindow(QQuickWindow *window)
if (profileFrames)
syncTime = renderTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSync);
//Tell the renderer about the windows backing store
auto softwareRenderer = static_cast<QSGSoftwareRenderer*>(cd->renderer);
@@ -162,7 +164,8 @@ void QSGSoftwareRenderLoop::renderWindow(QQuickWindow *window)
if (profileFrames)
renderTime = renderTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopRender);
if (data.grabOnly) {
grabContent = m_backingStores[window]->handle()->toImage();
@@ -178,7 +181,8 @@ void QSGSoftwareRenderLoop::renderWindow(QQuickWindow *window)
qint64 swapTime = 0;
if (profileFrames)
swapTime = renderTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSwap);
if (QSG_RASTER_LOG_TIME_RENDERLOOP().isDebugEnabled()) {
static QTime lastFrameTime = QTime::currentTime();
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp
index 5d5485ed8f..df5ec9b745 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarethreadedrenderloop.cpp
@@ -484,7 +484,8 @@ void QSGSoftwareRenderThread::syncAndRender()
if (syncRequested)
sync(exposeRequested);
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSync);
if (!syncResultedInChanges && !repaintRequested) {
qCDebug(QSG_RASTER_LOG_RENDERLOOP, "RT - no changes, render aborted");
@@ -510,7 +511,8 @@ void QSGSoftwareRenderThread::syncAndRender()
softwareRenderer->setBackingStore(backingStore);
wd->renderSceneGraph(exposedWindow->size());
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopRender);
if (softwareRenderer && (!wd->customRenderStage || !wd->customRenderStage->swap()))
backingStore->flush(softwareRenderer->flushRegion());
@@ -526,7 +528,8 @@ void QSGSoftwareRenderThread::syncAndRender()
wd->fireFrameSwapped();
} else {
- Q_QUICK_SG_PROFILE_SKIP(QQuickProfiler::SceneGraphRenderLoopFrame, 1);
+ Q_QUICK_SG_PROFILE_SKIP(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSync, 1);
qCDebug(QSG_RASTER_LOG_RENDERLOOP, "RT - window not ready, skipping render");
}
@@ -538,7 +541,8 @@ void QSGSoftwareRenderThread::syncAndRender()
mutex.unlock();
}
- Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSwap);
}
template<class T> T *windowFor(const QVector<T> &list, QQuickWindow *window)
@@ -951,7 +955,8 @@ void QSGSoftwareThreadedRenderLoop::polishAndSync(QSGSoftwareThreadedRenderLoop:
QQuickWindowPrivate *wd = QQuickWindowPrivate::get(window);
wd->polishItems();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync,
+ QQuickProfiler::SceneGraphPolishAndSyncPolish);
w->updateDuringSync = false;
@@ -965,13 +970,15 @@ void QSGSoftwareThreadedRenderLoop::polishAndSync(QSGSoftwareThreadedRenderLoop:
qCDebug(QSG_RASTER_LOG_RENDERLOOP, "polishAndSync - wait for sync");
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync,
+ QQuickProfiler::SceneGraphPolishAndSyncWait);
w->thread->waitCondition.wait(&w->thread->mutex);
lockedForSync = false;
w->thread->mutex.unlock();
qCDebug(QSG_RASTER_LOG_RENDERLOOP, "polishAndSync - unlock after sync");
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync,
+ QQuickProfiler::SceneGraphPolishAndSyncSync);
if (!animationTimer && m_anim->isRunning()) {
qCDebug(QSG_RASTER_LOG_RENDERLOOP, "polishAndSync - advancing animations");
@@ -983,7 +990,8 @@ void QSGSoftwareThreadedRenderLoop::polishAndSync(QSGSoftwareThreadedRenderLoop:
w->window->requestUpdate();
}
- Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphPolishAndSync);
+ Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphPolishAndSync,
+ QQuickProfiler::SceneGraphPolishAndSyncAnimations);
}
#include "qsgsoftwarethreadedrenderloop.moc"
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
index 81aa641e03..6771c0e940 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
@@ -170,7 +170,8 @@ ShaderManager::Shader *ShaderManager::prepareMaterial(QSGMaterial *material)
qCDebug(QSG_LOG_TIME_COMPILATION, "shader compiled in %dms", (int) qsg_renderer_timer.elapsed());
- Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphContextFrame);
+ Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphContextFrame,
+ QQuickProfiler::SceneGraphContextMaterialCompile);
rewrittenShaders[type] = shader;
return shader;
@@ -201,7 +202,8 @@ ShaderManager::Shader *ShaderManager::prepareMaterialNoRewrite(QSGMaterial *mate
qCDebug(QSG_LOG_TIME_COMPILATION, "shader compiled in %dms (no rewrite)", (int) qsg_renderer_timer.elapsed());
- Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphContextFrame);
+ Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphContextFrame,
+ QQuickProfiler::SceneGraphContextMaterialCompile);
return shader;
}
diff --git a/src/quick/scenegraph/coreapi/qsggeometry.cpp b/src/quick/scenegraph/coreapi/qsggeometry.cpp
index b43a2bc2ba..a278c6079b 100644
--- a/src/quick/scenegraph/coreapi/qsggeometry.cpp
+++ b/src/quick/scenegraph/coreapi/qsggeometry.cpp
@@ -39,7 +39,7 @@
#include "qsggeometry.h"
#include "qsggeometry_p.h"
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <qopenglcontext.h>
# include <qopenglfunctions.h>
# include <private/qopenglextensions_p.h>
@@ -441,7 +441,7 @@ QSGGeometry::QSGGeometry(const QSGGeometry::AttributeSet &attributes,
Q_UNUSED(m_reserved_bits);
Q_ASSERT(m_attributes.count > 0);
Q_ASSERT(m_attributes.stride > 0);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
Q_ASSERT_X(indexType != GL_UNSIGNED_INT
|| static_cast<QOpenGLExtensions *>(QOpenGLContext::currentContext()->functions())
->hasOpenGLExtension(QOpenGLExtensions::ElementIndexUint),
diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.cpp b/src/quick/scenegraph/coreapi/qsgmaterial.cpp
index 502ae56c63..8d666d3d0b 100644
--- a/src/quick/scenegraph/coreapi/qsgmaterial.cpp
+++ b/src/quick/scenegraph/coreapi/qsgmaterial.cpp
@@ -40,7 +40,7 @@
#include "qsgmaterial.h"
#include "qsgrenderer_p.h"
#include "qsgmaterialshader_p.h"
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <private/qsgshadersourcebuilder_p.h>
# include <private/qsgdefaultcontext_p.h>
# include <private/qsgdefaultrendercontext_p.h>
@@ -64,7 +64,7 @@ void qsg_set_material_failure()
qsg_material_failure = true;
}
#endif
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
const char *QSGMaterialShaderPrivate::loadShaderSource(QOpenGLShader::ShaderType type) const
{
const QStringList files = m_sourceFiles[type];
@@ -227,7 +227,7 @@ QSGMaterialShader::~QSGMaterialShader()
defines the attribute register position in the vertex shader.
*/
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
/*!
\fn const char *QSGMaterialShader::vertexShader() const
@@ -320,7 +320,7 @@ void QSGMaterialShader::updateState(const RenderState & /* state */, QSGMaterial
{
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
/*!
Sets the GLSL source file for the shader stage \a type to \a sourceFile. The
default implementation of the vertexShader() and fragmentShader() functions
@@ -550,7 +550,7 @@ QRect QSGMaterialShader::RenderState::deviceRect() const
return static_cast<const QSGRenderer *>(m_data)->deviceRect();
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
/*!
Returns the QOpenGLContext that is being used for rendering
diff --git a/src/quick/scenegraph/coreapi/qsgmaterial.h b/src/quick/scenegraph/coreapi/qsgmaterial.h
index 114651653f..c002cd5d5e 100644
--- a/src/quick/scenegraph/coreapi/qsgmaterial.h
+++ b/src/quick/scenegraph/coreapi/qsgmaterial.h
@@ -41,7 +41,7 @@
#define QSGMATERIAL_H
#include <QtQuick/qtquickglobal.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QtGui/qopenglshaderprogram.h>
#endif
#include <QtGui/QMatrix4x4>
@@ -84,7 +84,7 @@ public:
QRect deviceRect() const;
float determinant() const;
float devicePixelRatio() const;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QOpenGLContext *context() const;
#endif
private:
@@ -101,7 +101,7 @@ public:
// First time a material is used, oldMaterial is null.
virtual void updateState(const RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial);
virtual char const *const *attributeNames() const = 0; // Array must end with null.
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
inline QOpenGLShaderProgram *program() { return &m_program; }
#endif
protected:
@@ -110,19 +110,19 @@ protected:
friend class QSGDefaultRenderContext;
friend class QSGBatchRenderer::ShaderManager;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void setShaderSourceFile(QOpenGLShader::ShaderType type, const QString &sourceFile);
void setShaderSourceFiles(QOpenGLShader::ShaderType type, const QStringList &sourceFiles);
virtual void compile();
#endif
virtual void initialize() { }
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
virtual const char *vertexShader() const;
virtual const char *fragmentShader() const;
#endif
private:
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QOpenGLShaderProgram m_program;
#endif
QScopedPointer<QSGMaterialShaderPrivate> d_ptr;
diff --git a/src/quick/scenegraph/coreapi/qsgmaterialshader_p.h b/src/quick/scenegraph/coreapi/qsgmaterialshader_p.h
index 0dbce010db..47f5e5de09 100644
--- a/src/quick/scenegraph/coreapi/qsgmaterialshader_p.h
+++ b/src/quick/scenegraph/coreapi/qsgmaterialshader_p.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
class Q_QUICK_PRIVATE_EXPORT QSGMaterialShaderPrivate
{
public:
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
const char *loadShaderSource(QOpenGLShader::ShaderType type) const;
QHash<QOpenGLShader::ShaderType, QStringList> m_sourceFiles;
diff --git a/src/quick/scenegraph/coreapi/qsgrenderer.cpp b/src/quick/scenegraph/coreapi/qsgrenderer.cpp
index 220e6ab212..e5d464930c 100644
--- a/src/quick/scenegraph/coreapi/qsgrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgrenderer.cpp
@@ -39,7 +39,7 @@
#include "qsgrenderer_p.h"
#include "qsgnodeupdater_p.h"
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QtGui/QOpenGLFramebufferObject>
# include <QtGui/QOpenGLContext>
# include <QtGui/QOpenGLFunctions>
@@ -67,7 +67,7 @@ int qt_sg_envInt(const char *name, int defaultValue)
void QSGBindable::clear(QSGAbstractRenderer::ClearMode mode) const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
GLuint bits = 0;
if (mode & QSGAbstractRenderer::ClearColorBuffer) bits |= GL_COLOR_BUFFER_BIT;
if (mode & QSGAbstractRenderer::ClearDepthBuffer) bits |= GL_DEPTH_BUFFER_BIT;
@@ -81,11 +81,11 @@ void QSGBindable::clear(QSGAbstractRenderer::ClearMode mode) const
// Reactivate the color buffer after switching to the stencil.
void QSGBindable::reactivate() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QOpenGLContext::currentContext()->functions()->glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
#endif
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QSGBindableFboId::QSGBindableFboId(GLuint id)
: m_id(id)
{
@@ -181,7 +181,7 @@ bool QSGRenderer::isMirrored() const
void QSGRenderer::renderScene(uint fboId)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (fboId) {
QSGBindableFboId bindable(fboId);
renderScene(bindable);
@@ -220,9 +220,10 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
bindable.bind();
if (profileFrames)
bindTime = frameTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRendererFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRendererFrame,
+ QQuickProfiler::SceneGraphRendererBinding);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
// Sanity check that attribute registers are disabled
if (qsg_sanity_check) {
GLint count = 0;
@@ -240,7 +241,8 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
render();
if (profileFrames)
renderTime = frameTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRendererFrame);
+ Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRendererFrame,
+ QQuickProfiler::SceneGraphRendererRender);
m_is_rendering = false;
m_changed_emitted = false;
@@ -304,13 +306,15 @@ void QSGRenderer::preprocess()
bool profileFrames = QSG_LOG_TIME_RENDERER().isDebugEnabled();
if (profileFrames)
preprocessTime = frameTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRendererFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRendererFrame,
+ QQuickProfiler::SceneGraphRendererPreprocess);
nodeUpdater()->updateStates(root);
if (profileFrames)
updatePassTime = frameTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRendererFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRendererFrame,
+ QQuickProfiler::SceneGraphRendererUpdate);
}
void QSGRenderer::addNodesToPreprocess(QSGNode *node)
diff --git a/src/quick/scenegraph/coreapi/qsgrenderer_p.h b/src/quick/scenegraph/coreapi/qsgrenderer_p.h
index 3fb23fe3cd..4589685765 100644
--- a/src/quick/scenegraph/coreapi/qsgrenderer_p.h
+++ b/src/quick/scenegraph/coreapi/qsgrenderer_p.h
@@ -133,7 +133,7 @@ public:
virtual void clear(QSGAbstractRenderer::ClearMode mode) const;
virtual void reactivate() const;
};
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
class QSGBindableFboId : public QSGBindable
{
public:
diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp
index 9923fa6e24..412023564f 100644
--- a/src/quick/scenegraph/qsgadaptationlayer.cpp
+++ b/src/quick/scenegraph/qsgadaptationlayer.cpp
@@ -73,7 +73,7 @@ QSGDistanceFieldGlyphCache::QSGDistanceFieldGlyphCache(QSGDistanceFieldGlyphCach
// this allows us to call pathForGlyph once and reuse the result.
m_referenceFont.setPixelSize(QT_DISTANCEFIELD_BASEFONTSIZE(m_doubleGlyphResolution) * QT_DISTANCEFIELD_SCALE(m_doubleGlyphResolution));
Q_ASSERT(m_referenceFont.isValid());
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
m_coreProfile = (c->format().profile() == QSurfaceFormat::CoreProfile);
#else
Q_UNUSED(c)
@@ -189,7 +189,8 @@ void QSGDistanceFieldGlyphCache::update()
int count = m_pendingGlyphs.size();
if (profileFrames)
renderTime = qsg_render_timer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphAdaptationLayerFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphAdaptationLayerFrame,
+ QQuickProfiler::SceneGraphAdaptationLayerGlyphRender);
m_pendingGlyphs.reset();
@@ -210,6 +211,7 @@ void QSGDistanceFieldGlyphCache::update()
int((now - (renderTime / 1000000))));
}
Q_QUICK_SG_PROFILE_END_WITH_PAYLOAD(QQuickProfiler::SceneGraphAdaptationLayerFrame,
+ QQuickProfiler::SceneGraphAdaptationLayerGlyphStore,
(qint64)count);
}
diff --git a/src/quick/scenegraph/qsgcontextplugin.cpp b/src/quick/scenegraph/qsgcontextplugin.cpp
index 7fab9aeae8..635308c38a 100644
--- a/src/quick/scenegraph/qsgcontextplugin.cpp
+++ b/src/quick/scenegraph/qsgcontextplugin.cpp
@@ -45,7 +45,7 @@
// Built-in adaptations
#include <QtQuick/private/qsgsoftwareadaptation_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <QtQuick/private/qsgdefaultcontext_p.h>
#endif
@@ -62,7 +62,7 @@ QSGContextPlugin::~QSGContextPlugin()
{
}
-#ifndef QT_NO_LIBRARY
+#if QT_CONFIG(library)
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QSGContextFactoryInterface_iid, QLatin1String("/scenegraph")))
#endif
@@ -128,7 +128,7 @@ QSGAdaptationBackendData *contextFactory()
if (requestedBackend.isEmpty() && qEnvironmentVariableIsSet("QT_QUICK_BACKEND"))
requestedBackend = QString::fromLocal8Bit(qgetenv("QT_QUICK_BACKEND"));
-#ifdef QT_NO_OPENGL
+#if !QT_CONFIG(opengl)
// If this is a build without OpenGL, and no backend has been set
// default to the software renderer
if (requestedBackend.isEmpty())
@@ -148,7 +148,7 @@ QSGAdaptationBackendData *contextFactory()
}
}
-#ifndef QT_NO_LIBRARY
+#if QT_CONFIG(library)
// Then try the plugins.
if (!backendData->factory) {
const int index = loader()->indexOf(requestedBackend);
@@ -165,7 +165,7 @@ QSGAdaptationBackendData *contextFactory()
qPrintable(QLibraryInfo::location(QLibraryInfo::PluginsPath)));
}
}
-#endif // QT_NO_LIBRARY
+#endif // library
}
}
@@ -185,7 +185,7 @@ QSGContext *QSGContext::createDefaultContext()
QSGAdaptationBackendData *backendData = contextFactory();
if (backendData->factory)
return backendData->factory->create(backendData->name);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
return new QSGDefaultContext();
#else
return nullptr;
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp
index 9ddbe5aa1d..48288bfc62 100644
--- a/src/quick/scenegraph/qsgrenderloop.cpp
+++ b/src/quick/scenegraph/qsgrenderloop.cpp
@@ -58,7 +58,7 @@
#include <QtQuick/private/qsgcontext_p.h>
#include <private/qquickprofiler_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QtGui/QOpenGLContext>
# include <private/qsgdefaultrendercontext_p.h>
#if QT_CONFIG(quick_shadereffect)
@@ -74,7 +74,7 @@ QT_BEGIN_NAMESPACE
extern bool qsg_useConsistentTiming();
extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
/*!
expectations for this manager to work:
- one opengl context to render multiple windows
@@ -119,7 +119,7 @@ void QSGRenderLoop::cleanup()
void QSGRenderLoop::postJob(QQuickWindow *window, QRunnable *job)
{
Q_ASSERT(job);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
Q_ASSERT(window);
if (window->openglContext()) {
window->openglContext()->makeCurrent(window);
@@ -131,7 +131,7 @@ void QSGRenderLoop::postJob(QQuickWindow *window, QRunnable *job)
#endif
delete job;
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
class QSGGuiThreadRenderLoop : public QSGRenderLoop
{
Q_OBJECT
@@ -182,7 +182,7 @@ QSGRenderLoop *QSGRenderLoop::instance()
const_cast<QLoggingCategory &>(QSG_LOG_INFO()).setEnabled(QtDebugMsg, true);
s_instance = QSGContext::createWindowManager();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (!s_instance) {
enum RenderLoopType {
@@ -272,7 +272,7 @@ void QSGRenderLoop::handleContextCreationFailure(QQuickWindow *window,
if (!signalEmitted)
qFatal("%s", qPrintable(untranslatedMessage));
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QSGGuiThreadRenderLoop::QSGGuiThreadRenderLoop()
: gl(0)
{
@@ -401,7 +401,8 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
if (profileFrames)
polishTime = renderTimer.nsecsElapsed();
Q_QUICK_SG_PROFILE_SWITCH(QQuickProfiler::SceneGraphPolishFrame,
- QQuickProfiler::SceneGraphRenderLoopFrame);
+ QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphPolishPolish);
emit window->afterAnimating();
@@ -409,13 +410,15 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
if (profileFrames)
syncTime = renderTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSync);
cd->renderSceneGraph(window->size());
if (profileFrames)
renderTime = renderTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopRender);
if (data.grabOnly) {
bool alpha = window->format().alphaBufferSize() > 0 && window->color().alpha() != 255;
@@ -432,7 +435,8 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
qint64 swapTime = 0;
if (profileFrames)
swapTime = renderTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSwap);
if (QSG_LOG_TIME_RENDERLOOP().isDebugEnabled()) {
static QTime lastFrameTime = QTime::currentTime();
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index 693012154e..4543782d5b 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -602,7 +602,8 @@ void QSGRenderThread::syncAndRender()
if (profileFrames)
syncTime = threadTimer.nsecsElapsed();
#endif
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSync);
if (!syncResultedInChanges && !repaintRequested && sgrc->isValid()) {
qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- no changes, render aborted";
@@ -634,12 +635,14 @@ void QSGRenderThread::syncAndRender()
d->renderSceneGraph(windowSize);
if (profileFrames)
renderTime = threadTimer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopRender);
if (!d->customRenderStage || !d->customRenderStage->swap())
gl->swapBuffers(window);
d->fireFrameSwapped();
} else {
- Q_QUICK_SG_PROFILE_SKIP(QQuickProfiler::SceneGraphRenderLoopFrame, 1);
+ Q_QUICK_SG_PROFILE_SKIP(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSync, 1);
qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- window not ready, skipping render";
}
@@ -664,7 +667,8 @@ void QSGRenderThread::syncAndRender()
int(threadTimer.elapsed() - renderTime / 1000000));
- Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSwap);
}
@@ -1169,7 +1173,8 @@ void QSGThreadedRenderLoop::polishAndSync(Window *w, bool inExpose)
if (profileFrames)
polishTime = timer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync,
+ QQuickProfiler::SceneGraphPolishAndSyncPolish);
w->updateDuringSync = false;
@@ -1184,7 +1189,8 @@ void QSGThreadedRenderLoop::polishAndSync(Window *w, bool inExpose)
qCDebug(QSG_LOG_RENDERLOOP) << "- wait for sync";
if (profileFrames)
waitTime = timer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync,
+ QQuickProfiler::SceneGraphPolishAndSyncWait);
w->thread->waitCondition.wait(&w->thread->mutex);
m_lockedForSync = false;
w->thread->mutex.unlock();
@@ -1192,7 +1198,8 @@ void QSGThreadedRenderLoop::polishAndSync(Window *w, bool inExpose)
if (profileFrames)
syncTime = timer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphPolishAndSync,
+ QQuickProfiler::SceneGraphPolishAndSyncSync);
if (m_animation_timer == 0 && m_animation_driver->isRunning()) {
qCDebug(QSG_LOG_RENDERLOOP) << "- advancing animations";
@@ -1213,7 +1220,8 @@ void QSGThreadedRenderLoop::polishAndSync(Window *w, bool inExpose)
<< ", animations=" << (timer.nsecsElapsed() - syncTime) / 1000000
<< " - (on Gui thread) " << window;
- Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphPolishAndSync);
+ Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphPolishAndSync,
+ QQuickProfiler::SceneGraphPolishAndSyncAnimations);
}
bool QSGThreadedRenderLoop::event(QEvent *e)
diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
index 2a2d8be657..e944ddbc4f 100644
--- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp
+++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
@@ -71,9 +71,9 @@ static QElapsedTimer qsg_render_timer;
if (QSG_LOG_TIME_RENDERLOOP().isDebugEnabled()) \
sampleName = qsg_render_timer.nsecsElapsed(); \
-#define QSG_RENDER_TIMING_SAMPLE(frameType, sampleName) \
+#define QSG_RENDER_TIMING_SAMPLE(frameType, sampleName, position) \
QSG_LOG_TIME_SAMPLE(sampleName) \
- Q_QUICK_SG_PROFILE_RECORD(frameType);
+ Q_QUICK_SG_PROFILE_RECORD(frameType, position);
QSGWindowsRenderLoop::QSGWindowsRenderLoop()
@@ -405,7 +405,7 @@ void QSGWindowsRenderLoop::render()
"animations ticked in %dms",
int((qsg_render_timer.nsecsElapsed() - time_start)/1000000));
- Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphWindowsAnimations);
+ Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphWindowsAnimations, 1);
// It is not given that animations triggered another maybeUpdate()
// and thus another render pass, so to keep things running,
@@ -456,22 +456,26 @@ void QSGWindowsRenderLoop::renderWindow(QQuickWindow *window)
d->polishItems();
QSG_LOG_TIME_SAMPLE(time_polished);
Q_QUICK_SG_PROFILE_SWITCH(QQuickProfiler::SceneGraphPolishFrame,
- QQuickProfiler::SceneGraphRenderLoopFrame);
+ QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphPolishPolish);
emit window->afterAnimating();
RLDEBUG(" - syncing");
d->syncSceneGraph();
- QSG_RENDER_TIMING_SAMPLE(QQuickProfiler::SceneGraphRenderLoopFrame, time_synced);
+ QSG_RENDER_TIMING_SAMPLE(QQuickProfiler::SceneGraphRenderLoopFrame, time_synced,
+ QQuickProfiler::SceneGraphRenderLoopSync);
RLDEBUG(" - rendering");
d->renderSceneGraph(window->size());
- QSG_RENDER_TIMING_SAMPLE(QQuickProfiler::SceneGraphRenderLoopFrame, time_rendered);
+ QSG_RENDER_TIMING_SAMPLE(QQuickProfiler::SceneGraphRenderLoopFrame, time_rendered,
+ QQuickProfiler::SceneGraphRenderLoopRender);
RLDEBUG(" - swapping");
if (!d->customRenderStage || !d->customRenderStage->swap())
m_gl->swapBuffers(window);
- QSG_RENDER_TIMING_SAMPLE(QQuickProfiler::SceneGraphRenderLoopFrame, time_swapped);
+ QSG_RENDER_TIMING_SAMPLE(QQuickProfiler::SceneGraphRenderLoopFrame, time_swapped,
+ QQuickProfiler::SceneGraphRenderLoopSwap);
RLDEBUG(" - frameDone");
d->fireFrameSwapped();
@@ -484,7 +488,8 @@ void QSGWindowsRenderLoop::renderWindow(QQuickWindow *window)
<< ", swap=" << (time_swapped - time_rendered) / 1000000
<< " - " << window;
- Q_QUICK_SG_PROFILE_REPORT(QQuickProfiler::SceneGraphRenderLoopFrame);
+ Q_QUICK_SG_PROFILE_REPORT(QQuickProfiler::SceneGraphRenderLoopFrame,
+ QQuickProfiler::SceneGraphRenderLoopSwap);
}
QT_END_NAMESPACE
diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp
index b6abb55bd3..c864ea9496 100644
--- a/src/quick/scenegraph/util/qsgatlastexture.cpp
+++ b/src/quick/scenegraph/util/qsgatlastexture.cpp
@@ -395,9 +395,12 @@ void Atlas::bind(QSGTexture::Filtering filtering)
bool profileFrames = QSG_LOG_TIME_TEXTURE().isDebugEnabled();
if (profileFrames)
qsg_renderer_timer.start();
- // Skip bind, convert, swizzle; they're irrelevant
+
Q_QUICK_SG_PROFILE_START(QQuickProfiler::SceneGraphTexturePrepare);
- Q_QUICK_SG_PROFILE_SKIP(QQuickProfiler::SceneGraphTexturePrepare, 3);
+
+ // Skip bind, convert, swizzle; they're irrelevant
+ Q_QUICK_SG_PROFILE_SKIP(QQuickProfiler::SceneGraphTexturePrepare,
+ QQuickProfiler::SceneGraphTexturePrepareStart, 3);
Texture *t = m_pending_uploads.at(i);
if (m_externalFormat == GL_BGRA &&
@@ -415,10 +418,14 @@ void Atlas::bind(QSGTexture::Filtering filtering)
<< "ms (" << t->textureSize().width() << "x"
<< t->textureSize().height() << ")";
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphTexturePrepare,
+ QQuickProfiler::SceneGraphTexturePrepareUpload);
+
// Skip mipmap; unused
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphTexturePrepare);
- Q_QUICK_SG_PROFILE_SKIP(QQuickProfiler::SceneGraphTexturePrepare, 1);
- Q_QUICK_SG_PROFILE_REPORT(QQuickProfiler::SceneGraphTexturePrepare);
+ Q_QUICK_SG_PROFILE_SKIP(QQuickProfiler::SceneGraphTexturePrepare,
+ QQuickProfiler::SceneGraphTexturePrepareUpload, 1);
+ Q_QUICK_SG_PROFILE_REPORT(QQuickProfiler::SceneGraphTexturePrepare,
+ QQuickProfiler::SceneGraphTexturePrepareMipmap);
}
GLenum f = filtering == QSGTexture::Nearest ? GL_NEAREST : GL_LINEAR;
diff --git a/src/quick/scenegraph/util/qsgdistancefieldutil.cpp b/src/quick/scenegraph/util/qsgdistancefieldutil.cpp
index 79e43e3820..9ca9cdb107 100644
--- a/src/quick/scenegraph/util/qsgdistancefieldutil.cpp
+++ b/src/quick/scenegraph/util/qsgdistancefieldutil.cpp
@@ -40,7 +40,7 @@
#include "qsgdistancefieldutil_p.h"
#include <private/qsgadaptationlayer_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QtGui/private/qopenglengineshadersource_p.h>
#endif
#include <QtQuick/private/qsgcontext_p.h>
diff --git a/src/quick/scenegraph/util/qsgengine.cpp b/src/quick/scenegraph/util/qsgengine.cpp
index ad1fcfa470..09e4cdf5a7 100644
--- a/src/quick/scenegraph/util/qsgengine.cpp
+++ b/src/quick/scenegraph/util/qsgengine.cpp
@@ -44,7 +44,7 @@
#include <private/qsgrenderer_p.h>
#include <private/qsgtexture_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QtGui/QOpenGLContext>
# include <private/qsgdefaultrendercontext_p.h>
#endif
@@ -116,7 +116,7 @@ QSGEngine::~QSGEngine()
void QSGEngine::initialize(QOpenGLContext *context)
{
Q_D(QSGEngine);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (context && QOpenGLContext::currentContext() != context) {
qWarning("WARNING: The context must be current before calling QSGEngine::initialize.");
return;
@@ -125,7 +125,7 @@ void QSGEngine::initialize(QOpenGLContext *context)
if (d->sgRenderContext && !d->sgRenderContext->isValid()) {
d->sgRenderContext->setAttachToGraphicsContext(false);
d->sgRenderContext->initialize(context);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (context)
connect(context, &QOpenGLContext::aboutToBeDestroyed, this, &QSGEngine::invalidate);
#endif
diff --git a/src/quick/scenegraph/util/qsgflatcolormaterial.cpp b/src/quick/scenegraph/util/qsgflatcolormaterial.cpp
index 2ce27275cd..8ab7669891 100644
--- a/src/quick/scenegraph/util/qsgflatcolormaterial.cpp
+++ b/src/quick/scenegraph/util/qsgflatcolormaterial.cpp
@@ -39,7 +39,7 @@
#include "qsgflatcolormaterial.h"
#include <private/qsgmaterialshader_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <qopenglshaderprogram.h>
#endif
@@ -57,7 +57,7 @@ public:
private:
virtual void initialize();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
int m_matrix_id;
int m_color_id;
#endif
@@ -68,7 +68,7 @@ QSGMaterialType FlatColorMaterialShader::type;
FlatColorMaterialShader::FlatColorMaterialShader()
: QSGMaterialShader(*new QSGMaterialShaderPrivate)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/qt-project.org/scenegraph/shaders/flatcolor.vert"));
setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/scenegraph/shaders/flatcolor.frag"));
#endif
@@ -76,7 +76,7 @@ FlatColorMaterialShader::FlatColorMaterialShader()
void FlatColorMaterialShader::updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
Q_ASSERT(oldEffect == 0 || newEffect->type() == oldEffect->type());
QSGFlatColorMaterial *oldMaterial = static_cast<QSGFlatColorMaterial *>(oldEffect);
QSGFlatColorMaterial *newMaterial = static_cast<QSGFlatColorMaterial *>(newEffect);
@@ -109,7 +109,7 @@ char const *const *FlatColorMaterialShader::attributeNames() const
void FlatColorMaterialShader::initialize()
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
m_matrix_id = program()->uniformLocation("matrix");
m_color_id = program()->uniformLocation("color");
#endif
diff --git a/src/quick/scenegraph/util/qsgsimplematerial.h b/src/quick/scenegraph/util/qsgsimplematerial.h
index c14ba506ec..0e7219d7bd 100644
--- a/src/quick/scenegraph/util/qsgsimplematerial.h
+++ b/src/quick/scenegraph/util/qsgsimplematerial.h
@@ -50,7 +50,7 @@ class QSGSimpleMaterialShader : public QSGMaterialShader
public:
void initialize() override {
QSGMaterialShader::initialize();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
m_id_matrix = program()->uniformLocation(uniformMatrixName());
if (m_id_matrix < 0) {
qFatal("QSGSimpleMaterialShader does not implement 'uniform highp mat4 %s;' in its vertex shader",
@@ -197,7 +197,7 @@ QSGMaterialType QSGSimpleMaterial<State>::m_type;
template <typename State>
Q_INLINE_TEMPLATE void QSGSimpleMaterialShader<State>::updateState(const RenderState &state, QSGMaterial *newMaterial, QSGMaterial *oldMaterial)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (state.isMatrixDirty())
program()->setUniformValue(m_id_matrix, state.combinedMatrix());
if (state.isOpacityDirty() && m_id_opacity >= 0)
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp
index 4cf339aeb8..47248f2f37 100644
--- a/src/quick/scenegraph/util/qsgtexture.cpp
+++ b/src/quick/scenegraph/util/qsgtexture.cpp
@@ -45,7 +45,7 @@
#include <private/qqmlglobal_p.h>
#include <QtGui/qguiapplication.h>
#include <QtGui/qpa/qplatformnativeinterface.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <qopenglfunctions.h>
# include <QtGui/qopenglcontext.h>
# include <QtGui/qopenglfunctions.h>
@@ -70,7 +70,7 @@
#include <QHash>
#endif
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
static QElapsedTimer qsg_renderer_timer;
#endif
@@ -86,7 +86,7 @@ static const bool qsg_leak_check = !qEnvironmentVariableIsEmpty("QML_LEAK_CHECK"
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
inline static bool isPowerOfTwo(int x)
{
// Assumption: x >= 1
@@ -284,7 +284,7 @@ Q_GLOBAL_STATIC(QMutex, qsg_valid_texture_mutex)
bool qsg_safeguard_texture(QSGTexture *texture)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QMutexLocker locker(qsg_valid_texture_mutex());
if (!qsg_valid_texture_set()->contains(texture)) {
qWarning() << "Invalid texture accessed:" << (void *) texture;
@@ -527,7 +527,7 @@ QSGTexture::WrapMode QSGTexture::verticalWrapMode() const
*/
void QSGTexture::updateBindOptions(bool force)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
Q_D(QSGTexture);
QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions();
force |= isAtlasTexture();
@@ -582,7 +582,7 @@ QSGPlainTexture::QSGPlainTexture()
QSGPlainTexture::~QSGPlainTexture()
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_texture_id && m_owns_texture && QOpenGLContext::currentContext())
QOpenGLContext::currentContext()->functions()->glDeleteTextures(1, &m_texture_id);
#endif
@@ -617,7 +617,7 @@ int QSGPlainTexture::textureId() const
// or ~QSGPlainTexture so just keep it minimal here.
return 0;
} else if (m_texture_id == 0){
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
// Generate a texture id for use later and return it.
QOpenGLContext::currentContext()->functions()->glGenTextures(1, &const_cast<QSGPlainTexture *>(this)->m_texture_id);
#endif
@@ -629,7 +629,7 @@ int QSGPlainTexture::textureId() const
void QSGPlainTexture::setTextureId(int id)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_texture_id && m_owns_texture)
QOpenGLContext::currentContext()->functions()->glDeleteTextures(1, &m_texture_id);
#endif
@@ -643,7 +643,7 @@ void QSGPlainTexture::setTextureId(int id)
void QSGPlainTexture::bind()
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QOpenGLContext *context = QOpenGLContext::currentContext();
QOpenGLFunctions *funcs = context->functions();
if (!m_dirty_texture) {
@@ -673,7 +673,8 @@ void QSGPlainTexture::bind()
(int) qsg_renderer_timer.elapsed(),
m_texture_size.width(),
m_texture_size.height());
- Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphTextureDeletion);
+ Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphTextureDeletion,
+ QQuickProfiler::SceneGraphTextureDeletionDelete);
}
m_texture_id = 0;
m_texture_size = QSize();
@@ -689,7 +690,8 @@ void QSGPlainTexture::bind()
qint64 bindTime = 0;
if (profileFrames)
bindTime = qsg_renderer_timer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphTexturePrepare);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphTexturePrepare,
+ QQuickProfiler::SceneGraphTexturePrepareBind);
// ### TODO: check for out-of-memory situations...
@@ -730,7 +732,8 @@ void QSGPlainTexture::bind()
qint64 convertTime = 0;
if (profileFrames)
convertTime = qsg_renderer_timer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphTexturePrepare);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphTexturePrepare,
+ QQuickProfiler::SceneGraphTexturePrepareConvert);
updateBindOptions(m_dirty_bind_options);
@@ -773,14 +776,16 @@ void QSGPlainTexture::bind()
qint64 swizzleTime = 0;
if (profileFrames)
swizzleTime = qsg_renderer_timer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphTexturePrepare);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphTexturePrepare,
+ QQuickProfiler::SceneGraphTexturePrepareSwizzle);
funcs->glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, m_texture_size.width(), m_texture_size.height(), 0, externalFormat, GL_UNSIGNED_BYTE, tmp.constBits());
qint64 uploadTime = 0;
if (profileFrames)
uploadTime = qsg_renderer_timer.nsecsElapsed();
- Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphTexturePrepare);
+ Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphTexturePrepare,
+ QQuickProfiler::SceneGraphTexturePrepareUpload);
if (mipmapFiltering() != QSGTexture::None) {
funcs->glGenerateMipmap(GL_TEXTURE_2D);
@@ -803,7 +808,8 @@ void QSGPlainTexture::bind()
int((mipmapTime - uploadTime)/1000000),
m_texture_size != m_image.size() ? " (scaled to GL_MAX_TEXTURE_SIZE)" : "");
}
- Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphTexturePrepare);
+ Q_QUICK_SG_PROFILE_END(QQuickProfiler::SceneGraphTexturePrepare,
+ QQuickProfiler::SceneGraphTexturePrepareMipmap);
m_texture_rect = QRectF(0, 0, 1, 1);
diff --git a/src/quick/scenegraph/util/qsgtexture_p.h b/src/quick/scenegraph/util/qsgtexture_p.h
index e09cbdbef1..b6fcfc31c4 100644
--- a/src/quick/scenegraph/util/qsgtexture_p.h
+++ b/src/quick/scenegraph/util/qsgtexture_p.h
@@ -53,7 +53,7 @@
#include <QtQuick/qtquickglobal.h>
#include <private/qobject_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QtGui/qopengl.h>
#endif
#include "qsgtexture.h"
diff --git a/src/quick/scenegraph/util/qsgtexturematerial.cpp b/src/quick/scenegraph/util/qsgtexturematerial.cpp
index 119828bc81..9326ea640d 100644
--- a/src/quick/scenegraph/util/qsgtexturematerial.cpp
+++ b/src/quick/scenegraph/util/qsgtexturematerial.cpp
@@ -39,14 +39,14 @@
#include "qsgtexturematerial_p.h"
#include "qsgtexture_p.h"
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QtGui/qopenglshaderprogram.h>
# include <QtGui/qopenglfunctions.h>
#endif
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
inline static bool isPowerOfTwo(int x)
{
// Assumption: x >= 1
@@ -59,7 +59,7 @@ QSGMaterialType QSGOpaqueTextureMaterialShader::type;
QSGOpaqueTextureMaterialShader::QSGOpaqueTextureMaterialShader()
: QSGMaterialShader()
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/qt-project.org/scenegraph/shaders/opaquetexture.vert"));
setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/scenegraph/shaders/opaquetexture.frag"));
#endif
@@ -73,7 +73,7 @@ char const *const *QSGOpaqueTextureMaterialShader::attributeNames() const
void QSGOpaqueTextureMaterialShader::initialize()
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
m_matrix_id = program()->uniformLocation("qt_Matrix");
#endif
}
@@ -95,7 +95,7 @@ void QSGOpaqueTextureMaterialShader::updateState(const RenderState &state, QSGMa
t->setHorizontalWrapMode(tx->horizontalWrapMode());
t->setVerticalWrapMode(tx->verticalWrapMode());
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
bool npotSupported = const_cast<QOpenGLContext *>(state.context())
->functions()->hasOpenGLFeature(QOpenGLFunctions::NPOTTextureRepeat);
if (!npotSupported) {
@@ -115,7 +115,7 @@ void QSGOpaqueTextureMaterialShader::updateState(const RenderState &state, QSGMa
t->bind();
else
t->updateBindOptions();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (state.isMatrixDirty())
program()->setUniformValue(m_matrix_id, state.combinedMatrix());
#endif
@@ -379,7 +379,7 @@ QSGMaterialShader *QSGTextureMaterial::createShader() const
QSGTextureMaterialShader::QSGTextureMaterialShader()
: QSGOpaqueTextureMaterialShader()
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/scenegraph/shaders/texture.frag"));
#endif
}
@@ -387,7 +387,7 @@ QSGTextureMaterialShader::QSGTextureMaterialShader()
void QSGTextureMaterialShader::updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect)
{
Q_ASSERT(oldEffect == 0 || newEffect->type() == oldEffect->type());
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (state.isOpacityDirty())
program()->setUniformValue(m_opacity_id, state.opacity());
#endif
@@ -397,7 +397,7 @@ void QSGTextureMaterialShader::updateState(const RenderState &state, QSGMaterial
void QSGTextureMaterialShader::initialize()
{
QSGOpaqueTextureMaterialShader::initialize();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
m_opacity_id = program()->uniformLocation("opacity");
#endif
}
diff --git a/src/quick/scenegraph/util/qsgvertexcolormaterial.cpp b/src/quick/scenegraph/util/qsgvertexcolormaterial.cpp
index 847ec289d8..8c305d7fd4 100644
--- a/src/quick/scenegraph/util/qsgvertexcolormaterial.cpp
+++ b/src/quick/scenegraph/util/qsgvertexcolormaterial.cpp
@@ -38,7 +38,7 @@
****************************************************************************/
#include "qsgvertexcolormaterial.h"
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <qopenglshaderprogram.h>
#endif
QT_BEGIN_NAMESPACE
@@ -55,7 +55,7 @@ public:
private:
virtual void initialize();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
int m_matrix_id;
int m_opacity_id;
#endif
@@ -66,7 +66,7 @@ QSGMaterialType QSGVertexColorMaterialShader::type;
QSGVertexColorMaterialShader::QSGVertexColorMaterialShader()
: QSGMaterialShader()
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
setShaderSourceFile(QOpenGLShader::Vertex, QStringLiteral(":/qt-project.org/scenegraph/shaders/vertexcolor.vert"));
setShaderSourceFile(QOpenGLShader::Fragment, QStringLiteral(":/qt-project.org/scenegraph/shaders/vertexcolor.frag"));
#endif
@@ -74,7 +74,7 @@ QSGVertexColorMaterialShader::QSGVertexColorMaterialShader()
void QSGVertexColorMaterialShader::updateState(const RenderState &state, QSGMaterial * /*newEffect*/, QSGMaterial *)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (state.isOpacityDirty())
program()->setUniformValue(m_opacity_id, state.opacity());
@@ -93,7 +93,7 @@ char const *const *QSGVertexColorMaterialShader::attributeNames() const
void QSGVertexColorMaterialShader::initialize()
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
m_matrix_id = program()->uniformLocation("matrix");
m_opacity_id = program()->uniformLocation("opacity");
#endif
diff --git a/src/quick/util/qquickanimatorjob_p.h b/src/quick/util/qquickanimatorjob_p.h
index d7aaa988a9..a3ced4c21b 100644
--- a/src/quick/util/qquickanimatorjob_p.h
+++ b/src/quick/util/qquickanimatorjob_p.h
@@ -290,7 +290,7 @@ public:
private:
QSGOpacityNode *m_opacityNode;
};
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
class Q_QUICK_PRIVATE_EXPORT QQuickUniformAnimatorJob : public QQuickAnimatorJob
{
public:
diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp
index 7692cc79f9..5a723e4432 100644
--- a/src/quick/util/qquickglobal.cpp
+++ b/src/quick/util/qquickglobal.cpp
@@ -783,7 +783,7 @@ public:
return new QQuickApplication(parent);
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
QInputMethod *inputMethod()
{
QInputMethod *im = qGuiApp->inputMethod();
diff --git a/src/quick/util/qquickprofiler_p.h b/src/quick/util/qquickprofiler_p.h
index 66ed212722..d2fa935ad4 100644
--- a/src/quick/util/qquickprofiler_p.h
+++ b/src/quick/util/qquickprofiler_p.h
@@ -152,7 +152,6 @@ private:
template<uint size>
struct TimingData {
qint64 values[size][s_numSceneGraphTimings + 1];
- int offsets[size];
};
QThreadStorage<TimingData<NumRenderThreadFrameTypes> > renderThreadTimings;
@@ -167,15 +166,6 @@ public:
else
return guiThreadTimings.values[type - NumRenderThreadFrameTypes];
}
-
- template<SceneGraphFrameType type>
- int &offset()
- {
- if (type < NumRenderThreadFrameTypes)
- return renderThreadTimings.localData().offsets[type];
- else
- return guiThreadTimings.offsets[type - NumRenderThreadFrameTypes];
- }
};
class Q_QUICK_PRIVATE_EXPORT QQuickProfiler : public QObject, public QQmlProfilerDefinitions {
@@ -187,6 +177,59 @@ public:
RenderThread
};
+ enum SceneGraphContextStage {
+ SceneGraphContextStart,
+ SceneGraphContextMaterialCompile
+ };
+
+ enum SceneGraphRendererStage {
+ SceneGraphRendererStart,
+ SceneGraphRendererPreprocess,
+ SceneGraphRendererUpdate,
+ SceneGraphRendererBinding,
+ SceneGraphRendererRender
+ };
+
+ enum SceneGraphAdaptationLayerStage {
+ SceneGraphAdaptationLayerStart,
+ SceneGraphAdaptationLayerGlyphRender,
+ SceneGraphAdaptationLayerGlyphStore
+ };
+
+ enum SceneGraphRenderLoopStage {
+ SceneGraphRenderLoopStart,
+ SceneGraphRenderLoopSync,
+ SceneGraphRenderLoopRender,
+ SceneGraphRenderLoopSwap
+ };
+
+ enum SceneGraphPolishStage {
+ SceneGraphPolishStart,
+ SceneGraphPolishPolish
+ };
+
+ enum SceneGraphPolishAndSyncStage {
+ SceneGraphPolishAndSyncStart,
+ SceneGraphPolishAndSyncPolish,
+ SceneGraphPolishAndSyncWait,
+ SceneGraphPolishAndSyncSync,
+ SceneGraphPolishAndSyncAnimations
+ };
+
+ enum SceneGraphTexturePrepareStage {
+ SceneGraphTexturePrepareStart,
+ SceneGraphTexturePrepareBind,
+ SceneGraphTexturePrepareConvert,
+ SceneGraphTexturePrepareSwizzle,
+ SceneGraphTexturePrepareUpload,
+ SceneGraphTexturePrepareMipmap
+ };
+
+ enum SceneGraphTextureDeletionStage {
+ SceneGraphTextureDeletionStart,
+ SceneGraphTextureDeletionDelete
+ };
+
template<EventType DetailType, InputEventType InputType>
static void inputEvent(int x, int y = 0)
{
@@ -209,7 +252,6 @@ public:
static void startSceneGraphFrame()
{
startSceneGraphFrame<FrameType1>();
- s_instance->m_sceneGraphData.offset<FrameType2>() = 0;
s_instance->m_sceneGraphData.timings<FrameType2>()[0] =
s_instance->m_sceneGraphData.timings<FrameType1>()[0];
}
@@ -217,50 +259,45 @@ public:
template<SceneGraphFrameType FrameType>
static void startSceneGraphFrame()
{
- s_instance->m_sceneGraphData.offset<FrameType>() = 0;
s_instance->m_sceneGraphData.timings<FrameType>()[0] = s_instance->timestamp();
}
template<SceneGraphFrameType FrameType>
- static void recordSceneGraphTimestamp()
+ static void recordSceneGraphTimestamp(uint position)
{
- s_instance->m_sceneGraphData.timings<FrameType>()
- [++s_instance->m_sceneGraphData.offset<FrameType>()] = s_instance->timestamp();
+ s_instance->m_sceneGraphData.timings<FrameType>()[position] = s_instance->timestamp();
}
template<SceneGraphFrameType FrameType, uint Skip>
- static void skipSceneGraphTimestamps()
+ static void skipSceneGraphTimestamps(uint position)
{
qint64 *timings = s_instance->m_sceneGraphData.timings<FrameType>();
- const qint64 last = timings[s_instance->m_sceneGraphData.offset<FrameType>()];
+ const qint64 last = timings[position];
for (uint i = 0; i < Skip; ++i)
- timings[++s_instance->m_sceneGraphData.offset<FrameType>()] = last;
+ timings[++position] = last;
}
template<SceneGraphFrameType FrameType, bool Record>
- static void reportSceneGraphFrame(quint64 payload = ~0)
+ static void reportSceneGraphFrame(uint position, quint64 payload = ~0)
{
qint64 *timings = s_instance->m_sceneGraphData.timings<FrameType>();
- int &offset = s_instance->m_sceneGraphData.offset<FrameType>();
if (Record)
- timings[++offset] = s_instance->timestamp();
+ timings[position] = s_instance->timestamp();
s_instance->processMessage(QQuickProfilerData(
- timings[offset], 1 << SceneGraphFrame, 1 << FrameType,
- offset > 0 ? timings[1] - timings[0] : payload,
- offset > 1 ? timings[2] - timings[1] : payload,
- offset > 2 ? timings[3] - timings[2] : payload,
- offset > 3 ? timings[4] - timings[3] : payload,
- offset > 4 ? timings[5] - timings[4] : payload));
+ timings[position], 1 << SceneGraphFrame, 1 << FrameType,
+ position > 0 ? timings[1] - timings[0] : payload,
+ position > 1 ? timings[2] - timings[1] : payload,
+ position > 2 ? timings[3] - timings[2] : payload,
+ position > 3 ? timings[4] - timings[3] : payload,
+ position > 4 ? timings[5] - timings[4] : payload));
}
template<SceneGraphFrameType FrameType, bool Record, SceneGraphFrameType SwitchTo>
- static void reportSceneGraphFrame(quint64 payload = ~0)
+ static void reportSceneGraphFrame(uint position, quint64 payload = ~0)
{
- reportSceneGraphFrame<FrameType, Record>(payload);
- s_instance->m_sceneGraphData.offset<SwitchTo>() = 0;
+ reportSceneGraphFrame<FrameType, Record>(position, payload);
s_instance->m_sceneGraphData.timings<SwitchTo>()[0] =
- s_instance->m_sceneGraphData.timings<FrameType>()
- [s_instance->m_sceneGraphData.offset<FrameType>()];
+ s_instance->m_sceneGraphData.timings<FrameType>()[position];
}
template<PixmapEventType PixmapState>
@@ -326,38 +363,52 @@ protected:
#define Q_QUICK_PROFILE(feature, Method)\
Q_QUICK_PROFILE_IF_ENABLED(feature, QQuickProfiler::Method)
+// Record current timestamp for \a Type at position 0.
#define Q_QUICK_SG_PROFILE_START(Type)\
Q_QUICK_PROFILE_IF_ENABLED(QQuickProfiler::ProfileSceneGraph,\
(QQuickProfiler::startSceneGraphFrame<Type>()))
-#define Q_QUICK_SG_PROFILE_RECORD(Type)\
+// Record current timestamp for \a Type at \a position.
+#define Q_QUICK_SG_PROFILE_RECORD(Type, position)\
Q_QUICK_PROFILE_IF_ENABLED(QQuickProfiler::ProfileSceneGraph,\
- (QQuickProfiler::recordSceneGraphTimestamp<Type>()))
+ (QQuickProfiler::recordSceneGraphTimestamp<Type>(position)))
-#define Q_QUICK_SG_PROFILE_SKIP(Type, Skip)\
+// Use the timestamp for \a Type at position \a position and repeat it \a Skip times in subsequent
+// positions.
+#define Q_QUICK_SG_PROFILE_SKIP(Type, position, Skip)\
Q_QUICK_PROFILE_IF_ENABLED(QQuickProfiler::ProfileSceneGraph,\
- (QQuickProfiler::skipSceneGraphTimestamps<Type, Skip>()))
+ (QQuickProfiler::skipSceneGraphTimestamps<Type, Skip>(position)))
+// Record current timestamp for both \a Type1 and \a Type2 at position 0.
#define Q_QUICK_SG_PROFILE_START_SYNCHRONIZED(Type1, Type2)\
Q_QUICK_PROFILE_IF_ENABLED(QQuickProfiler::ProfileSceneGraph,\
(QQuickProfiler::startSceneGraphFrame<Type1, Type2>()))
-#define Q_QUICK_SG_PROFILE_SWITCH(Type1, Type2) \
+// report \a Type1, using the current timestamp at \a position, and switch to \a Typ2, using
+// the current timestamp at position 0.
+#define Q_QUICK_SG_PROFILE_SWITCH(Type1, Type2, position)\
Q_QUICK_PROFILE_IF_ENABLED(QQuickProfiler::ProfileSceneGraph,\
- (QQuickProfiler::reportSceneGraphFrame<Type1, true, Type2>()))
+ (QQuickProfiler::reportSceneGraphFrame<Type1, true, Type2>(\
+ position)))
-#define Q_QUICK_SG_PROFILE_REPORT(Type)\
+// report \a Type, using data points 0 to \a position, including \a position.
+#define Q_QUICK_SG_PROFILE_REPORT(Type, position)\
Q_QUICK_PROFILE_IF_ENABLED(QQuickProfiler::ProfileSceneGraph,\
- (QQuickProfiler::reportSceneGraphFrame<Type, false>()))
+ (QQuickProfiler::reportSceneGraphFrame<Type, false>(position)))
-#define Q_QUICK_SG_PROFILE_END(Type)\
+// report \a Type, using data points 0 to \a position, including \a position, and setting the
+// timestamp at \a position to the current one.
+#define Q_QUICK_SG_PROFILE_END(Type, position)\
Q_QUICK_PROFILE_IF_ENABLED(QQuickProfiler::ProfileSceneGraph,\
- (QQuickProfiler::reportSceneGraphFrame<Type, true>()))
+ (QQuickProfiler::reportSceneGraphFrame<Type, true>(position)))
-#define Q_QUICK_SG_PROFILE_END_WITH_PAYLOAD(Type, Payload)\
+// report \a Type, using data points 0 to \a position, including \a position, and setting the
+// timestamp at \a position to the current one. Remaining data points up to position 5 are filled
+// with \a Payload.
+#define Q_QUICK_SG_PROFILE_END_WITH_PAYLOAD(Type, position, Payload)\
Q_QUICK_PROFILE_IF_ENABLED(QQuickProfiler::ProfileSceneGraph,\
- (QQuickProfiler::reportSceneGraphFrame<Type, true>(Payload)))
-
+ (QQuickProfiler::reportSceneGraphFrame<Type, true>(position,\
+ Payload)))
#define Q_QUICK_INPUT_PROFILE(Type, DetailType, A, B)\
Q_QUICK_PROFILE_IF_ENABLED(QQuickProfiler::ProfileInputEvents,\
diff --git a/src/quick/util/qquickpropertychanges.cpp b/src/quick/util/qquickpropertychanges.cpp
index 4dfeb7cc4a..fafa2edd0b 100644
--- a/src/quick/util/qquickpropertychanges.cpp
+++ b/src/quick/util/qquickpropertychanges.cpp
@@ -455,14 +455,14 @@ QQuickPropertyChanges::ActionList QQuickPropertyChanges::actions()
QQmlBinding *newBinding = 0;
if (e.id != QQmlBinding::Invalid) {
QV4::Scope scope(QQmlEnginePrivate::getV4Engine(qmlEngine(this)));
- QV4::ScopedValue function(scope, QV4::FunctionObject::createQmlFunction(context, object(), d->compilationUnit->runtimeFunctions.at(e.id)));
+ QV4::Scoped<QV4::QmlContext> qmlContext(scope, QV4::QmlContext::create(scope.engine->rootContext(), context, object()));
newBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core,
- function, object(), context);
+ d->compilationUnit->runtimeFunctions.at(e.id), object(), context, qmlContext);
}
// QQmlBinding *newBinding = e.id != QQmlBinding::Invalid ? QQmlBinding::createBinding(e.id, object(), qmlContext(this)) : 0;
if (!newBinding)
newBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core,
- e.expression, object(), context, e.url.toString(), e.line, e.column);
+ e.expression, object(), context, e.url.toString(), e.line);
if (d->isExplicit) {
// in this case, we don't want to assign a binding, per se,
@@ -629,7 +629,7 @@ void QQuickPropertyChanges::changeExpression(const QString &name, const QString
auto prop = d->property(name);
QQmlBinding *newBinding = QQmlBinding::create(
&QQmlPropertyPrivate::get(prop)->core, expression, object(),
- qmlContext(this));
+ QQmlContextData::get(qmlContext(this)));
newBinding->setTarget(prop);
QQmlPropertyPrivate::setBinding(newBinding, QQmlPropertyPrivate::None, QQmlPropertyData::DontRemoveBinding | QQmlPropertyData::BypassInterceptor);
}
@@ -651,7 +651,7 @@ void QQuickPropertyChanges::changeExpression(const QString &name, const QString
auto prop = d->property(name);
QQmlBinding *newBinding = QQmlBinding::create(
&QQmlPropertyPrivate::get(prop)->core, expression, object(),
- qmlContext(this));
+ QQmlContextData::get(qmlContext(this)));
newBinding->setTarget(prop);
QQmlPropertyPrivate::setBinding(newBinding, QQmlPropertyPrivate::None, QQmlPropertyData::DontRemoveBinding | QQmlPropertyData::BypassInterceptor);
} else {
@@ -664,7 +664,7 @@ void QQuickPropertyChanges::changeExpression(const QString &name, const QString
QQmlBinding *newBinding = QQmlBinding::create(
&QQmlPropertyPrivate::get(action.property)->core, expression,
- object(), qmlContext(this));
+ object(), QQmlContextData::get(qmlContext(this)));
if (d->isExplicit) {
// don't assign the binding, merely evaluate the expression.
// XXX TODO: add a static QQmlJavaScriptExpression::evaluate(QString)
diff --git a/src/quick/util/qquickutilmodule.cpp b/src/quick/util/qquickutilmodule.cpp
index cb586d1565..77dae0d001 100644
--- a/src/quick/util/qquickutilmodule.cpp
+++ b/src/quick/util/qquickutilmodule.cpp
@@ -67,7 +67,7 @@ Q_DECLARE_METATYPE(QKeySequence::StandardKey)
void QQuickUtilModule::defineModule()
{
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
qmlRegisterUncreatableType<QInputMethod>("QtQuick",2,0,"InputMethod",
QInputMethod::tr("InputMethod is an abstract class"));
#endif
@@ -94,7 +94,7 @@ void QQuickUtilModule::defineModule()
qmlRegisterType<QQuickTransition>("QtQuick",2,0,"Transition");
qmlRegisterType<QQuickVector3dAnimation>("QtQuick",2,0,"Vector3dAnimation");
-#ifndef QT_NO_VALIDATOR
+#if QT_CONFIG(validator)
qmlRegisterType<QValidator>();
qmlRegisterType<QQuickIntValidator>("QtQuick",2,0,"IntValidator");
qmlRegisterType<QQuickDoubleValidator>("QtQuick",2,0,"DoubleValidator");
diff --git a/src/quick/util/qquickvalidator.cpp b/src/quick/util/qquickvalidator.cpp
index 67cb6a6c05..015a376603 100644
--- a/src/quick/util/qquickvalidator.cpp
+++ b/src/quick/util/qquickvalidator.cpp
@@ -41,7 +41,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_VALIDATOR
+#if QT_CONFIG(validator)
/*!
\qmltype IntValidator
@@ -221,7 +221,7 @@ void QQuickDoubleValidator::resetLocaleName()
By default, this property contains a regular expression with the pattern .* that matches any string.
*/
-#endif // QT_NO_VALIDATOR
+#endif // validator
QT_END_NAMESPACE
diff --git a/src/quick/util/qquickvalidator_p.h b/src/quick/util/qquickvalidator_p.h
index 97adfb742a..ba188e947a 100644
--- a/src/quick/util/qquickvalidator_p.h
+++ b/src/quick/util/qquickvalidator_p.h
@@ -56,7 +56,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_VALIDATOR
+#if QT_CONFIG(validator)
class Q_AUTOTEST_EXPORT QQuickIntValidator : public QIntValidator
{
Q_OBJECT
@@ -90,7 +90,7 @@ Q_SIGNALS:
QT_END_NAMESPACE
-#ifndef QT_NO_VALIDATOR
+#if QT_CONFIG(validator)
QML_DECLARE_TYPE(QValidator)
QML_DECLARE_TYPE(QQuickIntValidator)
QML_DECLARE_TYPE(QQuickDoubleValidator)
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index 1d617f5098..4ed41a0c6c 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -59,7 +59,7 @@
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/qpa/qplatformintegration.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLFunctions>
#include <QtGui/private/qopenglextensions_p.h>
@@ -76,7 +76,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha);
#endif
@@ -108,7 +108,7 @@ void QQuickWidgetPrivate::init(QQmlEngine* e)
useSoftwareRenderer = true;
if (!useSoftwareRenderer) {
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::RasterGLSurface))
setRenderToTexture();
else
@@ -121,7 +121,7 @@ void QQuickWidgetPrivate::init(QQmlEngine* e)
if (!engine.isNull() && !engine.data()->incubationController())
engine.data()->setIncubationController(offscreenWindow->incubationController());
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
q->setAcceptDrops(true);
#endif
@@ -143,7 +143,7 @@ void QQuickWidgetPrivate::ensureEngine() const
void QQuickWidgetPrivate::invalidateRenderControl()
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (!useSoftwareRenderer) {
if (!context) // this is not an error, could be called before creating the context, or multiple times
return;
@@ -183,7 +183,7 @@ QQuickWidgetPrivate::QQuickWidgetPrivate()
, offscreenWindow(0)
, offscreenSurface(0)
, renderControl(0)
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
, fbo(0)
, resolvedFbo(0)
, context(0)
@@ -206,7 +206,7 @@ QQuickWidgetPrivate::~QQuickWidgetPrivate()
delete renderControl;
delete offscreenWindow;
} else {
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
// context and offscreenSurface are current at this stage, if the context was created.
Q_ASSERT(!context || (QOpenGLContext::currentContext() == context && context->surface() == offscreenSurface));
delete renderControl; // always delete the rendercontrol first
@@ -258,7 +258,7 @@ void QQuickWidgetPrivate::itemGeometryChanged(QQuickItem *resizeItem, QQuickGeom
void QQuickWidgetPrivate::render(bool needsSync)
{
if (!useSoftwareRenderer) {
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
// createFramebufferObject() bails out when the size is empty. In this case
// we cannot render either.
if (!fbo)
@@ -327,7 +327,7 @@ void QQuickWidgetPrivate::renderSceneGraph()
render(true);
-#ifndef QT_NO_GRAPHICSVIEW
+#if QT_CONFIG(graphicsview)
if (q->window()->graphicsProxyWidget())
QWidgetPrivate::nearestGraphicsProxyWidget(q)->update();
else
@@ -343,7 +343,7 @@ void QQuickWidgetPrivate::renderSceneGraph()
QImage QQuickWidgetPrivate::grabFramebuffer()
{
if (!useSoftwareRenderer) {
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (!context)
return QImage();
@@ -835,7 +835,7 @@ void QQuickWidgetPrivate::handleContextCreationFailure(const QSurfaceFormat &for
// Never called by Software Rendering backend
void QQuickWidgetPrivate::createContext()
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
Q_Q(QQuickWidget);
// On hide-show we may invalidate() (when !isPersistentSceneGraph) but our
@@ -886,7 +886,7 @@ void QQuickWidgetPrivate::destroyContext()
{
delete offscreenSurface;
offscreenSurface = 0;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
delete context;
context = 0;
#endif
@@ -914,7 +914,7 @@ void QQuickWidget::createFramebufferObject()
return;
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QOpenGLContext *context = d->offscreenWindow->openglContext();
if (!context) {
@@ -995,7 +995,7 @@ void QQuickWidget::destroyFramebufferObject()
return;
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
delete d->fbo;
d->fbo = 0;
delete d->resolvedFbo;
@@ -1078,7 +1078,7 @@ void QQuickWidgetPrivate::setRootObject(QObject *obj)
}
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
GLuint QQuickWidgetPrivate::textureId() const
{
Q_Q(const QQuickWidget);
@@ -1180,7 +1180,7 @@ void QQuickWidget::resizeEvent(QResizeEvent *e)
createFramebufferObject();
}
} else {
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (d->context) {
// Bail out when receiving a resize after scenegraph invalidation. This can happen
// during hide - resize - show sequences and also during application exit.
@@ -1335,7 +1335,7 @@ void QQuickWidget::mouseReleaseEvent(QMouseEvent *e)
e->setAccepted(mappedEvent.isAccepted());
}
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
/*! \reimp */
void QQuickWidget::wheelEvent(QWheelEvent *e)
{
@@ -1408,14 +1408,14 @@ bool QQuickWidget::event(QEvent *e)
d->offscreenWindow->setScreen(newScreen);
if (d->offscreenSurface)
d->offscreenSurface->setScreen(newScreen);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (d->context)
d->context->setScreen(newScreen);
#endif
}
if (d->useSoftwareRenderer
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
|| d->fbo
#endif
) {
@@ -1442,7 +1442,7 @@ bool QQuickWidget::event(QEvent *e)
return QWidget::event(e);
}
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
/*! \reimp */
void QQuickWidget::dragEnterEvent(QDragEnterEvent *e)
@@ -1477,7 +1477,7 @@ void QQuickWidget::dropEvent(QDropEvent *e)
d->offscreenWindow->event(e);
}
-#endif // QT_NO_DRAGANDDROP
+#endif // draganddrop
// TODO: try to separate the two cases of
// 1. render() unconditionally without sync
@@ -1589,9 +1589,6 @@ QQuickWindow *QQuickWidget::quickWindow() const
return d->offscreenWindow;
}
-QT_END_NAMESPACE
-
-
void QQuickWidget::paintEvent(QPaintEvent *event)
{
Q_UNUSED(event)
@@ -1612,3 +1609,5 @@ void QQuickWidget::paintEvent(QPaintEvent *event)
}
}
}
+
+QT_END_NAMESPACE
diff --git a/src/quickwidgets/qquickwidget.h b/src/quickwidgets/qquickwidget.h
index 56e6b01ac5..2d159778ed 100644
--- a/src/quickwidgets/qquickwidget.h
+++ b/src/quickwidgets/qquickwidget.h
@@ -131,11 +131,11 @@ protected:
void focusInEvent(QFocusEvent * event) override;
void focusOutEvent(QFocusEvent * event) override;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *) override;
#endif
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
void dragEnterEvent(QDragEnterEvent *) override;
void dragMoveEvent(QDragMoveEvent *) override;
void dragLeaveEvent(QDragLeaveEvent *) override;
diff --git a/src/quickwidgets/qquickwidget_p.h b/src/quickwidgets/qquickwidget_p.h
index 0ba86172e6..559321cd51 100644
--- a/src/quickwidgets/qquickwidget_p.h
+++ b/src/quickwidgets/qquickwidget_p.h
@@ -101,7 +101,7 @@ public:
QObject *focusObject() Q_DECL_OVERRIDE;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
GLuint textureId() const Q_DECL_OVERRIDE;
QImage grabFramebuffer() Q_DECL_OVERRIDE;
#else
@@ -126,7 +126,7 @@ public:
QOffscreenSurface *offscreenSurface;
QQuickRenderControl *renderControl;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QOpenGLFramebufferObject *fbo;
QOpenGLFramebufferObject *resolvedFbo;
QOpenGLContext *context;
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index 556f5ddc7a..f25742fb14 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -2,6 +2,7 @@ TEMPLATE=subdirs
SUBDIRS=\
qml \
quick \
+ quicktest \
qmltest \
qmldevtools \
cmake \
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
index c4b17aa60a..692e70d7da 100644
--- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
@@ -618,7 +618,7 @@ void tst_QQmlProfilerService::scenegraphData()
// if the clocks are acting up.
qint64 contextFrameTime = -1;
qint64 renderFrameTime = -1;
-#ifndef QT_NO_OPENGL //Software renderer doesn't have context frames
+#if QT_CONFIG(opengl) //Software renderer doesn't have context frames
foreach (const QQmlProfilerData &msg, m_client->asynchronousMessages) {
if (msg.messageType == QQmlProfilerDefinitions::SceneGraphFrame) {
if (msg.detailType == QQmlProfilerDefinitions::SceneGraphContextFrame) {
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index f6fbb8c37e..82bc3d0c59 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -196,6 +196,8 @@ private slots:
void basicBlockMergeAfterLoopPeeling();
+ void malformedExpression();
+
signals:
void testSignal();
};
@@ -4079,6 +4081,12 @@ void tst_QJSEngine::basicBlockMergeAfterLoopPeeling()
}
+void tst_QJSEngine::malformedExpression()
+{
+ QJSEngine engine;
+ engine.evaluate("5%55555&&5555555\n7-0");
+}
+
QTEST_MAIN(tst_QJSEngine)
#include "tst_qjsengine.moc"
diff --git a/tests/auto/qml/qmlmin/tst_qmlmin.cpp b/tests/auto/qml/qmlmin/tst_qmlmin.cpp
index 7e4a643ffa..3ed0aa7446 100644
--- a/tests/auto/qml/qmlmin/tst_qmlmin.cpp
+++ b/tests/auto/qml/qmlmin/tst_qmlmin.cpp
@@ -86,7 +86,6 @@ void tst_qmlmin::initTestCase()
// Add invalid files (i.e. files with syntax errors)
invalidFiles << "tests/auto/quick/qquickloader/data/InvalidSourceComponent.qml";
- invalidFiles << "tests/auto/qml/qqmllanguage/data/dynamicObjectProperties.2.qml";
invalidFiles << "tests/auto/qml/qqmllanguage/data/signal.2.qml";
invalidFiles << "tests/auto/qml/qqmllanguage/data/signal.3.qml";
invalidFiles << "tests/auto/qml/qqmllanguage/data/signal.5.qml";
diff --git a/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp b/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp
index a401e04020..98b92e5fab 100644
--- a/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp
+++ b/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp
@@ -96,7 +96,7 @@ void tst_qqmlapplicationengine::application()
Note that checking the output means that on builds with extra debugging, this might fail with a false positive.
Also the testapp is automatically built and installed in shadow builds, so it does NOT use testData
*/
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
QDir::setCurrent(buildDir);
QProcess *testProcess = new QProcess(this);
QStringList args;
@@ -114,9 +114,9 @@ void tst_qqmlapplicationengine::application()
QVERIFY(QString(test_stderr).endsWith(QString(test_stderr_target)));
delete testProcess;
QDir::setCurrent(srcDir);
-#else // !QT_NO_PROCESS
+#else // process
QSKIP("No process support");
-#endif // QT_NO_PROCESS
+#endif // process
}
void tst_qqmlapplicationengine::applicationProperties()
diff --git a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
index 723f575330..f2b0b9973e 100644
--- a/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
+++ b/tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
@@ -37,7 +37,9 @@
#include <QtQuick/private/qquickmousearea_p.h>
#include <private/qv8engine_p.h>
#include <private/qqmlcontext_p.h>
+#include <private/qv4qmlcontext_p.h>
#include <private/qv4scopedvalue_p.h>
+#include <private/qv4qmlcontext_p.h>
#include <qcolor.h>
#include "../../shared/util.h"
#include "testhttpserver.h"
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index be04ec2bf3..88a8886ecb 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -36,7 +36,7 @@
#include <QtCore/qnumeric.h>
#include <private/qqmlengine_p.h>
#include <private/qqmlvmemetaobject_p.h>
-#include <private/qqmlcontextwrapper_p.h>
+#include <private/qv4qmlcontext_p.h>
#include "testtypes.h"
#include "testhttpserver.h"
#include "../../shared/util.h"
@@ -3986,7 +3986,7 @@ void tst_qqmlecmascript::verifyContextLifetime(QQmlContextData *ctxt) {
{
QV4::Scope scope(QV8Engine::getV4((engine)));
- QV4::ScopedValue temporaryScope(scope, QV4::QmlContextWrapper::qmlScope(scope.engine, scriptContext, 0));
+ QV4::ScopedContext temporaryScope(scope, QV4::QmlContext::create(scope.engine->rootContext(), scriptContext, 0));
Q_UNUSED(temporaryScope)
}
diff --git a/tests/auto/qml/qqmllanguage/data/dynamicObjectProperties.2.qml b/tests/auto/qml/qqmllanguage/data/dynamicObjectProperties.2.qml
index 319e1f5bc5..f028e5dcac 100644
--- a/tests/auto/qml/qqmllanguage/data/dynamicObjectProperties.2.qml
+++ b/tests/auto/qml/qqmllanguage/data/dynamicObjectProperties.2.qml
@@ -1,7 +1,7 @@
import QtQuick 2.0
import QtQuick 2.0 as Qt47
-Qt.QtObject {
+Qt47.QtObject {
property Qt47.QtObject objectProperty
property list<Qt47.QtObject> objectPropertyList
diff --git a/tests/auto/qml/qqmllanguage/data/namespacedPropertyTypes.qml b/tests/auto/qml/qqmllanguage/data/namespacedPropertyTypes.qml
new file mode 100644
index 0000000000..5ad62edab3
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/namespacedPropertyTypes.qml
@@ -0,0 +1,8 @@
+import QtQuick 2.0 as MyQuick
+
+MyQuick.Item {
+ property MyQuick.Item myProp;
+ property list<MyQuick.Item> myList;
+ default property list<MyQuick.Item> myDefaultList;
+ signal mySignal(MyQuick.Item someItem)
+}
diff --git a/tests/auto/qml/qqmllanguage/testtypes.cpp b/tests/auto/qml/qqmllanguage/testtypes.cpp
index 3af7645ff7..bc8c192a61 100644
--- a/tests/auto/qml/qqmllanguage/testtypes.cpp
+++ b/tests/auto/qml/qqmllanguage/testtypes.cpp
@@ -128,12 +128,11 @@ void CustomBinding::componentComplete()
QQmlContextData *context = QQmlContextData::get(qmlContext(this));
- QV4::Scope scope(QQmlEnginePrivate::getV4Engine(qmlEngine(this)));
- QV4::ScopedValue function(scope, QV4::FunctionObject::createQmlFunction(context, m_target, compilationUnit->runtimeFunctions[bindingId]));
-
QQmlProperty property(m_target, name, qmlContext(this));
+ QV4::Scope scope(QQmlEnginePrivate::getV4Engine(qmlEngine(this)));
+ QV4::Scoped<QV4::QmlContext> qmlContext(scope, QV4::QmlContext::create(scope.engine->rootContext(), context, m_target));
QQmlBinding *qmlBinding = QQmlBinding::create(&QQmlPropertyPrivate::get(property)->core,
- function, m_target, context);
+ compilationUnit->runtimeFunctions[bindingId], m_target, context, qmlContext);
qmlBinding->setTarget(property);
QQmlPropertyPrivate::setBinding(property, qmlBinding);
}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 658b4f5852..f586f7d429 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -255,6 +255,7 @@ private slots:
void arrayBuffer();
void defaultListProperty();
+ void namespacedPropertyTypes();
private:
QQmlEngine engine;
@@ -1397,7 +1398,6 @@ void tst_qqmllanguage::dynamicObjectProperties()
}
{
QQmlComponent component(&engine, testFileUrl("dynamicObjectProperties.2.qml"));
- QEXPECT_FAIL("", "QTBUG-10822", Abort);
VERIFY_ERRORS(0);
QObject *object = component.create();
QVERIFY(object != 0);
@@ -4242,6 +4242,14 @@ void tst_qqmllanguage::defaultListProperty()
QScopedPointer<QObject> o(component.create());
}
+void tst_qqmllanguage::namespacedPropertyTypes()
+{
+ QQmlComponent component(&engine, testFileUrl("namespacedPropertyTypes.qml"));
+ VERIFY_ERRORS(0);
+ QScopedPointer<QObject> o(component.create());
+ QVERIFY(!o.isNull());
+}
+
QTEST_MAIN(tst_qqmllanguage)
#include "tst_qqmllanguage.moc"
diff --git a/tests/auto/qml/qqmllistmodel/data/bindingsOnGetResult.qml b/tests/auto/qml/qqmllistmodel/data/bindingsOnGetResult.qml
new file mode 100644
index 0000000000..6bf750dcda
--- /dev/null
+++ b/tests/auto/qml/qqmllistmodel/data/bindingsOnGetResult.qml
@@ -0,0 +1,27 @@
+import QtQuick 2.0
+
+QtObject {
+ property ListModel model: ListModel {
+ ListElement { modified: false }
+ ListElement { modified: false }
+ ListElement { modified: false }
+ ListElement { modified: false }
+ ListElement { modified: false }
+ }
+
+ property bool isModified: {
+ for (var i = 0; i < model.count; ++i) {
+ if (model.get(i).modified)
+ return true;
+ }
+ return false;
+ }
+
+ property bool success: false
+ Component.onCompleted: {
+ // trigger read and setup of property captures
+ success = isModified
+ model.setProperty(0, "modified", true)
+ success = isModified
+ }
+}
diff --git a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
index cd497cbd79..555ca5713e 100644
--- a/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
+++ b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
@@ -122,6 +122,7 @@ private slots:
void datetime_data();
void about_to_be_signals();
void modify_through_delegate();
+ void bindingsOnGetResult();
};
bool tst_qqmllistmodel::compareVariantList(const QVariantList &testList, QVariant object)
@@ -1469,6 +1470,18 @@ void tst_qqmllistmodel::modify_through_delegate()
QCOMPARE(model->data(model->index(1, 0, QModelIndex()), roleNames.key("age")).toInt(), 18);
}
+void tst_qqmllistmodel::bindingsOnGetResult()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("bindingsOnGetResult.qml"));
+ QVERIFY2(!component.isError(), qPrintable(component.errorString()));
+
+ QScopedPointer<QObject> obj(component.create());
+ QVERIFY(!obj.isNull());
+
+ QVERIFY(obj->property("success").toBool());
+}
+
QTEST_MAIN(tst_qqmllistmodel)
#include "tst_qqmllistmodel.moc"
diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
index fe73610bcc..385ffc523a 100644
--- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
+++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp
@@ -157,7 +157,7 @@ void tst_qqmlproperty::qmlmetaproperty()
QObject *obj = new QObject;
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(nullptr, QLatin1String("null"), 0, engine.rootContext()));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(nullptr, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
QVERIFY(binding);
QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(obj, QObjectPrivate::get(obj)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
@@ -399,7 +399,7 @@ void tst_qqmlproperty::qmlmetaproperty_object()
{
QQmlProperty prop(&object);
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, engine.rootContext()));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
QVERIFY(binding);
QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&object, QObjectPrivate::get(&object)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
@@ -447,7 +447,7 @@ void tst_qqmlproperty::qmlmetaproperty_object()
{
QQmlProperty prop(&dobject);
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, engine.rootContext()));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
QVERIFY(binding);
QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QObjectPrivate::get(&dobject)->signalIndex("clicked()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
@@ -504,7 +504,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
{
QQmlProperty prop(&object, QString("defaultProperty"));
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, engine.rootContext()));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
QVERIFY(binding);
QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&object, QObjectPrivate::get(&object)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
@@ -552,7 +552,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
{
QQmlProperty prop(&dobject, QString("defaultProperty"));
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, engine.rootContext()));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
QVERIFY(binding);
QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QObjectPrivate::get(&dobject)->signalIndex("clicked()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
@@ -603,7 +603,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
{
QQmlProperty prop(&dobject, QString("onClicked"));
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, engine.rootContext()));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
QVERIFY(binding);
QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QQmlPropertyPrivate::get(prop)->signalIndex(), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
@@ -653,7 +653,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_string()
{
QQmlProperty prop(&dobject, QString("onPropertyWithNotifyChanged"));
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, engine.rootContext()));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
QVERIFY(binding);
QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QQmlPropertyPrivate::get(prop)->signalIndex(), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
@@ -709,7 +709,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_context()
{
QQmlProperty prop(&object, engine.rootContext());
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, engine.rootContext()));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
QVERIFY(binding);
QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&object, QObjectPrivate::get(&object)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
@@ -757,7 +757,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_context()
{
QQmlProperty prop(&dobject, engine.rootContext());
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, engine.rootContext()));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
QVERIFY(binding);
QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QObjectPrivate::get(&dobject)->signalIndex("clicked()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
@@ -814,7 +814,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
{
QQmlProperty prop(&object, QString("defaultProperty"), engine.rootContext());
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, engine.rootContext()));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
QVERIFY(binding);
QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&object, QObjectPrivate::get(&object)->signalIndex("destroyed()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
QQmlJavaScriptExpression::DeleteWatcher sigExprWatcher(sigExpr);
@@ -862,7 +862,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
{
QQmlProperty prop(&dobject, QString("defaultProperty"), engine.rootContext());
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, engine.rootContext()));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
QVERIFY(binding);
QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QObjectPrivate::get(&dobject)->signalIndex("clicked()"), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
@@ -913,7 +913,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
{
QQmlProperty prop(&dobject, QString("onClicked"), engine.rootContext());
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, engine.rootContext()));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
QVERIFY(binding);
QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QQmlPropertyPrivate::get(prop)->signalIndex(), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
@@ -963,7 +963,7 @@ void tst_qqmlproperty::qmlmetaproperty_object_string_context()
{
QQmlProperty prop(&dobject, QString("onPropertyWithNotifyChanged"), engine.rootContext());
- QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, engine.rootContext()));
+ QQmlAbstractBinding::Ptr binding(QQmlBinding::create(&QQmlPropertyPrivate::get(prop)->core, QLatin1String("null"), 0, QQmlContextData::get(engine.rootContext())));
static_cast<QQmlBinding *>(binding.data())->setTarget(prop);
QVERIFY(binding);
QQmlBoundSignalExpression *sigExpr = new QQmlBoundSignalExpression(&dobject, QQmlPropertyPrivate::get(prop)->signalIndex(), QQmlContextData::get(engine.rootContext()), 0, QLatin1String("null"), QString(), -1, -1);
diff --git a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
index 803bad197a..163ce11cb8 100644
--- a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
+++ b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
@@ -91,6 +91,7 @@ private slots:
void gadgetInheritance();
void toStringConversion();
void enumerableProperties();
+ void enumProperties();
private:
QQmlEngine engine;
@@ -322,7 +323,7 @@ void tst_qqmlvaluetypes::locale()
QScopedPointer<QObject> object(component.create());
QVERIFY(!object.isNull());
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
QVERIFY(QQml_guiProvider()->inputMethod());
QInputMethod *inputMethod = qobject_cast<QInputMethod*>(QQml_guiProvider()->inputMethod());
QLocale locale = inputMethod->locale();
@@ -349,7 +350,7 @@ void tst_qqmlvaluetypes::locale()
}
QCOMPARE(weekDays, locale.weekdays());
QCOMPARE(object->property("zeroDigit").toString().at(0), locale.zeroDigit());
-#endif // QT_NO_IM
+#endif // im
}
}
@@ -1703,6 +1704,39 @@ void tst_qqmlvaluetypes::enumerableProperties()
QVERIFY(names.contains(QStringLiteral("derivedProperty")));
}
+struct GadgetWithEnum
+{
+ Q_GADGET
+public:
+
+ enum MyEnum { FirstValue, SecondValue };
+
+ Q_ENUM(MyEnum)
+ Q_PROPERTY(MyEnum enumProperty READ enumProperty)
+
+ MyEnum enumProperty() const { return SecondValue; }
+};
+
+void tst_qqmlvaluetypes::enumProperties()
+{
+ QJSEngine engine;
+
+ // When creating the property cache for the gadget when MyEnum is _not_ a registered
+ // meta-type, then QMetaProperty::type() will return QMetaType::Int and consequently
+ // property-read meta-calls will return an int (as expected in this test). However if we
+ // explicitly register the gadget, then QMetaProperty::type() will return the user-type
+ // and QQmlValueTypeWrapper should still handle that and return an integer/number for the
+ // enum property when it is read.
+ qRegisterMetaType<GadgetWithEnum::MyEnum>();
+
+ GadgetWithEnum g;
+ QJSValue value = engine.toScriptValue(g);
+
+ QJSValue enumValue = value.property("enumProperty");
+ QVERIFY(enumValue.isNumber());
+ QCOMPARE(enumValue.toInt(), int(g.enumProperty()));
+}
+
QTEST_MAIN(tst_qqmlvaluetypes)
diff --git a/tests/auto/quick/examples/tst_examples.cpp b/tests/auto/quick/examples/tst_examples.cpp
index 872a71011d..1ca809c05f 100644
--- a/tests/auto/quick/examples/tst_examples.cpp
+++ b/tests/auto/quick/examples/tst_examples.cpp
@@ -103,7 +103,7 @@ tst_examples::tst_examples()
excludedFiles << "views/visualdatamodel/slideshow.qml";
#endif
-#ifdef QT_NO_OPENGL
+#if !QT_CONFIG(opengl)
//No support for Particles
excludedFiles << "examples/qml/dynamicscene/dynamicscene.qml";
excludedFiles << "examples/quick/animation/basics/color-animation.qml";
diff --git a/tests/auto/quick/nokeywords/tst_nokeywords.cpp b/tests/auto/quick/nokeywords/tst_nokeywords.cpp
index 6c94b484ae..ad77743ddd 100644
--- a/tests/auto/quick/nokeywords/tst_nokeywords.cpp
+++ b/tests/auto/quick/nokeywords/tst_nokeywords.cpp
@@ -48,7 +48,7 @@
#include <QtQuick/private/qsgadaptationlayer_p.h>
#include <QtQuick/private/qsgcontext_p.h>
#include <QtQuick/private/qsgcontextplugin_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <QtQuick/private/qsgdefaultdistancefieldglyphcache_p.h>
#include <QtQuick/private/qsgdefaultglyphnode_p.h>
#include <QtQuick/private/qsgdefaultinternalimagenode_p.h>
diff --git a/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp b/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
index 5d242fab9e..71b0160c8e 100644
--- a/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
+++ b/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
@@ -76,7 +76,7 @@ private slots:
void statusChanges_data();
void sourceSizeChanges();
void progressAndStatusChanges();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void borderImageMesh();
#endif
@@ -583,7 +583,7 @@ void tst_qquickborderimage::progressAndStatusChanges()
delete obj;
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void tst_qquickborderimage::borderImageMesh()
{
QQuickView *window = new QQuickView;
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index b774481592..942e99018f 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -1225,7 +1225,7 @@ void tst_qquickflickable::flickOnRelease()
QTRY_VERIFY(!flickable->isMoving());
#ifdef Q_OS_MAC
-# ifndef QT_NO_OPENGL
+# if QT_CONFIG(opengl)
QEXPECT_FAIL("", "QTBUG-26094 stopping on a full pixel doesn't work on OS X", Continue);
# endif
#endif
diff --git a/tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp b/tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp
index 256fa43d2e..650892d650 100644
--- a/tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp
+++ b/tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp
@@ -35,7 +35,7 @@
#include "../../shared/util.h"
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <QtGui/qopenglcontext.h>
#include <QtGui/qsurfaceformat.h>
#endif
@@ -67,7 +67,7 @@ void tst_QQuickGraphicsInfo::testProperties()
QCOMPARE(obj->property("api").toInt(), expectedAPI);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (expectedAPI == QSGRendererInterface::OpenGL) {
QCOMPARE(obj->property("shaderType").toInt(), int(QSGRendererInterface::GLSL));
QVERIFY(view.openglContext());
diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
index 78322b44a1..cc74b7e07d 100644
--- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
@@ -3133,7 +3133,7 @@ void tst_QQuickItem::parentLoop()
{
QQuickView *window = new QQuickView(0);
-#ifndef QT_NO_REGULAREXPRESSION
+#if QT_CONFIG(regularexpression)
QRegularExpression msgRegexp = QRegularExpression("QQuickItem::setParentItem: Parent QQuickItem\\(.*\\) is already part of the subtree of QQuickItem\\(.*\\)");
QTest::ignoreMessage(QtWarningMsg, msgRegexp);
#endif
@@ -3304,7 +3304,7 @@ void tst_QQuickItem::grab()
QVERIFY(root);
QQuickItem *item = root->findChild<QQuickItem *>("myItem");
QVERIFY(item);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
{ // Default size (item is 100x100)
QSharedPointer<QQuickItemGrabResult> result = item->grabToImage();
QSignalSpy spy(result.data(), SIGNAL(ready()));
diff --git a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp
index 2576a1b0fc..44310008d6 100644
--- a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp
+++ b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp
@@ -61,7 +61,7 @@ private slots:
void initTestCase() Q_DECL_OVERRIDE;
void layerEnabled();
void layerSmooth();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void layerMipmap();
void layerEffect();
#endif
@@ -105,7 +105,7 @@ tst_QQuickItemLayer::tst_QQuickItemLayer()
void tst_QQuickItemLayer::initTestCase()
{
QQmlDataTest::initTestCase();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QWindow window;
QOpenGLContext context;
window.setSurfaceType(QWindow::OpenGLSurface);
@@ -177,7 +177,7 @@ void tst_QQuickItemLayer::layerEnabled()
QVERIFY(fb.pixel(0, 0) != fb.pixel(0, fb.height() - 1));
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
// The test draws a one pixel wide line and scales it down by more than a a factor 2
// If mipmpping works, the pixels should be gray, not white or black
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
index b0d903908f..61ba2caaf7 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -2373,7 +2373,7 @@ void tst_QQuickListView::sectionsPositioning()
QTRY_COMPARE(item->y(), qreal(i*20*6));
}
- QTRY_VERIFY(topItem = findVisibleChild(contentItem, "sect_aaa")); // section header
+ QTRY_VERIFY((topItem = findVisibleChild(contentItem, "sect_aaa"))); // section header
QCOMPARE(topItem->y(), 10.);
// remove section boundary
@@ -2389,7 +2389,8 @@ void tst_QQuickListView::sectionsPositioning()
QTRY_COMPARE(item->y(), qreal(i*20*6));
}
- QVERIFY(topItem = findVisibleChild(contentItem, "sect_1"));
+ topItem = findVisibleChild(contentItem, "sect_1");
+ QVERIFY(topItem);
QTRY_COMPARE(topItem->y(), 120.);
// Change the next section
@@ -2974,31 +2975,38 @@ void tst_QQuickListView::itemListFlicker()
QTRY_COMPARE(model->count(), 3);
QTRY_COMPARE(listview->currentIndex(), 0);
- QQuickItem *item;
-
- QVERIFY(item = findItem<QQuickItem>(contentItem, "item1"));
+ QQuickItem *item = findItem<QQuickItem>(contentItem, "item1");
+ QVERIFY(item);
QVERIFY(delegateVisible(item));
- QVERIFY(item = findItem<QQuickItem>(contentItem, "item2"));
+ item = findItem<QQuickItem>(contentItem, "item2");
+ QVERIFY(item);
QVERIFY(delegateVisible(item));
- QVERIFY(item = findItem<QQuickItem>(contentItem, "item3"));
+ item = findItem<QQuickItem>(contentItem, "item3");
+ QVERIFY(item);
QVERIFY(delegateVisible(item));
listview->setCurrentIndex(1);
- QVERIFY(item = findItem<QQuickItem>(contentItem, "item1"));
+ item = findItem<QQuickItem>(contentItem, "item1");
+ QVERIFY(item);
QVERIFY(delegateVisible(item));
- QVERIFY(item = findItem<QQuickItem>(contentItem, "item2"));
+ item = findItem<QQuickItem>(contentItem, "item2");
+ QVERIFY(item);
QVERIFY(delegateVisible(item));
- QVERIFY(item = findItem<QQuickItem>(contentItem, "item3"));
+ item = findItem<QQuickItem>(contentItem, "item3");
+ QVERIFY(item);
QVERIFY(delegateVisible(item));
listview->setCurrentIndex(2);
- QVERIFY(item = findItem<QQuickItem>(contentItem, "item1"));
+ item = findItem<QQuickItem>(contentItem, "item1");
+ QVERIFY(item);
QVERIFY(delegateVisible(item));
- QVERIFY(item = findItem<QQuickItem>(contentItem, "item2"));
+ item = findItem<QQuickItem>(contentItem, "item2");
+ QVERIFY(item);
QVERIFY(delegateVisible(item));
- QVERIFY(item = findItem<QQuickItem>(contentItem, "item3"));
+ item = findItem<QQuickItem>(contentItem, "item3");
+ QVERIFY(item);
QVERIFY(delegateVisible(item));
}
@@ -5335,14 +5343,17 @@ void tst_QQuickListView::creationContext()
QVERIFY(rootItem);
QVERIFY(rootItem->property("count").toInt() > 0);
- QQuickItem *item;
- QVERIFY(item = findItem<QQuickItem>(rootItem, "listItem"));
+ QQuickItem *item = findItem<QQuickItem>(rootItem, "listItem");
+ QVERIFY(item);
QCOMPARE(item->property("text").toString(), QString("Hello!"));
- QVERIFY(item = rootItem->findChild<QQuickItem *>("header"));
+ item = rootItem->findChild<QQuickItem *>("header");
+ QVERIFY(item);
QCOMPARE(item->property("text").toString(), QString("Hello!"));
- QVERIFY(item = rootItem->findChild<QQuickItem *>("footer"));
+ item = rootItem->findChild<QQuickItem *>("footer");
+ QVERIFY(item);
QCOMPARE(item->property("text").toString(), QString("Hello!"));
- QVERIFY(item = rootItem->findChild<QQuickItem *>("section"));
+ item = rootItem->findChild<QQuickItem *>("section");
+ QVERIFY(item);
QCOMPARE(item->property("text").toString(), QString("Hello!"));
}
@@ -5604,42 +5615,49 @@ void tst_QQuickListView::unrequestedVisibility()
QVERIFY(QTest::qWaitForWindowExposed(window));
- QQuickListView *leftview = findItem<QQuickListView>(window->rootObject(), "leftList");
- QTRY_VERIFY(leftview != 0);
+ QQuickListView *leftview;
+ QTRY_VERIFY((leftview = findItem<QQuickListView>(window->rootObject(), "leftList")));
- QQuickListView *rightview = findItem<QQuickListView>(window->rootObject(), "rightList");
- QTRY_VERIFY(rightview != 0);
+ QQuickListView *rightview;
+ QTRY_VERIFY((rightview = findItem<QQuickListView>(window->rootObject(), "rightList")));
QQuickItem *leftContent = leftview->contentItem();
- QTRY_VERIFY(leftContent != 0);
+ QTRY_VERIFY((leftContent = leftview->contentItem()));
- QQuickItem *rightContent = rightview->contentItem();
- QTRY_VERIFY(rightContent != 0);
+ QQuickItem *rightContent;
+ QTRY_VERIFY((rightContent = rightview->contentItem()));
rightview->setCurrentIndex(20);
QTRY_COMPARE(leftview->contentY(), 0.0);
QTRY_COMPARE(rightview->contentY(), 100.0);
- QQuickItem *item;
-
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 1));
+ const QString wrapperObjectName = QStringLiteral("wrapper");
+ QQuickItem *item = findItem<QQuickItem>(leftContent, wrapperObjectName, 1);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 1));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 1);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 19));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 19);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 19));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 19);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 16));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 16);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 17));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 17);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 3));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 3);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 4));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 4);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
rightview->setCurrentIndex(0);
@@ -5647,106 +5665,139 @@ void tst_QQuickListView::unrequestedVisibility()
QTRY_COMPARE(leftview->contentY(), 0.0);
QTRY_COMPARE(rightview->contentY(), 0.0);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 1));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 1);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 1));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 1);
+ QVERIFY(item);
QTRY_COMPARE(delegateVisible(item), true);
- QVERIFY(!findItem<QQuickItem>(leftContent, "wrapper", 19));
- QVERIFY(!findItem<QQuickItem>(rightContent, "wrapper", 19));
+ QVERIFY(!findItem<QQuickItem>(leftContent, wrapperObjectName, 19));
+ QVERIFY(!findItem<QQuickItem>(rightContent, wrapperObjectName, 19));
leftview->setCurrentIndex(20);
QTRY_COMPARE(leftview->contentY(), 100.0);
QTRY_COMPARE(rightview->contentY(), 0.0);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 1));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 1);
+ QVERIFY(item);
QTRY_COMPARE(delegateVisible(item), false);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 1));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 1);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 19));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 19);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 19));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 19);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 3));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 3);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 4));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 4);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 16));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 16);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 17));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 17);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
model.moveItems(19, 1, 1);
QTRY_COMPARE(QQuickItemPrivate::get(leftview)->polishScheduled, false);
- QTRY_VERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 1));
+ QTRY_VERIFY((item = findItem<QQuickItem>(leftContent, wrapperObjectName, 1)));
QCOMPARE(delegateVisible(item), false);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 1));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 1);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 19));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 19);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 19));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 19);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 4));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 4);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 5));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 5);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 16));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 16);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 17));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 17);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
model.moveItems(3, 4, 1);
QTRY_COMPARE(QQuickItemPrivate::get(leftview)->polishScheduled, false);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 4));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 4);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 5));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 5);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 16));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 16);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 17));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 17);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
model.moveItems(4, 3, 1);
QTRY_COMPARE(QQuickItemPrivate::get(leftview)->polishScheduled, false);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 4));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 4);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 5));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 5);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 16));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 16);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 17));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 17);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
model.moveItems(16, 17, 1);
QTRY_COMPARE(QQuickItemPrivate::get(leftview)->polishScheduled, false);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 4));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 4);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 5));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 5);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 16));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 16);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 17));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 17);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
model.moveItems(17, 16, 1);
QTRY_COMPARE(QQuickItemPrivate::get(leftview)->polishScheduled, false);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 4));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 4);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
- QVERIFY(item = findItem<QQuickItem>(leftContent, "wrapper", 5));
+ item = findItem<QQuickItem>(leftContent, wrapperObjectName, 5);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 16));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 16);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(rightContent, "wrapper", 17));
+ item = findItem<QQuickItem>(rightContent, wrapperObjectName, 17);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
delete window;
@@ -7249,14 +7300,14 @@ void tst_QQuickListView::displayMargin()
QQuickItem *content = listview->contentItem();
QVERIFY(content != 0);
- QQuickItem *item0;
- QQuickItem *item14;
-
- QVERIFY(item0 = findItem<QQuickItem>(content, "delegate", 0));
+ QQuickItem *item0 = findItem<QQuickItem>(content, "delegate", 0);
+ QVERIFY(item0);
QCOMPARE(delegateVisible(item0), true);
// the 14th item should be within the end margin
- QVERIFY(item14 = findItem<QQuickItem>(content, "delegate", 13));
+
+ QQuickItem *item14 = findItem<QQuickItem>(content, "delegate", 13);
+ QVERIFY(item14);
QCOMPARE(delegateVisible(item14), true);
// the 15th item should be outside the end margin
@@ -7273,7 +7324,6 @@ void tst_QQuickListView::displayMargin()
void tst_QQuickListView::negativeDisplayMargin()
{
- QQuickItem *item;
QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("negativeDisplayMargin.qml"));
window->show();
@@ -7289,22 +7339,26 @@ void tst_QQuickListView::negativeDisplayMargin()
QQuickItem *content = innerList->contentItem();
QVERIFY(content != 0);
- QVERIFY(item = findItem<QQuickItem>(content, "delegate", 0));
+ QQuickItem *item = findItem<QQuickItem>(content, "delegate", 0);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(content, "delegate", 7));
+ item = findItem<QQuickItem>(content, "delegate", 7);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), true);
- QVERIFY(item = findItem<QQuickItem>(content, "delegate", 8));
+ item = findItem<QQuickItem>(content, "delegate", 8);
+ QVERIFY(item);
QCOMPARE(delegateVisible(item), false);
// Flick until contentY means that delegate8 should be visible
listview->setProperty("contentY", 500);
- QVERIFY(item = findItem<QQuickItem>(content, "delegate", 8));
+ item = findItem<QQuickItem>(content, "delegate", 8);
+ QVERIFY(item);
QTRY_COMPARE(delegateVisible(item), true);
listview->setProperty("contentY", 1000);
- QTRY_VERIFY(item = findItem<QQuickItem>(content, "delegate", 14));
+ QTRY_VERIFY((item = findItem<QQuickItem>(content, "delegate", 14)));
QTRY_COMPARE(delegateVisible(item), true);
listview->setProperty("contentY", 0);
diff --git a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
index f22528a8a0..e1f903123b 100644
--- a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
+++ b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
@@ -59,7 +59,7 @@ static bool initView(QQuickView &v, const QUrl &url, bool moveMouseOut, QByteArr
const QSize size = v.size();
const QPoint offset = QPoint(size.width() / 2, size.height() / 2);
v.setFramePosition(screenGeometry.center() - offset);
-#ifndef QT_NO_CURSOR // Get the cursor out of the way.
+#if QT_CONFIG(cursor) // Get the cursor out of the way.
if (moveMouseOut)
QCursor::setPos(v.geometry().topRight() + QPoint(100, 100));
#else
@@ -116,7 +116,7 @@ private slots:
void pressedMultipleButtons_data();
void pressedMultipleButtons();
void changeAxis();
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
void cursorShape();
#endif
void moveAndReleaseWithoutPress();
@@ -1692,7 +1692,7 @@ void tst_QQuickMouseArea::changeAxis()
QCOMPARE(blackRect->y(), 94.0);
}
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
void tst_QQuickMouseArea::cursorShape()
{
QQmlEngine engine;
diff --git a/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp b/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp
index 44d7b40ed9..1716bdeafb 100644
--- a/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp
+++ b/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp
@@ -32,7 +32,7 @@
#include <QtQuick/qquickview.h>
#include <private/qquickitem_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <private/qsgdefaultpainternode_p.h>
#else
#include <private/qsgsoftwarepainternode_p.h>
@@ -73,7 +73,7 @@ public:
++paintRequests;
clipRect = painter->clipBoundingRect();
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data)
{
paintNode = static_cast<QSGDefaultPainterNode *>(QQuickPaintedItem::updatePaintNode(oldNode, data));
diff --git a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
index d013d190ec..ba3d182efc 100644
--- a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
+++ b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
@@ -1633,8 +1633,8 @@ void tst_QQuickPathView::creationContext()
QVERIFY(rootItem);
QVERIFY(rootItem->property("count").toInt() > 0);
- QQuickItem *item;
- QVERIFY(item = findItem<QQuickItem>(rootItem, "listItem", 0));
+ QQuickItem *item = findItem<QQuickItem>(rootItem, "listItem", 0);
+ QVERIFY(item);
QCOMPARE(item->property("text").toString(), QString("Hello!"));
}
@@ -1685,7 +1685,8 @@ void tst_QQuickPathView::currentOffsetOnInsertion()
QCOMPARE(currentIndexSpy.count(), 1);
// currentIndex is now 1
- QVERIFY(item = findItem<QQuickRectangle>(pathview, "wrapper", 1));
+ item = findItem<QQuickRectangle>(pathview, "wrapper", 1);
+ QVERIFY(item);
// verify that current item (item 1) is still at offset 0.5
QCOMPARE(item->position() + offset, start);
@@ -1697,7 +1698,8 @@ void tst_QQuickPathView::currentOffsetOnInsertion()
QCOMPARE(currentIndexSpy.count(), 2);
// currentIndex is now 2
- QVERIFY(item = findItem<QQuickRectangle>(pathview, "wrapper", 2));
+ item = findItem<QQuickRectangle>(pathview, "wrapper", 2);
+ QVERIFY(item);
// verify that current item (item 2) is still at offset 0.5
QCOMPARE(item->position() + offset, start);
@@ -1709,7 +1711,8 @@ void tst_QQuickPathView::currentOffsetOnInsertion()
QCOMPARE(currentIndexSpy.count(), 3);
// currentIndex is now 1
- QVERIFY(item = findItem<QQuickRectangle>(pathview, "wrapper", 1));
+ item = findItem<QQuickRectangle>(pathview, "wrapper", 1);
+ QVERIFY(item);
// verify that current item (item 1) is still at offset 0.5
QCOMPARE(item->position() + offset, start);
diff --git a/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp b/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
index 80c6c9e553..e854a109a1 100644
--- a/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
+++ b/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
@@ -35,7 +35,7 @@
#include "testhttpserver.h"
#include <QtNetwork/QNetworkConfigurationManager>
-#ifndef QT_NO_CONCURRENT
+#if QT_CONFIG(concurrent)
#include <qtconcurrentrun.h>
#include <qfuture.h>
#endif
@@ -57,7 +57,7 @@ private slots:
void massive();
void cancelcrash();
void shrinkcache();
-#ifndef QT_NO_CONCURRENT
+#if QT_CONFIG(concurrent)
void networkCrash();
#endif
void lockingCrash();
@@ -105,7 +105,7 @@ void tst_qquickpixmapcache::initTestCase()
QVERIFY2(server.listen(), qPrintable(server.errorString()));
-#ifndef QT_NO_BEARERMANAGEMENT
+#if QT_CONFIG(bearermanagement)
// This avoids a race condition/deadlock bug in network config
// manager when it is accessed by the HTTP server thread before
// anything else. Bug report can be found at:
@@ -372,7 +372,7 @@ void tst_qquickpixmapcache::shrinkcache()
}
}
-#ifndef QT_NO_CONCURRENT
+#if QT_CONFIG(concurrent)
void createNetworkServer(TestHTTPServer *server)
{
@@ -382,7 +382,7 @@ void createNetworkServer(TestHTTPServer *server)
eventLoop.exec();
}
-#ifndef QT_NO_CONCURRENT
+#if QT_CONFIG(concurrent)
// QT-3957
void tst_qquickpixmapcache::networkCrash()
{
diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
index 30d1079df9..ac57a05176 100644
--- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
+++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
@@ -143,7 +143,7 @@ private slots:
void cursorDelegateHeight();
void navigation();
void readOnly();
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void copyAndPaste();
void canPaste();
void canPasteEmpty();
@@ -153,7 +153,7 @@ private slots:
void inputMethodUpdate();
void openInputPanel();
void geometrySignals();
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void pastingRichText_QTBUG_14003();
#endif
void implicitSize_data();
@@ -2923,7 +2923,7 @@ void tst_qquicktextedit::navigation()
QCOMPARE(input->hasActiveFocus(), false);
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextedit::copyAndPaste()
{
if (!PlatformQuirks::isClipboardAvailable())
@@ -3000,7 +3000,7 @@ void tst_qquicktextedit::copyAndPaste()
}
#endif
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextedit::canPaste()
{
QGuiApplication::clipboard()->setText("Some text");
@@ -3018,7 +3018,7 @@ void tst_qquicktextedit::canPaste()
}
#endif
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextedit::canPasteEmpty()
{
QGuiApplication::clipboard()->clear();
@@ -3036,7 +3036,7 @@ void tst_qquicktextedit::canPasteEmpty()
}
#endif
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextedit::middleClickPaste()
{
if (!PlatformQuirks::isClipboardAvailable())
@@ -3338,7 +3338,7 @@ void tst_qquicktextedit::geometrySignals()
delete o;
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextedit::pastingRichText_QTBUG_14003()
{
QString componentStr = "import QtQuick 2.0\nTextEdit { textFormat: TextEdit.PlainText }";
diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
index 8dc3053d89..1451f8e2fc 100644
--- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
+++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
@@ -145,7 +145,7 @@ private slots:
void cursorRectangle();
void navigation();
void navigation_RTL();
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void copyAndPaste();
void copyAndPasteKeySequence();
void canPasteEmpty();
@@ -2532,7 +2532,7 @@ void tst_qquicktextinput::navigation_RTL()
QVERIFY(input->hasActiveFocus());
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextinput::copyAndPaste()
{
if (!PlatformQuirks::isClipboardAvailable())
@@ -2630,7 +2630,7 @@ void tst_qquicktextinput::copyAndPaste()
}
#endif
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextinput::copyAndPasteKeySequence()
{
if (!PlatformQuirks::isClipboardAvailable())
@@ -2698,7 +2698,7 @@ void tst_qquicktextinput::copyAndPasteKeySequence()
}
#endif
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextinput::canPasteEmpty()
{
QGuiApplication::clipboard()->clear();
@@ -2714,7 +2714,7 @@ void tst_qquicktextinput::canPasteEmpty()
}
#endif
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextinput::canPaste()
{
QGuiApplication::clipboard()->setText("Some text");
@@ -2730,7 +2730,7 @@ void tst_qquicktextinput::canPaste()
}
#endif
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextinput::middleClickPaste()
{
if (!PlatformQuirks::isClipboardAvailable())
@@ -3052,7 +3052,7 @@ void tst_qquicktextinput::cursorRectangle_data()
<< false;
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
#define COMPARE_INPUT_METHOD_QUERY(type, input, property, method, result) \
QCOMPARE((type) input->inputMethodQuery(property).method(), result);
#else
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index bfffa6f7f5..300ca392f9 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -284,7 +284,7 @@ public:
private slots:
void cleanup();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void openglContextCreatedSignal();
#endif
void aboutToStopSignal();
@@ -351,7 +351,7 @@ private slots:
void qobjectEventFilter_key();
void qobjectEventFilter_mouse();
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
void cursor();
#endif
@@ -374,14 +374,14 @@ private:
QTouchDevice *touchDevice;
QTouchDevice *touchDeviceWithVelocity;
};
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
Q_DECLARE_METATYPE(QOpenGLContext *);
#endif
void tst_qquickwindow::cleanup()
{
QVERIFY(QGuiApplication::topLevelWindows().isEmpty());
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void tst_qquickwindow::openglContextCreatedSignal()
{
qRegisterMetaType<QOpenGLContext *>();
@@ -1346,7 +1346,7 @@ void tst_qquickwindow::headless()
if (isGL)
QVERIFY(!window->isSceneGraphInitialized());
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (QGuiApplication::platformName() == QLatin1String("windows")
&& QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES) {
QSKIP("Crashes on Windows/ANGLE, QTBUG-42967");
@@ -1534,7 +1534,7 @@ void tst_qquickwindow::ownershipRootItem()
QVERIFY(!accessor->isRootItemDestroyed());
}
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
void tst_qquickwindow::cursor()
{
QQuickWindow window;
@@ -1707,7 +1707,7 @@ void tst_qquickwindow::hideThenDelete()
QTest::qWaitForWindowExposed(&window);
const bool threaded = QQuickWindowPrivate::get(&window)->context->thread() != QGuiApplication::instance()->thread();
const bool isGL = window.rendererInterface()->graphicsApi() == QSGRendererInterface::OpenGL;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (isGL)
openglDestroyed = new QSignalSpy(window.openglContext(), SIGNAL(aboutToBeDestroyed()));
#endif
@@ -1736,7 +1736,7 @@ void tst_qquickwindow::hideThenDelete()
}
QVERIFY(sgInvalidated->size() > 0);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (openglDestroyed)
QVERIFY(openglDestroyed->size() > 0);
#endif
@@ -2147,7 +2147,7 @@ void tst_qquickwindow::defaultSurfaceFormat()
QCOMPARE(format.profile(), reqFmt.profile());
QCOMPARE(int(format.options()), int(reqFmt.options()));
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
// Depth and stencil should be >= what has been requested. For real. But use
// the context since the window's surface format is only partially updated
// on most platforms.
@@ -2202,7 +2202,7 @@ public:
}
static int deleted;
};
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
class GlRenderJob : public QRunnable
{
public:
@@ -2273,7 +2273,7 @@ void tst_qquickwindow::testRenderJob()
QTRY_COMPARE(RenderJob::deleted, 1);
QCOMPARE(completedJobs.size(), 1);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (window.rendererInterface()->graphicsApi() == QSGRendererInterface::OpenGL) {
// Do a synchronized GL job.
GLubyte readPixel[4] = {0, 0, 0, 0};
diff --git a/tests/auto/quick/scenegraph/tst_scenegraph.cpp b/tests/auto/quick/scenegraph/tst_scenegraph.cpp
index f6d624d871..2cd3a041c8 100644
--- a/tests/auto/quick/scenegraph/tst_scenegraph.cpp
+++ b/tests/auto/quick/scenegraph/tst_scenegraph.cpp
@@ -28,7 +28,7 @@
#include <qtest.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <QOffscreenSurface>
#include <QOpenGLContext>
#include <QOpenGLFunctions>
@@ -37,7 +37,7 @@
#include <QtQuick>
#include <QtQml>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <private/qopenglcontext_p.h>
#endif
@@ -105,7 +105,7 @@ private slots:
void render_data();
void render();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void hideWithOtherContext();
#endif
void createTextureFromImage_data();
@@ -130,7 +130,7 @@ void tst_SceneGraph::initTestCase()
QSGRenderLoop *loop = QSGRenderLoop::instance();
qDebug() << "RenderLoop: " << loop;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QOpenGLContext context;
context.setFormat(loop->sceneGraphContext()->defaultSurfaceFormat());
context.create();
@@ -222,7 +222,7 @@ void tst_SceneGraph::manyWindows_data()
QTest::newRow("rects,subwindow,sharing") << QStringLiteral("manyWindows_rects.qml") << false << true;
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
struct ShareContextResetter {
public:
~ShareContextResetter() { qt_gl_set_global_share_context(0); }
@@ -234,7 +234,7 @@ void tst_SceneGraph::manyWindows()
QFETCH(QString, file);
QFETCH(bool, toplevel);
QFETCH(bool, shared);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QOpenGLContext sharedGLContext;
ShareContextResetter cleanup; // To avoid dangling pointer in case of test-failure.
if (shared) {
@@ -479,7 +479,7 @@ void tst_SceneGraph::render()
}
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
// Testcase for QTBUG-34898. We make another context current on another surface
// in the GUI thread and hide the QQuickWindow while the other context is
// current on the other window.
diff --git a/tests/auto/quick/shared/viewtestutil.cpp b/tests/auto/quick/shared/viewtestutil.cpp
index ab58aee648..cb2b8be97a 100644
--- a/tests/auto/quick/shared/viewtestutil.cpp
+++ b/tests/auto/quick/shared/viewtestutil.cpp
@@ -61,7 +61,7 @@ void QQuickViewTestUtil::centerOnScreen(QQuickView *window)
void QQuickViewTestUtil::moveMouseAway(QQuickView *window)
{
-#ifndef QT_NO_CURSOR // Get the cursor out of the way.
+#if QT_CONFIG(cursor) // Get the cursor out of the way.
QCursor::setPos(window->geometry().topRight() + QPoint(100, 100));
#else
Q_UNUSED(window)
diff --git a/tests/auto/quicktest/quicktest.pro b/tests/auto/quicktest/quicktest.pro
new file mode 100644
index 0000000000..3b4ec23a64
--- /dev/null
+++ b/tests/auto/quicktest/quicktest.pro
@@ -0,0 +1,3 @@
+TEMPLATE = subdirs
+SUBDIRS = \
+ signalspy
diff --git a/tests/auto/quicktest/signalspy/data/signalspy.qml b/tests/auto/quicktest/signalspy/data/signalspy.qml
new file mode 100644
index 0000000000..6c365e296a
--- /dev/null
+++ b/tests/auto/quicktest/signalspy/data/signalspy.qml
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtTest 1.1
+import MyImport 1.0
+
+Rectangle {
+ id:rect
+ width: 200
+ height: 200
+ color:"red"
+
+ MouseArea {
+ id: mouseArea
+ anchors.fill: parent
+ }
+
+ MyPropertyMap {
+ id: propertyMap
+ objectName: "propertyMap"
+ }
+
+ SignalSpy {
+ objectName: "mouseSpy"
+ target: mouseArea
+ signalName: "pressed"
+ }
+
+ SignalSpy {
+ objectName: "propertyMapSpy"
+ target: propertyMap
+ signalName: "mySignal"
+ }
+}
diff --git a/tests/auto/quicktest/signalspy/mypropertymap.cpp b/tests/auto/quicktest/signalspy/mypropertymap.cpp
new file mode 100644
index 0000000000..91bd93dde0
--- /dev/null
+++ b/tests/auto/quicktest/signalspy/mypropertymap.cpp
@@ -0,0 +1,38 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "mypropertymap.h"
+
+MyPropertyMap::MyPropertyMap(QObject *parent): QQmlPropertyMap(this, parent)
+{
+}
+
+MyPropertyMap::~MyPropertyMap()
+{
+}
+
diff --git a/tests/auto/quicktest/signalspy/mypropertymap.h b/tests/auto/quicktest/signalspy/mypropertymap.h
new file mode 100644
index 0000000000..d69548fe88
--- /dev/null
+++ b/tests/auto/quicktest/signalspy/mypropertymap.h
@@ -0,0 +1,41 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QQmlPropertyMap>
+
+class MyPropertyMap : public QQmlPropertyMap
+{
+ Q_OBJECT
+
+public:
+ MyPropertyMap(QObject *parent = nullptr);
+ ~MyPropertyMap();
+
+Q_SIGNALS:
+ void mySignal();
+};
diff --git a/tests/auto/quicktest/signalspy/signalspy.pro b/tests/auto/quicktest/signalspy/signalspy.pro
new file mode 100644
index 0000000000..c8f9be1f36
--- /dev/null
+++ b/tests/auto/quicktest/signalspy/signalspy.pro
@@ -0,0 +1,9 @@
+CONFIG += testcase
+TARGET = tst_signalspy
+macos:CONFIG -= app_bundle
+
+SOURCES += tst_signalspy.cpp mypropertymap.cpp
+HEADERS += mypropertymap.h
+QT += quick testlib
+
+include (../../shared/util.pri)
diff --git a/tests/auto/quicktest/signalspy/tst_signalspy.cpp b/tests/auto/quicktest/signalspy/tst_signalspy.cpp
new file mode 100644
index 0000000000..f54da7819c
--- /dev/null
+++ b/tests/auto/quicktest/signalspy/tst_signalspy.cpp
@@ -0,0 +1,95 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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 The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+
+#include <qqmlengine.h>
+#include <qquickitem.h>
+#include <qquickview.h>
+
+#include "../../shared/util.h"
+#include "mypropertymap.h"
+
+class tst_SignalSpy : public QQmlDataTest
+{
+ Q_OBJECT
+public:
+ tst_SignalSpy();
+
+private slots:
+ void testValid();
+ void testCount();
+
+private:
+ QQmlEngine engine;
+};
+
+tst_SignalSpy::tst_SignalSpy()
+{
+ qmlRegisterType<MyPropertyMap>("MyImport", 1, 0, "MyPropertyMap");
+}
+
+void tst_SignalSpy::testValid()
+{
+ QQuickView window;
+ window.setSource(testFileUrl("signalspy.qml"));
+ QVERIFY(window.rootObject() != 0);
+
+ QObject *mouseSpy = window.rootObject()->findChild<QObject*>("mouseSpy");
+ QVERIFY(mouseSpy->property("valid").toBool());
+
+ QObject *propertyMapSpy = window.rootObject()->findChild<QObject*>("propertyMapSpy");
+ QVERIFY(propertyMapSpy->property("valid").toBool());
+}
+
+void tst_SignalSpy::testCount()
+{
+ QQuickView window;
+ window.resize(200, 200);
+ window.setSource(testFileUrl("signalspy.qml"));
+ window.show();
+ QTest::qWaitForWindowActive(&window);
+ QVERIFY(window.rootObject() != 0);
+
+ QObject *mouseSpy = window.rootObject()->findChild<QObject*>("mouseSpy");
+ QCOMPARE(mouseSpy->property("count").toInt(), 0);
+
+ QObject *propertyMapSpy = window.rootObject()->findChild<QObject*>("propertyMapSpy");
+ QCOMPARE(propertyMapSpy->property("count").toInt(), 0);
+
+ QTest::mouseClick(&window, Qt::LeftButton, Qt::KeyboardModifiers(), QPoint(100, 100));
+ QTRY_COMPARE(mouseSpy->property("count").toInt(), 1);
+
+ MyPropertyMap *propertyMap = static_cast<MyPropertyMap *>(window.rootObject()->findChild<QObject*>("propertyMap"));
+ Q_EMIT propertyMap->mySignal();
+ QCOMPARE(propertyMapSpy->property("count").toInt(), 1);
+}
+
+QTEST_MAIN(tst_SignalSpy)
+
+#include "tst_signalspy.moc"
diff --git a/tests/auto/shared/platformquirks.h b/tests/auto/shared/platformquirks.h
index 5e4929230a..5252e8cfe2 100644
--- a/tests/auto/shared/platformquirks.h
+++ b/tests/auto/shared/platformquirks.h
@@ -39,7 +39,7 @@ struct PlatformQuirks
{
static inline bool isClipboardAvailable()
{
-#if defined(QT_NO_CLIPBOARD)
+#if !QT_CONFIG(clipboard)
return false;
#elif defined(Q_OS_OSX)
PasteboardRef pasteboard;
diff --git a/tests/benchmarks/qml/compilation/tst_compilation.cpp b/tests/benchmarks/qml/compilation/tst_compilation.cpp
index 690e193b53..61339c6f60 100644
--- a/tests/benchmarks/qml/compilation/tst_compilation.cpp
+++ b/tests/benchmarks/qml/compilation/tst_compilation.cpp
@@ -75,7 +75,7 @@ void tst_compilation::boomblock()
QQmlComponent c(&engine);
c.setData(data, QUrl());
}
-#ifdef QT_NO_OPENGL
+#if !QT_CONFIG(opengl)
QSKIP("boomblock imports Particles which requires OpenGL Support");
#endif
QBENCHMARK {
diff --git a/tests/benchmarks/qml/creation/tst_creation.cpp b/tests/benchmarks/qml/creation/tst_creation.cpp
index a1c09db158..9fc67ada71 100644
--- a/tests/benchmarks/qml/creation/tst_creation.cpp
+++ b/tests/benchmarks/qml/creation/tst_creation.cpp
@@ -221,12 +221,15 @@ inline void QQmlGraphics_setParent_noEvent(QObject *object, QObject *parent)
void tst_creation::itemtree_notree_cpp()
{
+ std::vector<QQuickItem *> kids;
+ kids.resize(30);
QBENCHMARK {
QQuickItem *item = new QQuickItem;
for (int i = 0; i < 30; ++i) {
QQuickItem *child = new QQuickItem;
- Q_UNUSED(child);
+ kids[i] = child;
}
+ qDeleteAll(kids);
delete item;
}
}
@@ -258,12 +261,13 @@ void tst_creation::itemtree_cpp()
void tst_creation::itemtree_data_cpp()
{
+ QQmlEngine engine;
QBENCHMARK {
QQuickItem *item = new QQuickItem;
for (int i = 0; i < 30; ++i) {
QQuickItem *child = new QQuickItem;
QQmlGraphics_setParent_noEvent(child,item);
- QQmlListReference ref(item, "data");
+ QQmlListReference ref(item, "data", &engine);
ref.append(child);
}
delete item;
diff --git a/tests/benchmarks/qml/qml.pro b/tests/benchmarks/qml/qml.pro
index 2cf2dff413..f1fe87e532 100644
--- a/tests/benchmarks/qml/qml.pro
+++ b/tests/benchmarks/qml/qml.pro
@@ -14,5 +14,3 @@ SUBDIRS += \
creation
qtHaveModule(opengl): SUBDIRS += painting qquickwindow
-
-include(../trusted-benchmarks.pri)
diff --git a/tests/tests.pro b/tests/tests.pro
index f5731b2f34..ab94786b31 100644
--- a/tests/tests.pro
+++ b/tests/tests.pro
@@ -1,2 +1,3 @@
TEMPLATE = subdirs
-SUBDIRS += auto benchmarks
+SUBDIRS += auto
+contains(QT_CONFIG, release): SUBDIRS += benchmarks
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index e185fc41a9..5e8b872821 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -215,7 +215,7 @@ public Q_SLOTS:
returnCode = retCode;
}
-#if defined(QT_GUI_LIB) && !defined(QT_NO_OPENGL)
+#if defined(QT_GUI_LIB) && QT_CONFIG(opengl)
void onOpenGlContextCreated(QOpenGLContext *context);
#endif
};
@@ -237,7 +237,7 @@ void LoadWatcher::contain(QObject *o, const QUrl &containPath)
void LoadWatcher::checkForWindow(QObject *o)
{
-#if defined(QT_GUI_LIB) && !defined(QT_NO_OPENGL)
+#if defined(QT_GUI_LIB) && QT_CONFIG(opengl)
if (verboseMode && o->isWindowType() && o->inherits("QQuickWindow")) {
connect(o, SIGNAL(openglContextCreated(QOpenGLContext*)),
this, SLOT(onOpenGlContextCreated(QOpenGLContext*)));
@@ -247,7 +247,7 @@ void LoadWatcher::checkForWindow(QObject *o)
#endif // QT_GUI_LIB && !QT_NO_OPENGL
}
-#if defined(QT_GUI_LIB) && !defined(QT_NO_OPENGL)
+#if defined(QT_GUI_LIB) && QT_CONFIG(opengl)
void LoadWatcher::onOpenGlContextCreated(QOpenGLContext *context)
{
context->makeCurrent(qobject_cast<QWindow *>(sender()));
@@ -524,7 +524,7 @@ int main(int argc, char *argv[])
if (quietMode && verboseMode)
verboseMode = false;
-#ifndef QT_NO_TRANSLATION
+#if QT_CONFIG(translation)
//qt_ translations loaded by QQmlApplicationEngine
QString sysLocale = QLocale::system().name();
@@ -569,7 +569,7 @@ int main(int argc, char *argv[])
for (const QString &path : qAsConst(files)) {
//QUrl::fromUserInput doesn't treat no scheme as relative file paths
-#ifndef QT_NO_REGULAREXPRESSION
+#if QT_CONFIG(regularexpression)
QRegularExpression urlRe("[[:word:]]+://.*");
if (urlRe.match(path).hasMatch()) { //Treat as a URL
QUrl url = QUrl::fromUserInput(path);
diff --git a/tools/qmleasing/splineeditor.cpp b/tools/qmleasing/splineeditor.cpp
index d54a101b69..cd0c0b3ae0 100644
--- a/tools/qmleasing/splineeditor.cpp
+++ b/tools/qmleasing/splineeditor.cpp
@@ -224,7 +224,7 @@ void SplineEditor::mouseReleaseEvent(QMouseEvent *e)
}
}
-#ifndef QT_NO_CONTEXTMENU
+#if QT_CONFIG(contextmenu)
void SplineEditor::contextMenuEvent(QContextMenuEvent *e)
{
int index = findControlPoint(e->pos());
@@ -244,7 +244,7 @@ void SplineEditor::contextMenuEvent(QContextMenuEvent *e)
addPoint(e->pos());
}
}
-#endif // QT_NO_CONTEXTMENU
+#endif // contextmenu
void SplineEditor::invalidate()
{
diff --git a/tools/qmleasing/splineeditor.h b/tools/qmleasing/splineeditor.h
index f21713d6a7..8dd47c3a89 100644
--- a/tools/qmleasing/splineeditor.h
+++ b/tools/qmleasing/splineeditor.h
@@ -79,9 +79,9 @@ protected:
void mousePressEvent(QMouseEvent *) override;
void mouseMoveEvent(QMouseEvent *) override;
void mouseReleaseEvent(QMouseEvent *) override;
-#ifndef QT_NO_CONTEXTMENU
+#if QT_CONFIG(contextmenu)
void contextMenuEvent(QContextMenuEvent *) override;
-#endif // QT_NO_CONTEXTMENU
+#endif // contextmenu
void invalidate();
void invalidateSmoothList();
diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp
index 88660e46bb..92a8465d9f 100644
--- a/tools/qmlplugindump/main.cpp
+++ b/tools/qmlplugindump/main.cpp
@@ -72,11 +72,12 @@
#include <qt_windows.h>
#endif
+namespace {
-static const uint qtQmlMajorVersion = 2;
-static const uint qtQmlMinorVersion = 2;
-static const uint qtQuickMajorVersion = 2;
-static const uint qtQuickMinorVersion = 8;
+const uint qtQmlMajorVersion = 2;
+const uint qtQmlMinorVersion = 2;
+const uint qtQuickMajorVersion = 2;
+const uint qtQuickMinorVersion = 8;
const QString qtQuickQualifiedName = QString::fromLatin1("QtQuick %1.%2")
.arg(qtQuickMajorVersion)
@@ -89,6 +90,8 @@ bool creatable = true;
QString currentProperty;
QString inObjectInstantiation;
+}
+
static QString enquote(const QString &string)
{
QString s = string;
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp
index db0af1d071..1e8d91a95b 100644
--- a/tools/qmlscene/main.cpp
+++ b/tools/qmlscene/main.cpp
@@ -289,7 +289,7 @@ static bool checkVersion(const QUrl &url)
static void displayFileDialog(Options *options)
{
-#if defined(QT_WIDGETS_LIB) && !defined(QT_NO_FILEDIALOG)
+#if defined(QT_WIDGETS_LIB) && QT_CONFIG(filedialog)
QString fileName = QFileDialog::getOpenFileName(0, "Open QML file", QString(), "QML Files (*.qml)");
if (!fileName.isEmpty()) {
QFileInfo fi(fileName);
@@ -301,7 +301,7 @@ static void displayFileDialog(Options *options)
#endif
}
-#ifndef QT_NO_TRANSLATION
+#if QT_CONFIG(translation)
static void loadTranslationFile(QTranslator &translator, const QString& directory)
{
translator.load(QLatin1String("qml_" )+QLocale::system().name(), directory + QLatin1String("/i18n"));
@@ -361,7 +361,7 @@ static void usage()
puts(" ");
exit(1);
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
// Listen on GL context creation of the QQuickWindow in order to print diagnostic output.
class DiagnosticGlContextCreationListener : public QObject {
Q_OBJECT
@@ -405,7 +405,7 @@ static void setWindowTitle(bool verbose, const QObject *topLevel, QWindow *windo
if (verbose) {
newTitle += QLatin1String(" [Qt ") + QLatin1String(QT_VERSION_STR) + QLatin1Char(' ')
+ QGuiApplication::platformName() + QLatin1Char(' ');
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
newTitle += QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL
? QLatin1String("GL") : QLatin1String("GLES");
#endif
@@ -509,7 +509,7 @@ int main(int argc, char ** argv)
}
}
-#ifndef QT_NO_TRANSLATION
+#if QT_CONFIG(translation)
QTranslator translator;
QTranslator qtTranslator;
QString sysLocale = QLocale::system().name();
@@ -545,7 +545,7 @@ int main(int argc, char ** argv)
if (!options.url.isEmpty()) {
if (!options.versionDetection || checkVersion(options.url)) {
-#ifndef QT_NO_TRANSLATION
+#if QT_CONFIG(translation)
QTranslator translator;
#endif
@@ -559,7 +559,7 @@ int main(int argc, char ** argv)
engine.addPluginPath(pluginPaths.at(i));
if (options.url.isLocalFile()) {
QFileInfo fi(options.url.toLocalFile());
-#ifndef QT_NO_TRANSLATION
+#if QT_CONFIG(translation)
loadTranslationFile(translator, fi.path());
#endif
loadDummyDataFiles(engine, fi.path());
@@ -598,7 +598,7 @@ int main(int argc, char ** argv)
if (window) {
setWindowTitle(options.verbose, topLevel, window.data());
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (options.verbose)
new DiagnosticGlContextCreationListener(window.data());
#endif