aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2014-12-09 15:09:20 +0100
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2014-12-09 15:09:26 +0100
commitff466a1881435f927f5df9ce1e5eac07d5591904 (patch)
tree760e068743e6a8e1cc4ec63bb2f8e7dcef88b3e2
parente04822f3c2a6b69b7d75e2039256aa2433c59dd2 (diff)
parent4a3f6e58b591f2fe2204f7cbc1efc8abb0aade74 (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts: src/qml/jsruntime/qv4arraydata.cpp src/qml/jsruntime/qv4context_p.h src/qml/jsruntime/qv4globalobject.cpp src/qml/jsruntime/qv4internalclass.cpp src/quick/items/qquicktext_p.h src/quick/items/qquicktextedit_p.h src/quick/items/qquicktextinput_p.h Change-Id: If07e483e03197cb997ef47a9c647a479cdb09f4c
-rw-r--r--dist/changes-5.4.0144
-rw-r--r--examples/qmltest/qmltest/tst_basic.qml4
-rw-r--r--examples/qmltest/qmltest/tst_item.qml4
-rw-r--r--[-rwxr-xr-x]examples/quick/demos/samegame/content/samegame.js0
-rw-r--r--[-rwxr-xr-x]examples/quick/particles/images/backgroundLeaves.jpgbin78665 -> 78665 bytes
-rw-r--r--examples/quick/touchinteraction/flickable/content/Panel.qml2
-rw-r--r--[-rwxr-xr-x]examples/quick/tutorials/samegame/samegame4/highscores/score_data.xml0
-rw-r--r--[-rwxr-xr-x]examples/quick/tutorials/samegame/samegame4/highscores/score_style.xsl0
-rw-r--r--[-rwxr-xr-x]examples/quick/tutorials/samegame/samegame4/highscores/scores.php0
-rw-r--r--src/imports/localstorage/plugins.qmltypes2
-rw-r--r--src/imports/models/plugin.cpp2
-rw-r--r--src/imports/particles/plugins.qmltypes4
-rw-r--r--src/imports/qtquick2/plugin.cpp5
-rw-r--r--src/imports/qtquick2/plugins.qmltypes263
-rw-r--r--src/imports/settings/qqmlsettings.cpp2
-rw-r--r--src/imports/testlib/SignalSpy.qml2
-rw-r--r--src/imports/testlib/TestCase.qml4
-rw-r--r--src/imports/testlib/main.cpp3
-rw-r--r--src/imports/testlib/plugins.qmltypes17
-rw-r--r--src/imports/window/plugins.qmltypes15
-rw-r--r--src/imports/xmllistmodel/qqmlxmllistmodel.cpp4
-rw-r--r--src/particles/qquickage.cpp2
-rw-r--r--src/particles/qquickangledirection.cpp2
-rw-r--r--src/particles/qquickcumulativedirection.cpp2
-rw-r--r--src/particles/qquickcustomparticle.cpp2
-rw-r--r--src/particles/qquickdirection.cpp2
-rw-r--r--src/particles/qquickellipseextruder.cpp2
-rw-r--r--src/particles/qquickfriction.cpp2
-rw-r--r--src/particles/qquickgravity.cpp2
-rw-r--r--src/particles/qquickgroupgoal.cpp2
-rw-r--r--src/particles/qquickimageparticle.cpp2
-rw-r--r--src/particles/qquickitemparticle.cpp2
-rw-r--r--src/particles/qquicklineextruder.cpp2
-rw-r--r--src/particles/qquickmaskextruder.cpp2
-rw-r--r--src/particles/qquickparticleaffector.cpp2
-rw-r--r--src/particles/qquickparticleemitter.cpp2
-rw-r--r--src/particles/qquickparticleextruder.cpp2
-rw-r--r--src/particles/qquickparticlegroup.cpp2
-rw-r--r--src/particles/qquickparticlepainter.cpp2
-rw-r--r--src/particles/qquickparticlesystem.cpp2
-rw-r--r--src/particles/qquickpointattractor.cpp2
-rw-r--r--src/particles/qquickpointdirection.cpp2
-rw-r--r--src/particles/qquickrectangleextruder.cpp2
-rw-r--r--src/particles/qquickspritegoal.cpp2
-rw-r--r--src/particles/qquicktargetdirection.cpp2
-rw-r--r--src/particles/qquicktrailemitter.cpp2
-rw-r--r--src/particles/qquickturbulence.cpp2
-rw-r--r--src/particles/qquickv4particledata.cpp2
-rw-r--r--src/particles/qquickwander.cpp2
-rw-r--r--src/qml/compiler/qqmltypecompiler.cpp2
-rw-r--r--src/qml/compiler/qv4ssa.cpp14
-rw-r--r--src/qml/debugger/debugger.pri5
-rw-r--r--src/qml/debugger/qqmldebugserver.cpp1
-rw-r--r--src/qml/debugger/qqmlenginedebugservice.cpp12
-rw-r--r--src/qml/debugger/qqmlinspectorservice.cpp1
-rw-r--r--src/qml/jit/qv4isel_masm.cpp13
-rw-r--r--src/qml/jsapi/qjsengine.cpp6
-rw-r--r--src/qml/jsruntime/qv4context_p.h8
-rw-r--r--src/qml/jsruntime/qv4debugging.cpp36
-rw-r--r--src/qml/jsruntime/qv4globalobject.cpp5
-rw-r--r--src/qml/jsruntime/qv4internalclass.cpp35
-rw-r--r--src/qml/jsruntime/qv4mm.cpp2
-rw-r--r--src/qml/qml/qqmlengine.cpp6
-rw-r--r--src/qml/qml/qqmlimport.cpp36
-rw-r--r--src/qml/qml/qqmlprivate.h12
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp4
-rw-r--r--src/qml/types/qqmllistmodel.cpp4
-rw-r--r--src/qml/types/qqmlobjectmodel.cpp2
-rw-r--r--src/qmltest/quicktestresult_p.h2
-rw-r--r--src/quick/doc/src/examples.qdoc24
-rw-r--r--src/quick/doc/src/qmltypereference.qdoc10
-rw-r--r--src/quick/items/qquickanimatedsprite.cpp21
-rw-r--r--src/quick/items/qquickborderimage.cpp424
-rw-r--r--src/quick/items/qquickborderimage_p.h2
-rw-r--r--src/quick/items/qquickborderimage_p_p.h10
-rw-r--r--src/quick/items/qquickimagebase.cpp10
-rw-r--r--src/quick/items/qquickimagebase_p.h2
-rw-r--r--src/quick/items/qquickimagebase_p_p.h3
-rw-r--r--src/quick/items/qquickitem.cpp2
-rw-r--r--src/quick/items/qquickrendercontrol.cpp15
-rw-r--r--src/quick/items/qquicktext.cpp45
-rw-r--r--src/quick/items/qquicktext_p.h1
-rw-r--r--src/quick/items/qquicktext_p_p.h1
-rw-r--r--src/quick/items/qquicktextedit.cpp31
-rw-r--r--src/quick/items/qquicktextedit_p.h4
-rw-r--r--src/quick/items/qquicktextinput.cpp27
-rw-r--r--src/quick/items/qquicktextinput_p.h6
-rw-r--r--src/quick/items/qquickview.cpp4
-rw-r--r--src/quick/items/qquickwindow.cpp141
-rw-r--r--src/quick/items/qquickwindow.h2
-rw-r--r--src/quick/items/qquickwindowattached.cpp6
-rw-r--r--src/quick/items/qquickwindowattached_p.h3
-rw-r--r--src/quick/qtquick2.cpp5
-rw-r--r--src/quick/qtquick2_p.h1
-rw-r--r--src/quick/qtquickglobal_p.h1
-rw-r--r--src/quick/scenegraph/qsgadaptationlayer.cpp162
-rw-r--r--src/quick/scenegraph/qsgadaptationlayer_p.h16
-rw-r--r--src/quick/scenegraph/qsgcontext.cpp2
-rw-r--r--src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp28
-rw-r--r--src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h3
-rw-r--r--src/quick/scenegraph/qsgdefaultimagenode.cpp57
-rw-r--r--src/quick/scenegraph/qsgdefaultimagenode_p.h3
-rw-r--r--src/quick/scenegraph/qsgshareddistancefieldglyphcache.cpp173
-rw-r--r--src/quick/scenegraph/qsgwindowsrenderloop.cpp21
-rw-r--r--src/quick/scenegraph/scenegraph.pri1
-rw-r--r--src/quick/scenegraph/util/qsgsimpletexturenode.cpp4
-rw-r--r--src/quick/util/qquickglobal.cpp7
-rw-r--r--tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp2
-rw-r--r--tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp40
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp5
-rw-r--r--tests/auto/qml/qqmlenginecleanup/data/testFile1.qml49
-rw-r--r--tests/auto/qml/qqmlenginecleanup/data/testFile2.qml46
-rw-r--r--tests/auto/qml/qqmlenginecleanup/data/testFile3.qml68
-rw-r--r--tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp45
-rw-r--r--tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp1
-rw-r--r--tests/auto/qml/qv4debugger/tst_qv4debugger.cpp83
-rw-r--r--tests/auto/qmltest/animatedimage/tst_animatedimage.qml2
-rw-r--r--tests/auto/qmltest/animations/tst_abstractanimationjobcrash.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_behavior.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_mixed.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_mixedparallel.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_mixedsequential.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_multiwindow.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_nested.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_on.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_opacity.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_parallel.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_restart.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_rotation.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_scale.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_sequential.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_targetdestroyed.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_transformorigin.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_transition.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_x.qml2
-rw-r--r--tests/auto/qmltest/animators/tst_y.qml2
-rw-r--r--tests/auto/qmltest/borderimage/tst_borderimage.qml2
-rw-r--r--tests/auto/qmltest/buttonclick/tst_buttonclick.qml2
-rw-r--r--tests/auto/qmltest/createbenchmark/tst_createbenchmark.qml2
-rw-r--r--tests/auto/qmltest/events/tst_drag.qml2
-rw-r--r--tests/auto/qmltest/events/tst_events.qml2
-rw-r--r--tests/auto/qmltest/events/tst_wheel.qml2
-rw-r--r--tests/auto/qmltest/fontloader/tst_fontloader.qml2
-rw-r--r--tests/auto/qmltest/gradient/tst_gradient.qml2
-rw-r--r--tests/auto/qmltest/image/tst_image.qml2
-rw-r--r--tests/auto/qmltest/item/tst_layerInPositioner.qml2
-rw-r--r--tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml2
-rw-r--r--tests/auto/qmltest/listmodel/tst_listmodel.qml2
-rw-r--r--tests/auto/qmltest/listview/tst_listview.qml2
-rw-r--r--tests/auto/qmltest/pathview/tst_pathview.qml2
-rw-r--r--tests/auto/qmltest/pixel/tst_pixel.qml2
-rw-r--r--tests/auto/qmltest/qqmlbinding/tst_binding.qml2
-rw-r--r--tests/auto/qmltest/qqmlbinding/tst_binding2.qml2
-rw-r--r--tests/auto/qmltest/rectangle/tst_rectangle.qml2
-rw-r--r--tests/auto/qmltest/selftests/tst_compare.qml2
-rw-r--r--tests/auto/qmltest/selftests/tst_compare_quickobjects.qml2
-rw-r--r--tests/auto/qmltest/selftests/tst_datadriven.qml2
-rw-r--r--tests/auto/qmltest/selftests/tst_destroy.qml2
-rw-r--r--tests/auto/qmltest/selftests/tst_findChild.qml2
-rw-r--r--tests/auto/qmltest/selftests/tst_selftests.qml2
-rw-r--r--tests/auto/qmltest/shadersource/tst_DynamicallyCreated.qml2
-rw-r--r--tests/auto/qmltest/shadersource/tst_DynamicallyCreatedSource.qml2
-rw-r--r--tests/auto/qmltest/shadersource/tst_SourceInOtherWindow.qml2
-rw-r--r--tests/auto/qmltest/shadersource/tst_SourceItem.qml2
-rw-r--r--tests/auto/qmltest/shadersource/tst_SourcedFromOtherWindow.qml2
-rw-r--r--tests/auto/qmltest/stability/tst_unloadrepeater.qml2
-rw-r--r--tests/auto/qmltest/statemachine/tst_anonymousstate.qml2
-rw-r--r--tests/auto/qmltest/statemachine/tst_guardcondition.qml2
-rw-r--r--tests/auto/qmltest/statemachine/tst_historystate.qml2
-rw-r--r--tests/auto/qmltest/statemachine/tst_initialstate.qml2
-rw-r--r--tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml2
-rw-r--r--tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml2
-rw-r--r--tests/auto/qmltest/statemachine/tst_parallelmachine.qml2
-rw-r--r--tests/auto/qmltest/statemachine/tst_trafficlight.qml2
-rw-r--r--tests/auto/qmltest/text/tst_text.qml2
-rw-r--r--tests/auto/qmltest/textedit/tst_textedit.qml2
-rw-r--r--tests/auto/qmltest/textinput/tst_textinput.qml2
-rw-r--r--tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp27
-rwxr-xr-xtests/auto/quick/qquickanimationcontroller/data/tst_coloranimation.qml2
-rwxr-xr-xtests/auto/quick/qquickanimationcontroller/data/tst_completion.qml2
-rw-r--r--tests/auto/quick/qquickanimationcontroller/data/tst_numberanimation.qml2
-rw-r--r--tests/auto/quick/qquickanimationcontroller/data/tst_parallelanimation.qml2
-rw-r--r--tests/auto/quick/qquickanimationcontroller/data/tst_sequentialanimation.qml2
-rw-r--r--tests/auto/quick/qquickcanvasitem/data/CanvasComponent.qml2
-rw-r--r--tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml2
-rw-r--r--tests/auto/quick/qquickcanvasitem/data/tst_context.qml2
-rw-r--r--tests/auto/quick/qquickcanvasitem/data/tst_pixel.qml2
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp24
-rw-r--r--tests/auto/quick/qquickgridview/tst_qquickgridview.cpp2
-rw-r--r--tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml2
-rw-r--r--tests/auto/quick/qquickwindow/data/windowattached.qml2
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp27
-rw-r--r--tools/qml/main.cpp5
-rw-r--r--tools/qmlscene/main.cpp12
194 files changed, 1645 insertions, 952 deletions
diff --git a/dist/changes-5.4.0 b/dist/changes-5.4.0
new file mode 100644
index 0000000000..748ec8f371
--- /dev/null
+++ b/dist/changes-5.4.0
@@ -0,0 +1,144 @@
+Qt 5.4 introduces many new features and improvements as well as bugfixes
+over the 5.3.x series. For more details, refer to the online documentation
+included in this distribution. The documentation is also available online:
+
+ http://qt-project.org/doc/qt-5
+
+The Qt version 5.4 series is binary compatible with the 5.3.x series.
+Applications compiled for 5.3 will continue to run with 5.4.
+
+Some of the changes listed in this file include issue tracking numbers
+corresponding to tasks in the Qt Bug Tracker:
+
+ http://bugreports.qt-project.org/
+
+Each of these identifiers can be entered in the bug tracker to obtain more
+information about a particular change.
+
+****************************************************************************
+* General *
+****************************************************************************
+
+General Improvements
+--------------------
+
+ - The Declarative State Machine Framework extends Qt's State Machine
+ Framework (QSM) into QML. This gives you the power of deterministic
+ state machines, but declaratively.
+
+ - Added QML linter tool.
+
+Third party components
+----------------------
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
+
+ - [QTBUG-40431] When a JavaScript object/array is passed to C++ through
+ a QVariant, the engine no longer immediately converts the object
+ recursively into a QVariantMap or QVariantList but instead stores a
+ QJSValue in the QVariant. This prevents a loss of data when the JS
+ object contains non-primitive types such as function objects for
+ example. Code that expects the variant type to be exactly
+ QVariant::Map or QVariant::List may need to be adapted. Registered
+ conversion functions however ensure that code that merely calls
+ toMap() or toList() continues to work.
+ - [QTBUG-39971] Qt 5.3 changed the mapping of "var" parameters in QML
+ declared signals to QJSValue. This was reverted to the behavior of
+ earlier Qt versions to use QVariant. The original issue of not being
+ able to pass function objects through var parameters of QML declared
+ signals is solved by wrapping a QJSValue inside the QVariant.
+
+
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+QtQml
+-----
+
+ - qmldir:
+ [QTBUG-41489] added the ability to declare dependencies on other
+ modules in a module definition qmldir file
+
+
+QtQuick
+-------
+
+ - Accessibility for Qt Quick is now included in the qtquick library
+ instead of being a separate plugin.
+ - QQuickWindow will compresses touch events and delivers at most one touch
+ event per frame.
+ - [QTBUG-38539] Added property MouseArea.drag.smoothed for toggling
+ whether the drag target is moved to the current mouse position after a
+ drag operation has started.
+ - [QTBUG-37944] Introduced QQuickRenderControl as a public API.
+ - [QTBUG-37589] Added QQuickWidget::grabFramebuffer() for capturing the
+ content into a QImage.
+ - tools and examples consistently use the QtProject organization name
+ - [QTBUG-40130] Add containsPress property to MouseArea
+ - Added QQuickFontMetrics, which provides a subset of QFontMetricsF's API.
+ - Added QQuickTextMetrics, which provides a declarative API for the
+ functions in QFontMetricsF which take arguments.
+ - Introduced OpenGLInfo attached type that provides information about the
+ currently used OpenGL version.
+ - Images exceeding GL_MAX_TEXTURE_SIZE will be downscaled to fit so they
+ will still show.
+ - [QTBUG-42096] Fixed nodes sometimes disappearing when adding many new
+ nodes to the tree.
+
+ - Canvas:
+ * Implement antialiasing on FramebufferObject based render targets
+ through super-sampling (SSAA) when framebuffer multisampling is not
+ available.
+
+ - Important Behavior Changes:
+ * Drag and Drop events now propagate to child items before their
+ parents.
+ * [QTBUG-40329] TextInput::displayText now includes also partial input
+ from an input method and thus matches with the actual displayed text.
+
+ - Item:
+ * Added functions QQuickItem::grabToImage() and Item::grabToImage() to
+ allow grabbing of items into system-memory images.
+ * When Item.opacity is set to a value outside the range of 0 to 1, it
+ will be clamped.
+
+ - ListView:
+ * Introduced headerPositioning and footerPositioning properties to
+ control whether header and footer are positioned inline, as overlays,
+ or so that they slide away and can be pulled back regardless of the
+ content position.
+
+ - QQuickItem:
+ * Added signals sceneGraphInitialized and sceneGraphInvalidated
+
+ - QQuickWindow:
+ * Added QQuickWindow::scheduleRenderJob(), a convenience alternative to
+ the equivalent signals for one-shot tasks.
+
+ - SceneGraph:
+ * There might not be an OpenGL context bound when
+ QQuickWindow::sceneGraphInvalidated() is emitted if an error occurs
+ while cleaning up the scene graph (such as EGL_CONTEXT_LOST). This is
+ according to the documentation, but has never occurred in practice
+ before.
+
+ - TextInput:
+ * Added passwordMaskDelay property
+ * [QTBUG-38934] Added TextInput::ensureVisible(int pos) method to be
+ able to control the scrolling position of a TextInput that has
+ automatic scrolling enabled.
+
+ - Window:
+ * Added Item.Window attached property
+
+QtQuick.Dialogs
+---------------
+
+ - [QTBUG-39365] FontDialog: support keyboard navigation
+ - [QTBUG-39231] FileDialog: added sidebarVisible property and button
+
+
diff --git a/examples/qmltest/qmltest/tst_basic.qml b/examples/qmltest/qmltest/tst_basic.qml
index ba5ebe935a..1d9efbab61 100644
--- a/examples/qmltest/qmltest/tst_basic.qml
+++ b/examples/qmltest/qmltest/tst_basic.qml
@@ -31,8 +31,8 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
+import QtQuick 2.4
+import QtTest 1.1
TestCase {
name: "BasicTests"
diff --git a/examples/qmltest/qmltest/tst_item.qml b/examples/qmltest/qmltest/tst_item.qml
index 69e2b83a00..966d7e1bfe 100644
--- a/examples/qmltest/qmltest/tst_item.qml
+++ b/examples/qmltest/qmltest/tst_item.qml
@@ -31,8 +31,8 @@
**
****************************************************************************/
-import QtQuick 2.0
-import QtTest 1.0
+import QtQuick 2.4
+import QtTest 1.1
Rectangle {
id: foo
diff --git a/examples/quick/demos/samegame/content/samegame.js b/examples/quick/demos/samegame/content/samegame.js
index 99154320ca..99154320ca 100755..100644
--- a/examples/quick/demos/samegame/content/samegame.js
+++ b/examples/quick/demos/samegame/content/samegame.js
diff --git a/examples/quick/particles/images/backgroundLeaves.jpg b/examples/quick/particles/images/backgroundLeaves.jpg
index 08be16751d..08be16751d 100755..100644
--- a/examples/quick/particles/images/backgroundLeaves.jpg
+++ b/examples/quick/particles/images/backgroundLeaves.jpg
Binary files differ
diff --git a/examples/quick/touchinteraction/flickable/content/Panel.qml b/examples/quick/touchinteraction/flickable/content/Panel.qml
index a144c347e1..b2926f8098 100644
--- a/examples/quick/touchinteraction/flickable/content/Panel.qml
+++ b/examples/quick/touchinteraction/flickable/content/Panel.qml
@@ -116,7 +116,7 @@ Component {
drag.maximumY: page.height - 80
drag.minimumX: 100
drag.maximumX: page.width - 140
- onClicked: { myText.focus = true; Qt.inputMethod.show(); }
+ onClicked: myText.forceActiveFocus()
}
}
}
diff --git a/examples/quick/tutorials/samegame/samegame4/highscores/score_data.xml b/examples/quick/tutorials/samegame/samegame4/highscores/score_data.xml
index c3fd90d9cf..c3fd90d9cf 100755..100644
--- a/examples/quick/tutorials/samegame/samegame4/highscores/score_data.xml
+++ b/examples/quick/tutorials/samegame/samegame4/highscores/score_data.xml
diff --git a/examples/quick/tutorials/samegame/samegame4/highscores/score_style.xsl b/examples/quick/tutorials/samegame/samegame4/highscores/score_style.xsl
index 670354c965..670354c965 100755..100644
--- a/examples/quick/tutorials/samegame/samegame4/highscores/score_style.xsl
+++ b/examples/quick/tutorials/samegame/samegame4/highscores/score_style.xsl
diff --git a/examples/quick/tutorials/samegame/samegame4/highscores/scores.php b/examples/quick/tutorials/samegame/samegame4/highscores/scores.php
index 86e4187acd..86e4187acd 100755..100644
--- a/examples/quick/tutorials/samegame/samegame4/highscores/scores.php
+++ b/examples/quick/tutorials/samegame/samegame4/highscores/scores.php
diff --git a/src/imports/localstorage/plugins.qmltypes b/src/imports/localstorage/plugins.qmltypes
index 05bcc875f7..ff4c897f58 100644
--- a/src/imports/localstorage/plugins.qmltypes
+++ b/src/imports/localstorage/plugins.qmltypes
@@ -11,6 +11,8 @@ Module {
name: "QQuickLocalStorage"
prototype: "QObject"
exports: ["QtQuick.LocalStorage/LocalStorage 2.0"]
+ isCreatable: false
+ isSingleton: true
exportMetaObjectRevisions: [0]
Method {
name: "openDatabaseSync"
diff --git a/src/imports/models/plugin.cpp b/src/imports/models/plugin.cpp
index c0877be967..82c64764d8 100644
--- a/src/imports/models/plugin.cpp
+++ b/src/imports/models/plugin.cpp
@@ -38,7 +38,7 @@
QT_BEGIN_NAMESPACE
/*!
- \qmlmodule QtQml.Models 2
+ \qmlmodule QtQml.Models 2.1
\title Qt QML Models QML Types
\ingroup qmlmodules
\brief Provides QML types for data models
diff --git a/src/imports/particles/plugins.qmltypes b/src/imports/particles/plugins.qmltypes
index 712d4fd844..b1b825dea6 100644
--- a/src/imports/particles/plugins.qmltypes
+++ b/src/imports/particles/plugins.qmltypes
@@ -213,6 +213,7 @@ Module {
name: "QQuickDirection"
prototype: "QObject"
exports: ["QtQuick.Particles/NullVector 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
}
Component {
@@ -574,6 +575,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickItem"
exports: ["QtQuick.Particles/ParticleAffector 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
Property { name: "system"; type: "QQuickParticleSystem"; isPointer: true }
Property { name: "groups"; type: "QStringList" }
@@ -800,6 +802,7 @@ Module {
name: "QQuickParticleExtruder"
prototype: "QObject"
exports: ["QtQuick.Particles/ParticleExtruder 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
}
Component {
@@ -836,6 +839,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickItem"
exports: ["QtQuick.Particles/ParticlePainter 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
Property { name: "system"; type: "QQuickParticleSystem"; isPointer: true }
Property { name: "groups"; type: "QStringList" }
diff --git a/src/imports/qtquick2/plugin.cpp b/src/imports/qtquick2/plugin.cpp
index d5096fc6e8..ad3db2290f 100644
--- a/src/imports/qtquick2/plugin.cpp
+++ b/src/imports/qtquick2/plugin.cpp
@@ -49,6 +49,11 @@ public:
Q_UNUSED(uri);
QQmlQtQuick2Module::defineModule();
}
+
+ ~QtQuick2Plugin()
+ {
+ QQmlQtQuick2Module::undefineModule();
+ }
};
//![class decl]
diff --git a/src/imports/qtquick2/plugins.qmltypes b/src/imports/qtquick2/plugins.qmltypes
index dd41871e45..d98e9e6981 100644
--- a/src/imports/qtquick2/plugins.qmltypes
+++ b/src/imports/qtquick2/plugins.qmltypes
@@ -800,6 +800,7 @@ Module {
Property { name: "role"; type: "QAccessible::Role" }
Property { name: "name"; type: "string" }
Property { name: "description"; type: "string" }
+ Property { name: "ignored"; type: "bool" }
Property { name: "checkable"; type: "bool" }
Property { name: "checked"; type: "bool" }
Property { name: "editable"; type: "bool" }
@@ -814,6 +815,7 @@ Module {
Property { name: "defaultButton"; type: "bool" }
Property { name: "passwordEdit"; type: "bool" }
Property { name: "selectableText"; type: "bool" }
+ Property { name: "searchEdit"; type: "bool" }
Signal {
name: "checkableChanged"
Parameter { name: "arg"; type: "bool" }
@@ -870,8 +872,20 @@ Module {
name: "selectableTextChanged"
Parameter { name: "arg"; type: "bool" }
}
+ Signal {
+ name: "searchEditChanged"
+ Parameter { name: "arg"; type: "bool" }
+ }
+ Signal { name: "pressAction" }
+ Signal { name: "toggleAction" }
+ Signal { name: "increaseAction" }
+ Signal { name: "decreaseAction" }
Method { name: "valueChanged" }
Method { name: "cursorPositionChanged" }
+ Method {
+ name: "setIgnored"
+ Parameter { name: "ignored"; type: "bool" }
+ }
}
Component {
name: "QQuickAnchorAnimation"
@@ -1367,6 +1381,7 @@ Module {
Property { name: "maximumY"; type: "double" }
Property { name: "active"; type: "bool"; isReadonly: true }
Property { name: "filterChildren"; type: "bool" }
+ Property { name: "smoothed"; type: "bool" }
Property { name: "threshold"; type: "double" }
}
Component {
@@ -1632,6 +1647,61 @@ Module {
Property { name: "status"; type: "Status"; isReadonly: true }
}
Component {
+ name: "QQuickFontMetrics"
+ prototype: "QObject"
+ exports: ["QtQuick/FontMetrics 2.4"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "font"; type: "QFont" }
+ Property { name: "ascent"; type: "double"; isReadonly: true }
+ Property { name: "descent"; type: "double"; isReadonly: true }
+ Property { name: "height"; type: "double"; isReadonly: true }
+ Property { name: "leading"; type: "double"; isReadonly: true }
+ Property { name: "lineSpacing"; type: "double"; isReadonly: true }
+ Property { name: "minimumLeftBearing"; type: "double"; isReadonly: true }
+ Property { name: "minimumRightBearing"; type: "double"; isReadonly: true }
+ Property { name: "maximumCharacterWidth"; type: "double"; isReadonly: true }
+ Property { name: "xHeight"; type: "double"; isReadonly: true }
+ Property { name: "averageCharacterWidth"; type: "double"; isReadonly: true }
+ Property { name: "underlinePosition"; type: "double"; isReadonly: true }
+ Property { name: "overlinePosition"; type: "double"; isReadonly: true }
+ Property { name: "strikeOutPosition"; type: "double"; isReadonly: true }
+ Property { name: "lineWidth"; type: "double"; isReadonly: true }
+ Signal {
+ name: "fontChanged"
+ Parameter { name: "font"; type: "QFont" }
+ }
+ Method {
+ name: "advanceWidth"
+ type: "double"
+ Parameter { name: "text"; type: "string" }
+ }
+ Method {
+ name: "boundingRect"
+ type: "QRectF"
+ Parameter { name: "text"; type: "string" }
+ }
+ Method {
+ name: "tightBoundingRect"
+ type: "QRectF"
+ Parameter { name: "text"; type: "string" }
+ }
+ Method {
+ name: "elidedText"
+ type: "string"
+ Parameter { name: "text"; type: "string" }
+ Parameter { name: "mode"; type: "Qt::TextElideMode" }
+ Parameter { name: "width"; type: "double" }
+ Parameter { name: "flags"; type: "int" }
+ }
+ Method {
+ name: "elidedText"
+ type: "string"
+ Parameter { name: "text"; type: "string" }
+ Parameter { name: "mode"; type: "Qt::TextElideMode" }
+ Parameter { name: "width"; type: "double" }
+ }
+ }
+ Component {
name: "QQuickFontValueType"
prototype: "QQmlValueType"
exports: ["QtQuick/Font 2.0"]
@@ -1903,8 +1973,8 @@ Module {
name: "QQuickItem"
defaultProperty: "data"
prototype: "QObject"
- exports: ["QtQuick/Item 2.0", "QtQuick/Item 2.1"]
- exportMetaObjectRevisions: [0, 1]
+ exports: ["QtQuick/Item 2.0", "QtQuick/Item 2.1", "QtQuick/Item 2.4"]
+ exportMetaObjectRevisions: [0, 1, 2]
Enum {
name: "TransformOrigin"
values: {
@@ -2011,6 +2081,19 @@ Module {
}
Method { name: "update" }
Method {
+ name: "grabToImage"
+ revision: 2
+ type: "bool"
+ Parameter { name: "callback"; type: "QJSValue" }
+ Parameter { name: "targetSize"; type: "QSize" }
+ }
+ Method {
+ name: "grabToImage"
+ revision: 2
+ type: "bool"
+ Parameter { name: "callback"; type: "QJSValue" }
+ }
+ Method {
name: "contains"
type: "bool"
Parameter { name: "point"; type: "QPointF" }
@@ -2043,6 +2126,18 @@ Module {
}
}
Component {
+ name: "QQuickItemGrabResult"
+ prototype: "QObject"
+ Property { name: "image"; type: "QImage"; isReadonly: true }
+ Property { name: "url"; type: "QUrl"; isReadonly: true }
+ Signal { name: "ready" }
+ Method {
+ name: "saveToFile"
+ type: "bool"
+ Parameter { name: "fileName"; type: "string" }
+ }
+ }
+ Component {
name: "QQuickItemLayer"
prototype: "QObject"
Property { name: "enabled"; type: "bool" }
@@ -2435,8 +2530,12 @@ Module {
name: "QQuickListView"
defaultProperty: "data"
prototype: "QQuickItemView"
- exports: ["QtQuick/ListView 2.0", "QtQuick/ListView 2.1"]
- exportMetaObjectRevisions: [0, 1]
+ exports: [
+ "QtQuick/ListView 2.0",
+ "QtQuick/ListView 2.1",
+ "QtQuick/ListView 2.4"
+ ]
+ exportMetaObjectRevisions: [0, 1, 2]
attachedType: "QQuickListViewAttached"
Enum {
name: "Orientation"
@@ -2453,6 +2552,22 @@ Module {
"SnapOneItem": 2
}
}
+ Enum {
+ name: "HeaderPositioning"
+ values: {
+ "InlineHeader": 0,
+ "OverlayHeader": 1,
+ "PullBackHeader": 2
+ }
+ }
+ Enum {
+ name: "FooterPositioning"
+ values: {
+ "InlineFooter": 0,
+ "OverlayFooter": 1,
+ "PullBackFooter": 2
+ }
+ }
Property { name: "highlightMoveVelocity"; type: "double" }
Property { name: "highlightResizeVelocity"; type: "double" }
Property { name: "highlightResizeDuration"; type: "int" }
@@ -2461,6 +2576,10 @@ Module {
Property { name: "section"; type: "QQuickViewSection"; isReadonly: true; isPointer: true }
Property { name: "currentSection"; type: "string"; isReadonly: true }
Property { name: "snapMode"; type: "SnapMode" }
+ Property { name: "headerPositioning"; revision: 2; type: "HeaderPositioning" }
+ Property { name: "footerPositioning"; revision: 2; type: "FooterPositioning" }
+ Signal { name: "headerPositioningChanged"; revision: 2 }
+ Signal { name: "footerPositioningChanged"; revision: 2 }
Method { name: "incrementCurrentIndex" }
Method { name: "decrementCurrentIndex" }
}
@@ -2504,8 +2623,8 @@ Module {
name: "QQuickMouseArea"
defaultProperty: "data"
prototype: "QQuickItem"
- exports: ["QtQuick/MouseArea 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: ["QtQuick/MouseArea 2.0", "QtQuick/MouseArea 2.4"]
+ exportMetaObjectRevisions: [0, 1]
Property { name: "mouseX"; type: "double"; isReadonly: true }
Property { name: "mouseY"; type: "double"; isReadonly: true }
Property { name: "containsMouse"; type: "bool"; isReadonly: true }
@@ -2518,6 +2637,7 @@ Module {
Property { name: "preventStealing"; type: "bool" }
Property { name: "propagateComposedEvents"; type: "bool" }
Property { name: "cursorShape"; type: "Qt::CursorShape" }
+ Property { name: "containsPress"; revision: 1; type: "bool"; isReadonly: true }
Signal { name: "hoveredChanged" }
Signal {
name: "positionChanged"
@@ -2558,6 +2678,7 @@ Module {
Signal { name: "entered" }
Signal { name: "exited" }
Signal { name: "canceled" }
+ Signal { name: "containsPressChanged"; revision: 1 }
}
Component {
name: "QQuickMouseEvent"
@@ -2621,6 +2742,33 @@ Module {
exportMetaObjectRevisions: [0]
}
Component {
+ name: "QQuickOpenGLInfo"
+ prototype: "QObject"
+ exports: ["QtQuick/OpenGLInfo 2.4"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0]
+ Enum {
+ name: "ContextProfile"
+ values: {
+ "NoProfile": 0,
+ "CoreProfile": 1,
+ "CompatibilityProfile": 2
+ }
+ }
+ Enum {
+ name: "RenderableType"
+ values: {
+ "Unspecified": 0,
+ "OpenGL": 1,
+ "OpenGLES": 2
+ }
+ }
+ Property { name: "majorVersion"; type: "int"; isReadonly: true }
+ Property { name: "minorVersion"; type: "int"; isReadonly: true }
+ Property { name: "profile"; type: "ContextProfile"; isReadonly: true }
+ Property { name: "renderableType"; type: "RenderableType"; isReadonly: true }
+ }
+ Component {
name: "QQuickPackage"
defaultProperty: "data"
prototype: "QObject"
@@ -3226,8 +3374,8 @@ Module {
name: "QQuickShaderEffect"
defaultProperty: "data"
prototype: "QQuickItem"
- exports: ["QtQuick/ShaderEffect 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: ["QtQuick/ShaderEffect 2.0", "QtQuick/ShaderEffect 2.4"]
+ exportMetaObjectRevisions: [0, 1]
Enum {
name: "CullMode"
values: {
@@ -3251,6 +3399,7 @@ Module {
Property { name: "cullMode"; type: "CullMode" }
Property { name: "log"; type: "string"; isReadonly: true }
Property { name: "status"; type: "Status"; isReadonly: true }
+ Property { name: "supportsAtlasTextures"; revision: 1; type: "bool" }
}
Component {
name: "QQuickShaderEffectMesh"
@@ -3983,6 +4132,13 @@ Module {
Parameter { name: "text"; type: "string" }
}
Method {
+ name: "inputMethodQuery"
+ revision: 4
+ type: "QVariant"
+ Parameter { name: "query"; type: "Qt::InputMethodQuery" }
+ Parameter { name: "argument"; type: "QVariant" }
+ }
+ Method {
name: "positionToRectangle"
type: "QRectF"
Parameter { type: "int" }
@@ -4026,8 +4182,12 @@ Module {
name: "QQuickTextInput"
defaultProperty: "data"
prototype: "QQuickImplicitSizeItem"
- exports: ["QtQuick/TextInput 2.0", "QtQuick/TextInput 2.2"]
- exportMetaObjectRevisions: [0, 2]
+ exports: [
+ "QtQuick/TextInput 2.0",
+ "QtQuick/TextInput 2.2",
+ "QtQuick/TextInput 2.4"
+ ]
+ exportMetaObjectRevisions: [0, 2, 3]
Enum {
name: "EchoMode"
values: {
@@ -4110,6 +4270,7 @@ Module {
Property { name: "echoMode"; type: "EchoMode" }
Property { name: "activeFocusOnPress"; type: "bool" }
Property { name: "passwordCharacter"; type: "string" }
+ Property { name: "passwordMaskDelay"; revision: 3; type: "int" }
Property { name: "displayText"; type: "string"; isReadonly: true }
Property { name: "autoScroll"; type: "bool" }
Property { name: "selectByMouse"; type: "bool" }
@@ -4157,6 +4318,11 @@ Module {
Parameter { name: "echoMode"; type: "EchoMode" }
}
Signal {
+ name: "passwordMaskDelayChanged"
+ revision: 3
+ Parameter { name: "delay"; type: "int" }
+ }
+ Signal {
name: "activeFocusOnPressChanged"
Parameter { name: "activeFocusOnPress"; type: "bool" }
}
@@ -4203,6 +4369,11 @@ Module {
Parameter { name: "end"; type: "int" }
}
Method {
+ name: "ensureVisible"
+ revision: 3
+ Parameter { name: "position"; type: "int" }
+ }
+ Method {
name: "positionAt"
Parameter { name: "args"; type: "QQmlV4Function"; isPointer: true }
}
@@ -4221,6 +4392,13 @@ Module {
Parameter { name: "mode"; type: "SelectionMode" }
}
Method {
+ name: "inputMethodQuery"
+ revision: 3
+ type: "QVariant"
+ Parameter { name: "query"; type: "Qt::InputMethodQuery" }
+ Parameter { name: "argument"; type: "QVariant" }
+ }
+ Method {
name: "getText"
type: "string"
Parameter { name: "start"; type: "int" }
@@ -4237,6 +4415,23 @@ Module {
Property { name: "y"; type: "double" }
}
Component {
+ name: "QQuickTextMetrics"
+ prototype: "QObject"
+ exports: ["QtQuick/TextMetrics 2.4"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "font"; type: "QFont" }
+ Property { name: "text"; type: "string" }
+ Property { name: "advanceWidth"; type: "double"; isReadonly: true }
+ Property { name: "boundingRect"; type: "QRectF"; isReadonly: true }
+ Property { name: "width"; type: "double"; isReadonly: true }
+ Property { name: "height"; type: "double"; isReadonly: true }
+ Property { name: "tightBoundingRect"; type: "QRectF"; isReadonly: true }
+ Property { name: "elidedText"; type: "string"; isReadonly: true }
+ Property { name: "elide"; type: "Qt::TextElideMode" }
+ Property { name: "elideWidth"; type: "double" }
+ Signal { name: "metricsChanged" }
+ }
+ Component {
name: "QQuickTouchPoint"
prototype: "QObject"
exports: ["QtQuick/TouchPoint 2.0"]
@@ -4779,7 +4974,8 @@ Module {
"WA_TouchPadAcceptSingleTouchEvents": 123,
"WA_X11DoNotAcceptFocus": 126,
"WA_MacNoShadow": 127,
- "WA_AttributeCount": 128
+ "WA_AlwaysStackOnTop": 128,
+ "WA_AttributeCount": 129
}
}
Enum {
@@ -4801,7 +4997,9 @@ Module {
"AA_ForceRasterWidgets": 14,
"AA_UseDesktopOpenGL": 15,
"AA_UseOpenGLES": 16,
- "AA_AttributeCount": 17
+ "AA_UseSoftwareOpenGL": 17,
+ "AA_ShareOpenGLContexts": 18,
+ "AA_AttributeCount": 19
}
}
Enum {
@@ -5246,6 +5444,13 @@ Module {
"Key_Guide": 16777498,
"Key_Info": 16777499,
"Key_Settings": 16777500,
+ "Key_MicVolumeUp": 16777501,
+ "Key_MicVolumeDown": 16777502,
+ "Key_New": 16777504,
+ "Key_Open": 16777505,
+ "Key_Find": 16777506,
+ "Key_Undo": 16777507,
+ "Key_Redo": 16777508,
"Key_MediaLast": 16842751,
"Key_Select": 16842752,
"Key_Yes": 16842753,
@@ -5582,6 +5787,20 @@ Module {
}
}
Enum {
+ name: "FocusReason"
+ values: {
+ "MouseFocusReason": 0,
+ "TabFocusReason": 1,
+ "BacktabFocusReason": 2,
+ "ActiveWindowFocusReason": 3,
+ "PopupFocusReason": 4,
+ "ShortcutFocusReason": 5,
+ "MenuBarFocusReason": 6,
+ "OtherFocusReason": 7,
+ "NoFocusReason": 8
+ }
+ }
+ Enum {
name: "ContextMenuPolicy"
values: {
"NoContextMenu": 0,
@@ -5831,6 +6050,18 @@ Module {
}
}
Enum {
+ name: "NativeGestureType"
+ values: {
+ "BeginNativeGesture": 0,
+ "EndNativeGesture": 1,
+ "PanNativeGesture": 2,
+ "ZoomNativeGesture": 3,
+ "SmartZoomNativeGesture": 4,
+ "RotateNativeGesture": 5,
+ "SwipeNativeGesture": 6
+ }
+ }
+ Enum {
name: "CursorMoveStyle"
values: {
"LogicalMoveStyle": 0,
@@ -5853,6 +6084,14 @@ Module {
"ScrollEnd": 3
}
}
+ Enum {
+ name: "MouseEventSource"
+ values: {
+ "MouseEventNotSynthesized": 0,
+ "MouseEventSynthesizedBySystem": 1,
+ "MouseEventSynthesizedByQt": 2
+ }
+ }
}
Component { name: "QEasingCurve"; prototype: "QQmlEasingValueType" }
}
diff --git a/src/imports/settings/qqmlsettings.cpp b/src/imports/settings/qqmlsettings.cpp
index 65f091a9e4..5fdf40f0fc 100644
--- a/src/imports/settings/qqmlsettings.cpp
+++ b/src/imports/settings/qqmlsettings.cpp
@@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype Settings
\instantiates QQmlSettings
- \inqmlmodule Qt.labs.settings 1.0
+ \inqmlmodule Qt.labs.settings
\ingroup settings
\brief Provides persistent platform-independent application settings.
diff --git a/src/imports/testlib/SignalSpy.qml b/src/imports/testlib/SignalSpy.qml
index 547f403bab..e483e6f71f 100644
--- a/src/imports/testlib/SignalSpy.qml
+++ b/src/imports/testlib/SignalSpy.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
/*!
\qmltype SignalSpy
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml
index 700c9112eb..160e0bdb62 100644
--- a/src/imports/testlib/TestCase.qml
+++ b/src/imports/testlib/TestCase.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
import "testlogger.js" as TestLogger
import Qt.test.qtestroot 1.0
@@ -101,7 +101,7 @@ import Qt.test.qtestroot 1.0
\code
import QtQuick 2.0
- import QtTest 1.0
+ import QtTest 1.1
TestCase {
name: "DataTests"
diff --git a/src/imports/testlib/main.cpp b/src/imports/testlib/main.cpp
index 59002ba09b..6e28101530 100644
--- a/src/imports/testlib/main.cpp
+++ b/src/imports/testlib/main.cpp
@@ -140,7 +140,8 @@ public:
virtual void registerTypes(const char *uri)
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtTest"));
- qmlRegisterType<QuickTestResult>(uri,1,0,"TestResult");
+ qmlRegisterType<QuickTestResult, 0>(uri,1,0,"TestResult");
+ qmlRegisterType<QuickTestResult, 1>(uri,1,1,"TestResult");
qmlRegisterType<QuickTestEvent>(uri,1,0,"TestEvent");
qmlRegisterType<QuickTestUtil>(uri,1,0,"TestUtil");
}
diff --git a/src/imports/testlib/plugins.qmltypes b/src/imports/testlib/plugins.qmltypes
index 94203df4dc..a892f73eb0 100644
--- a/src/imports/testlib/plugins.qmltypes
+++ b/src/imports/testlib/plugins.qmltypes
@@ -4,13 +4,13 @@ import QtQuick.tooling 1.1
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable QtTest 1.0'
+// 'qmlplugindump QtTest 1.1'
Module {
Component {
name: "QuickTestEvent"
prototype: "QObject"
- exports: ["QtTest/TestEvent 1.0"]
+ exports: ["TestEvent 1.0"]
exportMetaObjectRevisions: [0]
Method {
name: "keyPress"
@@ -119,8 +119,8 @@ Module {
Component {
name: "QuickTestResult"
prototype: "QObject"
- exports: ["QtTest/TestResult 1.0"]
- exportMetaObjectRevisions: [0]
+ exports: ["TestResult 1.0", "TestResult 1.1"]
+ exportMetaObjectRevisions: [0, 1]
Enum {
name: "RunMode"
values: {
@@ -250,11 +250,18 @@ Module {
type: "QObject*"
Parameter { name: "item"; type: "QQuickItem"; isPointer: true }
}
+ Method {
+ name: "findChild"
+ revision: 1
+ type: "QObject*"
+ Parameter { name: "parent"; type: "QObject"; isPointer: true }
+ Parameter { name: "objectName"; type: "string" }
+ }
}
Component {
name: "QuickTestUtil"
prototype: "QObject"
- exports: ["QtTest/TestUtil 1.0"]
+ exports: ["TestUtil 1.0"]
exportMetaObjectRevisions: [0]
Property { name: "printAvailableFunctions"; type: "bool"; isReadonly: true }
Property { name: "dragThreshold"; type: "int"; isReadonly: true }
diff --git a/src/imports/window/plugins.qmltypes b/src/imports/window/plugins.qmltypes
index 27c0299c32..fa320886db 100644
--- a/src/imports/window/plugins.qmltypes
+++ b/src/imports/window/plugins.qmltypes
@@ -38,8 +38,10 @@ Module {
Property { name: "desktopAvailableHeight"; type: "int"; isReadonly: true }
Property { name: "logicalPixelDensity"; type: "double"; isReadonly: true }
Property { name: "pixelDensity"; type: "double"; isReadonly: true }
+ Property { name: "devicePixelRatio"; type: "double"; isReadonly: true }
Property { name: "primaryOrientation"; type: "Qt::ScreenOrientation"; isReadonly: true }
Property { name: "orientation"; type: "Qt::ScreenOrientation"; isReadonly: true }
+ Property { name: "orientationUpdateMask"; type: "Qt::ScreenOrientations" }
Signal { name: "desktopGeometryChanged" }
Method {
name: "angleBetween"
@@ -104,11 +106,20 @@ Module {
Method { name: "releaseResources" }
}
Component {
+ name: "QQuickWindowAttached"
+ prototype: "QObject"
+ Property { name: "visibility"; type: "QWindow::Visibility"; isReadonly: true }
+ Property { name: "active"; type: "bool"; isReadonly: true }
+ Property { name: "activeFocusItem"; type: "QQuickItem"; isReadonly: true; isPointer: true }
+ Property { name: "contentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true }
+ }
+ Component {
name: "QQuickWindowQmlImpl"
defaultProperty: "data"
prototype: "QQuickWindow"
- exports: ["QtQuick.Window/Window 2.1"]
- exportMetaObjectRevisions: [0]
+ exports: ["QtQuick.Window/Window 2.1", "QtQuick.Window/Window 2.2"]
+ exportMetaObjectRevisions: [0, 1]
+ attachedType: "QQuickWindowAttached"
Property { name: "visible"; type: "bool" }
Property { name: "visibility"; type: "Visibility" }
Signal {
diff --git a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
index e3678ec75b..225eedb578 100644
--- a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
+++ b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
@@ -83,7 +83,7 @@ typedef QPair<int, int> QQuickXmlListRange;
/*!
\qmltype XmlRole
\instantiates QQuickXmlListModelRole
- \inqmlmodule QtQuick.XmlListModel 2
+ \inqmlmodule QtQuick.XmlListModel
\brief For specifying a role to an XmlListModel
\ingroup qtquick-models
@@ -612,7 +612,7 @@ void QQuickXmlListModelPrivate::clear_role(QQmlListProperty<QQuickXmlListModelRo
/*!
\qmltype XmlListModel
\instantiates QQuickXmlListModel
- \inqmlmodule QtQuick.XmlListModel 2
+ \inqmlmodule QtQuick.XmlListModel
\brief For specifying a read-only model using XPath expressions
\ingroup qtquick-models
diff --git a/src/particles/qquickage.cpp b/src/particles/qquickage.cpp
index 14a591a39e..aa830784da 100644
--- a/src/particles/qquickage.cpp
+++ b/src/particles/qquickage.cpp
@@ -37,7 +37,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype Age
\instantiates QQuickAgeAffector
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\inherits Affector
\brief For altering particle ages
\ingroup qtquick-particles
diff --git a/src/particles/qquickangledirection.cpp b/src/particles/qquickangledirection.cpp
index bf66059dd1..9fec60e386 100644
--- a/src/particles/qquickangledirection.cpp
+++ b/src/particles/qquickangledirection.cpp
@@ -42,7 +42,7 @@ const qreal CONV = 0.017453292519943295;
/*!
\qmltype AngleDirection
\instantiates QQuickAngleDirection
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\ingroup qtquick-particles
\inherits Direction
\brief For specifying a direction that varies in angle
diff --git a/src/particles/qquickcumulativedirection.cpp b/src/particles/qquickcumulativedirection.cpp
index e9923d3a07..d791060a08 100644
--- a/src/particles/qquickcumulativedirection.cpp
+++ b/src/particles/qquickcumulativedirection.cpp
@@ -37,7 +37,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype CumulativeDirection
\instantiates QQuickCumulativeDirection
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\inherits Direction
\brief For specifying a direction made of other directions
\ingroup qtquick-particles
diff --git a/src/particles/qquickcustomparticle.cpp b/src/particles/qquickcustomparticle.cpp
index 2ab24175a3..b656e7ec28 100644
--- a/src/particles/qquickcustomparticle.cpp
+++ b/src/particles/qquickcustomparticle.cpp
@@ -79,7 +79,7 @@ struct PlainVertices {
/*!
\qmltype CustomParticle
\instantiates QQuickCustomParticle
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\inherits ParticlePainter
\brief For specifying shaders to paint particles
\ingroup qtquick-particles
diff --git a/src/particles/qquickdirection.cpp b/src/particles/qquickdirection.cpp
index 86ed9b4bb3..1f1eb1a55e 100644
--- a/src/particles/qquickdirection.cpp
+++ b/src/particles/qquickdirection.cpp
@@ -37,7 +37,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype Direction
\instantiates QQuickDirection
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\brief For specifying a vector space
\ingroup qtquick-particles
diff --git a/src/particles/qquickellipseextruder.cpp b/src/particles/qquickellipseextruder.cpp
index 919647e2ad..da65f03c13 100644
--- a/src/particles/qquickellipseextruder.cpp
+++ b/src/particles/qquickellipseextruder.cpp
@@ -43,7 +43,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype EllipseShape
\instantiates QQuickEllipseExtruder
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\ingroup qtquick-particles
\inherits Shape
\brief Represents an ellipse to other particle system elements
diff --git a/src/particles/qquickfriction.cpp b/src/particles/qquickfriction.cpp
index 3b6bbf06b0..94e915fafc 100644
--- a/src/particles/qquickfriction.cpp
+++ b/src/particles/qquickfriction.cpp
@@ -38,7 +38,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype Friction
\instantiates QQuickFrictionAffector
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\ingroup qtquick-particles
\inherits Affector
\brief For applying friction proportional to the particle's current velocity
diff --git a/src/particles/qquickgravity.cpp b/src/particles/qquickgravity.cpp
index 665805a013..0e96b83ecd 100644
--- a/src/particles/qquickgravity.cpp
+++ b/src/particles/qquickgravity.cpp
@@ -38,7 +38,7 @@ const qreal CONV = 0.017453292520444443;
/*!
\qmltype Gravity
\instantiates QQuickGravityAffector
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\ingroup qtquick-particles
\inherits Affector
\brief For applying acceleration in an angle
diff --git a/src/particles/qquickgroupgoal.cpp b/src/particles/qquickgroupgoal.cpp
index 54ea3cf619..0cd37f4472 100644
--- a/src/particles/qquickgroupgoal.cpp
+++ b/src/particles/qquickgroupgoal.cpp
@@ -42,7 +42,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype GroupGoal
\instantiates QQuickGroupGoalAffector
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\ingroup qtquick-particles
\inherits Affector
\brief For changing the state of a group of a particle
diff --git a/src/particles/qquickimageparticle.cpp b/src/particles/qquickimageparticle.cpp
index 50fa9dbc64..3ba0e69039 100644
--- a/src/particles/qquickimageparticle.cpp
+++ b/src/particles/qquickimageparticle.cpp
@@ -477,7 +477,7 @@ void fillUniformArrayFromImage(float* array, const QImage& img, int size)
/*!
\qmltype ImageParticle
\instantiates QQuickImageParticle
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\inherits ParticlePainter
\brief For visualizing logical particles using an image
\ingroup qtquick-particles
diff --git a/src/particles/qquickitemparticle.cpp b/src/particles/qquickitemparticle.cpp
index 51038e350a..3c6e249a4a 100644
--- a/src/particles/qquickitemparticle.cpp
+++ b/src/particles/qquickitemparticle.cpp
@@ -42,7 +42,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype ItemParticle
\instantiates QQuickItemParticle
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\inherits ParticlePainter
\brief For specifying a delegate to paint particles
\ingroup qtquick-particles
diff --git a/src/particles/qquicklineextruder.cpp b/src/particles/qquicklineextruder.cpp
index fd2d5ae1bd..082a04cdb4 100644
--- a/src/particles/qquicklineextruder.cpp
+++ b/src/particles/qquicklineextruder.cpp
@@ -37,7 +37,7 @@
/*!
\qmltype LineShape
\instantiates QQuickLineExtruder
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\inherits Shape
\brief Represents a line for affectors and emitters
\ingroup qtquick-particles
diff --git a/src/particles/qquickmaskextruder.cpp b/src/particles/qquickmaskextruder.cpp
index dd06117f58..400343cf6d 100644
--- a/src/particles/qquickmaskextruder.cpp
+++ b/src/particles/qquickmaskextruder.cpp
@@ -40,7 +40,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype MaskShape
\instantiates QQuickMaskExtruder
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\inherits Shape
\brief For representing an image as a shape to affectors and emitters
\ingroup qtquick-particles
diff --git a/src/particles/qquickparticleaffector.cpp b/src/particles/qquickparticleaffector.cpp
index fcc1e6adb6..f81a4f5a53 100644
--- a/src/particles/qquickparticleaffector.cpp
+++ b/src/particles/qquickparticleaffector.cpp
@@ -39,7 +39,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype Affector
\instantiates QQuickParticleAffector
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\brief Applies alterations to the attributes of logical particles at any
point in their lifetime
\ingroup qtquick-particles
diff --git a/src/particles/qquickparticleemitter.cpp b/src/particles/qquickparticleemitter.cpp
index 337057181c..9c7d9facf3 100644
--- a/src/particles/qquickparticleemitter.cpp
+++ b/src/particles/qquickparticleemitter.cpp
@@ -40,7 +40,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype Emitter
\instantiates QQuickParticleEmitter
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\brief Emits logical particles
\ingroup qtquick-particles
diff --git a/src/particles/qquickparticleextruder.cpp b/src/particles/qquickparticleextruder.cpp
index 31ff12ab0c..2ae2decbc8 100644
--- a/src/particles/qquickparticleextruder.cpp
+++ b/src/particles/qquickparticleextruder.cpp
@@ -39,7 +39,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype Shape
\instantiates QQuickParticleExtruder
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\brief For specifying an area for affectors and emitters
\ingroup qtquick-particles
diff --git a/src/particles/qquickparticlegroup.cpp b/src/particles/qquickparticlegroup.cpp
index 5f55ffc7c4..2e70f9afdb 100644
--- a/src/particles/qquickparticlegroup.cpp
+++ b/src/particles/qquickparticlegroup.cpp
@@ -36,7 +36,7 @@
/*!
\qmltype ParticleGroup
\instantiates QQuickParticleGroup
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\brief For setting attributes on a logical particle group
\ingroup qtquick-particles
diff --git a/src/particles/qquickparticlepainter.cpp b/src/particles/qquickparticlepainter.cpp
index 4f8ad88ed1..f83e0cd278 100644
--- a/src/particles/qquickparticlepainter.cpp
+++ b/src/particles/qquickparticlepainter.cpp
@@ -38,7 +38,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype ParticlePainter
\instantiates QQuickParticlePainter
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\inherits Item
\brief For specifying how to paint particles
\ingroup qtquick-particles
diff --git a/src/particles/qquickparticlesystem.cpp b/src/particles/qquickparticlesystem.cpp
index be64851a19..edd85721f1 100644
--- a/src/particles/qquickparticlesystem.cpp
+++ b/src/particles/qquickparticlesystem.cpp
@@ -95,7 +95,7 @@ DEFINE_BOOL_CONFIG_OPTION(qmlParticlesDebug, QML_PARTICLES_DEBUG)
/*!
\qmltype ParticleSystem
\instantiates QQuickParticleSystem
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\brief A system which includes particle painter, emitter, and affector types
\ingroup qtquick-particles
diff --git a/src/particles/qquickpointattractor.cpp b/src/particles/qquickpointattractor.cpp
index 500669c1f0..caa544f2b6 100644
--- a/src/particles/qquickpointattractor.cpp
+++ b/src/particles/qquickpointattractor.cpp
@@ -38,7 +38,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype Attractor
\instantiates QQuickAttractorAffector
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\ingroup qtquick-particles
\inherits Affector
\brief For attracting particles towards a specific point
diff --git a/src/particles/qquickpointdirection.cpp b/src/particles/qquickpointdirection.cpp
index ff7e34831e..85d5eea6da 100644
--- a/src/particles/qquickpointdirection.cpp
+++ b/src/particles/qquickpointdirection.cpp
@@ -39,7 +39,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype PointDirection
\instantiates QQuickPointDirection
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\ingroup qtquick-particles
\inherits Direction
\brief For specifying a direction that varies in x and y components
diff --git a/src/particles/qquickrectangleextruder.cpp b/src/particles/qquickrectangleextruder.cpp
index 9bf41275cc..00c168e0e0 100644
--- a/src/particles/qquickrectangleextruder.cpp
+++ b/src/particles/qquickrectangleextruder.cpp
@@ -39,7 +39,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype RectangleShape
\instantiates QQuickRectangleExtruder
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\brief For specifying an area for affectors and emitter
\ingroup qtquick-particles
diff --git a/src/particles/qquickspritegoal.cpp b/src/particles/qquickspritegoal.cpp
index a8c42de942..83470c3f16 100644
--- a/src/particles/qquickspritegoal.cpp
+++ b/src/particles/qquickspritegoal.cpp
@@ -42,7 +42,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype SpriteGoal
\instantiates QQuickSpriteGoalAffector
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\ingroup qtquick-images-sprites
\inherits Affector
\brief For changing the state of a sprite particle
diff --git a/src/particles/qquicktargetdirection.cpp b/src/particles/qquicktargetdirection.cpp
index c997f26be1..98da6b1dda 100644
--- a/src/particles/qquicktargetdirection.cpp
+++ b/src/particles/qquicktargetdirection.cpp
@@ -40,7 +40,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype TargetDirection
\instantiates QQuickTargetDirection
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\ingroup qtquick-particles
\inherits Direction
\brief For specifying a direction towards the target point
diff --git a/src/particles/qquicktrailemitter.cpp b/src/particles/qquicktrailemitter.cpp
index e07ad39590..d948f21820 100644
--- a/src/particles/qquicktrailemitter.cpp
+++ b/src/particles/qquicktrailemitter.cpp
@@ -40,7 +40,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype TrailEmitter
\instantiates QQuickTrailEmitter
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\inherits QQuickParticleEmitter
\brief Emits logical particles from other logical particles
\ingroup qtquick-particles
diff --git a/src/particles/qquickturbulence.cpp b/src/particles/qquickturbulence.cpp
index e9129ffd60..194df61eb8 100644
--- a/src/particles/qquickturbulence.cpp
+++ b/src/particles/qquickturbulence.cpp
@@ -41,7 +41,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype Turbulence
\instantiates QQuickTurbulenceAffector
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\ingroup qtquick-particles
\inherits Affector
\brief Provides fluid-like forces from a noise image
diff --git a/src/particles/qquickv4particledata.cpp b/src/particles/qquickv4particledata.cpp
index e40e476db0..55ff0a4d28 100644
--- a/src/particles/qquickv4particledata.cpp
+++ b/src/particles/qquickv4particledata.cpp
@@ -42,7 +42,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype Particle
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\brief Represents particles manipulated by emitters and affectors
\ingroup qtquick-particles
diff --git a/src/particles/qquickwander.cpp b/src/particles/qquickwander.cpp
index b6c70f6d30..1a14deda06 100644
--- a/src/particles/qquickwander.cpp
+++ b/src/particles/qquickwander.cpp
@@ -37,7 +37,7 @@ QT_BEGIN_NAMESPACE
/*!
\qmltype Wander
\instantiates QQuickWanderAffector
- \inqmlmodule QtQuick.Particles 2
+ \inqmlmodule QtQuick.Particles
\ingroup qtquick-particles
\inherits Affector
\brief For applying random particle trajectory
diff --git a/src/qml/compiler/qqmltypecompiler.cpp b/src/qml/compiler/qqmltypecompiler.cpp
index 3a27a859fd..8edf4bbe7c 100644
--- a/src/qml/compiler/qqmltypecompiler.cpp
+++ b/src/qml/compiler/qqmltypecompiler.cpp
@@ -1389,7 +1389,7 @@ void QQmlComponentAndAliasResolver::findAndRegisterImplicitComponents(const QmlI
if (!mo)
continue;
- static QQmlType *componentType = QQmlMetaType::qmlType(&QQmlComponent::staticMetaObject);
+ QQmlType *componentType = QQmlMetaType::qmlType(&QQmlComponent::staticMetaObject);
Q_ASSERT(componentType);
QmlIR::Object *syntheticComponent = pool->New<QmlIR::Object>();
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp
index 31e3ed867e..d2222a0458 100644
--- a/src/qml/compiler/qv4ssa.cpp
+++ b/src/qml/compiler/qv4ssa.cpp
@@ -2991,7 +2991,19 @@ void splitCriticalEdges(IR::Function *f, DominatorTree &df, StatementWorklist &w
toBB->in[inIdx] = newBB;
newBB->out.append(toBB);
- newBB->setContainingGroup(toBB->containingGroup());
+ // add newBB to the correct loop group
+ if (toBB->isGroupStart()) {
+ BasicBlock *container;
+ for (container = fromBB->containingGroup(); container; container = container->containingGroup())
+ if (container == toBB)
+ break;
+ if (container == toBB) // if we were already inside the toBB loop
+ newBB->setContainingGroup(toBB);
+ else
+ newBB->setContainingGroup(toBB->containingGroup());
+ } else {
+ newBB->setContainingGroup(toBB->containingGroup());
+ }
// patch the terminator
Stmt *terminator = fromBB->terminator();
diff --git a/src/qml/debugger/debugger.pri b/src/qml/debugger/debugger.pri
index 2545c7836d..77a3ba6490 100644
--- a/src/qml/debugger/debugger.pri
+++ b/src/qml/debugger/debugger.pri
@@ -34,8 +34,3 @@ HEADERS += \
$$PWD/qqmlprofiler_p.h
INCLUDEPATH += $$PWD
-
-!contains(DEFINES, QT_QML_NO_DEBUGGER): static {
- DEFINES += QML_DEBUGGER_EMBED
- include(../../plugins/qmltooling/qmldbg_tcp/qmldbg_tcp.pri)
-}
diff --git a/src/qml/debugger/qqmldebugserver.cpp b/src/qml/debugger/qqmldebugserver.cpp
index 9715b5c8d4..b4f905eb7c 100644
--- a/src/qml/debugger/qqmldebugserver.cpp
+++ b/src/qml/debugger/qqmldebugserver.cpp
@@ -460,6 +460,7 @@ QQmlDebugServer::QQmlDebugServer()
}
}
#else
+ Q_UNUSED(&cleanup)
if (!appD->qmljsDebugArgumentsString().isEmpty()) {
qWarning() << QString(QLatin1String(
"QML Debugger: Ignoring \"-qmljsdebugger=%1\". "
diff --git a/src/qml/debugger/qqmlenginedebugservice.cpp b/src/qml/debugger/qqmlenginedebugservice.cpp
index cb533a0459..088f3203d6 100644
--- a/src/qml/debugger/qqmlenginedebugservice.cpp
+++ b/src/qml/debugger/qqmlenginedebugservice.cpp
@@ -96,8 +96,16 @@ QDataStream &operator>>(QDataStream &ds,
QDataStream &operator<<(QDataStream &ds,
const QQmlEngineDebugService::QQmlObjectProperty &data)
{
- ds << (int)data.type << data.name << data.value << data.valueTypeName
- << data.binding << data.hasNotifySignal;
+ ds << (int)data.type << data.name;
+ // check first whether the data can be saved
+ // (otherwise we assert in QVariant::operator<<)
+ QByteArray buffer;
+ QDataStream fakeStream(&buffer, QIODevice::WriteOnly);
+ if (QMetaType::save(fakeStream, data.value.type(), data.value.constData()))
+ ds << data.value;
+ else
+ ds << QVariant();
+ ds << data.valueTypeName << data.binding << data.hasNotifySignal;
return ds;
}
diff --git a/src/qml/debugger/qqmlinspectorservice.cpp b/src/qml/debugger/qqmlinspectorservice.cpp
index 31fa9bddef..89c2c17c45 100644
--- a/src/qml/debugger/qqmlinspectorservice.cpp
+++ b/src/qml/debugger/qqmlinspectorservice.cpp
@@ -106,6 +106,7 @@ void QQmlInspectorService::updateState()
return;
}
+ m_currentInspectorPlugin = 0;
foreach (QQmlInspectorInterface *inspector, m_inspectorPlugins) {
if (inspector->canHandleView(m_views.first())) {
m_currentInspectorPlugin = inspector;
diff --git a/src/qml/jit/qv4isel_masm.cpp b/src/qml/jit/qv4isel_masm.cpp
index ff35abda67..f905e9c978 100644
--- a/src/qml/jit/qv4isel_masm.cpp
+++ b/src/qml/jit/qv4isel_masm.cpp
@@ -1533,16 +1533,15 @@ void InstructionSelection::calculateRegistersToSave(const RegisterInformation &u
fpRegistersToSave.clear();
foreach (const RegisterInfo &ri, Assembler::getRegisterInfo()) {
+#if defined(RESTORE_EBX_ON_CALL)
+ if (ri.isRegularRegister() && ri.reg<JSC::X86Registers::RegisterID>() == JSC::X86Registers::ebx) {
+ regularRegistersToSave.append(ri);
+ continue;
+ }
+#endif // RESTORE_EBX_ON_CALL
if (ri.isCallerSaved())
continue;
-
if (ri.isRegularRegister()) {
-#if defined(RESTORE_EBX_ON_CALL)
- if (ri.isRegularRegister() && ri.reg<JSC::X86Registers::RegisterID>() == JSC::X86Registers::ebx) {
- regularRegistersToSave.append(ri);
- continue;
- }
-#endif // RESTORE_EBX_ON_CALL
if (ri.isPredefined() || used.contains(ri))
regularRegistersToSave.append(ri);
} else {
diff --git a/src/qml/jsapi/qjsengine.cpp b/src/qml/jsapi/qjsengine.cpp
index 427575b386..fba5d1a910 100644
--- a/src/qml/jsapi/qjsengine.cpp
+++ b/src/qml/jsapi/qjsengine.cpp
@@ -243,6 +243,8 @@ void QJSEngine::collectGarbage()
\row \li QT_TRID_NOOP() \li QT_TRID_NOOP()
\endtable
+ It also adds an arg() method to the string prototype.
+
\sa {Internationalization with Qt}
*/
void QJSEngine::installTranslatorFunctions(const QJSValue &object)
@@ -260,6 +262,10 @@ void QJSEngine::installTranslatorFunctions(const QJSValue &object)
obj->defineDefaultProperty(QStringLiteral("QT_TR_NOOP"), QV4::GlobalExtensions::method_qsTrNoOp);
obj->defineDefaultProperty(QStringLiteral("qsTrId"), QV4::GlobalExtensions::method_qsTrId);
obj->defineDefaultProperty(QStringLiteral("QT_TRID_NOOP"), QV4::GlobalExtensions::method_qsTrIdNoOp);
+
+ // string prototype extension
+ v4->stringObjectClass->prototype->defineDefaultProperty(QStringLiteral("arg"),
+ QV4::GlobalExtensions::method_string_arg);
#endif
}
diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h
index 7057e94457..bb45bf4b7d 100644
--- a/src/qml/jsruntime/qv4context_p.h
+++ b/src/qml/jsruntime/qv4context_p.h
@@ -62,11 +62,6 @@ struct ExecutionContext : Base {
Type_CallContext = 0x5,
Type_QmlContext = 0x6
};
- struct EvalCode
- {
- Function *function;
- EvalCode *next;
- };
inline ExecutionContext(ExecutionEngine *engine, ContextType t);
@@ -80,7 +75,6 @@ struct ExecutionContext : Base {
ExecutionContext *outer;
Lookup *lookups;
CompiledData::CompilationUnit *compilationUnit;
- EvalCode *currentEvalCode;
int lineNumber;
@@ -158,7 +152,6 @@ Heap::ExecutionContext::ExecutionContext(ExecutionEngine *engine, ContextType t)
, outer(0)
, lookups(0)
, compilationUnit(0)
- , currentEvalCode(0)
, lineNumber(-1)
{
// ### GC
@@ -216,7 +209,6 @@ inline void ExecutionEngine::pushContext(CallContext *context)
Q_ASSERT(current && current->d() && context && context->d());
context->d()->parent = current->d();
current = context;
- current->d()->currentEvalCode = 0;
}
inline ExecutionContext *ExecutionEngine::popContext()
diff --git a/src/qml/jsruntime/qv4debugging.cpp b/src/qml/jsruntime/qv4debugging.cpp
index 8211aa584e..4299af7112 100644
--- a/src/qml/jsruntime/qv4debugging.cpp
+++ b/src/qml/jsruntime/qv4debugging.cpp
@@ -51,25 +51,36 @@ namespace {
class JavaScriptJob: public Debugger::Job
{
QV4::ExecutionEngine *engine;
+ int frameNr;
const QString &script;
public:
- JavaScriptJob(QV4::ExecutionEngine *engine, const QString &script)
+ JavaScriptJob(QV4::ExecutionEngine *engine, int frameNr, const QString &script)
: engine(engine)
+ , frameNr(frameNr)
, script(script)
{}
void run()
{
- QV4::Scope scope(engine);
- QV4::ExecutionContext *ctx = engine->currentContext();
- ContextStateSaver ctxSaver(ctx);
- QV4::ScopedValue result(scope);
+ Scope scope(engine);
+
+ ExecutionContextSaver saver(engine->currentContext());
+
+ Value *savedContexts = scope.alloc(frameNr);
+ for (int i = 0; i < frameNr; ++i) {
+ savedContexts[i] = engine->currentContext();
+ engine->popContext();
+ }
+ ExecutionContext *ctx = engine->currentContext();
QV4::Script script(ctx, this->script);
script.strictMode = ctx->d()->strictMode;
- script.inheritContext = false;
+ // In order for property lookups in QML to work, we need to disable fast v4 lookups. That
+ // is a side-effect of inheritContext.
+ script.inheritContext = true;
script.parse();
+ QV4::ScopedValue result(scope);
if (!scope.engine->hasException)
result = script.run();
if (scope.engine->hasException)
@@ -87,7 +98,7 @@ class EvalJob: public JavaScriptJob
public:
EvalJob(QV4::ExecutionEngine *engine, const QString &script)
- : JavaScriptJob(engine, script)
+ : JavaScriptJob(engine, /*frameNr*/-1, script)
, result(false)
{}
@@ -107,8 +118,8 @@ class ExpressionEvalJob: public JavaScriptJob
Debugger::Collector *collector;
public:
- ExpressionEvalJob(ExecutionEngine *engine, const QString &expression, Debugger::Collector *collector)
- : JavaScriptJob(engine, expression)
+ ExpressionEvalJob(ExecutionEngine *engine, int frameNr, const QString &expression, Debugger::Collector *collector)
+ : JavaScriptJob(engine, frameNr, expression)
, collector(collector)
{
}
@@ -499,13 +510,10 @@ QVector<Heap::ExecutionContext::ContextType> Debugger::getScopeTypes(int frame)
void Debugger::evaluateExpression(int frameNr, const QString &expression, Debugger::Collector *resultsCollector)
{
Q_ASSERT(state() == Paused);
- Q_UNUSED(frameNr);
Q_ASSERT(m_runningJob == 0);
- ExpressionEvalJob job(m_engine, expression, resultsCollector);
- m_runningJob = &job;
- m_runningJob->run();
- m_runningJob = 0;
+ ExpressionEvalJob job(m_engine, frameNr, expression, resultsCollector);
+ runInEngine(&job);
}
void Debugger::maybeBreakAtInstruction()
diff --git a/src/qml/jsruntime/qv4globalobject.cpp b/src/qml/jsruntime/qv4globalobject.cpp
index f287fc7aec..776e20231e 100644
--- a/src/qml/jsruntime/qv4globalobject.cpp
+++ b/src/qml/jsruntime/qv4globalobject.cpp
@@ -395,11 +395,6 @@ ReturnedValue EvalFunction::evalCall(CallData *callData, bool directCall)
ContextStateSaver stateSaver(ctx);
- Heap::ExecutionContext::EvalCode evalCode;
- evalCode.function = function;
- evalCode.next = ctx->d()->currentEvalCode;
- ctx->d()->currentEvalCode = &evalCode;
-
// set the correct strict mode flag on the context
ctx->d()->strictMode = strictMode();
ctx->d()->compilationUnit = function->compilationUnit;
diff --git a/src/qml/jsruntime/qv4internalclass.cpp b/src/qml/jsruntime/qv4internalclass.cpp
index f24263a251..d3e6bdd57b 100644
--- a/src/qml/jsruntime/qv4internalclass.cpp
+++ b/src/qml/jsruntime/qv4internalclass.cpp
@@ -421,25 +421,24 @@ InternalClass *InternalClass::frozen()
void InternalClass::destroy()
{
- if (!engine)
- return;
- engine = 0;
-
- propertyTable.~PropertyHash();
- nameMap.~SharedInternalClassData<Identifier *>();
- propertyData.~SharedInternalClassData<PropertyAttributes>();
+ QList<InternalClass *> destroyStack;
+ destroyStack.append(this);
- if (m_sealed)
- m_sealed->destroy();
-
- if (m_frozen)
- m_frozen->destroy();
-
- for (QHash<Transition, InternalClass *>::ConstIterator it = transitions.begin(), end = transitions.end();
- it != end; ++it)
- it.value()->destroy();
-
- transitions.clear();
+ while (!destroyStack.isEmpty()) {
+ InternalClass *next = destroyStack.takeLast();
+ if (!next->engine)
+ continue;
+ next->engine = 0;
+ next->propertyTable.~PropertyHash();
+ next->nameMap.~SharedInternalClassData<Identifier *>();
+ next->propertyData.~SharedInternalClassData<PropertyAttributes>();
+ if (next->m_sealed)
+ destroyStack.append(next->m_sealed);
+ if (next->m_frozen)
+ destroyStack.append(next->m_frozen);
+ destroyStack.append(next->transitions.values());
+ next->transitions.clear();
+ }
}
struct InternalClassPoolVisitor
diff --git a/src/qml/jsruntime/qv4mm.cpp b/src/qml/jsruntime/qv4mm.cpp
index f90db63924..1c46932383 100644
--- a/src/qml/jsruntime/qv4mm.cpp
+++ b/src/qml/jsruntime/qv4mm.cpp
@@ -245,7 +245,7 @@ Heap::Base *MemoryManager::allocData(std::size_t size)
m_d->availableItems[pos] += uint(increase);
m_d->totalItems += int(increase);
#ifdef V4_USE_VALGRIND
- VALGRIND_MAKE_MEM_NOACCESS(allocation.memory, allocation.chunkSize);
+ VALGRIND_MAKE_MEM_NOACCESS(allocation.memory.base(), allocSize);
#endif
}
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index a92162aa74..debf740358 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -491,6 +491,12 @@ The following functions are also on the Qt object.
\li \c application.domain
\li This is the organization domain set on the QCoreApplication instance. This property can be written
to in order to set the organization domain.
+
+ \row
+ \li \c application.supportsMultipleWindows
+ \li This read-only property can be used to determine whether or not the
+ platform supports multiple windows. Some embedded platforms do not support
+ multiple windows, for example.
\endtable
The object also has one signal, aboutToQuit(), which is the same as \l QCoreApplication::aboutToQuit().
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index df4006d3c2..807eb05362 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -63,7 +63,8 @@ static const QLatin1Char Backslash('\\');
static const QLatin1Char Colon(':');
static const QLatin1String Slash_qmldir("/qmldir");
static const QLatin1String String_qmldir("qmldir");
-static const QString dotqml_string(QLatin1String(".qml"));
+static const QString dotqml_string(QStringLiteral(".qml"));
+static const QString dotuidotqml_string(QStringLiteral(".ui.qml"));
static bool designerSupportRequired = false;
namespace {
@@ -657,23 +658,28 @@ bool QQmlImportNamespace::Import::resolveType(QQmlTypeLoader *typeLoader,
return (*type_return != 0);
}
} else if (!isLibrary) {
- QString qmlUrl = url + QString::fromRawData(type.constData(), type.length()) + dotqml_string;
-
+ QString qmlUrl;
bool exists = false;
- if (QQmlFile::isBundle(qmlUrl)) {
- exists = QQmlFile::bundleFileExists(qmlUrl, typeLoader->engine());
- } else {
- exists = !typeLoader->absoluteFilePath(QQmlFile::urlToLocalFileOrQrc(qmlUrl)).isEmpty();
- if (!exists) {
- QString formUrl = url + QString::fromRawData(type.constData(), type.length()) + QStringLiteral(".ui.qml");
- if (!typeLoader->absoluteFilePath(QQmlFile::urlToLocalFileOrQrc(formUrl)).isEmpty()) {
- exists = true;
- qmlUrl = formUrl;
- }
+ const QString urlsToTry[2] = {
+ url + QString::fromRawData(type.constData(), type.length()) + dotqml_string, // Type -> Type.qml
+ url + QString::fromRawData(type.constData(), type.length()) + dotuidotqml_string // Type -> Type.ui.qml
+ };
+ for (uint i = 0; i < sizeof(urlsToTry) / sizeof(urlsToTry[0]); ++i) {
+ const QString url = urlsToTry[i];
+
+ if (QQmlFile::isBundle(url)) {
+ exists = QQmlFile::bundleFileExists(url, typeLoader->engine());
+ } else {
+ exists = !typeLoader->absoluteFilePath(QQmlFile::urlToLocalFileOrQrc(url)).isEmpty();
+ if (!exists)
+ exists = QQmlMetaType::findCachedCompilationUnit(QUrl(url));
+ }
+
+ if (exists) {
+ qmlUrl = url;
+ break;
}
- if (!exists)
- exists = QQmlMetaType::findCachedCompilationUnit(QUrl(qmlUrl));
}
if (exists) {
diff --git a/src/qml/qml/qqmlprivate.h b/src/qml/qml/qqmlprivate.h
index 29d2bc6193..dfbf04a50f 100644
--- a/src/qml/qml/qqmlprivate.h
+++ b/src/qml/qml/qqmlprivate.h
@@ -122,12 +122,12 @@ namespace QQmlPrivate
typedef int yes_type;
typedef char no_type;
- static yes_type check(To *);
- static no_type check(...);
+ static yes_type checkType(To *);
+ static no_type checkType(...);
static inline int cast()
{
- return StaticCastSelectorClass<From, To, sizeof(check(reinterpret_cast<From *>(0)))>::cast();
+ return StaticCastSelectorClass<From, To, sizeof(checkType(reinterpret_cast<From *>(0)))>::cast();
}
};
@@ -145,10 +145,10 @@ namespace QQmlPrivate
typedef char no_type;
template<typename ReturnType>
- static yes_type check(ReturnType *(*)(QObject *));
- static no_type check(...);
+ static yes_type checkType(ReturnType *(*)(QObject *));
+ static no_type checkType(...);
- static bool const value = sizeof(check(&T::qmlAttachedProperties)) == sizeof(yes_type);
+ static bool const value = sizeof(checkType(&T::qmlAttachedProperties)) == sizeof(yes_type);
};
template <typename T>
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index fcbf474008..6e2e51b493 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -174,7 +174,7 @@ QQmlDelegateModelParts::QQmlDelegateModelParts(QQmlDelegateModel *parent)
/*!
\qmltype DelegateModel
\instantiates QQmlDelegateModel
- \inqmlmodule QtQml.Models 2
+ \inqmlmodule QtQml.Models
\brief Encapsulates a model and delegate
The DelegateModel type encapsulates a model and the delegate that will
@@ -2307,7 +2307,7 @@ void QQmlDelegateModelGroupPrivate::destroyingPackage(QQuickPackage *package)
/*!
\qmltype DelegateModelGroup
\instantiates QQmlDelegateModelGroup
- \inqmlmodule QtQml.Models 2
+ \inqmlmodule QtQml.Models
\ingroup qtquick-models
\brief Encapsulates a filtered set of visual data items
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
index 142625d7ae..afd887ba53 100644
--- a/src/qml/types/qqmllistmodel.cpp
+++ b/src/qml/types/qqmllistmodel.cpp
@@ -1436,7 +1436,7 @@ void DynamicRoleModelNodeMetaObject::propertyWritten(int index)
/*!
\qmltype ListModel
\instantiates QQmlListModel
- \inqmlmodule QtQml.Models 2
+ \inqmlmodule QtQml.Models
\ingroup qtquick-models
\brief Defines a free-form list data source
@@ -2447,7 +2447,7 @@ bool QQmlListModelParser::definesEmptyList(const QString &s)
/*!
\qmltype ListElement
\instantiates QQmlListElement
- \inqmlmodule QtQml.Models 2
+ \inqmlmodule QtQml.Models
\brief Defines a data item in a ListModel
\ingroup qtquick-models
diff --git a/src/qml/types/qqmlobjectmodel.cpp b/src/qml/types/qqmlobjectmodel.cpp
index d2f47c41b2..7c1a951a2b 100644
--- a/src/qml/types/qqmlobjectmodel.cpp
+++ b/src/qml/types/qqmlobjectmodel.cpp
@@ -123,7 +123,7 @@ public:
/*!
\qmltype ObjectModel
\instantiates QQmlObjectModel
- \inqmlmodule QtQml.Models 2
+ \inqmlmodule QtQml.Models
\ingroup qtquick-models
\brief Defines a set of items to be used as a model
diff --git a/src/qmltest/quicktestresult_p.h b/src/qmltest/quicktestresult_p.h
index 78d0501b7c..0da29e8bd4 100644
--- a/src/qmltest/quicktestresult_p.h
+++ b/src/qmltest/quicktestresult_p.h
@@ -139,7 +139,7 @@ public Q_SLOTS:
QObject *grabImage(QQuickItem *item);
- QObject *findChild(QObject *parent, const QString &objectName);
+ Q_REVISION(1) QObject *findChild(QObject *parent, const QString &objectName);
public:
// Helper functions for the C++ main() shell.
diff --git a/src/quick/doc/src/examples.qdoc b/src/quick/doc/src/examples.qdoc
index 51525b8f57..0ec4507450 100644
--- a/src/quick/doc/src/examples.qdoc
+++ b/src/quick/doc/src/examples.qdoc
@@ -72,8 +72,8 @@ The following pages show how to develop Qt applications using
\l{Qt Creator Manual}{Qt Creator} and Qt Quick. The pages demonstrate various
steps such as use cases and introductory material. For more information about Qt Quick Applications and related modules, visit the \l{QML Applications} page.
-\div {class="landingicons"}
- \div {class="icons1of3"}
+\div {class="multi-column"}
+ \div {class="doc-column"}
\b{Development Environment}
\list
\li \l{Qt Creator: Creating Qt Quick Projects}{Creating Qt Quick Projects}
@@ -84,7 +84,7 @@ steps such as use cases and introductory material. For more information about Qt
\li \l{Qt Creator: Using QML Modules with Plugins}{Using QML Modules with Plugins}
\endlist
\enddiv
- \div {class="icons1of3"}
+ \div {class="doc-column"}
\b{Beginning with QML and Qt Quick}
\list
\li \l{First Steps with QML}
@@ -92,7 +92,7 @@ steps such as use cases and introductory material. For more information about Qt
\li \l{QML Advanced Tutorial}{SameGame}
\endlist
\enddiv
- \div {class="icons1of3"}
+ \div {class="doc-column"}
\b{Use Cases}
\list
\li \l{qtquick-usecase-visual.html}{Visual types in QML}
@@ -120,8 +120,8 @@ Examples are small applications which show how to implement various Qt Quick
features. The examples run on various platforms and are opened from within Qt
Creator.
-\div {class="landingicons"}
- \div {class="icons1of3"}
+\div {class="multi-column"}
+ \div {class="doc-column"}
\b{QML Types and Controls}
\list
\li \l{Qt Quick Controls - Gallery}{Controls Gallery}
@@ -132,7 +132,7 @@ Creator.
\li \l{Qt Quick Examples - Toggle Switch}{Custom Toggle Switch}
\endlist
\enddiv
- \div {class="icons1of3"}
+ \div {class="doc-column"}
\b{Layouts and Views}
\list
\li \l{Qt Quick Controls - Basic Layouts Example}{Basic Layouts}
@@ -142,7 +142,7 @@ Creator.
\li \l{Qt Quick Examples - Right to Left}{Right-to-Left and Text Layout}
\endlist
\enddiv
- \div {class="icons1of3"}
+ \div {class="doc-column"}
\b{Image and Graphics}
\list
\li \l{Qt Quick Examples - Image Elements}{Image Elements}
@@ -153,8 +153,8 @@ Creator.
\enddiv
\enddiv
-\div {class="landingicons"}
- \div {class="icons1of3"}
+\div {class="multi-column"}
+ \div {class="doc-column"}
\b{Keyboard, Focus, and Touch}
\list
\li \l{Qt Quick Examples - Key Interaction}{Key Interaction}
@@ -162,7 +162,7 @@ Creator.
\li \l{Qt Quick Controls - Touch Gallery}{Touch Gallery}
\endlist
\enddiv
- \div {class="icons1of3"}
+ \div {class="doc-column"}
\b{System and Events}
\list
\li \l{Qt Quick Examples - Threading}{Threading}
@@ -171,7 +171,7 @@ Creator.
\li \l{Qt Quick Examples - Drag and Drop}{Drag and Drop}
\endlist
\enddiv
- \div {class="icons1of3"}
+ \div {class="doc-column"}
\b{Scene Graph}
\list
\li \l{Scene Graph - OpenGL Under QML}{OpenGL Under QML}
diff --git a/src/quick/doc/src/qmltypereference.qdoc b/src/quick/doc/src/qmltypereference.qdoc
index 4d3341aac4..430c0ed11a 100644
--- a/src/quick/doc/src/qmltypereference.qdoc
+++ b/src/quick/doc/src/qmltypereference.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
-\qmlmodule QtQuick 2.3
+\qmlmodule QtQuick 2.4
\title Qt Quick QML Types
\ingroup qmlmodules
\brief Provides graphical QML types.
@@ -34,11 +34,11 @@
The \l{Qt Quick} module provides graphical primitive types. These types are only
available in a QML document if that document imports the \c QtQuick namespace.
-The current version of the \c QtQuick module is version 2.3, and thus it may be
+The current version of the \c QtQuick module is version 2.4, and thus it may be
imported via the following statement:
\qml
-import QtQuick 2.3
+import QtQuick 2.4
\endqml
Visit the \l {Qt Quick} module documentation for more
@@ -830,14 +830,14 @@ console.log(c + " " + d); // false true
*/
/*!
-\qmlmodule QtTest 1.0
+\qmlmodule QtTest 1.1
\title Qt Quick Test QML Types
\brief This module provides QML types to unit test your QML application
\ingroup qmlmodules
You can import this module using the following statement:
\code
-import QtTest 1.0
+import QtTest 1.1
\endcode
For more information about how to use these types, see
diff --git a/src/quick/items/qquickanimatedsprite.cpp b/src/quick/items/qquickanimatedsprite.cpp
index f144345b6c..4d1d8b251e 100644
--- a/src/quick/items/qquickanimatedsprite.cpp
+++ b/src/quick/items/qquickanimatedsprite.cpp
@@ -628,8 +628,25 @@ void QQuickAnimatedSprite::prepareNextFrame()
qreal w = m_spriteEngine->spriteWidth() / m_sheetSize.width();
qreal h = m_spriteEngine->spriteHeight() / m_sheetSize.height();
- qreal x1 = m_spriteEngine->spriteX() / m_sheetSize.width() + frameAt * w;
- qreal y1 = m_spriteEngine->spriteY() / m_sheetSize.height();
+ qreal x1;
+ qreal y1;
+ if (m_paused) {
+ int spriteY = m_spriteEngine->spriteY();
+ if (reverse) {
+ int rows = m_spriteEngine->maxFrames() * m_spriteEngine->spriteWidth() / m_sheetSize.width();
+ spriteY -= rows * m_spriteEngine->spriteHeight();
+ frameAt = (frameCount - 1) - frameAt;
+ }
+
+ int position = frameAt * m_spriteEngine->spriteWidth() + m_spriteEngine->spriteX();
+ int row = position / m_sheetSize.width();
+
+ x1 = (position - (row * m_sheetSize.width())) / m_sheetSize.width();
+ y1 = (row * m_spriteEngine->spriteHeight() + spriteY) / m_sheetSize.height();
+ } else {
+ x1 = m_spriteEngine->spriteX() / m_sheetSize.width() + frameAt * w;
+ y1 = m_spriteEngine->spriteY() / m_sheetSize.height();
+ }
//### hard-coded 0/1 work because we are the only
// images in the sprite sheet (without this we cannot assume
diff --git a/src/quick/items/qquickborderimage.cpp b/src/quick/items/qquickborderimage.cpp
index 07b8958664..38bbc66896 100644
--- a/src/quick/items/qquickborderimage.cpp
+++ b/src/quick/items/qquickborderimage.cpp
@@ -540,390 +540,90 @@ void QQuickBorderImage::doUpdate()
update();
}
-QImage QQuickBorderImage::shallowCopy(const QImage &image, const QRect &rect)
-{
- if (image.depth() == 1) {
- return image.copy(rect);
- } else {
- const uchar *bits = image.constBits() + image.bytesPerLine() * rect.y() + (image.depth() / 8) * rect.x();
- return QImage(bits, rect.width(), rect.height(), image.bytesPerLine(), image.format());
- }
-}
-
QSGNode *QQuickBorderImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)
{
Q_D(QQuickBorderImage);
- if (!d->pix.isReady() || width() <= 0 || height() <= 0) {
+ QSGTexture *texture = d->sceneGraphRenderContext()->textureForFactory(d->pix.textureFactory(), window());
+
+ if (!texture || width() <= 0 || height() <= 0) {
delete oldNode;
return 0;
}
- // Don't implicitly create the scalegrid in the rendering thread...
- QRectF innerSourceRect(0, 0, 1, 1);
- QRectF innerTargetRect(0, 0, width(), height());
- int borderLeft = 0, borderTop = 0, borderRight = 0, borderBottom = 0;
-
- bool updateNode = !oldNode;
- if (d->border) {
- const QQuickScaleGrid *border = d->getScaleGrid();
-
- borderLeft = qBound(0, border->left(), d->pix.width());
- borderTop = qBound(0, border->top(), d->pix.height());
- borderRight = d->pix.rect().width() - qBound(0, border->right(), d->pix.rect().width() - borderLeft);
- borderBottom = d->pix.rect().height() - qBound(0, border->bottom(), d->pix.rect().height() - borderTop);
-
- innerSourceRect = QRectF(borderLeft / qreal(d->pix.width()),
- borderTop / qreal(d->pix.height()),
- qMax<qreal>(0, borderRight - borderLeft) / d->pix.width(),
- qMax<qreal>(0, borderBottom - borderTop) / d->pix.height());
- innerTargetRect = QRectF(borderLeft,
- borderTop,
- qMax<qreal>(0, width() - border->right() - border->left()),
- qMax<qreal>(0, height() - border->bottom() - border->top()));
-
- QSizeF newSize(width(), height());
- if (innerSourceRect != d->oldInnerSourceRect
- || innerTargetRect != d->oldInnerTargetRect
- || newSize != d->oldSize) {
- updateNode = true;
- }
-
- d->oldInnerSourceRect = innerSourceRect;
- d->oldInnerTargetRect = innerTargetRect;
- d->oldSize = newSize;
- }
+ QSGImageNode *node = static_cast<QSGImageNode *>(oldNode);
bool updatePixmap = d->pixmapChanged;
d->pixmapChanged = false;
- if (updateNode) {
- delete oldNode;
- oldNode = new QSGNode;
+ if (!node) {
+ node = d->sceneGraphContext()->createImageNode();
updatePixmap = true;
-
- for (int i=0; i<9; ++i)
- d->regions[i].node = 0;
-
- if (innerSourceRect.left() > 0) {
- if (innerSourceRect.top() > 0) {
- QRectF rect(0,
- 0,
- innerTargetRect.left(),
- innerTargetRect.top());
-
- if (!rect.isEmpty()) {
- d->regions[0].node = d->sceneGraphContext()->createImageNode();
- d->regions[0].node->setTargetRect(rect);
- d->regions[0].node->setInnerTargetRect(rect);
- d->regions[0].targetRect = rect;
- }
- }
-
- if (innerSourceRect.bottom() < 1) {
- QRectF rect(0,
- innerTargetRect.bottom(),
- innerTargetRect.left(),
- height() - innerTargetRect.height() - innerTargetRect.top());
-
- if (!rect.isEmpty()) {
- d->regions[6].node = d->sceneGraphContext()->createImageNode();
- d->regions[6].node->setTargetRect(rect);
- d->regions[6].node->setInnerTargetRect(rect);
- d->regions[6].targetRect = rect;
- }
- }
-
- if (innerSourceRect.top() < innerSourceRect.bottom()) {
- QRectF rect(0,
- innerTargetRect.top(),
- innerTargetRect.left(),
- innerTargetRect.height());
-
- if (!rect.isEmpty()) {
- d->regions[3].node = d->sceneGraphContext()->createImageNode();
- d->regions[3].node->setTargetRect(rect);
- d->regions[3].node->setInnerTargetRect(rect);
- d->regions[3].targetRect = rect;
- }
- }
- }
-
- if (innerSourceRect.right() < 1) {
- if (innerSourceRect.top() > 0) {
- QRectF rect(innerTargetRect.right(),
- 0,
- width() - innerTargetRect.width() - innerTargetRect.left(),
- innerTargetRect.top());
-
- if (!rect.isEmpty()) {
- d->regions[2].node = d->sceneGraphContext()->createImageNode();
- d->regions[2].node->setTargetRect(rect);
- d->regions[2].node->setInnerTargetRect(rect);
- d->regions[2].targetRect = rect;
- }
- }
-
- if (innerSourceRect.bottom() < 1) {
- QRectF rect(innerTargetRect.right(),
- innerTargetRect.bottom(),
- width() - innerTargetRect.width() - innerTargetRect.left(),
- height() - innerTargetRect.height() - innerTargetRect.top());
-
- if (!rect.isEmpty()) {
- d->regions[8].node = d->sceneGraphContext()->createImageNode();
- d->regions[8].node->setTargetRect(rect);
- d->regions[8].node->setInnerTargetRect(rect);
- d->regions[8].targetRect = rect;
- }
- }
-
- if (innerSourceRect.top() < innerSourceRect.bottom()) {
- QRectF rect(innerTargetRect.right(),
- innerTargetRect.top(),
- width() - innerTargetRect.width() - innerTargetRect.left(),
- innerTargetRect.height());
-
- if (!rect.isEmpty()) {
- d->regions[5].node = d->sceneGraphContext()->createImageNode();
- d->regions[5].node->setTargetRect(rect);
- d->regions[5].node->setInnerTargetRect(rect);
- d->regions[5].targetRect = rect;
- }
- }
- }
-
- if (innerSourceRect.top() > 0 && innerSourceRect.left() < innerSourceRect.right()) {
- QRectF rect(innerTargetRect.left(),
- 0,
- innerTargetRect.width(),
- innerTargetRect.top());
-
- if (!rect.isEmpty()) {
- d->regions[1].node = d->sceneGraphContext()->createImageNode();
- d->regions[1].node->setTargetRect(rect);
- d->regions[1].node->setInnerTargetRect(rect);
- d->regions[1].targetRect = rect;
- }
- }
-
- if (innerSourceRect.bottom() < 1 && innerSourceRect.left() < innerSourceRect.right()) {
- QRectF rect(innerTargetRect.left(),
- innerTargetRect.bottom(),
- innerTargetRect.width(),
- height() - innerTargetRect.height() - innerTargetRect.top());
-
- if (!rect.isEmpty()) {
- d->regions[7].node = d->sceneGraphContext()->createImageNode();
- d->regions[7].node->setTargetRect(rect);
- d->regions[7].node->setInnerTargetRect(rect);
- d->regions[7].targetRect = rect;
- }
- }
-
- if (innerSourceRect.left() < innerSourceRect.right()
- && innerSourceRect.top() < innerSourceRect.bottom()) {
- if (!innerTargetRect.isEmpty()) {
- d->regions[4].node = d->sceneGraphContext()->createImageNode();
- d->regions[4].node->setInnerTargetRect(innerTargetRect);
- d->regions[4].node->setTargetRect(innerTargetRect);
- d->regions[4].targetRect = innerTargetRect;
- }
- }
-
- for (int i=0; i<9; ++i) {
- if (d->regions[i].node != 0)
- oldNode->appendChildNode(d->regions[i].node);
- }
- }
-
-
- QImage image = d->pix.image();
-
- if (d->regions[0].node != 0) {
- if (updatePixmap)
- d->regions[0].image = shallowCopy(image, QRect(QPoint(0, 0), QSize(borderLeft, borderTop)));
-
- QSGImageNode::AntialiasingFlags antialiasing = QSGImageNode::AntialiasingFlags(QSGImageNode::AntialiasingLeft | QSGImageNode::AntialiasingTop);
- if (d->regions[1].node == 0 && d->regions[2].node == 0)
- antialiasing |= QSGImageNode::AntialiasingRight;
- if (d->regions[3].node == 0 && d->regions[6].node == 0)
- antialiasing |= QSGImageNode::AntialiasingBottom;
- d->regions[0].node->setAntialiasing(antialiasing);
}
- if (d->regions[1].node != 0) {
- if (updatePixmap)
- d->regions[1].image = shallowCopy(image, QRect(QPoint(borderLeft, 0), QSize(borderRight - borderLeft, borderTop)));
-
- QSGImageNode::AntialiasingFlags antialiasing = QSGImageNode::AntialiasingTop;
- if (d->regions[0].node == 0)
- antialiasing |= QSGImageNode::AntialiasingLeft;
- if (d->regions[2].node == 0)
- antialiasing |= QSGImageNode::AntialiasingRight;
- if (d->regions[4].node == 0 && d->regions[7].node == 0)
- antialiasing |= QSGImageNode::AntialiasingBottom;
- d->regions[1].node->setAntialiasing(antialiasing);
- }
-
- if (d->regions[2].node != 0) {
- if (updatePixmap)
- d->regions[2].image = shallowCopy(image, QRect(QPoint(borderRight, 0), QSize(d->pix.rect().width() - borderRight, borderTop)));
+ if (updatePixmap)
+ node->setTexture(texture);
- QSGImageNode::AntialiasingFlags antialiasing = QSGImageNode::AntialiasingFlags(QSGImageNode::AntialiasingTop | QSGImageNode::AntialiasingRight);
- if (d->regions[0].node == 0 && d->regions[1].node == 0)
- antialiasing |= QSGImageNode::AntialiasingLeft;
- if (d->regions[5].node == 0 && d->regions[8].node == 0)
- antialiasing |= QSGImageNode::AntialiasingBottom;
- d->regions[2].node->setAntialiasing(antialiasing);
- }
-
- if (d->regions[3].node != 0) {
- if (updatePixmap)
- d->regions[3].image = shallowCopy(image, QRect(QPoint(0, borderTop), QSize(borderLeft, borderBottom - borderTop)));
-
- QSGImageNode::AntialiasingFlags antialiasing = QSGImageNode::AntialiasingLeft;
- if (d->regions[4].node == 0 && d->regions[5].node == 0)
- antialiasing |= QSGImageNode::AntialiasingRight;
- if (d->regions[6].node == 0)
- antialiasing |= QSGImageNode::AntialiasingBottom;
- if (d->regions[0].node == 0)
- antialiasing |= QSGImageNode::AntialiasingTop;
- d->regions[3].node->setAntialiasing(antialiasing);
+ // Don't implicitly create the scalegrid in the rendering thread...
+ QRectF innerSourceRect(0, 0, 1, 1);
+ QRectF targetRect(0, 0, width(), height());
+ QRectF innerTargetRect = targetRect;
+ if (d->border) {
+ const QQuickScaleGrid *border = d->getScaleGrid();
+ innerSourceRect = QRectF(border->left() / qreal(d->pix.width()),
+ border->top() / qreal(d->pix.height()),
+ qMax<qreal>(0, d->pix.width() - border->right() - border->left()) / d->pix.width(),
+ qMax<qreal>(0, d->pix.height() - border->bottom() - border->top()) / d->pix.height());
+ innerTargetRect = QRectF(border->left(),
+ border->top(),
+ qMax<qreal>(0, width() - border->right() - border->left()),
+ qMax<qreal>(0, height() - border->bottom() - border->top()));
}
-
- if (d->regions[4].node != 0) {
- if (updatePixmap) {
- if (innerSourceRect == QRectF(0, 0, 1, 1)) {
- d->regions[4].image = image;
- } else {
- d->regions[4].image = shallowCopy(image, QRect(QPoint(borderLeft, borderTop), QSize(borderRight - borderLeft, borderBottom - borderTop)));
- }
+ qreal hTiles = 1;
+ qreal vTiles = 1;
+ if (innerSourceRect.width() != 0) {
+ switch (d->horizontalTileMode) {
+ case QQuickBorderImage::Repeat:
+ hTiles = innerTargetRect.width() / qreal(innerSourceRect.width() * d->pix.width());
+ break;
+ case QQuickBorderImage::Round:
+ hTiles = qCeil(innerTargetRect.width() / qreal(innerSourceRect.width() * d->pix.width()));
+ break;
+ default:
+ break;
}
-
- QSGImageNode::AntialiasingFlags antialiasing = QSGImageNode::AntialiasingNone;
- if (d->regions[3].node == 0)
- antialiasing |= QSGImageNode::AntialiasingLeft;
- if (d->regions[5].node == 0)
- antialiasing |= QSGImageNode::AntialiasingRight;
- if (d->regions[1].node == 0)
- antialiasing |= QSGImageNode::AntialiasingTop;
- if (d->regions[7].node == 0)
- antialiasing |= QSGImageNode::AntialiasingBottom;
- d->regions[4].node->setAntialiasing(antialiasing);
}
-
- if (d->regions[5].node != 0) {
- if (updatePixmap)
- d->regions[5].image = shallowCopy(image, QRect(QPoint(borderRight, borderTop), QSize(d->pix.rect().width() - borderRight, borderBottom - borderTop)));
-
- QSGImageNode::AntialiasingFlags antialiasing = QSGImageNode::AntialiasingRight;
- if (d->regions[4].node == 0 && d->regions[3].node == 0)
- antialiasing |= QSGImageNode::AntialiasingLeft;
- if (d->regions[2].node == 0)
- antialiasing |= QSGImageNode::AntialiasingTop;
- if (d->regions[8].node == 0)
- antialiasing |= QSGImageNode::AntialiasingBottom;
- d->regions[5].node->setAntialiasing(antialiasing);
- }
-
- if (d->regions[6].node != 0) {
- if (updatePixmap)
- d->regions[6].image = shallowCopy(image, QRect(QPoint(0, borderBottom), QSize(borderLeft, d->pix.rect().height() - borderBottom)));
-
- QSGImageNode::AntialiasingFlags antialiasing = QSGImageNode::AntialiasingFlags(QSGImageNode::AntialiasingBottom | QSGImageNode::AntialiasingLeft);
- if (d->regions[7].node == 0 && d->regions[8].node == 0)
- antialiasing |= QSGImageNode::AntialiasingRight;
- if (d->regions[3].node == 0 && d->regions[0].node == 0)
- antialiasing |= QSGImageNode::AntialiasingTop;
- d->regions[6].node->setAntialiasing(antialiasing);
- }
-
- if (d->regions[7].node != 0) {
- if (updatePixmap)
- d->regions[7].image = shallowCopy(image, QRect(QPoint(borderLeft, borderBottom), QSize(borderRight - borderLeft, d->pix.rect().height() - borderBottom)));
-
- QSGImageNode::AntialiasingFlags antialiasing = QSGImageNode::AntialiasingBottom;
- if (d->regions[6].node == 0)
- antialiasing |= QSGImageNode::AntialiasingLeft;
- if (d->regions[8].node == 0)
- antialiasing |= QSGImageNode::AntialiasingRight;
- if (d->regions[4].node == 0 && d->regions[1].node == 0)
- antialiasing |= QSGImageNode::AntialiasingTop;
- d->regions[7].node->setAntialiasing(antialiasing);
- }
-
- if (d->regions[8].node != 0) {
- if (updatePixmap)
- d->regions[8].image = shallowCopy(image, QRect(QPoint(borderRight, borderBottom), QSize(d->pix.rect().width() - borderRight, d->pix.rect().height() - borderBottom)));
-
- QSGImageNode::AntialiasingFlags antialiasing = QSGImageNode::AntialiasingFlags(QSGImageNode::AntialiasingBottom | QSGImageNode::AntialiasingRight);
- if (d->regions[7].node == 0 && d->regions[6].node == 0)
- antialiasing |= QSGImageNode::AntialiasingLeft;
- if (d->regions[5].node == 0 && d->regions[2].node == 0)
- antialiasing |= QSGImageNode::AntialiasingTop;
- d->regions[8].node->setAntialiasing(antialiasing);
+ if (innerSourceRect.height() != 0) {
+ switch (d->verticalTileMode) {
+ case QQuickBorderImage::Repeat:
+ vTiles = innerTargetRect.height() / qreal(innerSourceRect.height() * d->pix.height());
+ break;
+ case QQuickBorderImage::Round:
+ vTiles = qCeil(innerTargetRect.height() / qreal(innerSourceRect.height() * d->pix.height()));
+ break;
+ default:
+ break;
+ }
}
- for (int i=0; i<9; ++i) {
- if (d->regions[i].node != 0) {
- if (updatePixmap) {
- QQuickTextureFactory *textureFactory = QSGContext::createTextureFactoryFromImage(d->regions[i].image);
- if (textureFactory == 0)
- textureFactory = new QQuickDefaultTextureFactory(d->regions[i].image);
- d->regions[i].textureFactory.reset(textureFactory);
- d->regions[i].node->setTexture(d->sceneGraphRenderContext()->textureForFactory(d->regions[i].textureFactory.data(),
- window()));
- }
-
- d->regions[i].node->setInnerSourceRect(QRectF(0, 0, 1, 1));
- d->regions[i].node->setMipmapFiltering(QSGTexture::None);
- d->regions[i].node->setFiltering(d->smooth ? QSGTexture::Linear : QSGTexture::Nearest);
- d->regions[i].node->setMirror(d->mirror);
-
-
- qreal hTiles = 1;
- qreal vTiles = 1;
-
- if (innerSourceRect.width() != 0) {
- switch (d->horizontalTileMode) {
- case QQuickBorderImage::Repeat:
- hTiles = d->regions[i].targetRect.width() / qreal(d->regions[i].image.width());
- break;
- case QQuickBorderImage::Round:
- hTiles = qCeil(d->regions[i].targetRect.width() / qreal(d->regions[i].image.width()));
- break;
- default:
- break;
- }
- }
-
- if (innerSourceRect.height() != 0) {
- switch (d->verticalTileMode) {
- case QQuickBorderImage::Repeat:
- vTiles = d->regions[i].targetRect.height() / qreal(d->regions[i].image.height());
- break;
- case QQuickBorderImage::Round:
- vTiles = qCeil(d->regions[i].targetRect.height() / qreal(d->regions[i].image.height()));
- break;
- default:
- break;
- }
- }
-
- if (vTiles > 1 || hTiles > 1) {
- d->regions[i].node->setHorizontalWrapMode(QSGTexture::Repeat);
- d->regions[i].node->setVerticalWrapMode(QSGTexture::Repeat);
- } else {
- d->regions[i].node->setHorizontalWrapMode(QSGTexture::ClampToEdge);
- d->regions[i].node->setVerticalWrapMode(QSGTexture::ClampToEdge);
- }
-
- d->regions[i].node->setSubSourceRect(QRectF(0, 0, hTiles, vTiles));
- d->regions[i].node->update();
- }
+ node->setTargetRect(targetRect);
+ node->setInnerSourceRect(innerSourceRect);
+ node->setInnerTargetRect(innerTargetRect);
+ node->setSubSourceRect(QRectF(0, 0, hTiles, vTiles));
+ node->setMirror(d->mirror);
+
+ node->setMipmapFiltering(QSGTexture::None);
+ node->setFiltering(d->smooth ? QSGTexture::Linear : QSGTexture::Nearest);
+ if (innerSourceRect == QRectF(0, 0, 1, 1) && (vTiles > 1 || hTiles > 1)) {
+ node->setHorizontalWrapMode(QSGTexture::Repeat);
+ node->setVerticalWrapMode(QSGTexture::Repeat);
+ } else {
+ node->setHorizontalWrapMode(QSGTexture::ClampToEdge);
+ node->setVerticalWrapMode(QSGTexture::ClampToEdge);
}
+ node->setAntialiasing(d->antialiasing);
+ node->update();
- return oldNode;
+ return node;
}
void QQuickBorderImage::pixmapChange()
diff --git a/src/quick/items/qquickborderimage_p.h b/src/quick/items/qquickborderimage_p.h
index a33098d3b1..e998646e48 100644
--- a/src/quick/items/qquickborderimage_p.h
+++ b/src/quick/items/qquickborderimage_p.h
@@ -87,8 +87,6 @@ private Q_SLOTS:
void sciRequestFinished();
private:
- static QImage shallowCopy(const QImage &image, const QRect &rect);
-
Q_DISABLE_COPY(QQuickBorderImage)
Q_DECLARE_PRIVATE(QQuickBorderImage)
};
diff --git a/src/quick/items/qquickborderimage_p_p.h b/src/quick/items/qquickborderimage_p_p.h
index bda2867696..d5b959fd9f 100644
--- a/src/quick/items/qquickborderimage_p_p.h
+++ b/src/quick/items/qquickborderimage_p_p.h
@@ -89,16 +89,6 @@ public:
QQuickBorderImage::TileMode verticalTileMode;
int redirectCount;
- struct BorderImageRegion
- {
- BorderImageRegion() : node(0), textureFactory(0) {}
- QImage image;
- QSGImageNode *node;
- QScopedPointer<QQuickTextureFactory> textureFactory;
- QRectF targetRect;
- };
- BorderImageRegion regions[9];
-
bool pixmapChanged : 1;
};
diff --git a/src/quick/items/qquickimagebase.cpp b/src/quick/items/qquickimagebase.cpp
index 1a5d115a3c..a4c4af4e45 100644
--- a/src/quick/items/qquickimagebase.cpp
+++ b/src/quick/items/qquickimagebase.cpp
@@ -35,6 +35,7 @@
#include "qquickimagebase_p_p.h"
#include <QtGui/qguiapplication.h>
+#include <QtGui/qscreen.h>
#include <QtQml/qqmlinfo.h>
#include <QtQml/qqmlfile.h>
@@ -45,14 +46,12 @@ QQuickImageBase::QQuickImageBase(QQuickItem *parent)
: QQuickImplicitSizeItem(*(new QQuickImageBasePrivate), parent)
{
setFlag(ItemHasContents);
- connect(this, SIGNAL(windowChanged(QQuickWindow*)), SLOT(handleWindowChanged(QQuickWindow*)));
}
QQuickImageBase::QQuickImageBase(QQuickImageBasePrivate &dd, QQuickItem *parent)
: QQuickImplicitSizeItem(dd, parent)
{
setFlag(ItemHasContents);
- connect(this, SIGNAL(windowChanged(QQuickWindow*)), SLOT(handleWindowChanged(QQuickWindow*)));
}
QQuickImageBase::~QQuickImageBase()
@@ -278,10 +277,11 @@ void QQuickImageBase::requestProgress(qint64 received, qint64 total)
}
}
-void QQuickImageBase::handleWindowChanged(QQuickWindow* window)
+void QQuickImageBase::itemChange(ItemChange change, const ItemChangeData &value)
{
- if (window)
- connect(window, SIGNAL(screenChanged(QScreen*)), this, SLOT(handleScreenChanged(QScreen*)));
+ if (change == ItemSceneChange && value.window)
+ connect(value.window, &QQuickWindow::screenChanged, this, &QQuickImageBase::handleScreenChanged);
+ QQuickItem::itemChange(change, value);
}
void QQuickImageBase::handleScreenChanged(QScreen* screen)
diff --git a/src/quick/items/qquickimagebase_p.h b/src/quick/items/qquickimagebase_p.h
index 860cb2e670..c204bdd442 100644
--- a/src/quick/items/qquickimagebase_p.h
+++ b/src/quick/items/qquickimagebase_p.h
@@ -93,12 +93,12 @@ protected:
virtual void load();
void componentComplete() Q_DECL_OVERRIDE;
virtual void pixmapChange();
+ void itemChange(ItemChange change, const ItemChangeData &value) Q_DECL_OVERRIDE;
QQuickImageBase(QQuickImageBasePrivate &dd, QQuickItem *parent);
private Q_SLOTS:
virtual void requestFinished();
void requestProgress(qint64,qint64);
- void handleWindowChanged(QQuickWindow *window);
void handleScreenChanged(QScreen *screen);
private:
diff --git a/src/quick/items/qquickimagebase_p_p.h b/src/quick/items/qquickimagebase_p_p.h
index 21d11a7448..f30eacb4ac 100644
--- a/src/quick/items/qquickimagebase_p_p.h
+++ b/src/quick/items/qquickimagebase_p_p.h
@@ -75,9 +75,6 @@ public:
QSize sourcesize;
QSize oldSourceSize;
qreal devicePixelRatio;
- QRectF oldInnerSourceRect;
- QRectF oldInnerTargetRect;
- QSizeF oldSize;
bool async : 1;
bool cache : 1;
bool mirror: 1;
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 25f139549d..6ae74281ca 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -2481,7 +2481,7 @@ void QQuickItem::setParentItem(QQuickItem *parentItem)
return;
if (parentItem) {
- QQuickItem *itemAncestor = parentItem->parentItem();
+ QQuickItem *itemAncestor = parentItem;
while (itemAncestor != 0) {
if (itemAncestor == this) {
qWarning("QQuickItem::setParentItem: Parent is already part of this items subtree.");
diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp
index 7ccd3a0fb4..a666bb59c9 100644
--- a/src/quick/items/qquickrendercontrol.cpp
+++ b/src/quick/items/qquickrendercontrol.cpp
@@ -106,7 +106,7 @@ extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_
rendered by calling render(). After making the context current, applications
are expected to call render().
- \li QQuickRenderControl::sceneChanged() Inidcates that the scene has changed
+ \li QQuickRenderControl::sceneChanged() Indicates that the scene has changed
meaning that, before rendering, polishing and synchronizing is also necessary.
\endlist
@@ -172,6 +172,10 @@ void QQuickRenderControlPrivate::windowDestroyed()
/*!
Initializes the scene graph resources. The context \a gl has to
be the current context.
+
+ \note Qt Quick does not take ownership of the context. It is up to the
+ application to destroy it after a call to invalidate() or after the
+ QQuickRenderControl instance is destroyed.
*/
void QQuickRenderControl::initialize(QOpenGLContext *gl)
{
@@ -274,7 +278,6 @@ void QQuickRenderControl::invalidate()
// application right after returning from this function. Invalidating is
// also essential to allow a subsequent initialize() to succeed.
d->rc->invalidate();
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
d->initialized = false;
}
@@ -296,6 +299,10 @@ void QQuickRenderControl::render()
\fn void QQuickRenderControl::renderRequested()
This signal is emitted when the scene graph needs to be rendered. It is not necessary to call sync().
+
+ \note Avoid triggering rendering directly when this signal is
+ emitted. Instead, prefer deferring it by using a timer for example. This
+ will lead to better performance.
*/
/*!
@@ -304,6 +311,10 @@ void QQuickRenderControl::render()
This signal is emitted when the scene graph is updated, meaning that
polishItems() and sync() needs to be called. If sync() returns
true, then render() needs to be called.
+
+ \note Avoid triggering polishing, synchronization and rendering directly
+ when this signal is emitted. Instead, prefer deferring it by using a timer
+ for example. This will lead to better performance.
*/
/*!
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index bfa2fccd67..87255f4bd9 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -79,6 +79,7 @@ QQuickTextPrivate::QQuickTextPrivate()
, requireImplicitSize(false), implicitWidthValid(false), implicitHeightValid(false)
, truncated(false), hAlignImplicit(true), rightToLeftText(false)
, layoutTextElided(false), textHasChanged(true), needToUpdateLayout(false), formatModifiesFontSize(false)
+ , polishSize(false)
{
implicitAntialiasing = true;
}
@@ -356,6 +357,8 @@ void QQuickTextPrivate::updateLayout()
textHasChanged = true;
updateLayout();
}
+
+ q->polish();
}
void QQuickText::imageDownloadFinished()
@@ -2248,13 +2251,22 @@ QSGNode *QQuickText::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data
node->addImage(QRectF(img->pos.x() + dx, img->pos.y() + dy, pix->width(), pix->height()), pix->image());
}
}
+
+ // The font caches have now been initialized on the render thread, so they have to be
+ // invalidated before we can use them from the main thread again.
+ invalidateFontCaches();
+
return node;
}
void QQuickText::updatePolish()
{
Q_D(QQuickText);
- d->updateSize();
+ if (d->polishSize) {
+ d->updateSize();
+ d->polishSize = false;
+ }
+ invalidateFontCaches();
}
/*!
@@ -2381,6 +2393,7 @@ void QQuickText::setFontSizeMode(FontSizeMode mode)
if (d->fontSizeMode() == mode)
return;
+ d->polishSize = true;
polish();
d->extra.value().fontSizeMode = mode;
@@ -2409,8 +2422,10 @@ void QQuickText::setMinimumPixelSize(int size)
if (d->minimumPixelSize() == size)
return;
- if (d->fontSizeMode() != FixedSize && (widthValid() || heightValid()))
+ if (d->fontSizeMode() != FixedSize && (widthValid() || heightValid())) {
+ d->polishSize = true;
polish();
+ }
d->extra.value().minimumPixelSize = size;
emit minimumPixelSizeChanged();
}
@@ -2437,8 +2452,10 @@ void QQuickText::setMinimumPointSize(int size)
if (d->minimumPointSize() == size)
return;
- if (d->fontSizeMode() != FixedSize && (widthValid() || heightValid()))
+ if (d->fontSizeMode() != FixedSize && (widthValid() || heightValid())) {
+ d->polishSize = true;
polish();
+ }
d->extra.value().minimumPointSize = size;
emit minimumPointSizeChanged();
}
@@ -2699,4 +2716,26 @@ QString QQuickText::linkAt(qreal x, qreal y) const
return d->anchorAt(QPointF(x, y));
}
+/*!
+ * \internal
+ *
+ * Invalidates font caches owned by the text objects owned by the element
+ * to work around the fact that text objects cannot be used from multiple threads.
+ */
+void QQuickText::invalidateFontCaches()
+{
+ Q_D(QQuickText);
+
+ if (d->richText && d->extra->doc != 0) {
+ QTextBlock block;
+ for (block = d->extra->doc->firstBlock(); block.isValid(); block = block.next()) {
+ if (block.layout() != 0 && block.layout()->engine() != 0)
+ block.layout()->engine()->resetFontEngineCache();
+ }
+ } else {
+ if (d->layout.engine() != 0)
+ d->layout.engine()->resetFontEngineCache();
+ }
+}
+
QT_END_NAMESPACE
diff --git a/src/quick/items/qquicktext_p.h b/src/quick/items/qquicktext_p.h
index bc1a5198e8..18f2a73470 100644
--- a/src/quick/items/qquicktext_p.h
+++ b/src/quick/items/qquicktext_p.h
@@ -245,6 +245,7 @@ protected:
void hoverEnterEvent(QHoverEvent *event) Q_DECL_OVERRIDE;
void hoverMoveEvent(QHoverEvent *event) Q_DECL_OVERRIDE;
void hoverLeaveEvent(QHoverEvent *event) Q_DECL_OVERRIDE;
+ void invalidateFontCaches();
private Q_SLOTS:
void q_imagesLoaded();
diff --git a/src/quick/items/qquicktext_p_p.h b/src/quick/items/qquicktext_p_p.h
index 04a78f9c21..3b83d37899 100644
--- a/src/quick/items/qquicktext_p_p.h
+++ b/src/quick/items/qquicktext_p_p.h
@@ -151,6 +151,7 @@ public:
bool textHasChanged:1;
bool needToUpdateLayout:1;
bool formatModifiesFontSize:1;
+ bool polishSize:1; // Workaround for problem with polish called after updateSize (QTBUG-42636)
static const QChar elideChar;
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index 1ad37ed7dd..c46df8f1b0 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -1745,6 +1745,7 @@ void QQuickTextEdit::triggerPreprocess()
Q_D(QQuickTextEdit);
if (d->updateType == QQuickTextEditPrivate::UpdateNone)
d->updateType = QQuickTextEditPrivate::UpdateOnlyPreprocess;
+ polish();
update();
}
@@ -1764,6 +1765,25 @@ static inline void updateNodeTransform(QQuickTextNode* node, const QPointF &topL
node->setMatrix(transformMatrix);
}
+/*!
+ * \internal
+ *
+ * Invalidates font caches owned by the text objects owned by the element
+ * to work around the fact that text objects cannot be used from multiple threads.
+ */
+void QQuickTextEdit::invalidateFontCaches()
+{
+ Q_D(QQuickTextEdit);
+ if (d->document == 0)
+ return;
+
+ QTextBlock block;
+ for (block = d->document->firstBlock(); block.isValid(); block = block.next()) {
+ if (block.layout() != 0 && block.layout()->engine() != 0)
+ block.layout()->engine()->resetFontEngineCache();
+ }
+}
+
QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData)
{
Q_UNUSED(updatePaintNodeData);
@@ -1917,9 +1937,16 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
rootNode->resetCursorNode(cursor);
}
+ invalidateFontCaches();
+
return rootNode;
}
+void QQuickTextEdit::updatePolish()
+{
+ invalidateFontCaches();
+}
+
/*!
\qmlproperty bool QtQuick::TextEdit::canPaste
@@ -2087,6 +2114,7 @@ void QQuickTextEdit::q_contentsChange(int pos, int charsRemoved, int charsAdded)
markDirtyNodesForRange(pos, editRange, delta);
+ polish();
if (isComponentComplete()) {
d->updateType = QQuickTextEditPrivate::UpdatePaintNode;
update();
@@ -2114,6 +2142,7 @@ void QQuickTextEdit::updateSelection()
// No need for node updates when we go from an empty selection to another empty selection
if (d->control->textCursor().hasSelection() || d->hadSelection) {
markDirtyNodesForRange(qMin(d->lastSelectionStart, d->control->textCursor().selectionStart()), qMax(d->control->textCursor().selectionEnd(), d->lastSelectionEnd), 0);
+ polish();
if (isComponentComplete()) {
d->updateType = QQuickTextEditPrivate::UpdatePaintNode;
update();
@@ -2254,6 +2283,7 @@ void QQuickTextEdit::updateWholeDocument()
node->setDirty();
}
+ polish();
if (isComponentComplete()) {
d->updateType = QQuickTextEditPrivate::UpdatePaintNode;
update();
@@ -2268,6 +2298,7 @@ void QQuickTextEdit::invalidateBlock(const QTextBlock &block)
void QQuickTextEdit::updateCursor()
{
Q_D(QQuickTextEdit);
+ polish();
if (isComponentComplete()) {
d->updateType = QQuickTextEditPrivate::UpdatePaintNode;
update();
diff --git a/src/quick/items/qquicktextedit_p.h b/src/quick/items/qquicktextedit_p.h
index ea47c3b60e..5320ecc2ca 100644
--- a/src/quick/items/qquicktextedit_p.h
+++ b/src/quick/items/qquicktextedit_p.h
@@ -215,7 +215,7 @@ public:
#ifndef QT_NO_IM
QVariant inputMethodQuery(Qt::InputMethodQuery property) const Q_DECL_OVERRIDE;
- Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
+ Q_REVISION(4) Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
#endif
qreal contentWidth() const;
@@ -318,6 +318,7 @@ private Q_SLOTS:
private:
void markDirtyNodesForRange(int start, int end, int charDelta);
void updateTotalLines();
+ void invalidateFontCaches();
protected:
void geometryChanged(const QRectF &newGeometry,
@@ -342,6 +343,7 @@ protected:
void inputMethodEvent(QInputMethodEvent *e) Q_DECL_OVERRIDE;
#endif
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) Q_DECL_OVERRIDE;
+ void updatePolish();
friend class QQuickTextUtil;
friend class QQuickTextDocument;
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index d1bf022184..288464e0b4 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -56,6 +56,8 @@
#include "qquickaccessibleattached_p.h"
#endif
+#include <QtGui/private/qtextengine_p.h>
+
QT_BEGIN_NAMESPACE
DEFINE_BOOL_CONFIG_OPTION(qmlDisableDistanceField, QML_DISABLE_DISTANCEFIELD)
@@ -362,6 +364,7 @@ void QQuickTextInput::setColor(const QColor &c)
d->color = c;
d->textLayoutDirty = true;
d->updateType = QQuickTextInputPrivate::UpdatePaintNode;
+ polish();
update();
emit colorChanged();
}
@@ -389,6 +392,7 @@ void QQuickTextInput::setSelectionColor(const QColor &color)
if (d->hasSelectedText()) {
d->textLayoutDirty = true;
d->updateType = QQuickTextInputPrivate::UpdatePaintNode;
+ polish();
update();
}
emit selectionColorChanged();
@@ -414,6 +418,7 @@ void QQuickTextInput::setSelectedTextColor(const QColor &color)
if (d->hasSelectedText()) {
d->textLayoutDirty = true;
d->updateType = QQuickTextInputPrivate::UpdatePaintNode;
+ polish();
update();
}
emit selectedTextColorChanged();
@@ -723,6 +728,7 @@ void QQuickTextInput::setCursorVisible(bool on)
if (!d->cursorItem) {
d->setCursorBlinkPeriod(on ? qApp->styleHints()->cursorFlashTime() : 0);
d->updateType = QQuickTextInputPrivate::UpdatePaintNode;
+ polish();
update();
}
emit cursorVisibleChanged(d->cursorVisible);
@@ -1846,9 +1852,23 @@ void QQuickTextInput::triggerPreprocess()
Q_D(QQuickTextInput);
if (d->updateType == QQuickTextInputPrivate::UpdateNone)
d->updateType = QQuickTextInputPrivate::UpdateOnlyPreprocess;
+ polish();
update();
}
+void QQuickTextInput::updatePolish()
+{
+ invalidateFontCaches();
+}
+
+void QQuickTextInput::invalidateFontCaches()
+{
+ Q_D(QQuickTextInput);
+
+ if (d->m_textLayout.engine() != 0)
+ d->m_textLayout.engine()->resetFontEngineCache();
+}
+
QSGNode *QQuickTextInput::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data)
{
Q_UNUSED(data);
@@ -1907,6 +1927,8 @@ QSGNode *QQuickTextInput::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData
d->textLayoutDirty = false;
}
+ invalidateFontCaches();
+
return node;
}
@@ -2669,6 +2691,7 @@ void QQuickTextInput::updateCursorRectangle(bool scroll)
d->updateVerticalScroll();
}
d->updateType = QQuickTextInputPrivate::UpdatePaintNode;
+ polish();
update();
emit cursorRectangleChanged();
if (d->cursorItem) {
@@ -2686,6 +2709,7 @@ void QQuickTextInput::selectionChanged()
Q_D(QQuickTextInput);
d->textLayoutDirty = true; //TODO: Only update rect in selection
d->updateType = QQuickTextInputPrivate::UpdatePaintNode;
+ polish();
update();
emit selectedTextChanged();
@@ -2897,6 +2921,7 @@ void QQuickTextInputPrivate::updateLayout()
contentSize = QSizeF(width, height);
updateType = UpdatePaintNode;
+ q->polish();
q->update();
if (!requireImplicitWidth && !q->widthValid())
@@ -4185,6 +4210,7 @@ void QQuickTextInputPrivate::setCursorBlinkPeriod(int msec)
m_blinkTimer = 0;
if (m_blinkStatus == 1) {
updateType = UpdatePaintNode;
+ q->polish();
q->update();
}
}
@@ -4197,6 +4223,7 @@ void QQuickTextInput::timerEvent(QTimerEvent *event)
if (event->timerId() == d->m_blinkTimer) {
d->m_blinkStatus = !d->m_blinkStatus;
d->updateType = QQuickTextInputPrivate::UpdatePaintNode;
+ polish();
update();
} else if (event->timerId() == d->m_passwordEchoTimer.timerId()) {
d->m_passwordEchoTimer.stop();
diff --git a/src/quick/items/qquicktextinput_p.h b/src/quick/items/qquicktextinput_p.h
index 0d32cb2179..3cd5b7ad18 100644
--- a/src/quick/items/qquicktextinput_p.h
+++ b/src/quick/items/qquicktextinput_p.h
@@ -239,7 +239,7 @@ public:
#ifndef QT_NO_IM
QVariant inputMethodQuery(Qt::InputMethodQuery property) const Q_DECL_OVERRIDE;
- Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
+ Q_REVISION(3) Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
#endif
QRectF boundingRect() const Q_DECL_OVERRIDE;
@@ -301,6 +301,9 @@ Q_SIGNALS:
void inputMethodHintsChanged();
void renderTypeChanged();
+private:
+ void invalidateFontCaches();
+
protected:
void geometryChanged(const QRectF &newGeometry,
const QRectF &oldGeometry) Q_DECL_OVERRIDE;
@@ -319,6 +322,7 @@ protected:
void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) Q_DECL_OVERRIDE;
+ void updatePolish();
public Q_SLOTS:
void selectAll();
diff --git a/src/quick/items/qquickview.cpp b/src/quick/items/qquickview.cpp
index 41b53ddffe..0a16457e0e 100644
--- a/src/quick/items/qquickview.cpp
+++ b/src/quick/items/qquickview.cpp
@@ -379,10 +379,6 @@ QList<QQmlError> QQuickView::errors() const
If this property is set to SizeRootObjectToView, the view will
automatically resize the root item to the size of the view.
- Regardless of this property, the sizeHint of the view
- is the initial size of the root item. Note though that
- since QML may load dynamically, that size may change.
-
\sa initialSize()
*/
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 13462317a3..aba36ce118 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -897,8 +897,10 @@ void QQuickWindowPrivate::clearFocusInScope(QQuickItem *scope, QQuickItem *item,
void QQuickWindowPrivate::clearFocusObject()
{
- if (activeFocusItem)
- activeFocusItem->setFocus(false, Qt::OtherFocusReason);
+ if (activeFocusItem == contentItem)
+ return;
+
+ clearFocusInScope(contentItem, QQuickItemPrivate::get(contentItem)->subFocusItem, Qt::OtherFocusReason);
}
void QQuickWindowPrivate::notifyFocusChangesRecur(QQuickItem **items, int remaining)
@@ -970,10 +972,10 @@ void QQuickWindowPrivate::cleanup(QSGNode *n)
Alternatively you can set or bind \l x and \l y to position the Window
explicitly on the screen.
- When the user attempts to close a window, the \a closing signal will be
+ When the user attempts to close a window, the \l closing signal will be
emitted. You can force the window to stay open (for example to prompt the
- user to save changes) by writing an onClosing handler and setting
- close.accepted = false.
+ user to save changes) by writing an \c onClosing handler and setting
+ \c {close.accepted = false}.
*/
/*!
\class QQuickWindow
@@ -1254,6 +1256,14 @@ bool QQuickWindow::isPersistentSceneGraph() const
+/*!
+ \qmlattachedproperty Item Window::contentItem
+ \since 5.4
+
+ This attached property holds the invisible root item of the scene or
+ \c null if the item is not in a window. The Window attached property
+ can be attached to any Item.
+*/
/*!
\property QQuickWindow::contentItem
@@ -1795,7 +1805,9 @@ void QQuickWindowPrivate::deliverTouchEvent(QTouchEvent *event)
if (!delayedTouch) {
delayedTouch = new QTouchEvent(event->type(), event->device(), event->modifiers(), event->touchPointStates(), event->touchPoints());
delayedTouch->setTimestamp(event->timestamp());
- if (windowManager)
+ if (renderControl)
+ QQuickRenderControlPrivate::get(renderControl)->maybeUpdate();
+ else if (windowManager)
windowManager->maybeUpdate(q);
return;
} else {
@@ -3088,7 +3100,7 @@ bool QQuickWindow::isSceneGraphInitialized() const
\since 5.1
Notification that a window is about to be closed by the windowing system
- (e.g. the user clicked the titlebar close button). The CloseEvent contains
+ (e.g. the user clicked the title bar close button). The CloseEvent contains
an accepted property which can be set to false to abort closing the window.
\sa Window.closing()
@@ -3115,9 +3127,9 @@ bool QQuickWindow::isSceneGraphInitialized() const
This signal is emitted when the user tries to close the window.
- This signal includes a closeEvent parameter. The \a close \l accepted
+ This signal includes a \a close parameter. The \a close \l accepted
property is true by default so that the window is allowed to close; but you
- can implement an onClosing() handler and set close.accepted = false if
+ can implement an \c onClosing handler and set \c {close.accepted = false} if
you need to do something else before the window can be closed.
The corresponding handler is \c onClosing.
@@ -3799,7 +3811,7 @@ void QQuickWindow::resetOpenGLState()
Whether the window is visible on the screen.
- Setting visible to false is the same as setting \l visibility to Hidden.
+ Setting visible to false is the same as setting \l visibility to \l {QWindow::}{Hidden}.
\sa visibility
*/
@@ -3812,13 +3824,14 @@ void QQuickWindow::resetOpenGLState()
Visibility is whether the window should appear in the windowing system as
normal, minimized, maximized, fullscreen or hidden.
- To set the visibility to AutomaticVisibility means to give the window a
- default visible state, which might be fullscreen or windowed depending on
- the platform. However when reading the visibility property you will always
- get the actual state, never AutomaticVisibility.
+ To set the visibility to \l {QWindow::}{AutomaticVisibility} means to give the
+ window a default visible state, which might be \l {QWindow::}{FullScreen} or
+ \l {QWindow::}{Windowed} depending on the platform. However when reading the
+ visibility property you will always get the actual state, never
+ \c AutomaticVisibility.
When a window is not visible its visibility is Hidden, and setting
- visibility to Hidden is the same as setting \l visible to false.
+ visibility to \l {QWindow::}{Hidden} is the same as setting \l visible to \c false.
\sa visible
\since 5.1
@@ -3830,7 +3843,7 @@ void QQuickWindow::resetOpenGLState()
This attached property holds whether the window is currently shown
in the windowing system as normal, minimized, maximized, fullscreen or
- hidden. The Window attached property can be attached to any Item. If the
+ hidden. The \c Window attached property can be attached to any Item. If the
item is not shown in any window, the value will be \l {QWindow::}{Hidden}.
\sa visible, visibility
@@ -3931,12 +3944,94 @@ void QQuickWindow::resetOpenGLState()
\qmlmethod QtQuick::Window::alert(int msec)
\since 5.1
- Causes an alert to be shown for \a msec miliseconds. If \a msec is \c 0 (the
- default), then the alert is shown indefinitely until the window becomes
- active again.
+ Causes an alert to be shown for \a msec milliseconds. If \a msec is \c 0
+ (the default), then the alert is shown indefinitely until the window
+ becomes active again.
+
+ In alert state, the window indicates that it demands attention, for example
+ by flashing or bouncing the taskbar entry.
+*/
+
+/*!
+ \qmlmethod QtQuick::Window::close()
+
+ Closes the window.
+
+ When this method is called, or when the user tries to close the window by
+ its title bar button, the \l closing signal will be emitted. If there is no
+ handler, or the handler does not revoke permission to close, the window
+ will subsequently close. If the QGuiApplication::quitOnLastWindowClosed
+ property is \c true, and there are no other windows open, the application
+ will quit.
+*/
+
+/*!
+ \qmlmethod QtQuick::Window::raise()
+
+ Raises the window in the windowing system.
+
+ Requests that the window be raised to appear above other windows.
+*/
+
+/*!
+ \qmlmethod QtQuick::Window::lower()
+
+ Lowers the window in the windowing system.
+
+ Requests that the window be lowered to appear below other windows.
+*/
+
+/*!
+ \qmlmethod QtQuick::Window::show()
+
+ Shows the window.
+
+ This is equivalent to calling showFullScreen(), showMaximized(), or showNormal(),
+ depending on the platform's default behavior for the window type and flags.
+
+ \sa showFullScreen(), showMaximized(), showNormal(), hide(), flags()
+*/
+
+/*!
+ \qmlmethod QtQuick::Window::hide()
+
+ Hides the window.
+
+ Equivalent to setting \l visible to \c false or \l visibility to \l {QWindow::}{Hidden}.
+
+ \sa show()
+*/
+
+/*!
+ \qmlmethod QtQuick::Window::showMinimized()
+
+ Shows the window as minimized.
+
+ Equivalent to setting \l visibility to \l {QWindow::}{Minimized}.
+*/
+
+/*!
+ \qmlmethod QtQuick::Window::showMaximized()
+
+ Shows the window as maximized.
+
+ Equivalent to setting \l visibility to \l {QWindow::}{Maximized}.
+*/
+
+/*!
+ \qmlmethod QtQuick::Window::showFullScreen()
+
+ Shows the window as fullscreen.
+
+ Equivalent to setting \l visibility to \l {QWindow::}{FullScreen}.
+*/
+
+/*!
+ \qmlmethod QtQuick::Window::showNormal()
+
+ Shows the window as normal, i.e. neither maximized, minimized, nor fullscreen.
- In alert state, the window indicates that it demands attention, for example by
- flashing or bouncing the taskbar entry.
+ Equivalent to setting \l visibility to \l {QWindow::}{Windowed}.
*/
/*!
@@ -3955,7 +4050,7 @@ void QQuickWindow::resetOpenGLState()
/*!
\since 5.4
- Schedule \a job to run when the rendering of this window reaches
+ Schedules \a job to run when the rendering of this window reaches
the given \a stage.
This is a convenience to the equivalent signals in QQuickWindow for
@@ -4030,7 +4125,7 @@ void QQuickWindow::runJobsAfterSwap()
*
* \sa QWindow::devicePixelRatio()
*/
-int QQuickWindow::effectiveDevicePixelRatio() const
+qreal QQuickWindow::effectiveDevicePixelRatio() const
{
QWindow *w = QQuickRenderControl::renderWindowFor(const_cast<QQuickWindow *>(this));
return w ? w->devicePixelRatio() : devicePixelRatio();
diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h
index d02423d8af..349cdf7474 100644
--- a/src/quick/items/qquickwindow.h
+++ b/src/quick/items/qquickwindow.h
@@ -143,7 +143,7 @@ public:
void scheduleRenderJob(QRunnable *job, RenderStage schedule);
- int effectiveDevicePixelRatio() const;
+ qreal effectiveDevicePixelRatio() const;
Q_SIGNALS:
void frameSwapped();
diff --git a/src/quick/items/qquickwindowattached.cpp b/src/quick/items/qquickwindowattached.cpp
index 121da9e5d9..f74e903be3 100644
--- a/src/quick/items/qquickwindowattached.cpp
+++ b/src/quick/items/qquickwindowattached.cpp
@@ -65,6 +65,11 @@ QQuickItem *QQuickWindowAttached::activeFocusItem() const
return (m_window ? m_window->activeFocusItem() : Q_NULLPTR);
}
+QQuickItem *QQuickWindowAttached::contentItem() const
+{
+ return (m_window ? m_window->contentItem() : Q_NULLPTR);
+}
+
void QQuickWindowAttached::windowChanged(QQuickWindow *window)
{
if (window != m_window) {
@@ -83,6 +88,7 @@ void QQuickWindowAttached::windowChanged(QQuickWindow *window)
emit activeChanged();
if (!oldWindow || window->activeFocusItem() != oldWindow->activeFocusItem())
emit activeFocusItemChanged();
+ emit contentItemChanged();
// QQuickWindowQmlImpl::visibilityChanged also exists, and window might even
// be QQuickWindowQmlImpl, but that's not what we are connecting to.
diff --git a/src/quick/items/qquickwindowattached_p.h b/src/quick/items/qquickwindowattached_p.h
index 12dd273d60..7c2b0bc873 100644
--- a/src/quick/items/qquickwindowattached_p.h
+++ b/src/quick/items/qquickwindowattached_p.h
@@ -49,6 +49,7 @@ class Q_AUTOTEST_EXPORT QQuickWindowAttached : public QObject
Q_PROPERTY(QWindow::Visibility visibility READ visibility NOTIFY visibilityChanged)
Q_PROPERTY(bool active READ isActive NOTIFY activeChanged)
Q_PROPERTY(QQuickItem* activeFocusItem READ activeFocusItem NOTIFY activeFocusItemChanged)
+ Q_PROPERTY(QQuickItem* contentItem READ contentItem NOTIFY contentItemChanged)
public:
QQuickWindowAttached(QObject* attachee);
@@ -56,12 +57,14 @@ public:
QWindow::Visibility visibility() const;
bool isActive() const;
QQuickItem* activeFocusItem() const;
+ QQuickItem* contentItem() const;
Q_SIGNALS:
void visibilityChanged();
void activeChanged();
void activeFocusItemChanged();
+ void contentItemChanged();
protected Q_SLOTS:
void windowChanged(QQuickWindow*);
diff --git a/src/quick/qtquick2.cpp b/src/quick/qtquick2.cpp
index 6acff85961..09784d161a 100644
--- a/src/quick/qtquick2.cpp
+++ b/src/quick/qtquick2.cpp
@@ -194,5 +194,10 @@ void QQmlQtQuick2Module::defineModule()
}
}
+void QQmlQtQuick2Module::undefineModule()
+{
+ QQuick_deinitializeProviders();
+}
+
QT_END_NAMESPACE
diff --git a/src/quick/qtquick2_p.h b/src/quick/qtquick2_p.h
index 2847d5d3ff..8f415cbd02 100644
--- a/src/quick/qtquick2_p.h
+++ b/src/quick/qtquick2_p.h
@@ -42,6 +42,7 @@ class Q_QUICK_PRIVATE_EXPORT QQmlQtQuick2Module
{
public:
static void defineModule();
+ static void undefineModule();
};
QT_END_NAMESPACE
diff --git a/src/quick/qtquickglobal_p.h b/src/quick/qtquickglobal_p.h
index e2bf198b1c..7fe09da92e 100644
--- a/src/quick/qtquickglobal_p.h
+++ b/src/quick/qtquickglobal_p.h
@@ -54,6 +54,7 @@
QT_BEGIN_NAMESPACE
void QQuick_initializeProviders();
+void QQuick_deinitializeProviders();
Q_DECLARE_LOGGING_CATEGORY(DBG_TOUCH)
Q_DECLARE_LOGGING_CATEGORY(DBG_MOUSE)
diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp
index e0b96a45b6..7ddfdeb2d4 100644
--- a/src/quick/scenegraph/qsgadaptationlayer.cpp
+++ b/src/quick/scenegraph/qsgadaptationlayer.cpp
@@ -175,6 +175,11 @@ void QSGDistanceFieldGlyphCache::update()
storeGlyphs(distanceFields);
+#if defined(QSG_DISTANCEFIELD_CACHE_DEBUG)
+ foreach (Texture texture, m_textures)
+ saveTexture(texture.textureId, texture.size.width(), texture.size.height());
+#endif
+
if (QSG_LOG_TIME_GLYPH().isDebugEnabled()) {
quint64 now = qsg_render_timer.elapsed();
qCDebug(QSG_LOG_TIME_GLYPH,
@@ -283,6 +288,163 @@ void QSGDistanceFieldGlyphCache::updateTexture(GLuint oldTex, GLuint newTex, con
}
}
+#if defined(QSG_DISTANCEFIELD_CACHE_DEBUG)
+#include <QtGui/qopenglfunctions.h>
+
+void QSGDistanceFieldGlyphCache::saveTexture(GLuint textureId, int width, int height) const
+{
+ QOpenGLFunctions *functions = QOpenGLContext::currentContext()->functions();
+
+ GLuint fboId;
+ functions->glGenFramebuffers(1, &fboId);
+
+ GLuint tmpTexture = 0;
+ functions->glGenTextures(1, &tmpTexture);
+ functions->glBindTexture(GL_TEXTURE_2D, tmpTexture);
+ functions->glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ functions->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ functions->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ functions->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ functions->glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ functions->glBindTexture(GL_TEXTURE_2D, 0);
+
+ functions->glBindFramebuffer(GL_FRAMEBUFFER_EXT, fboId);
+ functions->glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D,
+ tmpTexture, 0);
+
+ functions->glActiveTexture(GL_TEXTURE0);
+ functions->glBindTexture(GL_TEXTURE_2D, textureId);
+
+ functions->glDisable(GL_STENCIL_TEST);
+ functions->glDisable(GL_DEPTH_TEST);
+ functions->glDisable(GL_SCISSOR_TEST);
+ functions->glDisable(GL_BLEND);
+
+ GLfloat textureCoordinateArray[8];
+ textureCoordinateArray[0] = 0.0f;
+ textureCoordinateArray[1] = 0.0f;
+ textureCoordinateArray[2] = 1.0f;
+ textureCoordinateArray[3] = 0.0f;
+ textureCoordinateArray[4] = 1.0f;
+ textureCoordinateArray[5] = 1.0f;
+ textureCoordinateArray[6] = 0.0f;
+ textureCoordinateArray[7] = 1.0f;
+
+ GLfloat vertexCoordinateArray[8];
+ vertexCoordinateArray[0] = -1.0f;
+ vertexCoordinateArray[1] = -1.0f;
+ vertexCoordinateArray[2] = 1.0f;
+ vertexCoordinateArray[3] = -1.0f;
+ vertexCoordinateArray[4] = 1.0f;
+ vertexCoordinateArray[5] = 1.0f;
+ vertexCoordinateArray[6] = -1.0f;
+ vertexCoordinateArray[7] = 1.0f;
+
+ functions->glViewport(0, 0, width, height);
+ functions->glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray);
+ functions->glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray);
+
+ {
+ static const char *vertexShaderSource =
+ "attribute vec4 vertexCoordsArray; \n"
+ "attribute vec2 textureCoordArray; \n"
+ "varying vec2 textureCoords; \n"
+ "void main(void) \n"
+ "{ \n"
+ " gl_Position = vertexCoordsArray; \n"
+ " textureCoords = textureCoordArray; \n"
+ "} \n";
+
+ static const char *fragmentShaderSource =
+ "varying vec2 textureCoords; \n"
+ "uniform sampler2D texture; \n"
+ "void main() \n"
+ "{ \n"
+ " gl_FragColor = texture2D(texture, textureCoords); \n"
+ "} \n";
+
+ GLuint vertexShader = functions->glCreateShader(GL_VERTEX_SHADER);
+ GLuint fragmentShader = functions->glCreateShader(GL_FRAGMENT_SHADER);
+
+ if (vertexShader == 0 || fragmentShader == 0) {
+ GLenum error = functions->glGetError();
+ qWarning("QSGDistanceFieldGlyphCache::saveTexture: Failed to create shaders. (GL error: %x)",
+ error);
+ return;
+ }
+
+ functions->glShaderSource(vertexShader, 1, &vertexShaderSource, NULL);
+ functions->glShaderSource(fragmentShader, 1, &fragmentShaderSource, NULL);
+ functions->glCompileShader(vertexShader);
+
+ GLint len = 1;
+ functions->glGetShaderiv(vertexShader, GL_INFO_LOG_LENGTH, &len);
+
+ char infoLog[2048];
+ functions->glGetShaderInfoLog(vertexShader, 2048, NULL, infoLog);
+ if (qstrlen(infoLog) > 0)
+ qWarning("Problems compiling vertex shader:\n %s", infoLog);
+
+ functions->glCompileShader(fragmentShader);
+ functions->glGetShaderInfoLog(fragmentShader, 2048, NULL, infoLog);
+ if (qstrlen(infoLog) > 0)
+ qWarning("Problems compiling fragment shader:\n %s", infoLog);
+
+ GLuint shaderProgram = functions->glCreateProgram();
+ functions->glAttachShader(shaderProgram, vertexShader);
+ functions->glAttachShader(shaderProgram, fragmentShader);
+
+ functions->glBindAttribLocation(shaderProgram, 0, "vertexCoordsArray");
+ functions->glBindAttribLocation(shaderProgram, 1, "textureCoordArray");
+
+ functions->glLinkProgram(shaderProgram);
+ functions->glGetProgramInfoLog(shaderProgram, 2048, NULL, infoLog);
+ if (qstrlen(infoLog) > 0)
+ qWarning("Problems linking shaders:\n %s", infoLog);
+
+ functions->glUseProgram(shaderProgram);
+ functions->glEnableVertexAttribArray(0);
+ functions->glEnableVertexAttribArray(1);
+
+ int textureUniformLocation = functions->glGetUniformLocation(shaderProgram, "texture");
+ functions->glUniform1i(textureUniformLocation, 0);
+ }
+
+ functions->glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+
+ {
+ GLenum error = functions->glGetError();
+ if (error != GL_NO_ERROR)
+ qWarning("glDrawArrays reported error 0x%x", error);
+ }
+
+ uchar *data = new uchar[width * height * 4];
+
+ functions->glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
+
+ QImage image(data, width, height, QImage::Format_ARGB32);
+
+ QByteArray fileName = m_referenceFont.familyName().toLatin1() + '_' + QByteArray::number(textureId);
+ fileName = fileName.replace('/', '_').replace(' ', '_') + ".png";
+
+ image.save(QString::fromLocal8Bit(fileName));
+
+ {
+ GLenum error = functions->glGetError();
+ if (error != GL_NO_ERROR)
+ qWarning("glReadPixels reported error 0x%x", error);
+ }
+
+ functions->glDisableVertexAttribArray(0);
+ functions->glDisableVertexAttribArray(1);
+
+ functions->glDeleteFramebuffers(1, &fboId);
+ functions->glDeleteTextures(1, &tmpTexture);
+
+ delete[] data;
+}
+#endif
+
void QSGNodeVisitorEx::visitChildren(QSGNode *node)
{
for (QSGNode *child = node->firstChild(); child; child = child->nextSibling()) {
diff --git a/src/quick/scenegraph/qsgadaptationlayer_p.h b/src/quick/scenegraph/qsgadaptationlayer_p.h
index a63299fcde..ef21385ee6 100644
--- a/src/quick/scenegraph/qsgadaptationlayer_p.h
+++ b/src/quick/scenegraph/qsgadaptationlayer_p.h
@@ -126,17 +126,6 @@ public:
class Q_QUICK_PRIVATE_EXPORT QSGImageNode : public QSGVisitableNode
{
public:
- enum AntialiasingFlag
- {
- AntialiasingNone = 0,
- AntialiasingLeft = 1,
- AntialiasingRight = 2,
- AntialiasingTop = 4,
- AntialiasingBottom = 8,
- AntialiasingAll = AntialiasingLeft | AntialiasingRight | AntialiasingBottom | AntialiasingTop
- };
- Q_DECLARE_FLAGS(AntialiasingFlags, AntialiasingFlag)
-
virtual void setTargetRect(const QRectF &rect) = 0;
virtual void setInnerTargetRect(const QRectF &rect) = 0;
virtual void setInnerSourceRect(const QRectF &rect) = 0;
@@ -151,7 +140,6 @@ public:
virtual void setFiltering(QSGTexture::Filtering filtering) = 0;
virtual void setHorizontalWrapMode(QSGTexture::WrapMode wrapMode) = 0;
virtual void setVerticalWrapMode(QSGTexture::WrapMode wrapMode) = 0;
- virtual void setAntialiasing(AntialiasingFlags flags) { Q_UNUSED(flags); }
virtual void update() = 0;
@@ -357,6 +345,10 @@ protected:
GlyphData &glyphData(glyph_t glyph);
+#if defined(QSG_DISTANCEFIELD_CACHE_DEBUG)
+ void saveTexture(GLuint textureId, int width, int height) const;
+#endif
+
inline bool isCoreProfile() const { return m_coreProfile; }
private:
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp
index 50db3883a5..95388d82e0 100644
--- a/src/quick/scenegraph/qsgcontext.cpp
+++ b/src/quick/scenegraph/qsgcontext.cpp
@@ -357,7 +357,7 @@ void QSGContext::renderContextInitialized(QSGRenderContext *renderContext)
// before without a context. Now the context is ready.
if (!d->distanceFieldAntialiasingDecided) {
d->distanceFieldAntialiasingDecided = true;
-#ifndef Q_OS_WIN
+#ifndef Q_OS_WIN32
if (renderContext->openglContext()->isOpenGLES())
d->distanceFieldAntialiasing = QSGGlyphNode::GrayAntialiasing;
#endif
diff --git a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
index 093e84b618..3d958245d2 100644
--- a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
+++ b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache.cpp
@@ -48,6 +48,10 @@ QT_BEGIN_NAMESPACE
DEFINE_BOOL_CONFIG_OPTION(qmlUseGlyphCacheWorkaround, QML_USE_GLYPHCACHE_WORKAROUND)
+#if !defined(QSG_DEFAULT_DISTANCEFIELD_GLYPH_CACHE_PADDING)
+# define QSG_DEFAULT_DISTANCEFIELD_GLYPH_CACHE_PADDING 2
+#endif
+
QSGDefaultDistanceFieldGlyphCache::QSGDefaultDistanceFieldGlyphCache(QSGDistanceFieldGlyphCacheManager *man, QOpenGLContext *c, const QRawFont &font)
: QSGDistanceFieldGlyphCache(man, c, font)
, m_maxTextureSize(0)
@@ -90,8 +94,9 @@ void QSGDefaultDistanceFieldGlyphCache::requestGlyphs(const QSet<glyph_t> &glyph
for (QSet<glyph_t>::const_iterator it = glyphs.constBegin(); it != glyphs.constEnd() ; ++it) {
glyph_t glyphIndex = *it;
+ int padding = QSG_DEFAULT_DISTANCEFIELD_GLYPH_CACHE_PADDING;
int glyphWidth = qCeil(glyphData(glyphIndex).boundingRect.width()) + distanceFieldRadius() * 2;
- QSize glyphSize(glyphWidth, QT_DISTANCEFIELD_TILESIZE(doubleGlyphResolution()));
+ QSize glyphSize(glyphWidth + padding * 2, QT_DISTANCEFIELD_TILESIZE(doubleGlyphResolution()) + padding * 2);
QRect alloc = m_areaAllocator->allocate(glyphSize);
if (alloc.isNull()) {
@@ -101,7 +106,10 @@ void QSGDefaultDistanceFieldGlyphCache::requestGlyphs(const QSet<glyph_t> &glyph
TexCoord unusedCoord = glyphTexCoord(unusedGlyph);
int unusedGlyphWidth = qCeil(glyphData(unusedGlyph).boundingRect.width()) + distanceFieldRadius() * 2;
- m_areaAllocator->deallocate(QRect(unusedCoord.x, unusedCoord.y, unusedGlyphWidth, QT_DISTANCEFIELD_TILESIZE(doubleGlyphResolution())));
+ m_areaAllocator->deallocate(QRect(unusedCoord.x - padding,
+ unusedCoord.y - padding,
+ padding * 2 + unusedGlyphWidth,
+ padding * 2 + QT_DISTANCEFIELD_TILESIZE(doubleGlyphResolution())));
m_unusedGlyphs.remove(unusedGlyph);
m_glyphsTexture.remove(unusedGlyph);
@@ -117,11 +125,14 @@ void QSGDefaultDistanceFieldGlyphCache::requestGlyphs(const QSet<glyph_t> &glyph
TextureInfo *tex = textureInfo(alloc.y() / maxTextureSize());
alloc = QRect(alloc.x(), alloc.y() % maxTextureSize(), alloc.width(), alloc.height());
+
tex->allocatedArea |= alloc;
+ Q_ASSERT(tex->padding == padding || tex->padding < 0);
+ tex->padding = padding;
GlyphPosition p;
p.glyph = glyphIndex;
- p.position = alloc.topLeft();
+ p.position = alloc.topLeft() + QPoint(padding, padding);
glyphPositions.append(p);
glyphsToRender.append(glyphIndex);
@@ -153,13 +164,14 @@ void QSGDefaultDistanceFieldGlyphCache::storeGlyphs(const QList<QDistanceField>
glyphTextures[texInfo].append(glyphIndex);
+ int padding = texInfo->padding;
int expectedWidth = qCeil(c.width + c.xMargin * 2);
- if (glyph.width() != expectedWidth)
- glyph = glyph.copy(0, 0, expectedWidth, glyph.height());
+ glyph = glyph.copy(-padding, -padding,
+ expectedWidth + padding * 2, glyph.height() + padding * 2);
if (useTextureResizeWorkaround()) {
uchar *inBits = glyph.scanLine(0);
- uchar *outBits = texInfo->image.scanLine(int(c.y)) + int(c.x);
+ uchar *outBits = texInfo->image.scanLine(int(c.y) - padding) + int(c.x) - padding;
for (int y = 0; y < glyph.height(); ++y) {
memcpy(outBits, inBits, glyph.width());
inBits += glyph.width();
@@ -175,13 +187,13 @@ void QSGDefaultDistanceFieldGlyphCache::storeGlyphs(const QList<QDistanceField>
if (useTextureUploadWorkaround()) {
for (int i = 0; i < glyph.height(); ++i) {
m_funcs->glTexSubImage2D(GL_TEXTURE_2D, 0,
- c.x, c.y + i, glyph.width(),1,
+ c.x - padding, c.y + i - padding, glyph.width(),1,
format, GL_UNSIGNED_BYTE,
glyph.scanLine(i));
}
} else {
m_funcs->glTexSubImage2D(GL_TEXTURE_2D, 0,
- c.x, c.y, glyph.width(), glyph.height(),
+ c.x - padding, c.y - padding, glyph.width(), glyph.height(),
format, GL_UNSIGNED_BYTE,
glyph.constBits());
}
diff --git a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h
index f7314776d6..2f9331f6d8 100644
--- a/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h
+++ b/src/quick/scenegraph/qsgdefaultdistancefieldglyphcache_p.h
@@ -73,8 +73,9 @@ private:
QSize size;
QRect allocatedArea;
QDistanceField image;
+ int padding;
- TextureInfo() : texture(0)
+ TextureInfo() : texture(0), padding(-1)
{ }
};
diff --git a/src/quick/scenegraph/qsgdefaultimagenode.cpp b/src/quick/scenegraph/qsgdefaultimagenode.cpp
index 69df506d2a..7f85c31ccb 100644
--- a/src/quick/scenegraph/qsgdefaultimagenode.cpp
+++ b/src/quick/scenegraph/qsgdefaultimagenode.cpp
@@ -140,11 +140,10 @@ void SmoothTextureMaterialShader::initialize()
QSGDefaultImageNode::QSGDefaultImageNode()
: m_innerSourceRect(0, 0, 1, 1)
, m_subSourceRect(0, 0, 1, 1)
+ , m_antialiasing(false)
, m_mirror(false)
, m_dirtyGeometry(false)
, m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4)
- , m_antialiasing(AntialiasingNone)
-
{
setMaterial(&m_materialO);
setOpaqueMaterial(&m_material);
@@ -250,20 +249,10 @@ void QSGDefaultImageNode::setTexture(QSGTexture *texture)
void QSGDefaultImageNode::setAntialiasing(bool antialiasing)
{
- AntialiasingFlags antialiasingFlags = antialiasing
- ? AntialiasingAll
- : AntialiasingNone;
-
- setAntialiasing(antialiasingFlags);
-}
-
-void QSGDefaultImageNode::setAntialiasing(AntialiasingFlags antialiasingFlags)
-{
- if (antialiasingFlags == m_antialiasing)
+ if (antialiasing == m_antialiasing)
return;
-
- m_antialiasing = antialiasingFlags;
- if (m_antialiasing != AntialiasingNone) {
+ m_antialiasing = antialiasing;
+ if (m_antialiasing) {
setMaterial(&m_smoothMaterial);
setOpaqueMaterial(0);
setGeometry(new QSGGeometry(smoothAttributeSet(), 0));
@@ -375,14 +364,11 @@ void QSGDefaultImageNode::updateGeometry()
}
// An image can be rendered as a single quad if:
- // - There is antialiasing on all or no edges
// - There are no margins, and either:
// - the image isn't repeated
// - the source rectangle fills the entire texture so that texture wrapping can be used,
// and NPOT is supported
- if (!hasMargins
- && (m_antialiasing == AntialiasingAll || m_antialiasing == AntialiasingNone)
- && (!hasTiles || (fullTexture && wrapSupported))) {
+ if (!hasMargins && (!hasTiles || (fullTexture && wrapSupported))) {
QRectF sr;
if (!fullTexture) {
sr = QRectF(innerSourceRect.x() + (m_subSourceRect.left() - floorLeft) * innerSourceRect.width(),
@@ -561,35 +547,10 @@ void QSGDefaultImageNode::updateGeometry()
topDv = bottomDv *= 0.5f;
}
- if (!m_antialiasing.testFlag(AntialiasingTop)) {
- topDy = 0.0f;
- topDv = 0.0f;
- }
-
- if (!m_antialiasing.testFlag(AntialiasingBottom)) {
- bottomDy = 0.0f;
- bottomDv = 0.0f;
- }
-
- if (!m_antialiasing.testFlag(AntialiasingLeft)) {
- leftDx = 0.0f;
- leftDu = 0.0f;
- }
-
- if (!m_antialiasing.testFlag(AntialiasingRight)) {
- rightDx = 0.0f;
- rightDu = 0.0f;
- }
-
// This delta is how much the fuzziness can reach out from the image.
float delta = float(qAbs(m_targetRect.width()) < qAbs(m_targetRect.height())
? m_targetRect.width() : m_targetRect.height()) * 0.5f;
- float deltaTop = m_antialiasing.testFlag(AntialiasingTop) ? delta : 0.0f;
- float deltaBottom = m_antialiasing.testFlag(AntialiasingBottom) ? delta : 0.0f;
- float deltaLeft = m_antialiasing.testFlag(AntialiasingLeft) ? delta : 0.0f;
- float deltaRight = m_antialiasing.testFlag(AntialiasingRight) ? delta : 0.0f;
-
quint16 index = 0;
ys = yData.data();
for (int j = 0; j < vCells; ++j, ys += 2) {
@@ -639,28 +600,28 @@ void QSGDefaultImageNode::updateGeometry()
if (isTop) {
vertices[topLeft].dy = vertices[topRight].dy = topDy;
vertices[topLeft].dv = vertices[topRight].dv = topDv;
- vertices[topLeft + 1].dy = vertices[topRight + 1].dy = -deltaTop;
+ vertices[topLeft + 1].dy = vertices[topRight + 1].dy = -delta;
appendQuad(&indices, topLeft + 1, topRight + 1, topLeft, topRight);
}
if (isBottom) {
vertices[bottomLeft].dy = vertices[bottomRight].dy = -bottomDy;
vertices[bottomLeft].dv = vertices[bottomRight].dv = -bottomDv;
- vertices[bottomLeft + 1].dy = vertices[bottomRight + 1].dy = deltaBottom;
+ vertices[bottomLeft + 1].dy = vertices[bottomRight + 1].dy = delta;
appendQuad(&indices, bottomLeft, bottomRight, bottomLeft + 1, bottomRight + 1);
}
if (isLeft) {
vertices[topLeft].dx = vertices[bottomLeft].dx = leftDx;
vertices[topLeft].du = vertices[bottomLeft].du = leftDu;
- vertices[topLeft + 1].dx = vertices[bottomLeft + 1].dx = -deltaLeft;
+ vertices[topLeft + 1].dx = vertices[bottomLeft + 1].dx = -delta;
appendQuad(&indices, topLeft + 1, topLeft, bottomLeft + 1, bottomLeft);
}
if (isRight) {
vertices[topRight].dx = vertices[bottomRight].dx = -rightDx;
vertices[topRight].du = vertices[bottomRight].du = -rightDu;
- vertices[topRight + 1].dx = vertices[bottomRight + 1].dx = deltaRight;
+ vertices[topRight + 1].dx = vertices[bottomRight + 1].dx = delta;
appendQuad(&indices, topRight, topRight + 1, bottomRight, bottomRight + 1);
}
}
diff --git a/src/quick/scenegraph/qsgdefaultimagenode_p.h b/src/quick/scenegraph/qsgdefaultimagenode_p.h
index 558e4d8ba4..26b087284b 100644
--- a/src/quick/scenegraph/qsgdefaultimagenode_p.h
+++ b/src/quick/scenegraph/qsgdefaultimagenode_p.h
@@ -62,7 +62,6 @@ public:
virtual void setSubSourceRect(const QRectF &rect);
virtual void setTexture(QSGTexture *t);
virtual void setAntialiasing(bool antialiasing);
- virtual void setAntialiasing(AntialiasingFlags antialiasing);
virtual void setMirror(bool mirror);
virtual void update();
@@ -85,11 +84,11 @@ private:
QSGTextureMaterial m_materialO;
QSGSmoothTextureMaterial m_smoothMaterial;
+ uint m_antialiasing : 1;
uint m_mirror : 1;
uint m_dirtyGeometry : 1;
QSGGeometry m_geometry;
- AntialiasingFlags m_antialiasing;
};
QT_END_NAMESPACE
diff --git a/src/quick/scenegraph/qsgshareddistancefieldglyphcache.cpp b/src/quick/scenegraph/qsgshareddistancefieldglyphcache.cpp
index 6f54b258ff..f635ccd17b 100644
--- a/src/quick/scenegraph/qsgshareddistancefieldglyphcache.cpp
+++ b/src/quick/scenegraph/qsgshareddistancefieldglyphcache.cpp
@@ -399,176 +399,6 @@ void QSGSharedDistanceFieldGlyphCache::unregisterOwnerElement(QQuickItem *ownerE
}
}
-#if defined(QSGSHAREDDISTANCEFIELDGLYPHCACHE_DEBUG_)
-# include <QtOpenGL/private/qglextensions_p.h>
-
-void QSGSharedDistanceFieldGlyphCache::saveTexture(GLuint textureId, int width, int height)
-{
- GLuint fboId;
- glGenFramebuffers(1, &fboId);
-
- GLuint tmpTexture = 0;
- glGenTextures(1, &tmpTexture);
- glBindTexture(GL_TEXTURE_2D, tmpTexture);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glBindTexture(GL_TEXTURE_2D, 0);
-
- glBindFramebuffer(GL_FRAMEBUFFER_EXT, fboId);
- glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D,
- tmpTexture, 0);
-
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, textureId);
-
- glDisable(GL_STENCIL_TEST);
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_SCISSOR_TEST);
- glDisable(GL_BLEND);
-
- GLfloat textureCoordinateArray[8];
- textureCoordinateArray[0] = 0.0f;
- textureCoordinateArray[1] = 0.0f;
- textureCoordinateArray[2] = 1.0f;
- textureCoordinateArray[3] = 0.0f;
- textureCoordinateArray[4] = 1.0f;
- textureCoordinateArray[5] = 1.0f;
- textureCoordinateArray[6] = 0.0f;
- textureCoordinateArray[7] = 1.0f;
-
- GLfloat vertexCoordinateArray[8];
- vertexCoordinateArray[0] = -1.0f;
- vertexCoordinateArray[1] = -1.0f;
- vertexCoordinateArray[2] = 1.0f;
- vertexCoordinateArray[3] = -1.0f;
- vertexCoordinateArray[4] = 1.0f;
- vertexCoordinateArray[5] = 1.0f;
- vertexCoordinateArray[6] = -1.0f;
- vertexCoordinateArray[7] = 1.0f;
-
- glViewport(0, 0, width, height);
- glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray);
- glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray);
-
- {
- static const char vertexShaderSource[] =
- "attribute highp vec4 vertexCoordsArray; \n"
- "attribute highp vec2 textureCoordArray; \n"
- "varying highp vec2 textureCoords; \n"
- "void main(void) \n"
- "{ \n"
- " gl_Position = vertexCoordsArray; \n"
- " textureCoords = textureCoordArray; \n"
- "} \n";
-
- static const char fragmentShaderSource[] =
- "varying highp vec2 textureCoords; \n"
- "uniform sampler2D texture; \n"
- "void main() \n"
- "{ \n"
- " gl_FragColor = texture2D(texture, textureCoords); \n"
- "} \n";
-
- GLuint vertexShader = glCreateShader(GL_VERTEX_SHADER);
- GLuint fragmentShader = glCreateShader(GL_FRAGMENT_SHADER);
-
- if (vertexShader == 0 || fragmentShader == 0) {
- GLenum error = glGetError();
- qWarning("SharedGraphicsCacheServer::setupShaderPrograms: Failed to create shaders. (GL error: %x)",
- error);
- return;
- }
-
- glShaderSource(vertexShader, 1, &vertexShaderSource, NULL);
- glShaderSource(fragmentShader, 1, &fragmentShaderSource, NULL);
- glCompileShader(vertexShader);
-
- GLint len = 1;
- glGetShaderiv(vertexShader, GL_INFO_LOG_LENGTH, &len);
-
- char infoLog[2048];
- glGetShaderInfoLog(vertexShader, 2048, NULL, infoLog);
- if (qstrlen(infoLog) > 0) {
- qWarning("SharedGraphicsCacheServer::setupShaderPrograms, problems compiling vertex shader:\n %s",
- infoLog);
- //return;
- }
-
- glCompileShader(fragmentShader);
- glGetShaderInfoLog(fragmentShader, 2048, NULL, infoLog);
- if (qstrlen(infoLog) > 0) {
- qWarning("SharedGraphicsCacheServer::setupShaderPrograms, problems compiling fragent shader:\n %s",
- infoLog);
- //return;
- }
-
- GLuint shaderProgram = glCreateProgram();
- glAttachShader(shaderProgram, vertexShader);
- glAttachShader(shaderProgram, fragmentShader);
-
- glBindAttribLocation(shaderProgram, 0, "vertexCoordsArray");
- glBindAttribLocation(shaderProgram, 1, "textureCoordArray");
-
- glLinkProgram(shaderProgram);
- glGetProgramInfoLog(shaderProgram, 2048, NULL, infoLog);
- if (qstrlen(infoLog) > 0) {
- qWarning("SharedGraphicsCacheServer::setupShaderPrograms, problems linking shaders:\n %s",
- infoLog);
- //return;
- }
-
- glUseProgram(shaderProgram);
- glEnableVertexAttribArray(0);
- glEnableVertexAttribArray(1);
-
- int textureUniformLocation = glGetUniformLocation(shaderProgram, "_qt_texture");
- glUniform1i(textureUniformLocation, 0);
- }
-
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
-
- {
- GLenum error = glGetError();
- if (error != GL_NO_ERROR) {
- qWarning("SharedGraphicsCacheServer::readBackBuffer: glDrawArrays reported error 0x%x",
- error);
- }
- }
-
- uchar *data = new uchar[width * height * 4];
-
- glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
-
- QImage image(width, height, QImage::Format_ARGB32);
- quint32 *dest = reinterpret_cast<quint32 *>(image.bits());
- for (int i=0; i<width*height; ++i)
- dest[i] = qRgba(0xff, 0xff, 0xff, data[i]);
-
- QByteArray fileName = m_cacheId + ' ' + QByteArray::number(textureId);
- fileName = fileName.replace('/', '_').replace(' ', '_') + ".png";
- image.save(QString::fromLocal8Bit(fileName));
-
- {
- GLenum error = glGetError();
- if (error != GL_NO_ERROR) {
- qWarning("SharedGraphicsCacheServer::readBackBuffer: glReadPixels reported error 0x%x",
- error);
- }
- }
-
- glDisableVertexAttribArray(0);
- glDisableVertexAttribArray(1);
-
- glDeleteFramebuffers(1, &fboId);
- glDeleteTextures(1, &tmpTexture);
-
- delete[] data;
-}
-#endif
-
namespace {
struct TextureContent {
QSize size;
@@ -683,9 +513,6 @@ void QSGSharedDistanceFieldGlyphCache::processPendingGlyphs()
texture.textureId = m_sharedGraphicsCache->textureIdForBuffer(it.key());
texture.size = m_sharedGraphicsCache->sizeOfBuffer(it.key());
-#if defined(QSGSHAREDDISTANCEFIELDGLYPHCACHE_DEBUG_)
- saveTexture(texture.textureId, texture.size.width(), texture.size.height());
-#endif
setGlyphsTexture(it.value().glyphs, texture);
++it;
diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
index 469cd1d21b..58d618a049 100644
--- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp
+++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
@@ -38,6 +38,7 @@
#include <QtGui/QScreen>
#include <QtGui/QGuiApplication>
+#include <QtGui/QOffscreenSurface>
#include <QtQuick/private/qsgcontext_p.h>
#include <QtQuick/private/qquickwindow_p.h>
@@ -214,15 +215,29 @@ void QSGWindowsRenderLoop::windowDestroyed(QQuickWindow *window)
hide(window);
QQuickWindowPrivate *d = QQuickWindowPrivate::get(window);
- if (m_gl)
- m_gl->makeCurrent(window);
+ bool current = false;
+ QScopedPointer<QOffscreenSurface> offscreenSurface;
+ if (m_gl) {
+ QSurface *surface = window;
+ // There may be no platform window if the window got closed.
+ if (!window->handle()) {
+ offscreenSurface.reset(new QOffscreenSurface);
+ offscreenSurface->setFormat(m_gl->format());
+ offscreenSurface->create();
+ surface = offscreenSurface.data();
+ }
+ current = m_gl->makeCurrent(surface);
+ }
+ if (Q_UNLIKELY(!current))
+ qCDebug(QSG_LOG_RENDERLOOP) << "cleanup without an OpenGL context";
+
d->cleanupNodesOnShutdown();
if (m_windows.size() == 0) {
d->context->invalidate();
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
delete m_gl;
m_gl = 0;
- } else if (m_gl) {
+ } else if (m_gl && current) {
m_gl->doneCurrent();
}
}
diff --git a/src/quick/scenegraph/scenegraph.pri b/src/quick/scenegraph/scenegraph.pri
index bcb523f90d..480ac5e569 100644
--- a/src/quick/scenegraph/scenegraph.pri
+++ b/src/quick/scenegraph/scenegraph.pri
@@ -1,6 +1,7 @@
!contains(QT_CONFIG, egl):DEFINES += QT_NO_EGL
# DEFINES += QSG_SEPARATE_INDEX_BUFFER
+# DEFINES += QSG_DISTANCEFIELD_CACHE_DEBUG
# Core API
HEADERS += \
diff --git a/src/quick/scenegraph/util/qsgsimpletexturenode.cpp b/src/quick/scenegraph/util/qsgsimpletexturenode.cpp
index 27b9e656ec..34e00e0b01 100644
--- a/src/quick/scenegraph/util/qsgsimpletexturenode.cpp
+++ b/src/quick/scenegraph/util/qsgsimpletexturenode.cpp
@@ -299,6 +299,8 @@ QSGSimpleTextureNode::TextureCoordinatesTransformMode QSGSimpleTextureNode::text
By default, the node does not take ownership of the texture.
\sa setTexture()
+
+ \since 5.4
*/
void QSGSimpleTextureNode::setOwnsTexture(bool owns)
{
@@ -308,6 +310,8 @@ void QSGSimpleTextureNode::setOwnsTexture(bool owns)
/*!
Returns \c true if the node takes ownership of the texture; otherwise returns \c false.
+
+ \since 5.4
*/
bool QSGSimpleTextureNode::ownsTexture() const
{
diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp
index 455e180dbe..139bae4038 100644
--- a/src/quick/util/qquickglobal.cpp
+++ b/src/quick/util/qquickglobal.cpp
@@ -982,4 +982,11 @@ void QQuick_initializeProviders()
QQml_setGuiProvider(getGuiProvider());
}
+void QQuick_deinitializeProviders()
+{
+ QQml_removeValueTypeProvider(getValueTypeProvider());
+ QQml_setColorProvider(0); // technically, another plugin may have overridden our providers
+ QQml_setGuiProvider(0); // but we cannot handle that case in a sane way.
+}
+
QT_END_NAMESPACE
diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
index c4c2705e01..e4c14a2e10 100644
--- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
+++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
@@ -54,7 +54,6 @@ class tst_QQmlEngineDebugInspectorIntegration : public QQmlDataTest
public:
tst_QQmlEngineDebugInspectorIntegration()
: m_process(0)
- , m_connection(0)
, m_inspectorClient(0)
, m_engineDebugClient(0)
{
@@ -65,7 +64,6 @@ private:
QmlDebugObjectReference findRootObject();
QQmlDebugProcess *m_process;
- QQmlDebugConnection *m_connection;
QQmlInspectorClient *m_inspectorClient;
QQmlEngineDebugClient *m_engineDebugClient;
diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp
index 5bbbe8e1e9..7c931928d4 100644
--- a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp
+++ b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp
@@ -36,6 +36,7 @@
#include <QHostAddress>
#include <QDebug>
#include <QThread>
+#include <QModelIndex>
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlcontext.h>
@@ -73,6 +74,16 @@ signals:
};
QML_DECLARE_TYPE(NonScriptProperty)
+class CustomTypes : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QModelIndex modelIndex READ modelIndex)
+public:
+ CustomTypes(QObject *parent = 0) : QObject(parent) {}
+
+ QModelIndex modelIndex() { return QModelIndex(); }
+};
+
class tst_QQmlEngineDebugService : public QObject
{
Q_OBJECT
@@ -125,6 +136,7 @@ private slots:
void setBindingInStates();
void regression_QTCREATORBUG_7451();
+ void queryObjectWithNonStreamableTypes();
};
QmlDebugObjectReference tst_QQmlEngineDebugService::findRootObject(
@@ -314,6 +326,12 @@ void tst_QQmlEngineDebugService::initTestCase()
"}\n"
;
+ // test non-streamable properties
+ qmlRegisterType<CustomTypes>("Backend", 1, 0, "CustomTypes");
+ qml << "import Backend 1.0\n"
+ "CustomTypes {}"
+ ;
+
for (int i=0; i<qml.count(); i++) {
QQmlComponent component(m_engine);
component.setData(qml[i], QUrl::fromLocalFile(""));
@@ -620,7 +638,7 @@ void tst_QQmlEngineDebugService::queryRootContexts()
// root context query sends only root object data - it doesn't fill in
// the children or property info
QCOMPARE(context.objects.count(), 0);
- QCOMPARE(context.contexts.count(), 5);
+ QCOMPARE(context.contexts.count(), 6);
QVERIFY(context.contexts[0].debugId >= 0);
QCOMPARE(context.contexts[0].name, QString("tst_QQmlDebug_childContext"));
}
@@ -819,6 +837,26 @@ void tst_QQmlEngineDebugService::regression_QTCREATORBUG_7451()
}
}
+void tst_QQmlEngineDebugService::queryObjectWithNonStreamableTypes()
+{
+ bool success;
+
+ QmlDebugObjectReference rootObject = findRootObject(4, true);
+
+ QQmlEngineDebugClient *unconnected = new QQmlEngineDebugClient(0);
+ unconnected->queryObject(rootObject, &success);
+ QVERIFY(!success);
+ delete unconnected;
+
+ m_dbg->queryObject(rootObject, &success);
+ QVERIFY(success);
+ QVERIFY(QQmlDebugTest::waitForSignal(m_dbg, SIGNAL(result())));
+
+ QmlDebugObjectReference obj = m_dbg->object();
+
+ QCOMPARE(findProperty(obj.properties, "modelIndex").value, QVariant());
+}
+
void tst_QQmlEngineDebugService::queryExpressionResult()
{
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index 2e7fe34796..4e9da046b5 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -3200,6 +3200,11 @@ void tst_QJSEngine::installTranslatorFunctions()
QVERIFY(ret.isString());
QCOMPARE(ret.toString(), QString::fromLatin1("foo"));
}
+ {
+ QJSValue ret = eng.evaluate("qsTr('%1').arg('foo')");
+ QVERIFY(ret.isString());
+ QCOMPARE(ret.toString(), QString::fromLatin1("foo"));
+ }
QVERIFY(eng.evaluate("QT_TRID_NOOP()").isUndefined());
}
diff --git a/tests/auto/qml/qqmlenginecleanup/data/testFile1.qml b/tests/auto/qml/qqmlenginecleanup/data/testFile1.qml
new file mode 100644
index 0000000000..3bd8e22ce4
--- /dev/null
+++ b/tests/auto/qml/qqmlenginecleanup/data/testFile1.qml
@@ -0,0 +1,49 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ Item {
+ id: c1
+ }
+ property Item a: c1
+}
diff --git a/tests/auto/qml/qqmlenginecleanup/data/testFile2.qml b/tests/auto/qml/qqmlenginecleanup/data/testFile2.qml
new file mode 100644
index 0000000000..9a32114918
--- /dev/null
+++ b/tests/auto/qml/qqmlenginecleanup/data/testFile2.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ property variant a: Qt.rgba(0.3, 0.4, 0.5, 0.6)
+}
diff --git a/tests/auto/qml/qqmlenginecleanup/data/testFile3.qml b/tests/auto/qml/qqmlenginecleanup/data/testFile3.qml
new file mode 100644
index 0000000000..c55c355388
--- /dev/null
+++ b/tests/auto/qml/qqmlenginecleanup/data/testFile3.qml
@@ -0,0 +1,68 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ width: 320
+ height: 480
+
+ ListView {
+ anchors.fill: parent
+ model: simpleModel
+ delegate: Text {
+ text: name
+ }
+ }
+
+ ListModel {
+ id: simpleModel
+ ListElement {
+ name: "first"
+ }
+ ListElement {
+ name: "second"
+ }
+ ListElement {
+ name: "third"
+ }
+ }
+}
diff --git a/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp b/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp
index fcc3e6a0a9..c8fae624a7 100644
--- a/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp
+++ b/tests/auto/qml/qqmlenginecleanup/tst_qqmlenginecleanup.cpp
@@ -46,6 +46,7 @@ public:
private slots:
void test_qmlClearTypeRegistrations();
+ void test_valueTypeProviderModule(); // QTBUG-43004
};
void tst_qqmlenginecleanup::test_qmlClearTypeRegistrations()
@@ -85,6 +86,50 @@ void tst_qqmlenginecleanup::test_qmlClearTypeRegistrations()
delete component;
}
+static void cleanState(QQmlEngine **e)
+{
+ delete *e;
+ qmlClearTypeRegistrations();
+ *e = new QQmlEngine;
+ QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+ QCoreApplication::processEvents();
+}
+
+void tst_qqmlenginecleanup::test_valueTypeProviderModule()
+{
+ // this test ensures that a module which installs a value type
+ // provider can be reinitialized after multiple calls to
+ // qmlClearTypeRegistrations() without causing cycles in the
+ // value type provider list.
+ QQmlEngine *e = 0;
+ QUrl testFile1 = testFileUrl("testFile1.qml");
+ QUrl testFile2 = testFileUrl("testFile2.qml");
+ bool noCycles = false;
+ for (int i = 0; i < 20; ++i) {
+ cleanState(&e);
+ QQmlComponent c(e, this);
+ c.loadUrl(i % 2 == 0 ? testFile1 : testFile2); // this will hang if cycles exist.
+ }
+ delete e;
+ e = 0;
+ noCycles = true;
+ QVERIFY(noCycles);
+
+ // this test ensures that no crashes occur due to using
+ // a dangling QQmlType pointer in the type compiler
+ // which results from qmlClearTypeRegistrations()
+ QUrl testFile3 = testFileUrl("testFile3.qml");
+ bool noDangling = false;
+ for (int i = 0; i < 20; ++i) {
+ cleanState(&e);
+ QQmlComponent c(e, this);
+ c.loadUrl(i % 2 == 0 ? testFile1 : testFile3); // this will crash if dangling ptr exists.
+ }
+ delete e;
+ noDangling = true;
+ QVERIFY(noDangling);
+}
+
QTEST_MAIN(tst_qqmlenginecleanup)
#include "tst_qqmlenginecleanup.moc"
diff --git a/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp b/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
index deb3f4e11b..1cdf8ce574 100644
--- a/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
+++ b/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
@@ -46,7 +46,6 @@
// From qquickfolderlistmodel.h
const int FileNameRole = Qt::UserRole+1;
-const int FilePathRole = Qt::UserRole+2;
enum SortField { Unsorted, Name, Time, Size, Type };
class tst_qquickfolderlistmodel : public QQmlDataTest
diff --git a/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp
index 3fe14fa216..63bfffacaa 100644
--- a/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp
+++ b/tests/auto/qml/qv4debugger/tst_qv4debugger.cpp
@@ -33,6 +33,8 @@
#include <QtTest/QtTest>
#include <QJSEngine>
+#include <QQmlEngine>
+#include <QQmlComponent>
#include <private/qv4engine_p.h>
#include <private/qv4debugging_p.h>
#include <private/qv8engine_p.h>
@@ -182,6 +184,14 @@ public:
m_stackTrace = debugger->stackTrace();
+ while (!m_expressionRequests.isEmpty()) {
+ ExpressionRequest request = m_expressionRequests.takeFirst();
+ QVariantMap result;
+ collector.setDestination(&result);
+ debugger->evaluateExpression(request.frameNr, request.expression, &collector);
+ m_expressionResults << result[QString::fromLatin1("body")];
+ }
+
if (m_captureContextInfo)
captureContextInfo(debugger);
@@ -233,6 +243,13 @@ public:
QList<QVariantMap> m_capturedLocals;
QVariant m_thrownValue;
+ struct ExpressionRequest {
+ QString expression;
+ int frameNr;
+ };
+ QVector<ExpressionRequest> m_expressionRequests;
+ QVector<QVariant> m_expressionResults;
+
// Utility methods:
void dumpStackTrace() const
{
@@ -259,6 +276,7 @@ private slots:
void addBreakPointWhilePaused();
void removeBreakPointForNextInstruction();
void conditionalBreakPoint();
+ void conditionalBreakPointInQml();
// context access:
void readArguments();
@@ -269,6 +287,8 @@ private slots:
// exceptions:
void pauseOnThrow();
+ void evaluateExpression();
+
private:
void evaluateJavaScript(const QString &script, const QString &fileName, int lineNumber = 1)
{
@@ -428,6 +448,42 @@ void tst_qv4debugger::conditionalBreakPoint()
QCOMPARE(m_debuggerAgent->m_capturedLocals[0]["i"].toInt(), 11);
}
+void tst_qv4debugger::conditionalBreakPointInQml()
+{
+ QQmlEngine engine;
+ QV4::ExecutionEngine *v4 = QV8Engine::getV4(&engine);
+ v4->enableDebugger();
+
+ QScopedPointer<QThread> debugThread(new QThread);
+ debugThread->start();
+ QScopedPointer<TestAgent> debuggerAgent(new TestAgent);
+ debuggerAgent->addDebugger(v4->debugger);
+ debuggerAgent->moveToThread(debugThread.data());
+
+ QQmlComponent component(&engine);
+ component.setData("import QtQml 2.0\n"
+ "QtObject {\n"
+ " id: root\n"
+ " property int foo: 42\n"
+ " property bool success: false\n"
+ " Component.onCompleted: {\n"
+ " success = true;\n" // breakpoint here
+ " }\n"
+ "}\n", QUrl("test.qml"));
+
+ debuggerAgent->addBreakPoint("test.qml", 7, /*enabled*/true, "root.foo == 42");
+
+ QScopedPointer<QObject> obj(component.create());
+ QCOMPARE(obj->property("success").toBool(), true);
+
+ QCOMPARE(debuggerAgent->m_statesWhenPaused.count(), 1);
+ QCOMPARE(debuggerAgent->m_statesWhenPaused.at(0).fileName, QStringLiteral("test.qml"));
+ QCOMPARE(debuggerAgent->m_statesWhenPaused.at(0).lineNumber, 7);
+
+ debugThread->quit();
+ debugThread->wait();
+}
+
void tst_qv4debugger::readArguments()
{
m_debuggerAgent->m_captureContextInfo = true;
@@ -556,6 +612,33 @@ void tst_qv4debugger::pauseOnThrow()
QCOMPARE(m_debuggerAgent->m_thrownValue.toString(), QString("hard"));
}
+void tst_qv4debugger::evaluateExpression()
+{
+ QString script =
+ "function testFunction() {\n"
+ " var x = 10\n"
+ " return x\n" // breakpoint
+ "}\n"
+ "var x = 20\n"
+ "testFunction()\n";
+
+ TestAgent::ExpressionRequest request;
+ request.expression = "x";
+ request.frameNr = 0;
+ m_debuggerAgent->m_expressionRequests << request;
+ request.expression = "x";
+ request.frameNr = 1;
+ m_debuggerAgent->m_expressionRequests << request;
+
+ m_debuggerAgent->addBreakPoint("evaluateExpression", 3);
+
+ evaluateJavaScript(script, "evaluateExpression");
+
+ QCOMPARE(m_debuggerAgent->m_expressionResults.count(), 2);
+ QCOMPARE(m_debuggerAgent->m_expressionResults[0].toInt(), 10);
+ QCOMPARE(m_debuggerAgent->m_expressionResults[1].toInt(), 20);
+}
+
QTEST_MAIN(tst_qv4debugger)
#include "tst_qv4debugger.moc"
diff --git a/tests/auto/qmltest/animatedimage/tst_animatedimage.qml b/tests/auto/qmltest/animatedimage/tst_animatedimage.qml
index d0574da4f5..a58a19fa58 100644
--- a/tests/auto/qmltest/animatedimage/tst_animatedimage.qml
+++ b/tests/auto/qmltest/animatedimage/tst_animatedimage.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/animations/tst_abstractanimationjobcrash.qml b/tests/auto/qmltest/animations/tst_abstractanimationjobcrash.qml
index 6d4b17f83e..008f0ad445 100644
--- a/tests/auto/qmltest/animations/tst_abstractanimationjobcrash.qml
+++ b/tests/auto/qmltest/animations/tst_abstractanimationjobcrash.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
Rectangle {
diff --git a/tests/auto/qmltest/animators/tst_behavior.qml b/tests/auto/qmltest/animators/tst_behavior.qml
index 87b0efff17..17b9bee0e2 100644
--- a/tests/auto/qmltest/animators/tst_behavior.qml
+++ b/tests/auto/qmltest/animators/tst_behavior.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_mixed.qml b/tests/auto/qmltest/animators/tst_mixed.qml
index 488f1c8156..1e3600f80f 100644
--- a/tests/auto/qmltest/animators/tst_mixed.qml
+++ b/tests/auto/qmltest/animators/tst_mixed.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_mixedparallel.qml b/tests/auto/qmltest/animators/tst_mixedparallel.qml
index 2b6ebfc17a..51372008e1 100644
--- a/tests/auto/qmltest/animators/tst_mixedparallel.qml
+++ b/tests/auto/qmltest/animators/tst_mixedparallel.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_mixedsequential.qml b/tests/auto/qmltest/animators/tst_mixedsequential.qml
index 6165cf5438..d1b0f92f59 100644
--- a/tests/auto/qmltest/animators/tst_mixedsequential.qml
+++ b/tests/auto/qmltest/animators/tst_mixedsequential.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_multiwindow.qml b/tests/auto/qmltest/animators/tst_multiwindow.qml
index de73434aab..f0f42725ba 100644
--- a/tests/auto/qmltest/animators/tst_multiwindow.qml
+++ b/tests/auto/qmltest/animators/tst_multiwindow.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
import QtQuick.Window 2.0
Item {
diff --git a/tests/auto/qmltest/animators/tst_nested.qml b/tests/auto/qmltest/animators/tst_nested.qml
index 0426dd96e7..fba5d8350d 100644
--- a/tests/auto/qmltest/animators/tst_nested.qml
+++ b/tests/auto/qmltest/animators/tst_nested.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_on.qml b/tests/auto/qmltest/animators/tst_on.qml
index d6be945723..e82711bb50 100644
--- a/tests/auto/qmltest/animators/tst_on.qml
+++ b/tests/auto/qmltest/animators/tst_on.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_opacity.qml b/tests/auto/qmltest/animators/tst_opacity.qml
index 37603a9ced..94f639e30c 100644
--- a/tests/auto/qmltest/animators/tst_opacity.qml
+++ b/tests/auto/qmltest/animators/tst_opacity.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_parallel.qml b/tests/auto/qmltest/animators/tst_parallel.qml
index 7702dd7dd8..074c7442f7 100644
--- a/tests/auto/qmltest/animators/tst_parallel.qml
+++ b/tests/auto/qmltest/animators/tst_parallel.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_restart.qml b/tests/auto/qmltest/animators/tst_restart.qml
index 3bacf6cb6a..fd9bd46c46 100644
--- a/tests/auto/qmltest/animators/tst_restart.qml
+++ b/tests/auto/qmltest/animators/tst_restart.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_rotation.qml b/tests/auto/qmltest/animators/tst_rotation.qml
index 9ff4278527..deb6006801 100644
--- a/tests/auto/qmltest/animators/tst_rotation.qml
+++ b/tests/auto/qmltest/animators/tst_rotation.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_scale.qml b/tests/auto/qmltest/animators/tst_scale.qml
index 10f3430c84..62f8fe1264 100644
--- a/tests/auto/qmltest/animators/tst_scale.qml
+++ b/tests/auto/qmltest/animators/tst_scale.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_sequential.qml b/tests/auto/qmltest/animators/tst_sequential.qml
index 9841413f70..232d084481 100644
--- a/tests/auto/qmltest/animators/tst_sequential.qml
+++ b/tests/auto/qmltest/animators/tst_sequential.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_targetdestroyed.qml b/tests/auto/qmltest/animators/tst_targetdestroyed.qml
index 92b14d0594..92ed3bda3e 100644
--- a/tests/auto/qmltest/animators/tst_targetdestroyed.qml
+++ b/tests/auto/qmltest/animators/tst_targetdestroyed.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_transformorigin.qml b/tests/auto/qmltest/animators/tst_transformorigin.qml
index bd3483dad5..d11e2040ba 100644
--- a/tests/auto/qmltest/animators/tst_transformorigin.qml
+++ b/tests/auto/qmltest/animators/tst_transformorigin.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_transition.qml b/tests/auto/qmltest/animators/tst_transition.qml
index 67230d2adf..c5becfe68b 100644
--- a/tests/auto/qmltest/animators/tst_transition.qml
+++ b/tests/auto/qmltest/animators/tst_transition.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_x.qml b/tests/auto/qmltest/animators/tst_x.qml
index 35e410e8e2..32f2eac75d 100644
--- a/tests/auto/qmltest/animators/tst_x.qml
+++ b/tests/auto/qmltest/animators/tst_x.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/animators/tst_y.qml b/tests/auto/qmltest/animators/tst_y.qml
index 79fd50e8bf..792cc91782 100644
--- a/tests/auto/qmltest/animators/tst_y.qml
+++ b/tests/auto/qmltest/animators/tst_y.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/borderimage/tst_borderimage.qml b/tests/auto/qmltest/borderimage/tst_borderimage.qml
index 49b4397ea9..91b0310009 100644
--- a/tests/auto/qmltest/borderimage/tst_borderimage.qml
+++ b/tests/auto/qmltest/borderimage/tst_borderimage.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/buttonclick/tst_buttonclick.qml b/tests/auto/qmltest/buttonclick/tst_buttonclick.qml
index aead8b91f2..18882587a9 100644
--- a/tests/auto/qmltest/buttonclick/tst_buttonclick.qml
+++ b/tests/auto/qmltest/buttonclick/tst_buttonclick.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Button {
id: button
diff --git a/tests/auto/qmltest/createbenchmark/tst_createbenchmark.qml b/tests/auto/qmltest/createbenchmark/tst_createbenchmark.qml
index f504c8f901..8da6fb1150 100644
--- a/tests/auto/qmltest/createbenchmark/tst_createbenchmark.qml
+++ b/tests/auto/qmltest/createbenchmark/tst_createbenchmark.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
TestCase {
id: top
diff --git a/tests/auto/qmltest/events/tst_drag.qml b/tests/auto/qmltest/events/tst_drag.qml
index 76682ab6fb..1665a8e0ae 100644
--- a/tests/auto/qmltest/events/tst_drag.qml
+++ b/tests/auto/qmltest/events/tst_drag.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle{
id: root
diff --git a/tests/auto/qmltest/events/tst_events.qml b/tests/auto/qmltest/events/tst_events.qml
index 1ae5d5fbb2..ea6e4ea4fb 100644
--- a/tests/auto/qmltest/events/tst_events.qml
+++ b/tests/auto/qmltest/events/tst_events.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
width: 50; height: 50
diff --git a/tests/auto/qmltest/events/tst_wheel.qml b/tests/auto/qmltest/events/tst_wheel.qml
index 707b5d46bb..8504939633 100644
--- a/tests/auto/qmltest/events/tst_wheel.qml
+++ b/tests/auto/qmltest/events/tst_wheel.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
id:top
diff --git a/tests/auto/qmltest/fontloader/tst_fontloader.qml b/tests/auto/qmltest/fontloader/tst_fontloader.qml
index be24bb603d..ea0d8bc7f4 100644
--- a/tests/auto/qmltest/fontloader/tst_fontloader.qml
+++ b/tests/auto/qmltest/fontloader/tst_fontloader.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.1
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/gradient/tst_gradient.qml b/tests/auto/qmltest/gradient/tst_gradient.qml
index c25ac19e84..1e9f7d4373 100644
--- a/tests/auto/qmltest/gradient/tst_gradient.qml
+++ b/tests/auto/qmltest/gradient/tst_gradient.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/image/tst_image.qml b/tests/auto/qmltest/image/tst_image.qml
index 1afa5f8274..a507dfe508 100644
--- a/tests/auto/qmltest/image/tst_image.qml
+++ b/tests/auto/qmltest/image/tst_image.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/item/tst_layerInPositioner.qml b/tests/auto/qmltest/item/tst_layerInPositioner.qml
index 706c895264..69f29be269 100644
--- a/tests/auto/qmltest/item/tst_layerInPositioner.qml
+++ b/tests/auto/qmltest/item/tst_layerInPositioner.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.4
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml b/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml
index 4e60e2d8d6..1a79cb4935 100644
--- a/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml
+++ b/tests/auto/qmltest/itemgrabber/tst_itemgrabber.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.4
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root;
diff --git a/tests/auto/qmltest/listmodel/tst_listmodel.qml b/tests/auto/qmltest/listmodel/tst_listmodel.qml
index 603993a092..aae9ec42ec 100644
--- a/tests/auto/qmltest/listmodel/tst_listmodel.qml
+++ b/tests/auto/qmltest/listmodel/tst_listmodel.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/listview/tst_listview.qml b/tests/auto/qmltest/listview/tst_listview.qml
index 069b62a726..7b7242d17d 100644
--- a/tests/auto/qmltest/listview/tst_listview.qml
+++ b/tests/auto/qmltest/listview/tst_listview.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.1
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/pathview/tst_pathview.qml b/tests/auto/qmltest/pathview/tst_pathview.qml
index 820034c960..a6b440e0b8 100644
--- a/tests/auto/qmltest/pathview/tst_pathview.qml
+++ b/tests/auto/qmltest/pathview/tst_pathview.qml
@@ -1,5 +1,5 @@
import QtQuick 2.1
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/pixel/tst_pixel.qml b/tests/auto/qmltest/pixel/tst_pixel.qml
index 6e4055b367..9b0b9e57c1 100644
--- a/tests/auto/qmltest/pixel/tst_pixel.qml
+++ b/tests/auto/qmltest/pixel/tst_pixel.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
id:rect
diff --git a/tests/auto/qmltest/qqmlbinding/tst_binding.qml b/tests/auto/qmltest/qqmlbinding/tst_binding.qml
index 81f9c04b55..35cf7e071d 100644
--- a/tests/auto/qmltest/qqmlbinding/tst_binding.qml
+++ b/tests/auto/qmltest/qqmlbinding/tst_binding.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
id: screen
diff --git a/tests/auto/qmltest/qqmlbinding/tst_binding2.qml b/tests/auto/qmltest/qqmlbinding/tst_binding2.qml
index b1f2143751..944f88b072 100644
--- a/tests/auto/qmltest/qqmlbinding/tst_binding2.qml
+++ b/tests/auto/qmltest/qqmlbinding/tst_binding2.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
id: screen
diff --git a/tests/auto/qmltest/rectangle/tst_rectangle.qml b/tests/auto/qmltest/rectangle/tst_rectangle.qml
index caf40cdb26..a0a6ee4862 100644
--- a/tests/auto/qmltest/rectangle/tst_rectangle.qml
+++ b/tests/auto/qmltest/rectangle/tst_rectangle.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/selftests/tst_compare.qml b/tests/auto/qmltest/selftests/tst_compare.qml
index efb4ce0349..2c1ecb5223 100644
--- a/tests/auto/qmltest/selftests/tst_compare.qml
+++ b/tests/auto/qmltest/selftests/tst_compare.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
TestCase {
name: "SelfTests_compare"
diff --git a/tests/auto/qmltest/selftests/tst_compare_quickobjects.qml b/tests/auto/qmltest/selftests/tst_compare_quickobjects.qml
index f246f0b116..de652ae044 100644
--- a/tests/auto/qmltest/selftests/tst_compare_quickobjects.qml
+++ b/tests/auto/qmltest/selftests/tst_compare_quickobjects.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
TestCase {
name: "SelfTests_compare_QuickObjects"
diff --git a/tests/auto/qmltest/selftests/tst_datadriven.qml b/tests/auto/qmltest/selftests/tst_datadriven.qml
index cc3afc43b5..a371bc9034 100644
--- a/tests/auto/qmltest/selftests/tst_datadriven.qml
+++ b/tests/auto/qmltest/selftests/tst_datadriven.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
TestCase {
diff --git a/tests/auto/qmltest/selftests/tst_destroy.qml b/tests/auto/qmltest/selftests/tst_destroy.qml
index 764f21ecbc..d943c5ed7a 100644
--- a/tests/auto/qmltest/selftests/tst_destroy.qml
+++ b/tests/auto/qmltest/selftests/tst_destroy.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.1
-import QtTest 1.0
+import QtTest 1.1
TestCase {
id: testCase
diff --git a/tests/auto/qmltest/selftests/tst_findChild.qml b/tests/auto/qmltest/selftests/tst_findChild.qml
index 69bcb390e9..ae0b24e0de 100644
--- a/tests/auto/qmltest/selftests/tst_findChild.qml
+++ b/tests/auto/qmltest/selftests/tst_findChild.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
TestCase {
name: "tst_findChild"
diff --git a/tests/auto/qmltest/selftests/tst_selftests.qml b/tests/auto/qmltest/selftests/tst_selftests.qml
index 5d91141429..167c21774a 100644
--- a/tests/auto/qmltest/selftests/tst_selftests.qml
+++ b/tests/auto/qmltest/selftests/tst_selftests.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
TestCase {
name: "SelfTests"
diff --git a/tests/auto/qmltest/shadersource/tst_DynamicallyCreated.qml b/tests/auto/qmltest/shadersource/tst_DynamicallyCreated.qml
index bbfa08f443..689f04aa04 100644
--- a/tests/auto/qmltest/shadersource/tst_DynamicallyCreated.qml
+++ b/tests/auto/qmltest/shadersource/tst_DynamicallyCreated.qml
@@ -33,7 +33,7 @@
import QtQuick 2.2
import QtQuick.Window 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
width: 100
diff --git a/tests/auto/qmltest/shadersource/tst_DynamicallyCreatedSource.qml b/tests/auto/qmltest/shadersource/tst_DynamicallyCreatedSource.qml
index 2042afa2c5..c04aab3c01 100644
--- a/tests/auto/qmltest/shadersource/tst_DynamicallyCreatedSource.qml
+++ b/tests/auto/qmltest/shadersource/tst_DynamicallyCreatedSource.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root
diff --git a/tests/auto/qmltest/shadersource/tst_SourceInOtherWindow.qml b/tests/auto/qmltest/shadersource/tst_SourceInOtherWindow.qml
index b00cfbc5f8..81aac5fb9e 100644
--- a/tests/auto/qmltest/shadersource/tst_SourceInOtherWindow.qml
+++ b/tests/auto/qmltest/shadersource/tst_SourceInOtherWindow.qml
@@ -34,7 +34,7 @@
import QtQuick 2.0
import QtQuick.Window 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
width: 100
diff --git a/tests/auto/qmltest/shadersource/tst_SourceItem.qml b/tests/auto/qmltest/shadersource/tst_SourceItem.qml
index 822b53d6fa..bde6ce2a0b 100644
--- a/tests/auto/qmltest/shadersource/tst_SourceItem.qml
+++ b/tests/auto/qmltest/shadersource/tst_SourceItem.qml
@@ -32,7 +32,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: root
diff --git a/tests/auto/qmltest/shadersource/tst_SourcedFromOtherWindow.qml b/tests/auto/qmltest/shadersource/tst_SourcedFromOtherWindow.qml
index 4fb08a02f6..48f1f3ecc2 100644
--- a/tests/auto/qmltest/shadersource/tst_SourcedFromOtherWindow.qml
+++ b/tests/auto/qmltest/shadersource/tst_SourcedFromOtherWindow.qml
@@ -34,7 +34,7 @@
import QtQuick 2.0
import QtQuick.Window 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
Rectangle {
diff --git a/tests/auto/qmltest/stability/tst_unloadrepeater.qml b/tests/auto/qmltest/stability/tst_unloadrepeater.qml
index dfb631493b..62811ddabc 100644
--- a/tests/auto/qmltest/stability/tst_unloadrepeater.qml
+++ b/tests/auto/qmltest/stability/tst_unloadrepeater.qml
@@ -40,7 +40,7 @@
****************************************************************************/
import QtQuick 2.2
-import QtTest 1.0
+import QtTest 1.1
Item {
width : 800
diff --git a/tests/auto/qmltest/statemachine/tst_anonymousstate.qml b/tests/auto/qmltest/statemachine/tst_anonymousstate.qml
index b05d5c67a9..e5fab06409 100644
--- a/tests/auto/qmltest/statemachine/tst_anonymousstate.qml
+++ b/tests/auto/qmltest/statemachine/tst_anonymousstate.qml
@@ -31,7 +31,7 @@
**
****************************************************************************/
-import QtTest 1.0
+import QtTest 1.1
import QtQml.StateMachine 1.0
TestCase {
diff --git a/tests/auto/qmltest/statemachine/tst_guardcondition.qml b/tests/auto/qmltest/statemachine/tst_guardcondition.qml
index 0390b5f8fa..abe348aa8d 100644
--- a/tests/auto/qmltest/statemachine/tst_guardcondition.qml
+++ b/tests/auto/qmltest/statemachine/tst_guardcondition.qml
@@ -39,7 +39,7 @@
**
****************************************************************************/
-import QtTest 1.0
+import QtTest 1.1
import QtQml.StateMachine 1.0
TestCase {
diff --git a/tests/auto/qmltest/statemachine/tst_historystate.qml b/tests/auto/qmltest/statemachine/tst_historystate.qml
index 6e2aa70417..1da554c9bb 100644
--- a/tests/auto/qmltest/statemachine/tst_historystate.qml
+++ b/tests/auto/qmltest/statemachine/tst_historystate.qml
@@ -31,7 +31,7 @@
**
****************************************************************************/
-import QtTest 1.0
+import QtTest 1.1
import QtQml.StateMachine 1.0
TestCase {
diff --git a/tests/auto/qmltest/statemachine/tst_initialstate.qml b/tests/auto/qmltest/statemachine/tst_initialstate.qml
index c08b3f7001..a1fa6f2d55 100644
--- a/tests/auto/qmltest/statemachine/tst_initialstate.qml
+++ b/tests/auto/qmltest/statemachine/tst_initialstate.qml
@@ -31,7 +31,7 @@
**
****************************************************************************/
-import QtTest 1.0
+import QtTest 1.1
import QtQml.StateMachine 1.0
TestCase {
diff --git a/tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml b/tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml
index 443771f8f4..792ddd33bc 100644
--- a/tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml
+++ b/tests/auto/qmltest/statemachine/tst_nestedinitialstates.qml
@@ -31,7 +31,7 @@
**
****************************************************************************/
-import QtTest 1.0
+import QtTest 1.1
import QtQml.StateMachine 1.0
TestCase {
diff --git a/tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml b/tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml
index f584b7cd01..f123f3f3af 100644
--- a/tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml
+++ b/tests/auto/qmltest/statemachine/tst_nestedstatemachine.qml
@@ -31,7 +31,7 @@
**
****************************************************************************/
-import QtTest 1.0
+import QtTest 1.1
import QtQml.StateMachine 1.0
TestCase {
diff --git a/tests/auto/qmltest/statemachine/tst_parallelmachine.qml b/tests/auto/qmltest/statemachine/tst_parallelmachine.qml
index 2e3a5efdfd..1926b100b6 100644
--- a/tests/auto/qmltest/statemachine/tst_parallelmachine.qml
+++ b/tests/auto/qmltest/statemachine/tst_parallelmachine.qml
@@ -31,7 +31,7 @@
**
****************************************************************************/
-import QtTest 1.0
+import QtTest 1.1
import QtQml.StateMachine 1.0
TestCase {
diff --git a/tests/auto/qmltest/statemachine/tst_trafficlight.qml b/tests/auto/qmltest/statemachine/tst_trafficlight.qml
index 3f731a4014..6e2eebb354 100644
--- a/tests/auto/qmltest/statemachine/tst_trafficlight.qml
+++ b/tests/auto/qmltest/statemachine/tst_trafficlight.qml
@@ -31,7 +31,7 @@
**
****************************************************************************/
-import QtTest 1.0
+import QtTest 1.1
import QtQml.StateMachine 1.0
TestCase {
diff --git a/tests/auto/qmltest/text/tst_text.qml b/tests/auto/qmltest/text/tst_text.qml
index b1d743f630..772d9987bc 100644
--- a/tests/auto/qmltest/text/tst_text.qml
+++ b/tests/auto/qmltest/text/tst_text.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/textedit/tst_textedit.qml b/tests/auto/qmltest/textedit/tst_textedit.qml
index 1dc7084049..a7fb2374b6 100644
--- a/tests/auto/qmltest/textedit/tst_textedit.qml
+++ b/tests/auto/qmltest/textedit/tst_textedit.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/qmltest/textinput/tst_textinput.qml b/tests/auto/qmltest/textinput/tst_textinput.qml
index 9a00ac8a60..4942665e9d 100644
--- a/tests/auto/qmltest/textinput/tst_textinput.qml
+++ b/tests/auto/qmltest/textinput/tst_textinput.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Item {
id: top
diff --git a/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp b/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp
index 921c81ae89..e0ea57056a 100644
--- a/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp
+++ b/tests/auto/quick/qquickaccessible/tst_qquickaccessible.cpp
@@ -59,29 +59,6 @@
} \
} while (0)
-static int verifyHierarchy(QAccessibleInterface *iface)
-{
- int errorAt = 0;
- static int treelevel = 0; // for error diagnostics
- QAccessibleInterface *if2;
- ++treelevel;
- int middle = iface->childCount()/2 + 1;
- for (int i = 0; i < iface->childCount() && !errorAt; ++i) {
- if2 = iface->child(i);
- EXPECT(if2 != 0);
- // navigate Ancestor...
- QAccessibleInterface *parent = if2->parent();
- EXPECT(iface->object() == parent->object());
-
- // verify children...
- if (!errorAt)
- errorAt = verifyHierarchy(if2);
- }
-
- --treelevel;
- return errorAt;
-}
-
//TESTED_FILES=
@@ -383,8 +360,6 @@ void tst_QQuickAccessible::checkableTest()
QScopedPointer<QQuickView> window(new QQuickView());
window->setSource(testFileUrl("checkbuttons.qml"));
window->show();
- window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window.data()));
QQuickItem *contentItem = window->contentItem();
QVERIFY(contentItem);
@@ -462,8 +437,6 @@ void tst_QQuickAccessible::ignoredTest()
QScopedPointer<QQuickView> window(new QQuickView());
window->setSource(testFileUrl("ignored.qml"));
window->show();
- window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window.data()));
QQuickItem *contentItem = window->contentItem();
QVERIFY(contentItem);
diff --git a/tests/auto/quick/qquickanimationcontroller/data/tst_coloranimation.qml b/tests/auto/quick/qquickanimationcontroller/data/tst_coloranimation.qml
index 92e27b9945..8374552974 100755
--- a/tests/auto/quick/qquickanimationcontroller/data/tst_coloranimation.qml
+++ b/tests/auto/quick/qquickanimationcontroller/data/tst_coloranimation.qml
@@ -1,5 +1,5 @@
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
id:container
diff --git a/tests/auto/quick/qquickanimationcontroller/data/tst_completion.qml b/tests/auto/quick/qquickanimationcontroller/data/tst_completion.qml
index 48c4fb734c..1a8ca81ba0 100755
--- a/tests/auto/quick/qquickanimationcontroller/data/tst_completion.qml
+++ b/tests/auto/quick/qquickanimationcontroller/data/tst_completion.qml
@@ -1,5 +1,5 @@
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
id:container
diff --git a/tests/auto/quick/qquickanimationcontroller/data/tst_numberanimation.qml b/tests/auto/quick/qquickanimationcontroller/data/tst_numberanimation.qml
index 7c4496b206..c5f9860fe2 100644
--- a/tests/auto/quick/qquickanimationcontroller/data/tst_numberanimation.qml
+++ b/tests/auto/quick/qquickanimationcontroller/data/tst_numberanimation.qml
@@ -1,5 +1,5 @@
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
id:container
diff --git a/tests/auto/quick/qquickanimationcontroller/data/tst_parallelanimation.qml b/tests/auto/quick/qquickanimationcontroller/data/tst_parallelanimation.qml
index 1a17a1a908..87cba880af 100644
--- a/tests/auto/quick/qquickanimationcontroller/data/tst_parallelanimation.qml
+++ b/tests/auto/quick/qquickanimationcontroller/data/tst_parallelanimation.qml
@@ -1,5 +1,5 @@
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
id:container
diff --git a/tests/auto/quick/qquickanimationcontroller/data/tst_sequentialanimation.qml b/tests/auto/quick/qquickanimationcontroller/data/tst_sequentialanimation.qml
index 59671f5145..4098af14f2 100644
--- a/tests/auto/quick/qquickanimationcontroller/data/tst_sequentialanimation.qml
+++ b/tests/auto/quick/qquickanimationcontroller/data/tst_sequentialanimation.qml
@@ -1,5 +1,5 @@
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Rectangle {
id:container
diff --git a/tests/auto/quick/qquickcanvasitem/data/CanvasComponent.qml b/tests/auto/quick/qquickcanvasitem/data/CanvasComponent.qml
index 000888a36f..5be221042e 100644
--- a/tests/auto/quick/qquickcanvasitem/data/CanvasComponent.qml
+++ b/tests/auto/quick/qquickcanvasitem/data/CanvasComponent.qml
@@ -1,5 +1,5 @@
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Component {
id:canvas
diff --git a/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml b/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml
index c8c2f4960f..b0cae69fe3 100644
--- a/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml
+++ b/tests/auto/quick/qquickcanvasitem/data/CanvasTestCase.qml
@@ -1,5 +1,5 @@
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
import QtQuick.Window 2.1
TestCase {
diff --git a/tests/auto/quick/qquickcanvasitem/data/tst_context.qml b/tests/auto/quick/qquickcanvasitem/data/tst_context.qml
index b18250291e..f266c16d76 100644
--- a/tests/auto/quick/qquickcanvasitem/data/tst_context.qml
+++ b/tests/auto/quick/qquickcanvasitem/data/tst_context.qml
@@ -1,6 +1,6 @@
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
Canvas {
id: canvas
diff --git a/tests/auto/quick/qquickcanvasitem/data/tst_pixel.qml b/tests/auto/quick/qquickcanvasitem/data/tst_pixel.qml
index 487f7dc903..281264ba92 100644
--- a/tests/auto/quick/qquickcanvasitem/data/tst_pixel.qml
+++ b/tests/auto/quick/qquickcanvasitem/data/tst_pixel.qml
@@ -1,5 +1,5 @@
import QtQuick 2.0
-import QtTest 1.0
+import QtTest 1.1
CanvasTestCase {
id:testCase
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index 26819ff48b..a3d902a054 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -91,12 +91,17 @@ private slots:
void stopAtBounds_data();
void nestedMouseAreaUsingTouch();
void pressDelayWithLoader();
+ void cleanup();
private:
void flickWithTouch(QQuickWindow *window, QTouchDevice *touchDevice, const QPoint &from, const QPoint &to);
- QQmlEngine engine;
};
+void tst_qquickflickable::cleanup()
+{
+ QVERIFY(QGuiApplication::topLevelWindows().isEmpty());
+}
+
void tst_qquickflickable::create()
{
QQmlEngine engine;
@@ -199,6 +204,7 @@ void tst_qquickflickable::properties()
void tst_qquickflickable::boundsBehavior()
{
+ QQmlEngine engine;
QQmlComponent component(&engine);
component.setData("import QtQuick 2.0; Flickable { boundsBehavior: Flickable.StopAtBounds }", QUrl::fromLocalFile(""));
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(component.create());
@@ -330,6 +336,7 @@ void tst_qquickflickable::rebound()
void tst_qquickflickable::maximumFlickVelocity()
{
+ QQmlEngine engine;
QQmlComponent component(&engine);
component.setData("import QtQuick 2.0; Flickable { maximumFlickVelocity: 1.0; }", QUrl::fromLocalFile(""));
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(component.create());
@@ -349,6 +356,7 @@ void tst_qquickflickable::maximumFlickVelocity()
void tst_qquickflickable::flickDeceleration()
{
+ QQmlEngine engine;
QQmlComponent component(&engine);
component.setData("import QtQuick 2.0; Flickable { flickDeceleration: 1.0; }", QUrl::fromLocalFile(""));
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(component.create());
@@ -553,6 +561,7 @@ void tst_qquickflickable::nestedClickThenFlick()
void tst_qquickflickable::flickableDirection()
{
+ QQmlEngine engine;
QQmlComponent component(&engine);
component.setData("import QtQuick 2.0; Flickable { flickableDirection: Flickable.VerticalFlick; }", QUrl::fromLocalFile(""));
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(component.create());
@@ -1213,9 +1222,16 @@ void tst_qquickflickable::flickVelocity()
void tst_qquickflickable::margins()
{
- QQmlEngine engine;
- QQmlComponent c(&engine, testFileUrl("margins.qml"));
- QQuickItem *root = qobject_cast<QQuickItem*>(c.create());
+ QScopedPointer<QQuickView> window(new QQuickView);
+ window->setSource(testFileUrl("margins.qml"));
+ QTRY_COMPARE(window->status(), QQuickView::Ready);
+ QQuickViewTestUtil::centerOnScreen(window.data());
+ QQuickViewTestUtil::moveMouseAway(window.data());
+ window->setTitle(QTest::currentTestFunction());
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
+ QQuickItem *root = window->rootObject();
+ QVERIFY(root);
QQuickFlickable *obj = qobject_cast<QQuickFlickable*>(root);
QVERIFY(obj != 0);
diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
index 99702236ee..478944c650 100644
--- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
+++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
@@ -1558,7 +1558,7 @@ void tst_QQuickGridView::multipleChanges(bool condensed)
{
QList<QPair<QString, QString> > items;
for (int j=changes[i].index; j<changes[i].index + changes[i].count; ++j)
- items << qMakePair(QString("new item " + j), QString::number(j));
+ items << qMakePair(QString("new item %1").arg(j), QString::number(j));
model.insertItems(changes[i].index, items);
break;
}
diff --git a/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml b/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml
index c57cde5eda..c5fb53a3de 100644
--- a/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml
+++ b/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.1
-import QtTest 1.0
+import QtTest 1.1
Item {
width: 300
diff --git a/tests/auto/quick/qquickwindow/data/windowattached.qml b/tests/auto/quick/qquickwindow/data/windowattached.qml
index e000d5c6fd..0e3f1d4b62 100644
--- a/tests/auto/quick/qquickwindow/data/windowattached.qml
+++ b/tests/auto/quick/qquickwindow/data/windowattached.qml
@@ -6,6 +6,7 @@ Rectangle {
width: 100
height: 100
property bool windowActive: root.Window.active
+ property Item contentItem: root.Window.contentItem
Text {
objectName: "rectangleWindowText"
anchors.centerIn: parent
@@ -20,6 +21,7 @@ Rectangle {
objectName: "extraWindowText"
anchors.centerIn: parent
text: (extraWindow.active ? "active" : "inactive") + "\nvisibility: " + Window.visibility
+ property Item contentItem: Window.contentItem
}
}
}
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index 5bd7492d70..7c94cf6d17 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -341,6 +341,7 @@ private slots:
void testWindowVisibilityOrder();
void blockClosing();
+ void blockCloseMethod();
void crashWhenHoverItemDeleted();
@@ -1208,6 +1209,11 @@ void tst_qquickwindow::headless()
QVERIFY(window->openglContext() == 0);
}
+ if (QGuiApplication::platformName() == QLatin1String("windows")
+ && QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES) {
+ QSKIP("Crashes on Windows/ANGLE, QTBUG-42967");
+ }
+
// Destroy the native windowing system buffers
window->destroy();
QVERIFY(window->handle() == 0);
@@ -1739,6 +1745,25 @@ void tst_qquickwindow::blockClosing()
QTRY_VERIFY(!window->isVisible());
}
+void tst_qquickwindow::blockCloseMethod()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.loadUrl(testFileUrl("ucantclosethis.qml"));
+ QQuickWindow *window = qobject_cast<QQuickWindow *>(component.create());
+ QVERIFY(window);
+ window->show();
+ QTest::qWaitForWindowExposed(window);
+ QVERIFY(window->isVisible());
+ QVERIFY(QMetaObject::invokeMethod(window, "close", Qt::DirectConnection));
+ QVERIFY(window->isVisible());
+ QVERIFY(QMetaObject::invokeMethod(window, "close", Qt::DirectConnection));
+ QVERIFY(window->isVisible());
+ window->setProperty("canCloseThis", true);
+ QVERIFY(QMetaObject::invokeMethod(window, "close", Qt::DirectConnection));
+ QTRY_VERIFY(!window->isVisible());
+}
+
void tst_qquickwindow::crashWhenHoverItemDeleted()
{
// QTBUG-32771
@@ -1952,6 +1977,7 @@ void tst_qquickwindow::attachedProperty()
view.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&view));
QVERIFY(view.rootObject()->property("windowActive").toBool());
+ QCOMPARE(view.rootObject()->property("contentItem").value<QQuickItem*>(), view.contentItem());
QQuickWindow *innerWindow = view.rootObject()->findChild<QQuickWindow*>("extraWindow");
QVERIFY(innerWindow);
@@ -1961,6 +1987,7 @@ void tst_qquickwindow::attachedProperty()
QQuickText *text = view.rootObject()->findChild<QQuickText*>("extraWindowText");
QVERIFY(text);
QCOMPARE(text->text(), QLatin1String("active\nvisibility: 2"));
+ QCOMPARE(text->property("contentItem").value<QQuickItem*>(), innerWindow->contentItem());
}
class RenderJob : public QRunnable
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp
index 69ccd7a316..e06f249b40 100644
--- a/tools/qml/main.cpp
+++ b/tools/qml/main.cpp
@@ -494,6 +494,7 @@ int main(int argc, char *argv[])
foreach (const QString &path, files) {
//QUrl::fromUserInput doesn't treat no scheme as relative file paths
+#ifndef QT_NO_REGULAREXPRESSION
QRegularExpression urlRe("[[:word:]]+://.*");
if (urlRe.match(path).hasMatch()) { //Treat as a URL
QUrl url = QUrl::fromUserInput(path);
@@ -503,7 +504,9 @@ int main(int argc, char *argv[])
? QDir::toNativeSeparators(url.toLocalFile())
: url.toString()));
e.load(url);
- } else { //Local file path
+ } else
+#endif
+ { //Local file path
if (verboseMode)
printf("qml: loading %s\n", qPrintable(QDir::toNativeSeparators(path)));
diff --git a/tools/qmlscene/main.cpp b/tools/qmlscene/main.cpp
index bc339ae3e5..2a86b724f4 100644
--- a/tools/qmlscene/main.cpp
+++ b/tools/qmlscene/main.cpp
@@ -405,6 +405,9 @@ int main(int argc, char ** argv)
}
}
+ // QtWebEngine needs a shared context in order for the GPU thread to
+ // upload textures.
+ QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, options.contextSharing);
#ifdef QT_WIDGETS_LIB
QApplication app(argc, argv);
#else
@@ -443,15 +446,6 @@ int main(int argc, char ** argv)
displayFileDialog(&options);
#endif
- // QWebEngine needs a shared context in order for the GPU thread to
- // upload textures.
- QScopedPointer<QOpenGLContext> shareContext;
- if (options.contextSharing) {
- shareContext.reset(new QOpenGLContext);
- shareContext->create();
- qt_gl_set_global_share_context(shareContext.data());
- }
-
int exitCode = 0;
if (!options.file.isEmpty()) {