aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dist/changes-5.0.245
-rw-r--r--dist/changes-5.1.065
-rw-r--r--examples/qml/dynamicscene/doc/src/dynamicscene.qdoc2
-rw-r--r--examples/qml/i18n/doc/src/i18n.qdoc2
-rw-r--r--examples/qml/plugins/doc/src/qmlpluginex.qdoc2
-rw-r--r--examples/qml/xmlhttprequest/doc/src/xmlhttprequest.qdoc2
-rw-r--r--examples/quick/accessibility/doc/src/accessibility.qdoc2
-rw-r--r--examples/quick/animation/doc/src/animation.qdoc2
-rw-r--r--examples/quick/canvas/doc/src/canvas.qdoc2
-rw-r--r--examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc2
-rw-r--r--examples/quick/doc/src/qml-extending.qdoc20
-rw-r--r--examples/quick/draganddrop/doc/src/draganddrop.qdoc2
-rw-r--r--examples/quick/imageelements/doc/src/imageelements.qdoc2
-rw-r--r--examples/quick/keyinteraction/doc/src/keyinteraction.qdoc2
-rw-r--r--examples/quick/keyinteraction/focus/Core/ContextMenu.qml2
-rw-r--r--examples/quick/keyinteraction/focus/Core/GridMenu.qml2
-rw-r--r--examples/quick/keyinteraction/focus/Core/ListMenu.qml2
-rw-r--r--examples/quick/keyinteraction/focus/Core/ListViewDelegate.qml2
-rw-r--r--examples/quick/keyinteraction/focus/Core/TabMenu.qml2
-rw-r--r--examples/quick/keyinteraction/focus/focus.qml2
-rw-r--r--examples/quick/keyinteraction/keyinteraction.qml2
-rw-r--r--examples/quick/localstorage/doc/src/localstorage.qdoc2
-rw-r--r--examples/quick/mousearea/doc/src/mousearea.qdoc2
-rw-r--r--examples/quick/painteditem/textballoons/doc/src/textballoons.qdoc2
-rw-r--r--examples/quick/particles/affectors/doc/src/affectors.qdoc2
-rw-r--r--examples/quick/particles/customparticle/doc/src/customparticle.qdoc2
-rw-r--r--examples/quick/particles/emitters/doc/src/emitters.qdoc2
-rw-r--r--examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc2
-rw-r--r--examples/quick/particles/system/doc/src/system.qdoc4
-rw-r--r--examples/quick/positioners/doc/src/positioners.qdoc2
-rw-r--r--examples/quick/righttoleft/doc/src/righttoleft.qdoc2
-rw-r--r--examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc2
-rw-r--r--examples/quick/scenegraph/openglunderqml/doc/src/openglunderqml.qdoc2
-rw-r--r--examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc2
-rw-r--r--examples/quick/shadereffects/doc/src/shadereffects.qdoc2
-rw-r--r--examples/quick/text/doc/src/text.qdoc2
-rw-r--r--examples/quick/threading/doc/src/threading.qdoc2
-rw-r--r--examples/quick/touchinteraction/doc/src/touchinteraction.qdoc2
-rw-r--r--examples/quick/views/doc/src/views.qdoc2
-rw-r--r--src/imports/testlib/TestCase.qml42
-rw-r--r--src/imports/testlib/testcase.qdoc4
-rw-r--r--src/plugins/accessible/shared/qqmlaccessible.cpp8
-rw-r--r--src/qml/doc/qtqml.qdocconf2
-rw-r--r--src/qml/doc/src/cppintegration/extending-tutorial.qdoc12
-rw-r--r--src/qml/qml/qqmlfile.cpp66
-rw-r--r--src/qml/qml/qqmlproperty.cpp1
-rw-r--r--src/qml/qml/qqmltypeloader.cpp17
-rw-r--r--src/qmltest/quicktestevent.cpp30
-rw-r--r--src/qmltest/quicktestevent_p.h4
-rw-r--r--src/quick/doc/qtquick.qdocconf3
-rw-r--r--src/quick/doc/src/advtutorial.qdoc8
-rw-r--r--src/quick/doc/src/dynamicview-tutorial.qdoc8
-rw-r--r--src/quick/items/qquickitem.h4
-rw-r--r--src/quick/items/qquickitemsmodule.cpp1
-rw-r--r--src/quick/items/qquicktextedit.cpp15
-rw-r--r--src/quick/items/qquicktextnode.cpp1
-rw-r--r--src/quick/items/qquickwindow.cpp2
-rw-r--r--src/quick/scenegraph/coreapi/qsgrenderer.cpp16
-rw-r--r--src/quick/scenegraph/qsgadaptationlayer.cpp10
-rw-r--r--src/quick/scenegraph/qsgcontext.cpp8
-rw-r--r--src/quick/scenegraph/qsgdefaultglyphnode.cpp63
-rw-r--r--src/quick/scenegraph/qsgdefaultglyphnode_p.cpp279
-rw-r--r--src/quick/scenegraph/qsgdefaultglyphnode_p.h12
-rw-r--r--src/quick/scenegraph/qsgdefaultglyphnode_p_p.h45
-rw-r--r--src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp46
-rw-r--r--src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h6
-rw-r--r--src/quick/scenegraph/qsgrenderloop.cpp17
-rw-r--r--src/quick/scenegraph/qsgrenderloop_p.h1
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp83
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop_p.h2
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp20
-rw-r--r--src/quick/util/qquickanimation.cpp5
-rw-r--r--src/quick/util/qquickanimation_p_p.h2
-rw-r--r--src/quick/util/qquickglobal.cpp2
-rw-r--r--tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs.pro2
-rw-r--r--tests/auto/qml/debugger/shared/debugutil_p.h2
-rw-r--r--tests/auto/qmltest/events/tst_drag.qml102
-rw-r--r--tests/auto/qmltest/textedit/tst_textedit.qml24
-rw-r--r--tests/auto/quick/dialogs/dialogs.pro2
-rw-r--r--tests/auto/quick/qquickitem2/data/activeFocusOnTab.qml2
-rw-r--r--tests/auto/quick/qquickitem2/data/activeFocusOnTab3.qml2
-rw-r--r--tests/auto/quick/qquickitem2/data/activeFocusOnTab4.qml56
-rw-r--r--tests/auto/quick/qquickitem2/tst_qquickitem.cpp62
-rw-r--r--tests/auto/quick/qquickpathview/tst_qquickpathview.cpp2
84 files changed, 1049 insertions, 256 deletions
diff --git a/dist/changes-5.0.2 b/dist/changes-5.0.2
new file mode 100644
index 0000000000..d2839fb5f2
--- /dev/null
+++ b/dist/changes-5.0.2
@@ -0,0 +1,45 @@
+Qt 5.0.2 is a bug-fix release. It maintains both forward and backward
+compatibility (source and binary) with Qt 5.0.0 and 5.0.1.
+
+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.0/
+
+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
+--------------------
+
+ - Fix build when Qt is configured with -no-opengl.
+ - Various documentation improvements.
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+ - [QTBUG-29138] Strengthen reference to var properties during construction
+ so they can be used even if GC runs while the object is being created.
+ - [QTBUG-29176] Fix crash in PathView when path is empty.
+ - [QTBUG-29560] Fix Text and TextEdit embedding images in RichText mode.
+
+****************************************************************************
+* Platform Specific Changes *
+****************************************************************************
+
+Qt for Windows
+--------------
+
+ - [QTBUG-28782] Enable sub-pixel anti-aliasing for default builds on Windows.
+
diff --git a/dist/changes-5.1.0 b/dist/changes-5.1.0
new file mode 100644
index 0000000000..cee8d4b382
--- /dev/null
+++ b/dist/changes-5.1.0
@@ -0,0 +1,65 @@
+Qt 5.1 introduces many new features and improvements as well as bugfixes
+over the 5.0.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.1
+
+The Qt version 5.1 series is binary compatible with the 5.0.x series.
+Applications compiled for 5.0 will continue to run with 5.1.
+
+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
+--------------------
+
+
+Third party components
+----------------------
+
+
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
+
+
+****************************************************************************
+* Library *
+****************************************************************************
+
+
+****************************************************************************
+* Database Drivers *
+****************************************************************************
+
+
+****************************************************************************
+* Platform Specific Changes *
+****************************************************************************
+
+
+****************************************************************************
+* Compiler Specific Changes *
+****************************************************************************
+
+
+****************************************************************************
+* Tools *
+****************************************************************************
+
+
+
+****************************************************************************
+* Plugins *
+****************************************************************************
+
diff --git a/examples/qml/dynamicscene/doc/src/dynamicscene.qdoc b/examples/qml/dynamicscene/doc/src/dynamicscene.qdoc
index 7a62f82ed9..77cb5959b9 100644
--- a/examples/qml/dynamicscene/doc/src/dynamicscene.qdoc
+++ b/examples/qml/dynamicscene/doc/src/dynamicscene.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
\title QML Example - Dynamic Scene
- \example qml/dynamicscene
+ \example dynamicscene
\brief This example demonstrates creating components dynamically.
\image qml-dynamicscene-example.png
*/
diff --git a/examples/qml/i18n/doc/src/i18n.qdoc b/examples/qml/i18n/doc/src/i18n.qdoc
index a342e99ea5..39f2bf9a08 100644
--- a/examples/qml/i18n/doc/src/i18n.qdoc
+++ b/examples/qml/i18n/doc/src/i18n.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
\title QML Examples - Internationalization
- \example qml/i18n
+ \example i18n
\image qml-i18n-example.png
\brief This is an internationalization example
diff --git a/examples/qml/plugins/doc/src/qmlpluginex.qdoc b/examples/qml/plugins/doc/src/qmlpluginex.qdoc
index 895030418a..5ea7237c8f 100644
--- a/examples/qml/plugins/doc/src/qmlpluginex.qdoc
+++ b/examples/qml/plugins/doc/src/qmlpluginex.qdoc
@@ -27,7 +27,7 @@
/*!
\title QML Plugin Example
- \example qml/plugins
+ \example plugins
\brief This example creates a C++ plugin extension by subclassing QQmlExtensionPlugin.
diff --git a/examples/qml/xmlhttprequest/doc/src/xmlhttprequest.qdoc b/examples/qml/xmlhttprequest/doc/src/xmlhttprequest.qdoc
index 5167ecfad1..db0b9e0a03 100644
--- a/examples/qml/xmlhttprequest/doc/src/xmlhttprequest.qdoc
+++ b/examples/qml/xmlhttprequest/doc/src/xmlhttprequest.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
\title Qt Quick Examples - XMLHttpRequest
- \example qml/xmlhttprequest
+ \example xmlhttprequest
\brief This is a collection of XMLHttpRequest examples
\image qml-xmlhttprequest-example.png
diff --git a/examples/quick/accessibility/doc/src/accessibility.qdoc b/examples/quick/accessibility/doc/src/accessibility.qdoc
index 467ae3c4a7..a637383324 100644
--- a/examples/quick/accessibility/doc/src/accessibility.qdoc
+++ b/examples/quick/accessibility/doc/src/accessibility.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
\title Qt Quick Examples - Accessibility
- \example quick/accessibility
+ \example accessibility
\brief This example has accessible buttons.
\ingroup qtquickexamples
diff --git a/examples/quick/animation/doc/src/animation.qdoc b/examples/quick/animation/doc/src/animation.qdoc
index 21ed74a576..064717835d 100644
--- a/examples/quick/animation/doc/src/animation.qdoc
+++ b/examples/quick/animation/doc/src/animation.qdoc
@@ -27,7 +27,7 @@
/*!
\title Qt Quick Examples - Animation
- \example quick/animation
+ \example animation
\brief This is a collection of QML Animation examples.
\image qml-animations-example.png
\ingroup qtquickexamples
diff --git a/examples/quick/canvas/doc/src/canvas.qdoc b/examples/quick/canvas/doc/src/canvas.qdoc
index 5c694c5464..638d25d83f 100644
--- a/examples/quick/canvas/doc/src/canvas.qdoc
+++ b/examples/quick/canvas/doc/src/canvas.qdoc
@@ -27,7 +27,7 @@
/*!
\title Qt Quick Examples - Canvas
- \example quick/canvas
+ \example canvas
\brief This is a collection of QML Canvas examples.
\image qml-canvas-example.png
\ingroup qtquickexamples
diff --git a/examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc b/examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc
index 9e2dc01667..60a9725e53 100644
--- a/examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc
+++ b/examples/quick/demos/calqlatr/doc/src/calqlatr.qdoc
@@ -27,7 +27,7 @@
/*!
\title QML Demo - Calqlatr
- \example quick/demos/calqlatr
+ \example demos/calqlatr
\brief This is an example calculator written in QML.
\image qml-calqlatr-demo-small.png
\ingroup qmldemos
diff --git a/examples/quick/doc/src/qml-extending.qdoc b/examples/quick/doc/src/qml-extending.qdoc
index 0b032c60fc..ee2dd06623 100644
--- a/examples/quick/doc/src/qml-extending.qdoc
+++ b/examples/quick/doc/src/qml-extending.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
-\example qml/referenceexamples/adding
+\example referenceexamples/adding
\title Extending QML - Adding Types Example
\brief Exporting C++ Classes
\ingroup qmlextendingexamples
@@ -63,7 +63,7 @@ loads and runs the QML snippet shown at the beginning of this page.
*/
/*!
-\example qml/referenceexamples/properties
+\example referenceexamples/properties
\title Extending QML - Object and List Property Types Example
\brief Exporting C++ Properties
\ingroup qmlextendingexamples
@@ -113,7 +113,7 @@ loads and runs the QML snippet shown at the beginning of this page.
*/
/*!
-\example qml/referenceexamples/coercion
+\example referenceexamples/coercion
\title Extending QML - Inheritance and Coercion Example
\brief C++ Inheritance and Coercion
\ingroup qmlextendingexamples
@@ -178,7 +178,7 @@ loads and runs the QML snippet shown at the beginning of this page.
*/
/*!
-\example qml/referenceexamples/default
+\example referenceexamples/default
\title Extending QML - Default Property Example
\brief Default Property
\ingroup qmlextendingexamples
@@ -216,7 +216,7 @@ loads and runs the QML snippet shown at the beginning of this page.
*/
/*!
-\example qml/referenceexamples/grouped
+\example referenceexamples/grouped
\title Extending QML - Grouped Properties Example
\brief Grouped Properties
\ingroup qmlextendingexamples
@@ -232,7 +232,7 @@ This example builds on:
*/
/*!
-\example qml/referenceexamples/attached
+\example referenceexamples/attached
\title Extending QML - Attached Properties Example
\brief Attached Properties
\ingroup qmlextendingexamples
@@ -249,7 +249,7 @@ This example builds on:
*/
/*!
-\example qml/referenceexamples/signal
+\example referenceexamples/signal
\title Extending QML - Signal Support Example
\brief Signal Support
\ingroup qmlextendingexamples
@@ -267,7 +267,7 @@ This example builds on:
*/
/*!
-\example qml/referenceexamples/methods
+\example referenceexamples/methods
\title Extending QML - Methods Example
\brief Methods Support
\ingroup qmlextendingexamples
@@ -283,7 +283,7 @@ This example builds on:
*/
/*!
-\example qml/referenceexamples/valuesource
+\example referenceexamples/valuesource
\title Extending QML - Property Value Source Example
\brief Property Value Source
\ingroup qmlextendingexamples
@@ -302,7 +302,7 @@ This example builds on:
*/
/*!
-\example qml/referenceexamples/binding
+\example referenceexamples/binding
\title Extending QML - Binding Example
\brief Binding
\ingroup qmlextendingexamples
diff --git a/examples/quick/draganddrop/doc/src/draganddrop.qdoc b/examples/quick/draganddrop/doc/src/draganddrop.qdoc
index 67621031f9..381fdd1299 100644
--- a/examples/quick/draganddrop/doc/src/draganddrop.qdoc
+++ b/examples/quick/draganddrop/doc/src/draganddrop.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
\title Qt Quick Examples - Drag and Drop
- \example quick/draganddrop
+ \example draganddrop
\brief This is a collection of QML drag and drop examples
\image qml-draganddrop-example.png
\ingroup qtquickexamples
diff --git a/examples/quick/imageelements/doc/src/imageelements.qdoc b/examples/quick/imageelements/doc/src/imageelements.qdoc
index cae5d20134..5abcece4fc 100644
--- a/examples/quick/imageelements/doc/src/imageelements.qdoc
+++ b/examples/quick/imageelements/doc/src/imageelements.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
\title QML Examples - Image Elements
- \example quick/imageelements
+ \example imageelements
\brief This is a collection of QML examples relating to image types.
\image qml-imageelements-example.png
\ingroup qtquickexamples
diff --git a/examples/quick/keyinteraction/doc/src/keyinteraction.qdoc b/examples/quick/keyinteraction/doc/src/keyinteraction.qdoc
index 3f84572084..d29536c66c 100644
--- a/examples/quick/keyinteraction/doc/src/keyinteraction.qdoc
+++ b/examples/quick/keyinteraction/doc/src/keyinteraction.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
\title Qt Quick Examples - Key Interaction
- \example quick/keyinteraction
+ \example keyinteraction
\brief This is a collection of QML keyboard interaction examples.
\image qml-keyinteraction-example.png
\ingroup qtquickexamples
diff --git a/examples/quick/keyinteraction/focus/Core/ContextMenu.qml b/examples/quick/keyinteraction/focus/Core/ContextMenu.qml
index eb10f0206b..3bbce04b07 100644
--- a/examples/quick/keyinteraction/focus/Core/ContextMenu.qml
+++ b/examples/quick/keyinteraction/focus/Core/ContextMenu.qml
@@ -38,7 +38,7 @@
**
****************************************************************************/
-import QtQuick 2.0
+import QtQuick 2.1
FocusScope {
id: container
diff --git a/examples/quick/keyinteraction/focus/Core/GridMenu.qml b/examples/quick/keyinteraction/focus/Core/GridMenu.qml
index e18ec1f0d3..0fba859466 100644
--- a/examples/quick/keyinteraction/focus/Core/GridMenu.qml
+++ b/examples/quick/keyinteraction/focus/Core/GridMenu.qml
@@ -38,7 +38,7 @@
**
****************************************************************************/
-import QtQuick 2.0
+import QtQuick 2.1
FocusScope {
property alias interactive: gridView.interactive
diff --git a/examples/quick/keyinteraction/focus/Core/ListMenu.qml b/examples/quick/keyinteraction/focus/Core/ListMenu.qml
index 32b3d1f4c8..27ed804f63 100644
--- a/examples/quick/keyinteraction/focus/Core/ListMenu.qml
+++ b/examples/quick/keyinteraction/focus/Core/ListMenu.qml
@@ -38,7 +38,7 @@
**
****************************************************************************/
-import QtQuick 2.0
+import QtQuick 2.1
FocusScope {
clip: true
diff --git a/examples/quick/keyinteraction/focus/Core/ListViewDelegate.qml b/examples/quick/keyinteraction/focus/Core/ListViewDelegate.qml
index 2aa3000eaf..dfd9e81af5 100644
--- a/examples/quick/keyinteraction/focus/Core/ListViewDelegate.qml
+++ b/examples/quick/keyinteraction/focus/Core/ListViewDelegate.qml
@@ -38,7 +38,7 @@
**
****************************************************************************/
-import QtQuick 2.0
+import QtQuick 2.1
Item {
id: container
diff --git a/examples/quick/keyinteraction/focus/Core/TabMenu.qml b/examples/quick/keyinteraction/focus/Core/TabMenu.qml
index 5eea611b44..a803e5289b 100644
--- a/examples/quick/keyinteraction/focus/Core/TabMenu.qml
+++ b/examples/quick/keyinteraction/focus/Core/TabMenu.qml
@@ -38,7 +38,7 @@
**
****************************************************************************/
-import QtQuick 2.0
+import QtQuick 2.1
FocusScope {
onActiveFocusChanged: {
diff --git a/examples/quick/keyinteraction/focus/focus.qml b/examples/quick/keyinteraction/focus/focus.qml
index 91fb146e40..4e58d4b8cc 100644
--- a/examples/quick/keyinteraction/focus/focus.qml
+++ b/examples/quick/keyinteraction/focus/focus.qml
@@ -38,7 +38,7 @@
**
****************************************************************************/
-import QtQuick 2.0
+import QtQuick 2.1
import "Core"
Rectangle {
diff --git a/examples/quick/keyinteraction/keyinteraction.qml b/examples/quick/keyinteraction/keyinteraction.qml
index 12e783024c..1a300cbda1 100644
--- a/examples/quick/keyinteraction/keyinteraction.qml
+++ b/examples/quick/keyinteraction/keyinteraction.qml
@@ -38,7 +38,7 @@
**
****************************************************************************/
-import QtQuick 2.0
+import QtQuick 2.1
Loader {//Just loader, since there's only one.
source: "focus/focus.qml"
diff --git a/examples/quick/localstorage/doc/src/localstorage.qdoc b/examples/quick/localstorage/doc/src/localstorage.qdoc
index 92d2101558..0a5d1cd6fd 100644
--- a/examples/quick/localstorage/doc/src/localstorage.qdoc
+++ b/examples/quick/localstorage/doc/src/localstorage.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
\title Qt Quick Examples - Local Storage
- \example quick/localstorage
+ \example localstorage
\brief A collection of QML local storage examples.
\image qml-localstorage-example.png
diff --git a/examples/quick/mousearea/doc/src/mousearea.qdoc b/examples/quick/mousearea/doc/src/mousearea.qdoc
index a7368b9273..b0d9abce8f 100644
--- a/examples/quick/mousearea/doc/src/mousearea.qdoc
+++ b/examples/quick/mousearea/doc/src/mousearea.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
\title Qt Quick Examples - MouseArea
- \example quick/mousearea
+ \example mousearea
\brief This is an example of the MouseArea type in QML
\image qml-mousearea-example.png
\ingroup qtquickexamples
diff --git a/examples/quick/painteditem/textballoons/doc/src/textballoons.qdoc b/examples/quick/painteditem/textballoons/doc/src/textballoons.qdoc
index fff7f2147d..d4aabc01d8 100644
--- a/examples/quick/painteditem/textballoons/doc/src/textballoons.qdoc
+++ b/examples/quick/painteditem/textballoons/doc/src/textballoons.qdoc
@@ -29,7 +29,7 @@
/*!
\title Scenegraph Painted Item Example
\brief Shows how to implement QPainter-based custom scenegraph items.
- \example quick/customitems/painteditem
+ \example customitems/painteditem
\ingroup qtquickexamples
The Painted Item example shows how to use the QML Scene Graph framework to
diff --git a/examples/quick/particles/affectors/doc/src/affectors.qdoc b/examples/quick/particles/affectors/doc/src/affectors.qdoc
index 3d0a84e1d4..58661d5b70 100644
--- a/examples/quick/particles/affectors/doc/src/affectors.qdoc
+++ b/examples/quick/particles/affectors/doc/src/affectors.qdoc
@@ -27,7 +27,7 @@
/*!
\title Qt Quick Particles Examples - Affectors
- \example quick/particles/affectors
+ \example particles/affectors
\brief This is a collection of examples using Affectors in the QML particle system.
\image qml-affectors-example.png
diff --git a/examples/quick/particles/customparticle/doc/src/customparticle.qdoc b/examples/quick/particles/customparticle/doc/src/customparticle.qdoc
index bb68c5fe9e..ccef82c922 100644
--- a/examples/quick/particles/customparticle/doc/src/customparticle.qdoc
+++ b/examples/quick/particles/customparticle/doc/src/customparticle.qdoc
@@ -27,7 +27,7 @@
/*!
\title Qt Quick Particles Examples - CustomParticle
- \example quick/particles/customparticle
+ \example particles/customparticle
\brief This is a collection of examples using CustomParticle in the QML particle system.
\image qml-customparticle-example.png
diff --git a/examples/quick/particles/emitters/doc/src/emitters.qdoc b/examples/quick/particles/emitters/doc/src/emitters.qdoc
index 63cb305c16..8eb7919000 100644
--- a/examples/quick/particles/emitters/doc/src/emitters.qdoc
+++ b/examples/quick/particles/emitters/doc/src/emitters.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
\title Qt Quick Particles Examples - Emitters
- \example quick/particles/emitters
+ \example particles/emitters
\brief This is a collection of examples using Emitters in the QML particle system.
\image qml-emitters-example.png
diff --git a/examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc b/examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc
index 85c1a62a9a..c8f2dc988b 100644
--- a/examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc
+++ b/examples/quick/particles/imageparticle/doc/src/imageparticle.qdoc
@@ -27,7 +27,7 @@
/*!
\title Qt Quick Particles Examples - Affectors
- \example quick/particles/imageparticle
+ \example particles/imageparticle
\brief This is a collection of examples using Affectors in the QML particle system.
\image qml-imageparticle-example.png
diff --git a/examples/quick/particles/system/doc/src/system.qdoc b/examples/quick/particles/system/doc/src/system.qdoc
index bb32325da3..04dc1727d2 100644
--- a/examples/quick/particles/system/doc/src/system.qdoc
+++ b/examples/quick/particles/system/doc/src/system.qdoc
@@ -27,7 +27,7 @@
/*!
\title Qt Quick Particles Examples - Affectors
- \example quick/particles/system
+ \example particles/system
\brief This is a collection of examples using Affectors in the QML particle system.
\image qml-system-example.png
@@ -40,7 +40,7 @@
Start and Stop simply sets the running and paused states of a ParticleSystem. While the system does not perform any simulation when stopped or paused, a restart restarts the simulation from the beginning, while unpausing resumes the simulation from where it was.
- Timed group changes is an example that highlights the ParticleGroup type. While normally referring to groups with a string name is sufficent, additional effects can be
+ Timed group changes is an example that highlights the ParticleGroup type. While normally referring to groups with a string name is sufficient, additional effects can be
done by setting properties on groups.
The first group has a variable duration on it, but always transitions to the second group.
\snippet quick/particles/system/content/timedgroupchanges.qml 0
diff --git a/examples/quick/positioners/doc/src/positioners.qdoc b/examples/quick/positioners/doc/src/positioners.qdoc
index 015fe759e1..3a20b145ef 100644
--- a/examples/quick/positioners/doc/src/positioners.qdoc
+++ b/examples/quick/positioners/doc/src/positioners.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
\title Qt Quick Examples - Positioners
- \example quick/positioners
+ \example positioners
\brief This is a collection of QML Positioner examples.
\image qml-positioners-example.png
\ingroup qtquickexamples
diff --git a/examples/quick/righttoleft/doc/src/righttoleft.qdoc b/examples/quick/righttoleft/doc/src/righttoleft.qdoc
index d7dc5792ea..6a207f7233 100644
--- a/examples/quick/righttoleft/doc/src/righttoleft.qdoc
+++ b/examples/quick/righttoleft/doc/src/righttoleft.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
\title Qt Quick Examples - Right to Left
- \example quick/righttoleft
+ \example righttoleft
\brief This is a collection of QML Right to Left examples.
\image qml-righttoleft-example.png
\ingroup qtquickexamples
diff --git a/examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc b/examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc
index dbc4d59470..d98407b6c1 100644
--- a/examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc
+++ b/examples/quick/scenegraph/customgeometry/doc/src/customgeometry.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example quick/scenegraph/customgeometry
+ \example scenegraph/customgeometry
\title Scene Graph - Custom Geometry
\ingroup qtquickexamples
\brief Shows how to implement a custom geometry in the Qt Quick Scene Graph.
diff --git a/examples/quick/scenegraph/openglunderqml/doc/src/openglunderqml.qdoc b/examples/quick/scenegraph/openglunderqml/doc/src/openglunderqml.qdoc
index 49f1a825e1..4bf5444d79 100644
--- a/examples/quick/scenegraph/openglunderqml/doc/src/openglunderqml.qdoc
+++ b/examples/quick/scenegraph/openglunderqml/doc/src/openglunderqml.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example quick/scenegraph/openglunderqml
+ \example scenegraph/openglunderqml
\title Scene Graph - OpenGL Under QML
\ingroup qtquickexamples
\brief Shows how to render OpenGL under a Qt Quick scene.
diff --git a/examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc b/examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc
index 97cc4677d5..1529649798 100644
--- a/examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc
+++ b/examples/quick/scenegraph/simplematerial/doc/src/simplematerial.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \example quick/scenegraph/simplematerial
+ \example scenegraph/simplematerial
\title Scene Graph - Simple Material
\ingroup qtquickexamples
\brief Shows how to define a scene graph material to fill a shape.
diff --git a/examples/quick/shadereffects/doc/src/shadereffects.qdoc b/examples/quick/shadereffects/doc/src/shadereffects.qdoc
index fdc80a05c0..5d1547a1fe 100644
--- a/examples/quick/shadereffects/doc/src/shadereffects.qdoc
+++ b/examples/quick/shadereffects/doc/src/shadereffects.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
\title QML Examples - Shader Effects
- \example quick/shadereffects
+ \example shadereffects
\image qml-shadereffects-example.png
\brief This is a shader effects example
\ingroup qtquickexamples
diff --git a/examples/quick/text/doc/src/text.qdoc b/examples/quick/text/doc/src/text.qdoc
index 82d142988b..1f173ac843 100644
--- a/examples/quick/text/doc/src/text.qdoc
+++ b/examples/quick/text/doc/src/text.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
\title QML Examples - Text
- \example quick/text
+ \example text
\brief This is a collection of QML examples relating to text
\image qml-text-example.png
\ingroup qtquickexamples
diff --git a/examples/quick/threading/doc/src/threading.qdoc b/examples/quick/threading/doc/src/threading.qdoc
index b27b027216..71fcdf820b 100644
--- a/examples/quick/threading/doc/src/threading.qdoc
+++ b/examples/quick/threading/doc/src/threading.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
\title Qt Quick Examples - Threading
- \example quick/threading
+ \example threading
\brief This is a collection of QML Multithreading examples.
\image qml-threading-example.png
\ingroup qtquickexamples
diff --git a/examples/quick/touchinteraction/doc/src/touchinteraction.qdoc b/examples/quick/touchinteraction/doc/src/touchinteraction.qdoc
index 2d383aff58..164409076c 100644
--- a/examples/quick/touchinteraction/doc/src/touchinteraction.qdoc
+++ b/examples/quick/touchinteraction/doc/src/touchinteraction.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
\title Qt Quick Examples - Touch Interaction
- \example quick/touchinteraction
+ \example touchinteraction
\brief This is a collection of QML Touch Interaction examples.
\image qml-touchinteraction-example.png
diff --git a/examples/quick/views/doc/src/views.qdoc b/examples/quick/views/doc/src/views.qdoc
index b807ceaead..cc8112f4dd 100644
--- a/examples/quick/views/doc/src/views.qdoc
+++ b/examples/quick/views/doc/src/views.qdoc
@@ -27,7 +27,7 @@
/*!
\title Qt Quick Examples - Views
- \example quick/views
+ \example views
\brief This is a collection of QML model/view examples
\image qml-modelviews-example.png
\ingroup qtquickexamples
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml
index f774a46d5d..fbfad28209 100644
--- a/src/imports/testlib/TestCase.qml
+++ b/src/imports/testlib/TestCase.qml
@@ -372,8 +372,13 @@ Item {
modifiers = Qt.NoModifier
if (delay == undefined)
delay = -1
- if (!qtest_events.keyPress(key, modifiers, delay))
- qtest_fail("window not shown", 2)
+ if (typeof(key) == "string" && key.length == 1) {
+ if (!qtest_events.keyPressChar(key, modifiers, delay))
+ qtest_fail("window not shown", 2)
+ } else {
+ if (!qtest_events.keyPress(key, modifiers, delay))
+ qtest_fail("window not shown", 2)
+ }
}
function keyRelease(key, modifiers, delay) {
@@ -381,8 +386,13 @@ Item {
modifiers = Qt.NoModifier
if (delay == undefined)
delay = -1
- if (!qtest_events.keyRelease(key, modifiers, delay))
- qtest_fail("window not shown", 2)
+ if (typeof(key) == "string" && key.length == 1) {
+ if (!qtest_events.keyReleaseChar(key, modifiers, delay))
+ qtest_fail("window not shown", 2)
+ } else {
+ if (!qtest_events.keyRelease(key, modifiers, delay))
+ qtest_fail("window not shown", 2)
+ }
}
function keyClick(key, modifiers, delay) {
@@ -390,8 +400,13 @@ Item {
modifiers = Qt.NoModifier
if (delay == undefined)
delay = -1
- if (!qtest_events.keyClick(key, modifiers, delay))
- qtest_fail("window not shown", 2)
+ if (typeof(key) == "string" && key.length == 1) {
+ if (!qtest_events.keyClickChar(key, modifiers, delay))
+ qtest_fail("window not shown", 2)
+ } else {
+ if (!qtest_events.keyClick(key, modifiers, delay))
+ qtest_fail("window not shown", 2)
+ }
}
function mousePress(item, x, y, button, modifiers, delay) {
@@ -426,10 +441,25 @@ Item {
if (delay == undefined)
delay = -1
+ // Divide dx and dy to have intermediate mouseMove while dragging
+ // Fractions of dx/dy need be superior to the dragThreshold
+ // to make the drag works though
+ var ddx = Math.round(dx/3)
+ if (ddx < (util.dragThreshold + 1))
+ ddx = 0
+ var ddy = Math.round(dy/3)
+ if (ddy < (util.dragThreshold + 1))
+ ddy = 0
+
mousePress(item, x, y, button, modifiers, delay)
//trigger dragging
mouseMove(item, x + util.dragThreshold + 1, y + util.dragThreshold + 1, delay, button)
+ if (ddx > 0 || ddy > 0) {
+ mouseMove(item, x + ddx, y + ddy, delay, button)
+ mouseMove(item, x + 2*ddx, y + 2*ddy, delay, button)
+ }
mouseMove(item, x + dx, y + dy, delay, button)
+ mouseRelease(item, x + dx, y + dy, button, modifiers, delay)
}
function mouseClick(item, x, y, button, modifiers, delay) {
diff --git a/src/imports/testlib/testcase.qdoc b/src/imports/testlib/testcase.qdoc
index 64fa42d579..56fcb24beb 100644
--- a/src/imports/testlib/testcase.qdoc
+++ b/src/imports/testlib/testcase.qdoc
@@ -174,7 +174,8 @@
The keyPress(), keyRelease(), and keyClick() methods can be used
to simulate keyboard events within unit tests. The events are
- delivered to the currently focused QML item.
+ delivered to the currently focused QML item. You can pass either
+ a Qt.Key enum value or a latin1 char (string of length one)
\code
Rectangle {
@@ -187,6 +188,7 @@
function test_key_click() {
keyClick(Qt.Key_Left)
+ keyClick("a")
...
}
}
diff --git a/src/plugins/accessible/shared/qqmlaccessible.cpp b/src/plugins/accessible/shared/qqmlaccessible.cpp
index 4abf80a60c..c4daa3e014 100644
--- a/src/plugins/accessible/shared/qqmlaccessible.cpp
+++ b/src/plugins/accessible/shared/qqmlaccessible.cpp
@@ -46,14 +46,6 @@
QT_BEGIN_NAMESPACE
-
-QString Q_GUI_EXPORT qTextBeforeOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType,
- int *startOffset, int *endOffset, const QString& text);
-QString Q_GUI_EXPORT qTextAtOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType,
- int *startOffset, int *endOffset, const QString& text);
-QString Q_GUI_EXPORT qTextAfterOffsetFromString(int offset, QAccessible2::BoundaryType boundaryType,
- int *startOffset, int *endOffset, const QString& text);
-
QQmlAccessible::QQmlAccessible(QObject *object)
:QAccessibleObject(object)
{
diff --git a/src/qml/doc/qtqml.qdocconf b/src/qml/doc/qtqml.qdocconf
index 2f92f45245..4ce44ba46e 100644
--- a/src/qml/doc/qtqml.qdocconf
+++ b/src/qml/doc/qtqml.qdocconf
@@ -5,6 +5,8 @@ description = Qt QML Reference Documentation
url = http://qt-project.org/doc/qt-$QT_VER/qtqml
version = $QT_VERSION
+examplesinstallpath = qml
+
qhp.projects = QtQml
qhp.QtQml.file = qtqml.qhp
diff --git a/src/qml/doc/src/cppintegration/extending-tutorial.qdoc b/src/qml/doc/src/cppintegration/extending-tutorial.qdoc
index 82c04b1457..3253752e47 100644
--- a/src/qml/doc/src/cppintegration/extending-tutorial.qdoc
+++ b/src/qml/doc/src/cppintegration/extending-tutorial.qdoc
@@ -64,7 +64,7 @@ and \l {qtqml-cppintegration-definetypes.html}{Defining QML Types from C++}.
/*!
\title Chapter 1: Creating a New Type
-\example quick/tutorials/extending/chapter1-basics
+\example tutorials/extending/chapter1-basics
A common task when extending QML is to provide a new QML type that supports some
custom functionality beyond what is provided by the built-in \l {Qt Quick QML Types}{Qt Quick types}.
@@ -162,7 +162,7 @@ Try it yourself with the code in Qt's \c examples/quick/tutorials/extending/chap
/*!
\title Chapter 2: Connecting to C++ Methods and Signals
-\example quick/tutorials/extending/chapter2-methods
+\example tutorials/extending/chapter2-methods
Suppose we want \c PieChart to have a "clearChart()" method that erases the
chart and then emits a "chartCleared" signal. Our \c app.qml would be able
@@ -207,7 +207,7 @@ Try out the example yourself with the updated code in Qt's \c examples/quick/tut
/*!
\title Chapter 3: Adding Property Bindings
-\example quick/tutorials/extending/chapter3-bindings
+\example tutorials/extending/chapter3-bindings
Property binding is a powerful feature of QML that allows values of different
types to be synchronized automatically. It uses signals to notify and update
@@ -259,7 +259,7 @@ custom QML types may see unexpected behavior if bindings are not implemented.
/*!
\title Chapter 4: Using Custom Property Types
-\example quick/tutorials/extending/chapter4-customPropertyTypes
+\example tutorials/extending/chapter4-customPropertyTypes
The \c PieChart type currently has a string-type property and a color-type property.
It could have many other types of properties. For example, it could have an
@@ -343,7 +343,7 @@ Try it out with the code in Qt's \c examples/quick/tutorials/extending/chapter4-
/*!
\title Chapter 5: Using List Property Types
-\example quick/tutorials/extending/chapter5-listproperties
+\example tutorials/extending/chapter5-listproperties
Right now, a \c PieChart can only have one \c PieSlice. Ideally a chart would
have multiple slices, with different colors and sizes. To do this, we could
@@ -392,7 +392,7 @@ The complete code can be seen in the updated \c examples/quick/tutorials/extendi
/*!
\title Chapter 6: Writing an Extension Plugin
-\example quick/tutorials/extending/chapter6-plugins
+\example tutorials/extending/chapter6-plugins
Currently the \c PieChart and \c PieSlice types are used by \c app.qml,
which is displayed using a QQuickView in a C++ application. An alternative
diff --git a/src/qml/qml/qqmlfile.cpp b/src/qml/qml/qqmlfile.cpp
index 836f68da28..4e76fbd2e5 100644
--- a/src/qml/qml/qqmlfile.cpp
+++ b/src/qml/qml/qqmlfile.cpp
@@ -64,6 +64,10 @@ static QString qrc_string(QLatin1String("qrc"));
static QString file_string(QLatin1String("file"));
static QString bundle_string(QLatin1String("bundle"));
+#if defined(Q_OS_ANDROID)
+static QString assets_string(QLatin1String("assets"));
+#endif
+
class QQmlFilePrivate;
class QQmlFileNetworkReply : public QObject
{
@@ -484,6 +488,8 @@ bool QQmlFile::connectDownloadProgress(QObject *object, int method)
Returns true if QQmlFile will open \a url synchronously.
Synchronous urls have a qrc:/, file://, or bundle:// scheme.
+
+\note On Android, urls with assets:/ scheme are also considered synchronous.
*/
bool QQmlFile::isSynchronous(const QUrl &url)
{
@@ -491,16 +497,25 @@ bool QQmlFile::isSynchronous(const QUrl &url)
if ((scheme.length() == 4 && 0 == scheme.compare(file_string, Qt::CaseInsensitive)) ||
(scheme.length() == 6 && 0 == scheme.compare(bundle_string, Qt::CaseInsensitive)) ||
- (scheme.length() == 3 && 0 == scheme.compare(qrc_string, Qt::CaseInsensitive)))
+ (scheme.length() == 3 && 0 == scheme.compare(qrc_string, Qt::CaseInsensitive))) {
return true;
- else
+
+#if defined(Q_OS_ANDROID)
+ } else if (scheme.length() == 6 && 0 == scheme.compare(assets_string, Qt::CaseInsensitive)) {
+ return true;
+#endif
+
+ } else {
return false;
+ }
}
/*!
Returns true if QQmlFile will open \a url synchronously.
Synchronous urls have a qrc:/, file://, or bundle:// scheme.
+
+\note On Android, urls with assets:/ scheme are also considered synchronous.
*/
bool QQmlFile::isSynchronous(const QString &url)
{
@@ -529,6 +544,15 @@ bool QQmlFile::isSynchronous(const QString &url)
}
+#if defined(Q_OS_ANDROID)
+ else if (f == QLatin1Char('a') || f == QLatin1Char('A')) {
+ return url.length() >= 8 /* assets:/ */ &&
+ url.startsWith(assets_string, Qt::CaseInsensitive) &&
+ url[6] == QLatin1Char(':') && url[7] == QLatin1Char('/');
+
+ }
+#endif
+
return false;
}
@@ -559,22 +583,33 @@ bool QQmlFile::isBundle(const QUrl &url)
Returns true if \a url is a local file that can be opened with QFile.
Local file urls have either a qrc:/ or file:// scheme.
+
+\note On Android, urls with assets:/ scheme are also considered local files.
*/
bool QQmlFile::isLocalFile(const QUrl &url)
{
QString scheme = url.scheme();
if ((scheme.length() == 4 && 0 == scheme.compare(file_string, Qt::CaseInsensitive)) ||
- (scheme.length() == 3 && 0 == scheme.compare(qrc_string, Qt::CaseInsensitive)))
+ (scheme.length() == 3 && 0 == scheme.compare(qrc_string, Qt::CaseInsensitive))) {
return true;
- else
+
+#if defined(Q_OS_ANDROID)
+ } else if (scheme.length() == 6 && 0 == scheme.compare(assets_string, Qt::CaseInsensitive)) {
+ return true;
+#endif
+
+ } else {
return false;
+ }
}
/*!
Returns true if \a url is a local file that can be opened with QFile.
Local file urls have either a qrc:/ or file:// scheme.
+
+\note On Android, urls with assets:/ scheme are also considered local files.
*/
bool QQmlFile::isLocalFile(const QString &url)
{
@@ -596,6 +631,14 @@ bool QQmlFile::isLocalFile(const QString &url)
url[3] == QLatin1Char(':') && url[4] == QLatin1Char('/');
}
+#if defined(Q_OS_ANDROID)
+ else if (f == QLatin1Char('a') || f == QLatin1Char('A')) {
+ return url.length() >= 8 /* assets:/ */ &&
+ url.startsWith(assets_string, Qt::CaseInsensitive) &&
+ url[6] == QLatin1Char(':') && url[7] == QLatin1Char('/');
+
+ }
+#endif
return false;
}
@@ -611,6 +654,15 @@ QString QQmlFile::urlToLocalFileOrQrc(const QUrl& url)
return QLatin1Char(':') + url.path();
return QString();
}
+
+#if defined(Q_OS_ANDROID)
+ else if (url.scheme().compare(QLatin1String("assets"), Qt::CaseInsensitive) == 0) {
+ if (url.authority().isEmpty())
+ return url.toString();
+ return QString();
+ }
+#endif
+
return url.toLocalFile();
}
@@ -642,6 +694,12 @@ QString QQmlFile::urlToLocalFileOrQrc(const QString& url)
return QString();
}
+#if defined(Q_OS_ANDROID)
+ else if (url.startsWith(QLatin1String("assets:"), Qt::CaseInsensitive)) {
+ return url;
+ }
+#endif
+
return toLocalFile(url);
}
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp
index f301b5a6c7..fa728fec0d 100644
--- a/src/qml/qml/qqmlproperty.cpp
+++ b/src/qml/qml/qqmlproperty.cpp
@@ -1558,7 +1558,6 @@ bool QQmlPropertyPrivate::writeBinding(QObject *object,
return false;
}
- typedef QQmlVMEMetaObject VMEMO;
QQmlVMEMetaObject *vmemo = QQmlVMEMetaObject::get(object);
Q_ASSERT(vmemo);
vmemo->setVMEProperty(core.coreIndex, result);
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index e800eb815d..bbce8e625e 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -1659,6 +1659,15 @@ QString QQmlTypeLoader::absoluteFilePath(const QString &path)
QFileInfo fileInfo(QQmlFile::urlToLocalFileOrQrc(path));
return fileInfo.isFile() ? fileInfo.absoluteFilePath() : QString();
}
+#if defined(Q_OS_ANDROID)
+ else if (path.count() > 7 && path.at(6) == QLatin1Char(':') && path.at(7) == QLatin1Char('/') &&
+ path.startsWith(QLatin1String("assets"), Qt::CaseInsensitive)) {
+ // assets resource url
+ QFileInfo fileInfo(QQmlFile::urlToLocalFileOrQrc(path));
+ return fileInfo.isFile() ? fileInfo.absoluteFilePath() : QString();
+ }
+#endif
+
int lastSlash = path.lastIndexOf(QLatin1Char('/'));
QStringRef dirPath(&path, 0, lastSlash);
@@ -1717,7 +1726,13 @@ bool QQmlTypeLoader::directoryExists(const QString &path)
{
if (path.isEmpty())
return false;
- if (path.at(0) == QLatin1Char(':')) {
+
+ bool isResource = path.at(0) == QLatin1Char(':');
+#if defined(Q_OS_ANDROID)
+ isResource = isResource || path.startsWith(QLatin1String("assets:/"));
+#endif
+
+ if (isResource) {
// qrc resource
QFileInfo fileInfo(path);
return fileInfo.exists() && fileInfo.isDir();
diff --git a/src/qmltest/quicktestevent.cpp b/src/qmltest/quicktestevent.cpp
index 16ba80083f..1f72bc65c1 100644
--- a/src/qmltest/quicktestevent.cpp
+++ b/src/qmltest/quicktestevent.cpp
@@ -83,6 +83,36 @@ bool QuickTestEvent::keyClick(int key, int modifiers, int delay)
return true;
}
+bool QuickTestEvent::keyPressChar(const QString &character, int modifiers, int delay)
+{
+ QTEST_ASSERT(character.length() == 1);
+ QWindow *window = eventWindow();
+ if (!window)
+ return false;
+ QTest::keyPress(window, character[0].toLatin1(), Qt::KeyboardModifiers(modifiers), delay);
+ return true;
+}
+
+bool QuickTestEvent::keyReleaseChar(const QString &character, int modifiers, int delay)
+{
+ QTEST_ASSERT(character.length() == 1);
+ QWindow *window = eventWindow();
+ if (!window)
+ return false;
+ QTest::keyRelease(window, character[0].toLatin1(), Qt::KeyboardModifiers(modifiers), delay);
+ return true;
+}
+
+bool QuickTestEvent::keyClickChar(const QString &character, int modifiers, int delay)
+{
+ QTEST_ASSERT(character.length() == 1);
+ QWindow *window = eventWindow();
+ if (!window)
+ return false;
+ QTest::keyClick(window, character[0].toLatin1(), Qt::KeyboardModifiers(modifiers), delay);
+ return true;
+}
+
namespace QTest {
extern int Q_TESTLIB_EXPORT defaultMouseDelay();
};
diff --git a/src/qmltest/quicktestevent_p.h b/src/qmltest/quicktestevent_p.h
index de33ff736b..595ea9e1f7 100644
--- a/src/qmltest/quicktestevent_p.h
+++ b/src/qmltest/quicktestevent_p.h
@@ -59,6 +59,10 @@ public Q_SLOTS:
bool keyRelease(int key, int modifiers, int delay);
bool keyClick(int key, int modifiers, int delay);
+ bool keyPressChar(const QString &character, int modifiers, int delay);
+ bool keyReleaseChar(const QString &character, int modifiers, int delay);
+ bool keyClickChar(const QString &character, int modifiers, int delay);
+
bool mousePress(QObject *item, qreal x, qreal y, int button,
int modifiers, int delay);
bool mouseRelease(QObject *item, qreal x, qreal y, int button,
diff --git a/src/quick/doc/qtquick.qdocconf b/src/quick/doc/qtquick.qdocconf
index b0676218cd..d9b4e03818 100644
--- a/src/quick/doc/qtquick.qdocconf
+++ b/src/quick/doc/qtquick.qdocconf
@@ -5,6 +5,7 @@ description = Qt Quick Reference Documentation
url = http://qt-project.org/doc/qt-$QT_VER/qtquick-index.html
version = $QT_VERSION
+examplesinstallpath = quick
qhp.projects = QtQuick
@@ -39,7 +40,7 @@ headerdirs += ..
sourcedirs += ..
-exampledirs += ../../../examples/ \
+exampledirs += ../../../examples/quick \
snippets
diff --git a/src/quick/doc/src/advtutorial.qdoc b/src/quick/doc/src/advtutorial.qdoc
index f670e3a323..966233c371 100644
--- a/src/quick/doc/src/advtutorial.qdoc
+++ b/src/quick/doc/src/advtutorial.qdoc
@@ -71,7 +71,7 @@ directory.
\previouspage QML Advanced Tutorial
\nextpage QML Advanced Tutorial 2 - Populating the Game Canvas
-\example quick/tutorials/samegame/samegame1
+\example tutorials/samegame/samegame1
\section2 Creating the application screen
@@ -141,7 +141,7 @@ types to get started. Next, we will populate the game canvas with some blocks.
\previouspage QML Advanced Tutorial 1 - Creating the Game Canvas and Blocks
\nextpage QML Advanced Tutorial 3 - Implementing the Game Logic
-\example quick/tutorials/samegame/samegame2
+\example tutorials/samegame/samegame2
\section2 Generating the blocks in JavaScript
@@ -217,7 +217,7 @@ Now, we have a screen of blocks, and we can begin to add the game mechanics.
\previouspage QML Advanced Tutorial 2 - Populating the Game Canvas
\nextpage QML Advanced Tutorial 4 - Finishing Touches
-\example quick/tutorials/samegame/samegame3
+\example tutorials/samegame/samegame3
\section2 Making a playable game
@@ -305,7 +305,7 @@ until the next chapter - where your application becomes alive!
\contentspage QML Advanced Tutorial
\previouspage QML Advanced Tutorial 3 - Implementing the Game Logic
-\example quick/tutorials/samegame/samegame4
+\example tutorials/samegame/samegame4
\section2 Adding some flair
diff --git a/src/quick/doc/src/dynamicview-tutorial.qdoc b/src/quick/doc/src/dynamicview-tutorial.qdoc
index 9c224f8642..daa14a6973 100644
--- a/src/quick/doc/src/dynamicview-tutorial.qdoc
+++ b/src/quick/doc/src/dynamicview-tutorial.qdoc
@@ -57,7 +57,7 @@ directory.
\previouspage QML Dynamic View Ordering Tutorial
\nextpage QML Dynamic View Ordering Tutorial 2 - Dragging View Items
-\example quick/tutorials/dynamicview/dynamicview1
+\example tutorials/dynamicview/dynamicview1
We begin our application by defining a ListView, a model which will provide data to the view, and a
delegate which provides a template for constructing items in the view.
@@ -94,7 +94,7 @@ The second part of the application is the ListView itself to which we bind the m
\previouspage QML Dynamic View Ordering Tutorial 1 - A Simple ListView and Delegate
\nextpage QML Dynamic View Ordering Tutorial 3 - Moving Dragged Items
-\example quick/tutorials/dynamicview/dynamicview2
+\example tutorials/dynamicview/dynamicview2
Now that we have a visible list of items we want to be able to interact with them. We'll start
by extending the delegate so the visible content can be dragged up and down the screen. The
@@ -139,7 +139,7 @@ so that is above other items in the stacking order and isn't obscured as it is d
\previouspage QML Dynamic View Ordering Tutorial 2 - Dragging View Items
\nextpage QML Dynamic View Ordering Tutorial 4 - Sorting Items
-\example quick/tutorials/dynamicview/dynamicview3
+\example tutorials/dynamicview/dynamicview3
The next step in our application to move items within the list as they're dragged so that we
can re-order the list. To achieve this we introduce three new types to our application;
@@ -192,7 +192,7 @@ property of the view and bind the \l {QtQuick2::VisualDataModel::model}{model} a
\contentspage QML Dynamic View Ordering Tutorial
\previouspage QML Dynamic View Ordering Tutorial 3 - Moving Dragged Items
-\example quick/tutorials/dynamicview/dynamicview4
+\example tutorials/dynamicview/dynamicview4
Drag and drop isn't the only way items in a view can be re-ordered, using a VisualDataModel it is
also possible to sort items based on model data. To do that we extend our VisualDataModel instance
diff --git a/src/quick/items/qquickitem.h b/src/quick/items/qquickitem.h
index c37bc10bdd..040f9d6888 100644
--- a/src/quick/items/qquickitem.h
+++ b/src/quick/items/qquickitem.h
@@ -132,7 +132,7 @@ class Q_QUICK_EXPORT QQuickItem : public QObject, public QQmlParserStatus
Q_PROPERTY(bool focus READ hasFocus WRITE setFocus NOTIFY focusChanged FINAL)
Q_PROPERTY(bool activeFocus READ hasActiveFocus NOTIFY activeFocusChanged FINAL)
- Q_PROPERTY(bool activeFocusOnTab READ activeFocusOnTab WRITE setActiveFocusOnTab NOTIFY activeFocusOnTabChanged FINAL)
+ Q_PROPERTY(bool activeFocusOnTab READ activeFocusOnTab WRITE setActiveFocusOnTab NOTIFY activeFocusOnTabChanged FINAL REVISION 1)
Q_PROPERTY(qreal rotation READ rotation WRITE setRotation NOTIFY rotationChanged)
Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged)
@@ -349,7 +349,7 @@ Q_SIGNALS:
void stateChanged(const QString &);
void focusChanged(bool);
void activeFocusChanged(bool);
- void activeFocusOnTabChanged(bool);
+ Q_REVISION(1) void activeFocusOnTabChanged(bool);
void parentChanged(QQuickItem *);
void transformOriginChanged(TransformOrigin);
void smoothChanged(bool);
diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp
index cd49377822..741583a95d 100644
--- a/src/quick/items/qquickitemsmodule.cpp
+++ b/src/quick/items/qquickitemsmodule.cpp
@@ -228,6 +228,7 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor)
qmlRegisterUncreatableType<QQuickAccessibleAttached>("QtQuick", 2, 0, "Accessible",QQuickAccessibleAttached::tr("Accessible is only available via attached properties"));
#endif
+ qmlRegisterType<QQuickItem, 1>(uri, 2, 1,"Item");
qmlRegisterType<QQuickGrid, 1>(uri, 2, 1, "Grid");
qmlRegisterType<QQuickTextEdit, 1>(uri, 2, 1, "TextEdit");
}
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index 506b4caa52..dde3587018 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -125,6 +125,17 @@ TextEdit {
// into text nodes corresponding to a text block each so that the glyph node grouping doesn't become pointless.
static const int nodeBreakingSize = 300;
+namespace {
+ class ProtectedLayoutAccessor: public QAbstractTextDocumentLayout
+ {
+ public:
+ inline QTextCharFormat formatAccessor(int pos)
+ {
+ return format(pos);
+ }
+ };
+}
+
QQuickTextEdit::QQuickTextEdit(QQuickItem *parent)
: QQuickImplicitSizeItem(*(new QQuickTextEditPrivate), parent)
{
@@ -1772,9 +1783,11 @@ QSGNode *QQuickTextEdit::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
node->setMatrix(transformMatrix);
}
const int pos = textFrame->firstPosition() - 1;
+ ProtectedLayoutAccessor *a = static_cast<ProtectedLayoutAccessor *>(d->document->documentLayout());
+ QTextCharFormat format = a->formatAccessor(pos);
QTextBlock block = textFrame->firstCursorPosition().block();
node->m_engine->setCurrentLine(block.layout()->lineForTextPosition(pos - block.position()));
- node->m_engine->addTextObject(QPointF(0, 0), block.charFormat(), QQuickTextNodeEngine::Unselected, d->document,
+ node->m_engine->addTextObject(QPointF(0, 0), format, QQuickTextNodeEngine::Unselected, d->document,
pos, textFrame->frameFormat().position());
} else {
diff --git a/src/quick/items/qquicktextnode.cpp b/src/quick/items/qquicktextnode.cpp
index d46959464a..4952a37082 100644
--- a/src/quick/items/qquicktextnode.cpp
+++ b/src/quick/items/qquicktextnode.cpp
@@ -249,6 +249,7 @@ void QQuickTextNode::addTextLayout(const QPointF &position, QTextLayout *textLay
int selectionStart, int selectionEnd,
int lineStart, int lineCount)
{
+ Q_UNUSED(position);
initEngine(color, selectedTextColor, selectionColor, anchorColor);
#ifndef QT_NO_IM
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 176f46e3b7..4789314e01 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -207,8 +207,6 @@ void QQuickWindow::exposeEvent(QExposeEvent *)
/*! \reimp */
void QQuickWindow::resizeEvent(QResizeEvent *)
{
- Q_D(QQuickWindow);
- d->windowManager->resize(this, size());
}
/*! \reimp */
diff --git a/src/quick/scenegraph/coreapi/qsgrenderer.cpp b/src/quick/scenegraph/coreapi/qsgrenderer.cpp
index 45a0b4b6ab..b46d45be57 100644
--- a/src/quick/scenegraph/coreapi/qsgrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgrenderer.cpp
@@ -60,8 +60,8 @@ QT_BEGIN_NAMESPACE
-#ifndef QSG_NO_RENDERER_TIMING
-static bool qsg_render_timing = !qgetenv("QML_RENDERER_TIMING").isEmpty();
+#ifndef QSG_NO_RENDER_TIMING
+static bool qsg_render_timing = !qgetenv("QSG_RENDER_TIMING").isEmpty();
static QTime frameTimer;
static int preprocessTime;
static int updatePassTime;
@@ -237,7 +237,7 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
m_is_rendering = true;
-#ifndef QSG_NO_RENDERER_TIMING
+#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing)
frameTimer.start();
int bindTime = 0;
@@ -248,7 +248,7 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
preprocess();
bindable.bind();
-#ifndef QSG_NO_RENDERER_TIMING
+#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing)
bindTime = frameTimer.elapsed();
#endif
@@ -269,7 +269,7 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
#endif
render();
-#ifndef QSG_NO_RENDERER_TIMING
+#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing)
renderTime = frameTimer.elapsed();
#endif
@@ -289,7 +289,7 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
m_index_buffer_bound = false;
}
-#ifndef QSG_NO_RENDERER_TIMING
+#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing) {
printf(" - Breakdown of render time: preprocess=%d, updates=%d, binding=%d, render=%d, total=%d\n",
preprocessTime,
@@ -379,7 +379,7 @@ void QSGRenderer::preprocess()
}
}
-#ifndef QSG_NO_RENDERER_TIMING
+#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing)
preprocessTime = frameTimer.elapsed();
#endif
@@ -387,7 +387,7 @@ void QSGRenderer::preprocess()
nodeUpdater()->setToplevelOpacity(context()->renderAlpha());
nodeUpdater()->updateStates(m_root_node);
-#ifndef QSG_NO_RENDERER_TIMING
+#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing)
updatePassTime = frameTimer.elapsed();
#endif
diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp
index 4e8bafbe95..1d534e3563 100644
--- a/src/quick/scenegraph/qsgadaptationlayer.cpp
+++ b/src/quick/scenegraph/qsgadaptationlayer.cpp
@@ -52,8 +52,8 @@
QT_BEGIN_NAMESPACE
-#ifndef QSG_NO_RENDERER_TIMING
-static bool qsg_render_timing = !qgetenv("QML_RENDERER_TIMING").isEmpty();
+#ifndef QSG_NO_RENDER_TIMING
+static bool qsg_render_timing = !qgetenv("QSG_RENDER_TIMING").isEmpty();
static QElapsedTimer qsg_render_timer;
#endif
@@ -161,7 +161,7 @@ void QSGDistanceFieldGlyphCache::update()
if (m_pendingGlyphs.isEmpty())
return;
-#ifndef QSG_NO_RENDERER_TIMING
+#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing)
qsg_render_timer.start();
#endif
@@ -175,7 +175,7 @@ void QSGDistanceFieldGlyphCache::update()
distanceFields.insert(glyphIndex, distanceField);
}
-#ifndef QSG_NO_RENDERER_TIMING
+#ifndef QSG_NO_RENDER_TIMING
int renderTime = 0;
int count = m_pendingGlyphs.size();
if (qsg_render_timing)
@@ -186,7 +186,7 @@ void QSGDistanceFieldGlyphCache::update()
storeGlyphs(distanceFields);
-#ifndef QSG_NO_RENDERER_TIMING
+#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing) {
printf(" - glyphs: count=%d, render=%d, store=%d, total=%d\n",
count,
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp
index 705b12c4d4..8d36fce481 100644
--- a/src/quick/scenegraph/qsgcontext.cpp
+++ b/src/quick/scenegraph/qsgcontext.cpp
@@ -72,8 +72,8 @@ DEFINE_BOOL_CONFIG_OPTION(qmlTranslucentMode, QML_TRANSLUCENT_MODE)
DEFINE_BOOL_CONFIG_OPTION(qmlDisableDistanceField, QML_DISABLE_DISTANCEFIELD)
-#ifndef QSG_NO_RENDERER_TIMING
-static bool qsg_render_timing = !qgetenv("QML_RENDERER_TIMING").isEmpty();
+#ifndef QSG_NO_RENDER_TIMING
+static bool qsg_render_timing = !qgetenv("QSG_RENDER_TIMING").isEmpty();
static QElapsedTimer qsg_renderer_timer;
#endif
@@ -477,7 +477,7 @@ QSGMaterialShader *QSGContext::prepareMaterial(QSGMaterial *material)
if (shader)
return shader;
-#ifndef QSG_NO_RENDERER_TIMING
+#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing)
qsg_renderer_timer.start();
#endif
@@ -487,7 +487,7 @@ QSGMaterialShader *QSGContext::prepareMaterial(QSGMaterial *material)
shader->initialize();
d->materials[type] = shader;
-#ifndef QSG_NO_RENDERER_TIMING
+#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing)
printf(" - compiling material: %dms\n", (int) qsg_renderer_timer.elapsed());
#endif
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode.cpp b/src/quick/scenegraph/qsgdefaultglyphnode.cpp
index 55eadab704..8f24485fc0 100644
--- a/src/quick/scenegraph/qsgdefaultglyphnode.cpp
+++ b/src/quick/scenegraph/qsgdefaultglyphnode.cpp
@@ -48,7 +48,8 @@
QT_BEGIN_NAMESPACE
QSGDefaultGlyphNode::QSGDefaultGlyphNode()
- : m_material(0)
+ : m_style(QQuickText::Normal)
+ , m_material(0)
, m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 0)
{
m_geometry.setDrawingMode(GL_TRIANGLES);
@@ -74,22 +75,62 @@ void QSGDefaultGlyphNode::setGlyphs(const QPointF &position, const QGlyphRun &gl
if (m_material != 0)
delete m_material;
- QRawFont font = glyphs.rawFont();
- m_material = new QSGTextMaskMaterial(font);
+ m_position = position;
+ m_glyphs = glyphs;
+
+#ifdef QML_RUNTIME_TESTING
+ description = QLatin1String("glyphs");
+#endif
+}
+
+void QSGDefaultGlyphNode::setStyle(QQuickText::TextStyle style)
+{
+ if (m_style == style)
+ return;
+ m_style = style;
+}
+
+void QSGDefaultGlyphNode::setStyleColor(const QColor &color)
+{
+ if (m_styleColor == color)
+ return;
+ m_styleColor = color;
+}
+
+void QSGDefaultGlyphNode::update()
+{
+ QRawFont font = m_glyphs.rawFont();
+ QMargins margins(0, 0, 0, 0);
+
+ if (m_style == QQuickText::Normal) {
+ m_material = new QSGTextMaskMaterial(font);
+ } else if (m_style == QQuickText::Outline) {
+ QSGOutlinedTextMaterial *material = new QSGOutlinedTextMaterial(font);
+ material->setStyleColor(m_styleColor);
+ m_material = material;
+ margins = QMargins(1, 1, 1, 1);
+ } else {
+ QSGStyledTextMaterial *material = new QSGStyledTextMaterial(font);
+ if (m_style == QQuickText::Sunken) {
+ material->setStyleShift(QPointF(0, -1));
+ margins.setTop(1);
+ } else if (m_style == QQuickText::Raised) {
+ material->setStyleShift(QPointF(0, 1));
+ margins.setBottom(1);
+ }
+ material->setStyleColor(m_styleColor);
+ m_material = material;
+ }
+
m_material->setColor(m_color);
QRectF boundingRect;
- m_material->populate(position, glyphs.glyphIndexes(), glyphs.positions(), geometry(),
- &boundingRect, &m_baseLine);
-
- setMaterial(m_material);
+ m_material->populate(m_position, m_glyphs.glyphIndexes(), m_glyphs.positions(), geometry(),
+ &boundingRect, &m_baseLine, margins);
setBoundingRect(boundingRect);
+ setMaterial(m_material);
markDirty(DirtyGeometry);
-
-#ifdef QML_RUNTIME_TESTING
- description = QLatin1String("glyphs");
-#endif
}
QT_END_NAMESPACE
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
index 9e0cfca069..419062d025 100644
--- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
+++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
@@ -43,7 +43,6 @@
#include <qopenglshaderprogram.h>
-#include <QtGui/private/qopengltextureglyphcache_p.h>
#include <QtGui/private/qguiapplication_p.h>
#include <qpa/qplatformintegration.h>
#include <private/qfontengine_p.h>
@@ -67,7 +66,7 @@ public:
virtual void activate();
virtual void deactivate();
-private:
+protected:
virtual void initialize();
virtual const char *vertexShader() const;
virtual const char *fragmentShader() const;
@@ -210,8 +209,197 @@ void QSGTextMaskMaterialData::updateState(const RenderState &state, QSGMaterial
}
}
-QSGTextMaskMaterial::QSGTextMaskMaterial(const QRawFont &font)
- : m_texture(0), m_glyphCache(), m_font(font)
+class QSGStyledTextMaterialData : public QSGTextMaskMaterialData
+{
+public:
+ QSGStyledTextMaterialData() { }
+
+ virtual void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect);
+ virtual void activate();
+ virtual void deactivate();
+
+private:
+ virtual void initialize();
+ virtual const char *vertexShader() const;
+ virtual const char *fragmentShader() const;
+
+ int m_shift_id;
+ int m_styleColor_id;
+};
+
+void QSGStyledTextMaterialData::initialize()
+{
+ QSGTextMaskMaterialData::initialize();
+ m_shift_id = program()->uniformLocation("shift");
+ m_styleColor_id = program()->uniformLocation("styleColor");
+}
+
+void QSGStyledTextMaterialData::updateState(const RenderState &state,
+ QSGMaterial *newEffect,
+ QSGMaterial *oldEffect)
+{
+ Q_ASSERT(oldEffect == 0 || newEffect->type() == oldEffect->type());
+
+ QSGStyledTextMaterial *material = static_cast<QSGStyledTextMaterial *>(newEffect);
+ QSGStyledTextMaterial *oldMaterial = static_cast<QSGStyledTextMaterial *>(oldEffect);
+
+ if (oldMaterial == 0 || oldMaterial->styleShift() != material->styleShift())
+ program()->setUniformValue(m_shift_id, material->styleShift());
+
+ if (oldMaterial == 0 || material->color() != oldMaterial->color() || state.isOpacityDirty()) {
+ QColor c = material->color();
+ QVector4D color(c.redF() * c.alphaF(), c.greenF() * c.alphaF(), c.blueF() * c.alphaF(), c.alphaF());
+ color *= state.opacity();
+ program()->setUniformValue(m_color_id, color);
+ }
+
+ if (oldMaterial == 0 || material->styleColor() != oldMaterial->styleColor() || state.isOpacityDirty()) {
+ QColor c = material->styleColor();
+ QVector4D color(c.redF() * c.alphaF(), c.greenF() * c.alphaF(), c.blueF() * c.alphaF(), c.alphaF());
+ color *= state.opacity();
+ program()->setUniformValue(m_styleColor_id, color);
+ }
+
+ bool updated = material->ensureUpToDate();
+ Q_ASSERT(material->texture());
+
+ Q_ASSERT(oldMaterial == 0 || oldMaterial->texture());
+ if (updated
+ || oldMaterial == 0
+ || oldMaterial->texture()->textureId() != material->texture()->textureId()) {
+ program()->setUniformValue(m_textureScale_id, QVector2D(1.0 / material->cacheTextureWidth(),
+ 1.0 / material->cacheTextureHeight()));
+ glBindTexture(GL_TEXTURE_2D, material->texture()->textureId());
+
+ // Set the mag/min filters to be linear. We only need to do this when the texture
+ // has been recreated.
+ if (updated) {
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ }
+ }
+
+ if (state.isMatrixDirty())
+ program()->setUniformValue(m_matrix_id, state.combinedMatrix());
+}
+
+void QSGStyledTextMaterialData::activate()
+{
+ QSGMaterialShader::activate();
+
+#if !defined(QT_OPENGL_ES_2) && defined(GL_ARB_framebuffer_sRGB)
+ // 0.25 was found to be acceptable error margin by experimentation. On Mac, the gamma is 2.0,
+ // but using sRGB looks okay.
+ if (qAbs(fontSmoothingGamma() - 2.2) < 0.25)
+ glEnable(GL_FRAMEBUFFER_SRGB);
+#endif
+}
+
+void QSGStyledTextMaterialData::deactivate()
+{
+ QSGMaterialShader::deactivate();
+
+#if !defined(QT_OPENGL_ES_2) && defined(GL_ARB_framebuffer_sRGB)
+ if (qAbs(fontSmoothingGamma() - 2.2) < 0.25)
+ glDisable(GL_FRAMEBUFFER_SRGB);
+#endif
+}
+
+const char *QSGStyledTextMaterialData::vertexShader() const
+{
+ return
+ "uniform highp mat4 matrix; \n"
+ "uniform highp vec2 textureScale; \n"
+ "uniform highp vec2 shift; \n"
+ "attribute highp vec4 vCoord; \n"
+ "attribute highp vec2 tCoord; \n"
+ "varying highp vec2 sampleCoord; \n"
+ "varying highp vec2 shiftedSampleCoord; \n"
+ "void main() { \n"
+ " sampleCoord = tCoord * textureScale; \n"
+ " shiftedSampleCoord = (tCoord - shift) * textureScale; \n"
+ " gl_Position = matrix * vCoord; \n"
+ "}";
+}
+
+const char *QSGStyledTextMaterialData::fragmentShader() const
+{
+ return
+ "varying highp vec2 sampleCoord; \n"
+ "varying highp vec2 shiftedSampleCoord; \n"
+ "uniform sampler2D texture; \n"
+ "uniform lowp vec4 color; \n"
+ "uniform lowp vec4 styleColor; \n"
+ "void main() { \n"
+ " lowp float glyph = texture2D(texture, sampleCoord).a; \n"
+ " lowp float style = clamp(texture2D(texture, shiftedSampleCoord).a - glyph, \n"
+ " 0.0, 1.0); \n"
+ " gl_FragColor = style * styleColor + glyph * color; \n"
+ "}";
+}
+
+
+class QSGOutlinedTextMaterialData : public QSGStyledTextMaterialData
+{
+public:
+ QSGOutlinedTextMaterialData() { }
+
+private:
+ const char *vertexShader() const;
+ const char *fragmentShader() const;
+};
+
+const char *QSGOutlinedTextMaterialData::vertexShader() const
+{
+ return
+ "uniform highp mat4 matrix; \n"
+ "uniform highp vec2 textureScale; \n"
+ "uniform highp vec2 shift; \n"
+ "attribute highp vec4 vCoord; \n"
+ "attribute highp vec2 tCoord; \n"
+ "varying highp vec2 sampleCoord; \n"
+ "varying highp vec2 sCoordUp; \n"
+ "varying highp vec2 sCoordDown; \n"
+ "varying highp vec2 sCoordLeft; \n"
+ "varying highp vec2 sCoordRight; \n"
+ "void main() { \n"
+ " sampleCoord = tCoord * textureScale; \n"
+ " sCoordUp = (tCoord - vec2(0.0, -1.0)) * textureScale; \n"
+ " sCoordDown = (tCoord - vec2(0.0, 1.0)) * textureScale; \n"
+ " sCoordLeft = (tCoord - vec2(-1.0, 0.0)) * textureScale; \n"
+ " sCoordRight = (tCoord - vec2(1.0, 0.0)) * textureScale; \n"
+ " gl_Position = matrix * vCoord; \n"
+ "}";
+}
+
+const char *QSGOutlinedTextMaterialData::fragmentShader() const
+{
+ return
+ "varying highp vec2 sampleCoord; \n"
+ "varying highp vec2 sCoordUp; \n"
+ "varying highp vec2 sCoordDown; \n"
+ "varying highp vec2 sCoordLeft; \n"
+ "varying highp vec2 sCoordRight; \n"
+ "uniform sampler2D texture; \n"
+ "uniform lowp vec4 color; \n"
+ "uniform lowp vec4 styleColor; \n"
+ "void main() { \n"
+ "lowp float glyph = texture2D(texture, sampleCoord).a; \n"
+ " lowp float outline = clamp(clamp(texture2D(texture, sCoordUp).a + \n"
+ " texture2D(texture, sCoordDown).a + \n"
+ " texture2D(texture, sCoordLeft).a + \n"
+ " texture2D(texture, sCoordRight).a, \n"
+ " 0.0, 1.0) - glyph, \n"
+ " 0.0, 1.0); \n"
+ " gl_FragColor = outline * styleColor + glyph * color; \n"
+ "}";
+}
+
+QSGTextMaskMaterial::QSGTextMaskMaterial(const QRawFont &font, QFontEngineGlyphCache::Type cacheType)
+ : m_texture(0)
+ , m_cacheType(cacheType)
+ , m_glyphCache(0)
+ , m_font(font)
{
init();
}
@@ -224,7 +412,6 @@ void QSGTextMaskMaterial::init()
{
Q_ASSERT(m_font.isValid());
- QFontEngineGlyphCache::Type type = QFontEngineGlyphCache::Raster_RGBMask;
setFlag(Blending, true);
QOpenGLContext *ctx = const_cast<QOpenGLContext *>(QOpenGLContext::currentContext());
@@ -232,20 +419,21 @@ void QSGTextMaskMaterial::init()
QRawFontPrivate *fontD = QRawFontPrivate::get(m_font);
if (fontD->fontEngine != 0) {
- m_glyphCache = fontD->fontEngine->glyphCache(ctx, type, QTransform());
- if (!m_glyphCache || m_glyphCache->cacheType() != type) {
- m_glyphCache = new QOpenGLTextureGlyphCache(type, QTransform());
+ m_glyphCache = fontD->fontEngine->glyphCache(ctx, m_cacheType, QTransform());
+ if (!m_glyphCache || m_glyphCache->cacheType() != m_cacheType) {
+ m_glyphCache = new QOpenGLTextureGlyphCache(m_cacheType, QTransform());
fontD->fontEngine->setGlyphCache(ctx, m_glyphCache.data());
}
}
}
void QSGTextMaskMaterial::populate(const QPointF &p,
- const QVector<quint32> &glyphIndexes,
- const QVector<QPointF> &glyphPositions,
- QSGGeometry *geometry,
- QRectF *boundingRect,
- QPointF *baseLine)
+ const QVector<quint32> &glyphIndexes,
+ const QVector<QPointF> &glyphPositions,
+ QSGGeometry *geometry,
+ QRectF *boundingRect,
+ QPointF *baseLine,
+ const QMargins &margins)
{
Q_ASSERT(m_font.isValid());
QVector<QFixedPoint> fixedPointPositions;
@@ -283,15 +471,15 @@ void QSGTextMaskMaterial::populate(const QPointF &p,
*boundingRect |= QRectF(x + margin, y + margin, c.w, c.h);
- float cx1 = x;
- float cx2 = x + c.w;
- float cy1 = y;
- float cy2 = y + c.h;
+ float cx1 = x - margins.left();
+ float cx2 = x + c.w + margins.right();
+ float cy1 = y - margins.top();
+ float cy2 = y + c.h + margins.bottom();
- float tx1 = c.x;
- float tx2 = (c.x + c.w);
- float ty1 = c.y;
- float ty2 = (c.y + c.h);
+ float tx1 = c.x - margins.left();
+ float tx2 = c.x + c.w + margins.right();
+ float ty1 = c.y - margins.top();
+ float ty2 = c.y + c.h + margins.bottom();
if (baseLine->isNull())
*baseLine = glyphPosition;
@@ -367,4 +555,53 @@ int QSGTextMaskMaterial::cacheTextureHeight() const
return glyphCache()->height();
}
+
+QSGStyledTextMaterial::QSGStyledTextMaterial(const QRawFont &font)
+ : QSGTextMaskMaterial(font, QFontEngineGlyphCache::Raster_A8)
+{
+}
+
+QSGMaterialType *QSGStyledTextMaterial::type() const
+{
+ static QSGMaterialType type;
+ return &type;
+}
+
+QSGMaterialShader *QSGStyledTextMaterial::createShader() const
+{
+ return new QSGStyledTextMaterialData;
+}
+
+int QSGStyledTextMaterial::compare(const QSGMaterial *o) const
+{
+ const QSGStyledTextMaterial *other = static_cast<const QSGStyledTextMaterial *>(o);
+
+ if (m_styleShift != other->m_styleShift)
+ return m_styleShift.y() - other->m_styleShift.y();
+
+ QRgb c1 = m_styleColor.rgba();
+ QRgb c2 = other->m_styleColor.rgba();
+ if (c1 != c2)
+ return int(c2 < c1) - int(c1 < c2);
+
+ return QSGTextMaskMaterial::compare(o);
+}
+
+
+QSGOutlinedTextMaterial::QSGOutlinedTextMaterial(const QRawFont &font)
+ : QSGStyledTextMaterial(font)
+{
+}
+
+QSGMaterialType *QSGOutlinedTextMaterial::type() const
+{
+ static QSGMaterialType type;
+ return &type;
+}
+
+QSGMaterialShader *QSGOutlinedTextMaterial::createShader() const
+{
+ return new QSGOutlinedTextMaterialData;
+}
+
QT_END_NAMESPACE
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.h b/src/quick/scenegraph/qsgdefaultglyphnode_p.h
index a3d5d7c3ae..e264c1b70e 100644
--- a/src/quick/scenegraph/qsgdefaultglyphnode_p.h
+++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.h
@@ -53,22 +53,24 @@ class QSGDefaultGlyphNode: public QSGGlyphNode
{
public:
QSGDefaultGlyphNode();
- ~QSGDefaultGlyphNode();
+ virtual ~QSGDefaultGlyphNode();
virtual QPointF baseLine() const { return m_baseLine; }
virtual void setGlyphs(const QPointF &position, const QGlyphRun &glyphs);
virtual void setColor(const QColor &color);
virtual void setPreferredAntialiasingMode(AntialiasingMode) { }
- virtual void setStyle(QQuickText::TextStyle) { }
- virtual void setStyleColor(const QColor &) { }
+ virtual void setStyle(QQuickText::TextStyle);
+ virtual void setStyleColor(const QColor &);
- virtual void update() { }
+ virtual void update();
-private:
+protected:
QGlyphRun m_glyphs;
QPointF m_position;
QColor m_color;
+ QQuickText::TextStyle m_style;
+ QColor m_styleColor;
QPointF m_baseLine;
QSGTextMaskMaterial *m_material;
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p_p.h b/src/quick/scenegraph/qsgdefaultglyphnode_p_p.h
index 263523221e..d1a739de88 100644
--- a/src/quick/scenegraph/qsgdefaultglyphnode_p_p.h
+++ b/src/quick/scenegraph/qsgdefaultglyphnode_p_p.h
@@ -43,24 +43,25 @@
#define QSGDEFAULTGLYPHNODE_P_P_H
#include <qcolor.h>
+#include <QtGui/private/qopengltextureglyphcache_p.h>
#include <QtQuick/qsgmaterial.h>
#include <QtQuick/qsgtexture.h>
#include <QtQuick/qsggeometry.h>
#include <qshareddata.h>
#include <QtQuick/private/qsgtexture_p.h>
#include <qrawfont.h>
+#include <qmargins.h>
QT_BEGIN_NAMESPACE
-class QFontEngineGlyphCache;
-class QOpenGLTextureGlyphCache;
class QFontEngine;
class Geometry;
class QSGTextMaskMaterial: public QSGMaterial
{
public:
- QSGTextMaskMaterial(const QRawFont &font);
- ~QSGTextMaskMaterial();
+ QSGTextMaskMaterial(const QRawFont &font,
+ QFontEngineGlyphCache::Type cacheType = QFontEngineGlyphCache::Raster_RGBMask);
+ virtual ~QSGTextMaskMaterial();
virtual QSGMaterialType *type() const;
virtual QSGMaterialShader *createShader() const;
@@ -79,18 +80,52 @@ public:
QOpenGLTextureGlyphCache *glyphCache() const;
void populate(const QPointF &position,
const QVector<quint32> &glyphIndexes, const QVector<QPointF> &glyphPositions,
- QSGGeometry *geometry, QRectF *boundingRect, QPointF *baseLine);
+ QSGGeometry *geometry, QRectF *boundingRect, QPointF *baseLine,
+ const QMargins &margins = QMargins(0, 0, 0, 0));
private:
void init();
QSGPlainTexture *m_texture;
+ QFontEngineGlyphCache::Type m_cacheType;
QExplicitlySharedDataPointer<QFontEngineGlyphCache> m_glyphCache;
QRawFont m_font;
QColor m_color;
QSize m_size;
};
+class QSGStyledTextMaterial : public QSGTextMaskMaterial
+{
+public:
+ QSGStyledTextMaterial(const QRawFont &font);
+ virtual ~QSGStyledTextMaterial() { }
+
+ void setStyleShift(const QPointF &shift) { m_styleShift = shift; }
+ const QPointF &styleShift() const { return m_styleShift; }
+
+ void setStyleColor(const QColor &color) { m_styleColor = color; }
+ const QColor &styleColor() const { return m_styleColor; }
+
+ virtual QSGMaterialType *type() const;
+ virtual QSGMaterialShader *createShader() const;
+
+ int compare(const QSGMaterial *other) const;
+
+private:
+ QPointF m_styleShift;
+ QColor m_styleColor;
+};
+
+class QSGOutlinedTextMaterial : public QSGStyledTextMaterial
+{
+public:
+ QSGOutlinedTextMaterial(const QRawFont &font);
+ ~QSGOutlinedTextMaterial() { }
+
+ QSGMaterialType *type() const;
+ QSGMaterialShader *createShader() const;
+};
+
QT_END_NAMESPACE
#endif
diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp
index d409cea81a..86c3356d58 100644
--- a/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp
+++ b/src/quick/scenegraph/qsgdistancefieldglyphnode_p.cpp
@@ -144,8 +144,8 @@ void QSGDistanceFieldTextMaterialShader::updateState(const RenderState &state, Q
if (oldMaterial == 0
|| material->color() != oldMaterial->color()
|| state.isOpacityDirty()) {
- QVector4D color(material->color().redF(), material->color().greenF(),
- material->color().blueF(), material->color().alphaF());
+ QColor c = material->color();
+ QVector4D color(c.redF(), c.greenF(), c.blueF(), c.alphaF());
color *= state.opacity();
program()->setUniformValue(m_color_id, color);
}
@@ -204,6 +204,14 @@ QSGMaterialType *QSGDistanceFieldTextMaterial::type() const
return &type;
}
+void QSGDistanceFieldTextMaterial::setColor(const QColor &color)
+{
+ m_color = QColor::fromRgbF(color.redF() * color.alphaF(),
+ color.greenF() * color.alphaF(),
+ color.blueF() * color.alphaF(),
+ color.alphaF());
+}
+
QSGMaterialShader *QSGDistanceFieldTextMaterial::createShader() const
{
return new QSGDistanceFieldTextMaterialShader;
@@ -276,8 +284,8 @@ void DistanceFieldStyledTextMaterialShader::updateState(const RenderState &state
if (oldMaterial == 0
|| material->styleColor() != oldMaterial->styleColor()
|| (state.isOpacityDirty())) {
- QVector4D color(material->styleColor().redF(), material->styleColor().greenF(),
- material->styleColor().blueF(), material->styleColor().alphaF());
+ QColor c = material->styleColor();
+ QVector4D color(c.redF(), c.greenF(), c.blueF(), c.alphaF());
color *= state.opacity();
program()->setUniformValue(m_styleColor_id, color);
}
@@ -292,6 +300,14 @@ QSGDistanceFieldStyledTextMaterial::~QSGDistanceFieldStyledTextMaterial()
{
}
+void QSGDistanceFieldStyledTextMaterial::setStyleColor(const QColor &color)
+{
+ m_styleColor = QColor::fromRgbF(color.redF() * color.alphaF(),
+ color.greenF() * color.alphaF(),
+ color.blueF() * color.alphaF(),
+ color.alphaF());
+}
+
int QSGDistanceFieldStyledTextMaterial::compare(const QSGMaterial *o) const
{
Q_ASSERT(o && type() == o->type());
@@ -316,7 +332,7 @@ protected:
virtual void initialize();
virtual const char *fragmentShader() const;
- void updateOutlineAlphaRange(int dfRadius);
+ void updateOutlineAlphaRange(ThresholdFunc thresholdFunc, AntialiasingSpreadFunc spreadFunc, int dfRadius);
int m_outlineAlphaMax0_id;
int m_outlineAlphaMax1_id;
@@ -351,14 +367,18 @@ void DistanceFieldOutlineTextMaterialShader::initialize()
m_outlineAlphaMax1_id = program()->uniformLocation("outlineAlphaMax1");
}
-void DistanceFieldOutlineTextMaterialShader::updateOutlineAlphaRange(int dfRadius)
+void DistanceFieldOutlineTextMaterialShader::updateOutlineAlphaRange(ThresholdFunc thresholdFunc,
+ AntialiasingSpreadFunc spreadFunc,
+ int dfRadius)
{
- qreal outlineLimit = qMax(qreal(0.2), qreal(0.5 - 0.5 / dfRadius / m_fontScale));
+ float combinedScale = m_fontScale * m_matrixScale;
+ float base = thresholdFunc(combinedScale);
+ float range = spreadFunc(combinedScale);
+ float outlineLimit = qMax(0.2f, base - 0.5f / dfRadius / m_fontScale);
- qreal combinedScale = m_fontScale * m_matrixScale;
- qreal alphaMin = qMax(0.0, 0.5 - 0.07 / combinedScale);
- qreal styleAlphaMin0 = qMax(0.0, outlineLimit - 0.07 / combinedScale);
- qreal styleAlphaMin1 = qMin(qreal(outlineLimit + 0.07 / combinedScale), alphaMin);
+ float alphaMin = qMax(0.0f, base - range);
+ float styleAlphaMin0 = qMax(0.0f, outlineLimit - range);
+ float styleAlphaMin1 = qMin(outlineLimit + range, alphaMin);
program()->setUniformValue(m_outlineAlphaMax0_id, GLfloat(styleAlphaMin0));
program()->setUniformValue(m_outlineAlphaMax1_id, GLfloat(styleAlphaMin1));
}
@@ -373,7 +393,9 @@ void DistanceFieldOutlineTextMaterialShader::updateState(const RenderState &stat
if (oldMaterial == 0
|| material->fontScale() != oldMaterial->fontScale()
|| state.isMatrixDirty())
- updateOutlineAlphaRange(material->glyphCache()->distanceFieldRadius());
+ updateOutlineAlphaRange(material->glyphCache()->manager()->thresholdFunc(),
+ material->glyphCache()->manager()->antialiasingSpreadFunc(),
+ material->glyphCache()->distanceFieldRadius());
}
diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h b/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h
index d6aa38affa..7fea8f65dc 100644
--- a/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h
+++ b/src/quick/scenegraph/qsgdistancefieldglyphnode_p_p.h
@@ -58,7 +58,7 @@ public:
virtual QSGMaterialShader *createShader() const;
virtual int compare(const QSGMaterial *other) const;
- void setColor(const QColor &color) { m_color = color; }
+ virtual void setColor(const QColor &color);
const QColor &color() const { return m_color; }
void setGlyphCache(QSGDistanceFieldGlyphCache *a) { m_glyph_cache = a; }
@@ -92,7 +92,7 @@ public:
virtual QSGMaterialShader *createShader() const = 0;
virtual int compare(const QSGMaterial *other) const;
- void setStyleColor(const QColor &color) { m_styleColor = color; }
+ void setStyleColor(const QColor &color);
const QColor &styleColor() const { return m_styleColor; }
protected:
@@ -130,6 +130,7 @@ class Q_QUICK_PRIVATE_EXPORT QSGHiQSubPixelDistanceFieldTextMaterial : public QS
public:
virtual QSGMaterialType *type() const;
virtual QSGMaterialShader *createShader() const;
+ void setColor(const QColor &color) { m_color = color; }
};
class Q_QUICK_PRIVATE_EXPORT QSGLoQSubPixelDistanceFieldTextMaterial : public QSGDistanceFieldTextMaterial
@@ -137,6 +138,7 @@ class Q_QUICK_PRIVATE_EXPORT QSGLoQSubPixelDistanceFieldTextMaterial : public QS
public:
virtual QSGMaterialType *type() const;
virtual QSGMaterialShader *createShader() const;
+ void setColor(const QColor &color) { m_color = color; }
};
QT_END_NAMESPACE
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp
index a55658bf71..33a99d1506 100644
--- a/src/quick/scenegraph/qsgrenderloop.cpp
+++ b/src/quick/scenegraph/qsgrenderloop.cpp
@@ -58,7 +58,7 @@
QT_BEGIN_NAMESPACE
-DEFINE_BOOL_CONFIG_OPTION(qquick_render_timing, QML_RENDER_TIMING)
+DEFINE_BOOL_CONFIG_OPTION(qsg_render_timing, QSG_RENDER_TIMING)
extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha);
@@ -95,7 +95,6 @@ public:
void renderWindow(QQuickWindow *window);
void exposureChanged(QQuickWindow *window);
QImage grab(QQuickWindow *window);
- void resize(QQuickWindow *window, const QSize &size);
void maybeUpdate(QQuickWindow *window);
void update(QQuickWindow *window) { maybeUpdate(window); } // identical for this implementation.
@@ -272,17 +271,17 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
int renderTime = 0, syncTime = 0;
QTime renderTimer;
- if (qquick_render_timing())
+ if (qsg_render_timing())
renderTimer.start();
cd->syncSceneGraph();
- if (qquick_render_timing())
+ if (qsg_render_timing())
syncTime = renderTimer.elapsed();
cd->renderSceneGraph(window->size());
- if (qquick_render_timing())
+ if (qsg_render_timing())
renderTime = renderTimer.elapsed() - syncTime;
if (data.grabOnly) {
@@ -295,7 +294,7 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
cd->fireFrameSwapped();
}
- if (qquick_render_timing()) {
+ if (qsg_render_timing()) {
static QTime lastFrameTime = QTime::currentTime();
const int swapTime = renderTimer.elapsed() - renderTime - syncTime;
qDebug() << "- Breakdown of frame time; sync:" << syncTime
@@ -335,12 +334,6 @@ QImage QSGGuiThreadRenderLoop::grab(QQuickWindow *window)
-void QSGGuiThreadRenderLoop::resize(QQuickWindow *, const QSize &)
-{
-}
-
-
-
void QSGGuiThreadRenderLoop::maybeUpdate(QQuickWindow *window)
{
if (!m_windows.contains(window))
diff --git a/src/quick/scenegraph/qsgrenderloop_p.h b/src/quick/scenegraph/qsgrenderloop_p.h
index 2ec6de9411..b18e6f00ad 100644
--- a/src/quick/scenegraph/qsgrenderloop_p.h
+++ b/src/quick/scenegraph/qsgrenderloop_p.h
@@ -63,7 +63,6 @@ public:
virtual void exposureChanged(QQuickWindow *window) = 0;
virtual QImage grab(QQuickWindow *window) = 0;
- virtual void resize(QQuickWindow *window, const QSize &size) = 0;
virtual void update(QQuickWindow *window) = 0;
virtual void maybeUpdate(QQuickWindow *window) = 0;
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index ef50d5a89d..b457c33bed 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -136,8 +136,8 @@ static inline int qsgrl_animation_interval() {
}
-#ifndef QSG_NO_WINDOW_TIMING
-static bool qquick_window_timing = !qgetenv("QML_WINDOW_TIMING").isEmpty();
+#ifndef QSG_NO_RENDER_TIMING
+static bool qsg_render_timing = !qgetenv("QSG_RENDER_TIMING").isEmpty();
static QTime threadTimer;
static int syncTime;
static int renderTime;
@@ -168,9 +168,6 @@ const QEvent::Type WM_RequestSync = QEvent::Type(QEvent::User + 4);
// typically a result of QQuickWindow::update().
const QEvent::Type WM_RequestRepaint = QEvent::Type(QEvent::User + 5);
-// Passed by the RL to the RT when a window has changed size.
-const QEvent::Type WM_Resize = QEvent::Type(QEvent::User + 6);
-
// Passed by the RL to the RT to free up maybe release SG and GL contexts
// if no windows are rendering.
const QEvent::Type WM_TryRelease = QEvent::Type(QEvent::User + 7);
@@ -213,14 +210,6 @@ public:
bool inDestructor;
};
-class WMResizeEvent : public WMWindowEvent
-{
-public:
- WMResizeEvent(QQuickWindow *c, const QSize &s) : WMWindowEvent(c, WM_Resize), size(s) { }
- QSize size;
-};
-
-
class WMExposeEvent : public WMWindowEvent
{
public:
@@ -374,7 +363,8 @@ bool QSGRenderThread::event(QEvent *e)
pendingUpdate |= RepaintRequest;
- if (windowFor(m_windows, se->window)) {
+ if (Window *w = windowFor(m_windows, se->window)) {
+ w->size = se->size;
RLDEBUG1(" Render: - window already added...");
return true;
}
@@ -409,14 +399,6 @@ bool QSGRenderThread::event(QEvent *e)
pendingUpdate |= SyncRequest;
return true;
- case WM_Resize: {
- RLDEBUG(" Render: WM_Resize");
- WMResizeEvent *re = static_cast<WMResizeEvent *>(e);
- Window *w = windowFor(m_windows, re->window);
- w->size = re->size;
- // No need to wake up here as we will get a sync shortly.. (see QSGThreadedRenderLoop::resize());
- return true; }
-
case WM_TryRelease:
RLDEBUG1(" Render: WM_TryRelease");
mutex.lock();
@@ -563,8 +545,8 @@ void QSGRenderThread::sync()
void QSGRenderThread::syncAndRender()
{
-#ifndef QSG_NO_WINDOW_TIMING
- if (qquick_window_timing)
+#ifndef QSG_NO_RENDER_TIMING
+ if (qsg_render_timing)
sinceLastTime = threadTimer.restart();
#endif
QElapsedTimer waitTimer;
@@ -589,8 +571,8 @@ void QSGRenderThread::syncAndRender()
return;
}
-#ifndef QSG_NO_WINDOW_TIMING
- if (qquick_window_timing)
+#ifndef QSG_NO_RENDER_TIMING
+ if (qsg_render_timing)
syncTime = threadTimer.elapsed();
#endif
RLDEBUG(" Render: - rendering starting");
@@ -604,8 +586,8 @@ void QSGRenderThread::syncAndRender()
}
gl->makeCurrent(w.window);
d->renderSceneGraph(w.size);
-#ifndef QSG_NO_WINDOW_TIMING
- if (qquick_window_timing && i == 0)
+#ifndef QSG_NO_RENDER_TIMING
+ if (qsg_render_timing && i == 0)
renderTime = threadTimer.elapsed();
#endif
gl->swapBuffers(w.window);
@@ -613,8 +595,8 @@ void QSGRenderThread::syncAndRender()
}
RLDEBUG(" Render: - rendering done");
-#ifndef QSG_NO_WINDOW_TIMING
- if (qquick_window_timing)
+#ifndef QSG_NO_RENDER_TIMING
+ if (qsg_render_timing)
qDebug("window Time: sinceLast=%d, sync=%d, first render=%d, after final swap=%d",
sinceLastTime,
syncTime,
@@ -965,12 +947,12 @@ void QSGThreadedRenderLoop::polishAndSync()
RLDEBUG("GUI: polishAndSync()");
-#ifndef QSG_NO_WINDOW_TIMING
+#ifndef QSG_NO_RENDER_TIMING
QElapsedTimer timer;
int polishTime = 0;
int waitTime = 0;
int syncTime;
- if (qquick_window_timing)
+ if (qsg_render_timing)
timer.start();
#endif
@@ -980,8 +962,8 @@ void QSGThreadedRenderLoop::polishAndSync()
QQuickWindowPrivate *d = QQuickWindowPrivate::get(w.window);
d->polishItems();
}
-#ifndef QSG_NO_WINDOW_TIMING
- if (qquick_window_timing)
+#ifndef QSG_NO_RENDER_TIMING
+ if (qsg_render_timing)
polishTime = timer.elapsed();
#endif
@@ -993,8 +975,8 @@ void QSGThreadedRenderLoop::polishAndSync()
m_thread->postEvent(new QEvent(WM_RequestSync));
RLDEBUG("GUI: - wait for sync...");
-#ifndef QSG_NO_WINDOW_TIMING
- if (qquick_window_timing)
+#ifndef QSG_NO_RENDER_TIMING
+ if (qsg_render_timing)
waitTime = timer.elapsed();
#endif
m_thread->waitCondition.wait(&m_thread->mutex);
@@ -1002,8 +984,8 @@ void QSGThreadedRenderLoop::polishAndSync()
m_thread->mutex.unlock();
RLDEBUG("GUI: - unlocked after sync...");
-#ifndef QSG_NO_WINDOW_TIMING
- if (qquick_window_timing)
+#ifndef QSG_NO_RENDER_TIMING
+ if (qsg_render_timing)
syncTime = timer.elapsed();
#endif
@@ -1021,8 +1003,8 @@ void QSGThreadedRenderLoop::polishAndSync()
maybePostPolishRequest();
}
-#ifndef QSG_NO_WINDOW_TIMING
- if (qquick_window_timing)
+#ifndef QSG_NO_RENDER_TIMING
+ if (qsg_render_timing)
qDebug(" - polish=%d, wait=%d, sync=%d -- animations=%d", polishTime, waitTime - polishTime, syncTime - waitTime, int(timer.elapsed() - syncTime));
#endif
}
@@ -1086,27 +1068,6 @@ QImage QSGThreadedRenderLoop::grab(QQuickWindow *window)
return result;
}
-/*
- Notify the render thread that the window is now a new size. Then
- locks GUI until render has adapted.
- */
-
-void QSGThreadedRenderLoop::resize(QQuickWindow *w, const QSize &size)
-{
- RLDEBUG1("GUI: resize");
-
- if (!m_thread->isRunning() || !m_windows.size() || !w->isExposed() || windowFor(m_windows, w) == 0) {
- return;
- }
-
- if (size.width() == 0 || size.height() == 0)
- return;
-
- RLDEBUG("GUI: - posting resize event...");
- m_thread->postEvent(new WMResizeEvent(w, size));
-
- polishAndSync();
-}
#include "qsgthreadedrenderloop.moc"
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop_p.h b/src/quick/scenegraph/qsgthreadedrenderloop_p.h
index 63b2b442e6..aab0e8726f 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop_p.h
+++ b/src/quick/scenegraph/qsgthreadedrenderloop_p.h
@@ -69,8 +69,6 @@ public:
QImage grab(QQuickWindow *);
- void resize(QQuickWindow *, const QSize &);
-
void update(QQuickWindow *window);
void maybeUpdate(QQuickWindow *window);
QSGContext *sceneGraphContext() const;
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp
index cd95d9f445..ad98fe9d47 100644
--- a/src/quick/scenegraph/util/qsgtexture.cpp
+++ b/src/quick/scenegraph/util/qsgtexture.cpp
@@ -69,8 +69,8 @@
static bool qsg_leak_check = !qgetenv("QML_LEAK_CHECK").isEmpty();
#endif
-#ifndef QSG_NO_RENDERER_TIMING
-static bool qsg_render_timing = !qgetenv("QML_RENDERER_TIMING").isEmpty();
+#ifndef QSG_NO_RENDER_TIMING
+static bool qsg_render_timing = !qgetenv("QSG_RENDER_TIMING").isEmpty();
static QElapsedTimer qsg_renderer_timer;
#endif
@@ -613,7 +613,7 @@ void QSGPlainTexture::bind()
m_dirty_texture = false;
-#ifndef QSG_NO_RENDERER_TIMING
+#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing)
qsg_renderer_timer.start();
#endif
@@ -621,7 +621,7 @@ void QSGPlainTexture::bind()
if (m_image.isNull()) {
if (m_texture_id && m_owns_texture) {
glDeleteTextures(1, &m_texture_id);
-#ifndef QSG_NO_RENDERER_TIMING
+#ifndef QSG_NO_RENDER_TIMING
if (qsg_render_timing) {
printf(" - texture deleted in %dms (size: %dx%d)\n",
(int) qsg_renderer_timer.elapsed(),
@@ -644,7 +644,7 @@ void QSGPlainTexture::bind()
glGenTextures(1, &m_texture_id);
glBindTexture(GL_TEXTURE_2D, m_texture_id);
-#ifndef QSG_NO_RENDERER_TIMING
+#ifndef QSG_NO_RENDER_TIMING
int bindTime = 0;
if (qsg_render_timing)
bindTime = qsg_renderer_timer.elapsed();
@@ -658,7 +658,7 @@ void QSGPlainTexture::bind()
? m_image
: m_image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
-#ifndef QSG_NO_RENDERER_TIMING
+#ifndef QSG_NO_RENDER_TIMING
int convertTime = 0;
if (qsg_render_timing)
convertTime = qsg_renderer_timer.elapsed();
@@ -675,8 +675,6 @@ void QSGPlainTexture::bind()
#ifdef QT_OPENGL_ES
internalFormat = GL_BGRA;
#endif
- } else if (strstr(extensions, "GL_APPLE_texture_format_BGRA8888")) {
- externalFormat = GL_BGRA;
} else if (strstr(extensions, "GL_EXT_texture_format_BGRA8888")
|| strstr(extensions, "GL_IMG_texture_format_BGRA8888")) {
externalFormat = GL_BGRA;
@@ -685,14 +683,14 @@ void QSGPlainTexture::bind()
qsg_swizzleBGRAToRGBA(&tmp);
}
-#ifndef QSG_NO_RENDERER_TIMING
+#ifndef QSG_NO_RENDER_TIMING
int swizzleTime = 0;
if (qsg_render_timing)
swizzleTime = qsg_renderer_timer.elapsed();
#endif
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, w, h, 0, externalFormat, GL_UNSIGNED_BYTE, tmp.constBits());
-#ifndef QSG_NO_RENDERER_TIMING
+#ifndef QSG_NO_RENDER_TIMING
int uploadTime = 0;
if (qsg_render_timing)
uploadTime = qsg_renderer_timer.elapsed();
@@ -705,7 +703,7 @@ void QSGPlainTexture::bind()
m_mipmaps_generated = true;
}
-#ifndef QSG_NO_RENDERER_TIMING
+#ifndef QSG_NO_RENDER_TIMING
int mipmapTime = 0;
if (qsg_render_timing) {
mipmapTime = qsg_renderer_timer.elapsed();
diff --git a/src/quick/util/qquickanimation.cpp b/src/quick/util/qquickanimation.cpp
index 8bbd3a788a..f74ad20bc6 100644
--- a/src/quick/util/qquickanimation.cpp
+++ b/src/quick/util/qquickanimation.cpp
@@ -2565,4 +2565,9 @@ QAbstractAnimationJob* QQuickPropertyAnimation::transition(QQuickStateActions &a
return initInstance(animator);
}
+QQuickAnimationPropertyUpdater::~QQuickAnimationPropertyUpdater()
+{
+ if (wasDeleted) *wasDeleted = true;
+}
+
QT_END_NAMESPACE
diff --git a/src/quick/util/qquickanimation_p_p.h b/src/quick/util/qquickanimation_p_p.h
index eb36a702a7..fb5f2d341f 100644
--- a/src/quick/util/qquickanimation_p_p.h
+++ b/src/quick/util/qquickanimation_p_p.h
@@ -303,7 +303,7 @@ class Q_AUTOTEST_EXPORT QQuickAnimationPropertyUpdater : public QQuickBulkValueU
{
public:
QQuickAnimationPropertyUpdater() : interpolatorType(0), interpolator(0), prevInterpolatorType(0), reverse(false), fromSourced(false), fromDefined(false), wasDeleted(0) {}
- ~QQuickAnimationPropertyUpdater() { if (wasDeleted) *wasDeleted = true; }
+ ~QQuickAnimationPropertyUpdater();
void setValue(qreal v);
diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp
index 4d17399222..3ea1bc73ad 100644
--- a/src/quick/util/qquickglobal.cpp
+++ b/src/quick/util/qquickglobal.cpp
@@ -1014,6 +1014,6 @@ static bool initializeProviders()
return true;
}
-static bool initialized = initializeProviders();
+Q_CONSTRUCTOR_FUNCTION(initializeProviders)
QT_END_NAMESPACE
diff --git a/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs.pro b/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs.pro
index d4ce36dc4a..eb5f17a55d 100644
--- a/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs.pro
+++ b/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs.pro
@@ -22,5 +22,3 @@ OTHER_FILES += data/test.qml data/test.js \
data/breakpointRelocation.qml \
data/createComponent.qml
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
-
-mac:CONFIG+=insignificant_test # QTBUG-28263
diff --git a/tests/auto/qml/debugger/shared/debugutil_p.h b/tests/auto/qml/debugger/shared/debugutil_p.h
index 363aabbf39..2b9a94366a 100644
--- a/tests/auto/qml/debugger/shared/debugutil_p.h
+++ b/tests/auto/qml/debugger/shared/debugutil_p.h
@@ -57,7 +57,7 @@
class QQmlDebugTest
{
public:
- static bool waitForSignal(QObject *receiver, const char *member, int timeout = 5000);
+ static bool waitForSignal(QObject *receiver, const char *member, int timeout = 10000);
};
class QQmlDebugTestClient : public QQmlDebugClient
diff --git a/tests/auto/qmltest/events/tst_drag.qml b/tests/auto/qmltest/events/tst_drag.qml
index 70e0ea2096..7db1e1e1b2 100644
--- a/tests/auto/qmltest/events/tst_drag.qml
+++ b/tests/auto/qmltest/events/tst_drag.qml
@@ -51,6 +51,17 @@ Rectangle{
id: util
}
+ SignalSpy {
+ id: spyX
+ target: container2
+ signalName: "posXChanged"
+ }
+ SignalSpy {
+ id: spyY
+ target: container2
+ signalName: "posYChanged"
+ }
+
Rectangle {
id:container
width:20
@@ -66,6 +77,55 @@ Rectangle{
}
}
+ Rectangle {
+ id: container2
+ x: 25
+ y: 25
+ width:100
+ height:100
+ color: "red"
+ property bool updatePositionWhileDragging: false
+ property var posX: 0
+ property var posY: 0
+
+ function reset() {
+ fakeHandle.x = 0
+ fakeHandle.y = 0
+ spyX.clear()
+ spyY.clear()
+ }
+
+ Binding {
+ when: container2.updatePositionWhileDragging
+ target: container2
+ property: "posX"
+ value: fakeHandle.x
+ }
+
+ Binding {
+ when: container2.updatePositionWhileDragging
+ target: container2
+ property: "posY"
+ value: fakeHandle.y
+ }
+
+ Item { id: fakeHandle }
+
+ MouseArea {
+ anchors.fill : container2
+ drag.maximumX: 180
+ drag.maximumY: 180
+ drag.minimumX: 0
+ drag.minimumY: 0
+ drag.target: fakeHandle
+
+ onReleased: if (!container2.updatePositionWhileDragging) {
+ container2.posX = mouse.x;
+ container2.posY = mouse.y
+ }
+ }
+ }
+
TestCase {
name:"mouserelease"
when:windowShown
@@ -74,5 +134,47 @@ Rectangle{
compare(container.x, 20 - util.dragThreshold - 1);
compare(container.y, 30 - util.dragThreshold - 1);
}
+
+ function test_doSomethingWhileDragging() {
+ container2.updatePositionWhileDragging = false
+ // dx and dy are superior to 3 times util.dragThreshold.
+ // but here the dragging does not update posX and posY
+ // posX and posY are only updated on mouseRelease
+ container2.reset()
+ mouseDrag(container2, container2.x + 10, container2.y + 10, 10*util.dragThreshold, 10*util.dragThreshold);
+ compare(spyX.count, 1)
+ compare(spyY.count, 1)
+
+ container2.updatePositionWhileDragging = true
+ // dx and dy are superior to 3 times util.dragThreshold.
+ // 3 intermediate mouseMove when dragging
+ container2.reset()
+ mouseDrag(container2, container2.x + 10, container2.y + 10, 10*util.dragThreshold, 10*util.dragThreshold);
+ compare(spyX.count, 3)
+ compare(spyY.count, 3)
+
+ // dx and dy are inferior to 3 times util.dragThreshold.
+ // No intermediate mouseMove when dragging, only one mouseMove
+ container2.reset()
+ mouseDrag(container2, container2.x + 10, container2.y + 10, 2*util.dragThreshold, 2*util.dragThreshold);
+ compare(spyX.count, 1)
+ compare(spyY.count, 1)
+
+ // dx is superior to 3 times util.dragThreshold.
+ // 3 intermediate mouseMove when dragging on x axis
+ // no move on the y axis
+ container2.reset()
+ mouseDrag(container2, container2.x + 10, container2.y + 10, 10*util.dragThreshold, 0);
+ compare(spyX.count, 3)
+ compare(spyY.count, 0)
+
+ // dy is inferior to 3 times util.dragThreshold.
+ // No intermediate mouseMove when dragging, only one mouseMove on y axis
+ // no move on the x axis
+ container2.reset()
+ mouseDrag(container2, container2.x + 10, container2.y + 10, 0, 2*util.dragThreshold);
+ compare(spyX.count, 0)
+ compare(spyY.count, 1)
+ }
}
}
diff --git a/tests/auto/qmltest/textedit/tst_textedit.qml b/tests/auto/qmltest/textedit/tst_textedit.qml
index dc9affdad8..edfa127c59 100644
--- a/tests/auto/qmltest/textedit/tst_textedit.qml
+++ b/tests/auto/qmltest/textedit/tst_textedit.qml
@@ -74,6 +74,13 @@ Item {
}
TextEdit {
+ id: txtentry2
+ text: ""
+ height: 20
+ width: 50
+ }
+
+ TextEdit {
id: txtfunctions
text: "The quick brown fox jumped over the lazy dog"
height: 20
@@ -124,6 +131,23 @@ Item {
compare(txtentry.text, "hello world")
}
+ function test_textentry_char() {
+ txtentry2.focus = true;
+ compare(txtentry2.text, "")
+ keyClick("h")
+ keyClick("e")
+ keyClick("l")
+ keyClick("l")
+ keyClick("o")
+ keyClick(" ")
+ keyClick("W")
+ keyClick("o")
+ keyClick("r")
+ keyClick("l")
+ keyClick("d")
+ compare(txtentry2.text, "hello World")
+ }
+
function test_functions() {
compare(txtfunctions.getText(4,9), "quick")
txtfunctions.select(4,9);
diff --git a/tests/auto/quick/dialogs/dialogs.pro b/tests/auto/quick/dialogs/dialogs.pro
index d28c623a1f..024b15a758 100644
--- a/tests/auto/quick/dialogs/dialogs.pro
+++ b/tests/auto/quick/dialogs/dialogs.pro
@@ -5,6 +5,8 @@ SOURCES += tst_dialogs.cpp
include (../../shared/util.pri)
macx:CONFIG -= app_bundle
+macx:CONFIG+=insignificant_test # QTBUG-30513 - test is unstable
+linux-*:CONFIG+=insignificant_test # QTBUG-30513 - test is unstable
CONFIG += parallel_test
QT += core-private gui-private qml-private quick-private v8-private testlib
diff --git a/tests/auto/quick/qquickitem2/data/activeFocusOnTab.qml b/tests/auto/quick/qquickitem2/data/activeFocusOnTab.qml
index e064b41efe..f8f81e306a 100644
--- a/tests/auto/quick/qquickitem2/data/activeFocusOnTab.qml
+++ b/tests/auto/quick/qquickitem2/data/activeFocusOnTab.qml
@@ -1,4 +1,4 @@
-import QtQuick 2.0
+import QtQuick 2.1
Item {
id: main
diff --git a/tests/auto/quick/qquickitem2/data/activeFocusOnTab3.qml b/tests/auto/quick/qquickitem2/data/activeFocusOnTab3.qml
index 00fb82d59e..480c0d4863 100644
--- a/tests/auto/quick/qquickitem2/data/activeFocusOnTab3.qml
+++ b/tests/auto/quick/qquickitem2/data/activeFocusOnTab3.qml
@@ -1,4 +1,4 @@
-import QtQuick 2.0
+import QtQuick 2.1
Item {
id: main
diff --git a/tests/auto/quick/qquickitem2/data/activeFocusOnTab4.qml b/tests/auto/quick/qquickitem2/data/activeFocusOnTab4.qml
new file mode 100644
index 0000000000..0c8586294d
--- /dev/null
+++ b/tests/auto/quick/qquickitem2/data/activeFocusOnTab4.qml
@@ -0,0 +1,56 @@
+import QtQuick 2.1
+
+Item {
+ id: main
+ objectName: "main"
+ width: 800
+ height: 600
+ focus: true
+ Component.onCompleted: button11.focus = true
+ Item {
+ id: sub1
+ objectName: "sub1"
+ width: 230
+ height: 600
+ activeFocusOnTab: false
+ anchors.top: parent.top
+ anchors.left: parent.left
+ Item {
+ id: button11
+ objectName: "button11"
+ width: 100
+ height: 50
+ activeFocusOnTab: false
+ Rectangle {
+ anchors.fill: parent
+ color: parent.activeFocus ? "red" : "black"
+ }
+
+ anchors.top: parent.top
+ anchors.topMargin: 100
+ }
+ }
+ Item {
+ id: sub2
+ objectName: "sub2"
+ activeFocusOnTab: false
+ width: 230
+ height: 600
+ anchors.top: parent.top
+ anchors.left: sub1.right
+ Item {
+ id: button21
+ objectName: "button21"
+ width: 100
+ height: 50
+ activeFocusOnTab: true
+ Rectangle {
+ anchors.fill: parent
+ color: parent.activeFocus ? "red" : "black"
+ }
+
+ anchors.top: parent.top
+ anchors.topMargin: 100
+ }
+ }
+}
diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
index 668b5e2945..f2d25e81ed 100644
--- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
@@ -67,6 +67,8 @@ private slots:
void activeFocusOnTab();
void activeFocusOnTab2();
void activeFocusOnTab3();
+ void activeFocusOnTab4();
+ void activeFocusOnTab5();
void keys();
void keysProcessingOrder();
@@ -602,6 +604,66 @@ void tst_QQuickItem::activeFocusOnTab3()
delete window;
}
+void tst_QQuickItem::activeFocusOnTab4()
+{
+ QQuickView *window = new QQuickView(0);
+ window->setBaseSize(QSize(800,600));
+
+ window->setSource(testFileUrl("activeFocusOnTab4.qml"));
+ window->show();
+ window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window));
+ QVERIFY(QGuiApplication::focusWindow() == window);
+
+ // original: button11
+ QQuickItem *item = findItem<QQuickItem>(window->rootObject(), "button11");
+ item->setActiveFocusOnTab(true);
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ // Tab: button11->button21
+ QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
+ QGuiApplication::sendEvent(window, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QQuickItem>(window->rootObject(), "button21");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ delete window;
+}
+
+void tst_QQuickItem::activeFocusOnTab5()
+{
+ QQuickView *window = new QQuickView(0);
+ window->setBaseSize(QSize(800,600));
+
+ window->setSource(testFileUrl("activeFocusOnTab4.qml"));
+ window->show();
+ window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window));
+ QVERIFY(QGuiApplication::focusWindow() == window);
+
+ // original: button11 in sub1
+ QQuickItem *item = findItem<QQuickItem>(window->rootObject(), "button11");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ QQuickItem *item2 = findItem<QQuickItem>(window->rootObject(), "sub1");
+ item2->setActiveFocusOnTab(true);
+
+ // Tab: button11->button21
+ QKeyEvent key(QEvent::KeyPress, Qt::Key_Tab, Qt::NoModifier, "", false, 1);
+ QGuiApplication::sendEvent(window, &key);
+ QVERIFY(key.isAccepted());
+
+ item = findItem<QQuickItem>(window->rootObject(), "button21");
+ QVERIFY(item);
+ QVERIFY(item->hasActiveFocus());
+
+ delete window;
+}
+
void tst_QQuickItem::keys()
{
QQuickView *window = new QQuickView(0);
diff --git a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
index e805a6b074..274b93e81a 100644
--- a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
+++ b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
@@ -1833,7 +1833,7 @@ void tst_QQuickPathView::snapToItem()
flick(window.data(), QPoint(200,10), QPoint(10,10), 180);
QVERIFY(pathview->isMoving());
- QTRY_VERIFY(!pathview->isMoving());
+ QTRY_VERIFY_WITH_TIMEOUT(!pathview->isMoving(), 50000);
QVERIFY(pathview->offset() == qFloor(pathview->offset()));