aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-12-03 18:15:53 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-12-03 18:15:55 +0100
commita79d616501f028183c154f175ec3ed0fa45ffd85 (patch)
tree1d4290d0e61db71571dcec2d250f4d5d07ef2c5f
parent9e77d6c31b406e5941a2d287f3c8842954815db4 (diff)
parent3b7a8d9d5e214a88f5855800e7bf54da4425d7b9 (diff)
Merge remote-tracking branch 'origin/release' into stable
-rw-r--r--dist/changes-5.1.225
-rw-r--r--dist/changes-5.2.075
-rw-r--r--examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.pro10
-rw-r--r--examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.qrc5
-rw-r--r--examples/qml/tutorials/extending/chapter1-basics/main.cpp2
-rw-r--r--examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.pro10
-rw-r--r--examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.qrc5
-rw-r--r--examples/qml/tutorials/extending/chapter2-methods/main.cpp2
-rw-r--r--examples/qml/tutorials/extending/chapter3-bindings/chapter3-binding.qrc5
-rw-r--r--examples/qml/tutorials/extending/chapter3-bindings/chapter3-bindings.pro10
-rw-r--r--examples/qml/tutorials/extending/chapter3-bindings/main.cpp2
-rw-r--r--examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro10
-rw-r--r--examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.qrc5
-rw-r--r--examples/qml/tutorials/extending/chapter4-customPropertyTypes/main.cpp2
-rw-r--r--examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro10
-rw-r--r--examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.qrc5
-rw-r--r--examples/qml/tutorials/extending/chapter5-listproperties/main.cpp2
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/app.pro10
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/app.qrc5
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/chapter6-plugins.pro23
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/import/chartsplugin.cpp (renamed from examples/qml/tutorials/extending/chapter6-plugins/chartsplugin.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/import/chartsplugin.h (renamed from examples/qml/tutorials/extending/chapter6-plugins/chartsplugin.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/import/import.pro26
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/import/piechart.cpp (renamed from examples/qml/tutorials/extending/chapter6-plugins/piechart.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/import/piechart.h (renamed from examples/qml/tutorials/extending/chapter6-plugins/piechart.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/import/pieslice.cpp (renamed from examples/qml/tutorials/extending/chapter6-plugins/pieslice.cpp)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/import/pieslice.h (renamed from examples/qml/tutorials/extending/chapter6-plugins/pieslice.h)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/import/qmldir (renamed from examples/qml/tutorials/extending/chapter6-plugins/Charts/qmldir)0
-rw-r--r--examples/qml/tutorials/extending/chapter6-plugins/main.cpp53
-rw-r--r--src/qml/doc/qtqml.qdocconf4
-rw-r--r--src/qml/doc/src/cppintegration/extending-tutorial.qdoc45
-rw-r--r--src/quick/items/qquickitem.cpp5
-rw-r--r--src/quick/items/qquicktext.cpp98
-rw-r--r--src/quick/items/qquickwindowmodule.cpp80
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp11
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h4
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp16
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop_p.h2
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp20
-rw-r--r--tools/qmljs/qmljs.pro1
40 files changed, 446 insertions, 142 deletions
diff --git a/dist/changes-5.1.2 b/dist/changes-5.1.2
deleted file mode 100644
index 2ea62a4f6b..0000000000
--- a/dist/changes-5.1.2
+++ /dev/null
@@ -1,25 +0,0 @@
-Qt 5.1.2 is a bug-fix release. It maintains both forward and backward
-compatibility (source and binary) with Qt 5.1.0 and 5.1.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.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.
-
-****************************************************************************
-* Important Behavior Changes *
-****************************************************************************
-
- - QTBUG-32838: Setting the model property of ListView, GridView or PathView to
- an empty model will now correctly reset currentIndex to -1. In prior versions
- currentIndex was set to 0 regardless of the actual number of rows in the model
- when the model property was changed after the view's initialization.
-
diff --git a/dist/changes-5.2.0 b/dist/changes-5.2.0
index 8b044d6932..b44dc74a5e 100644
--- a/dist/changes-5.2.0
+++ b/dist/changes-5.2.0
@@ -53,27 +53,87 @@ Third party components
to what one would expect and more inline with primitive values in
Javascript.
+ - QTBUG-32838: Setting the model property of ListView, GridView or PathView to
+ an empty model will now correctly reset currentIndex to -1. In prior versions
+ currentIndex was set to 0 regardless of the actual number of rows in the model
+ when the model property was changed after the view's initialization.
+
****************************************************************************
* Library *
****************************************************************************
QtQml
------
+New types and properties in this version can be accessed using
+"import QtQml 2.2".
- New class QQmlFileSelectors allows applying a QFileSelector to QML assets
and types. One is automatically set on QQmlApplicationEngines from now on,
plain QQmlEngines must set their own in order to be affected.
+- QML Singletons can now be defined in QML using the "pragma Singleton"
+ directive, combined with a singleton entry in a qmldir file.
+
+- The Locale type (from Qt.local()) is now available from the QtQml import as
+ well as from the QtQuick import.
+
+- New qmlProtectModule function for preventing type injection into built-in
+ QML modules.
+
+- Qt.application gained several new members
+ * enumeration "state" replaces boolean "active", so as to indicate more
+ states than just active/inactive
+ * strings "organization" and "domain" added, exposing those properties
+ from QCoreApplication.
+
QtQuick
------
+New types and properties in this version can be accessed using
+"import QtQuick 2.2".
- New scene graph renderer should reduce state changes, number of draw calls,
CPU->GPU bandwidth and generally improve performance.
+- QTBUG-33993: There is now one render thread per window in QtQuick.
+
- Textures in the scene graph can now be entered into an atlas, facilitating
in better batching in the renderer. Atlas textures are enabled by passing
QQuickWindow::TextureCanUseAtlas to QQuickWindow::createTextureFromImage()
+- New "Animator" types available for running QtQuick animations on the render
+ thread. This allows certain animations to continue when the GUI thread is
+ blocked.
+
+- Text gained a hoveredLink signal.
+
+- TextEdit gained an append method for easier programmatic text controls.
+
+- TextInput gained an editingFinished signal.
+
+- Drag and DropArea elements now handle drag'n'drop from other applications.
+
+- Screen type gained a pixelDensity property, deprecating logicalPixelDensity,
+ as logicalPixelDensity is less portable across some mobile platforms.
+
+- QTBUG-34368: Click signals are no longer propagated to disabled MouseAreas
+
+- QTBUG-33644: Windows created dynamically now respond appropriately when
+ modality is set.
+
+- QTBUG-33699: PathView now follows the same pattern as Flickable for
+ grabbing the mouse.
+
+- QTBUG-32078: qmlClearTypeRegistrations now works when using QtQuick.
+
+- QTBUG-33112: Setting an items state too early no longer crashes.
+
+- QTBUG-32920: Dragging a MouseArea nested in a Flickable now works with touch
+ to mouse translation.
+
+- QTBUG-32513: Crash fix when changing image source repeatedly.
+
+- QTBUG-32750: Fix over-clipping text on smaller fonts.
+
****************************************************************************
* Database Drivers *
****************************************************************************
@@ -93,6 +153,8 @@ QtQuick
* Tools *
****************************************************************************
+- qmltestrunner: qtest context property is deprecated. Use QTestRootObject
+ from Qt.test.qtestroot instead.
****************************************************************************
* Plugins *
@@ -100,6 +162,17 @@ QtQuick
- A new experimental QML Settings type provides means for applications to
manage persistent settings in a platform-independent manner. The type is
- made available by importing the Qt.labs.settings module. Note: types in
+ made available by importing the Qt.labs.settings 1.0 module. Note: types in
the Qt.labs module are not guaranteed to remain compatible in future
versions.
+
+- Qt.labs.folderlistmodel FolderListModel type gained showFiles and
+ showHidden properties in Qt.labs.folderlistmodel 2.1.
+
+- QML-backed plugins, like QtQuick.Dialogs, now only deploy QML files in debug
+ mode. In release mode QML files are built into the plugin and referenced via
+ qrc URLs.
+
+- New FontDialog and MessageDialog types available in QtQuick.Dialogs 1.1
+
+- ColorDialog added currentColor property in QtQuick.Dialogs 1.1
diff --git a/examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.pro b/examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.pro
index 8ed66f8b66..c28664ea51 100644
--- a/examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.pro
+++ b/examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.pro
@@ -3,3 +3,13 @@ QT += qml quick
HEADERS += piechart.h
SOURCES += piechart.cpp \
main.cpp
+
+RESOURCES += chapter1-basics.qrc
+
+DESTPATH = $$[QT_INSTALL_EXAMPLES]/qml/tutorials/extending/chapter1-basics
+target.path = $$DESTPATH
+
+qml.files = *.qml
+qml.path = $$DESTPATH
+
+INSTALLS += target qml
diff --git a/examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.qrc b/examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.qrc
new file mode 100644
index 0000000000..f1168aef3b
--- /dev/null
+++ b/examples/qml/tutorials/extending/chapter1-basics/chapter1-basics.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>app.qml</file>
+ </qresource>
+</RCC>
diff --git a/examples/qml/tutorials/extending/chapter1-basics/main.cpp b/examples/qml/tutorials/extending/chapter1-basics/main.cpp
index d30628fd5a..4e719d2722 100644
--- a/examples/qml/tutorials/extending/chapter1-basics/main.cpp
+++ b/examples/qml/tutorials/extending/chapter1-basics/main.cpp
@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
QQuickView view;
view.setResizeMode(QQuickView::SizeRootObjectToView);
- view.setSource(QUrl::fromLocalFile("app.qml"));
+ view.setSource(QUrl("qrc:///app.qml"));
view.show();
return app.exec();
}
diff --git a/examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.pro b/examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.pro
index 8ed66f8b66..a451c775cf 100644
--- a/examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.pro
+++ b/examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.pro
@@ -3,3 +3,13 @@ QT += qml quick
HEADERS += piechart.h
SOURCES += piechart.cpp \
main.cpp
+
+RESOURCES += chapter2-methods.qrc
+
+DESTPATH = $$[QT_INSTALL_EXAMPLES]/qml/tutorials/extending/chapter2-methods
+target.path = $$DESTPATH
+
+qml.files = *.qml
+qml.path = $$DESTPATH
+
+INSTALLS += target qml
diff --git a/examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.qrc b/examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.qrc
new file mode 100644
index 0000000000..f1168aef3b
--- /dev/null
+++ b/examples/qml/tutorials/extending/chapter2-methods/chapter2-methods.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>app.qml</file>
+ </qresource>
+</RCC>
diff --git a/examples/qml/tutorials/extending/chapter2-methods/main.cpp b/examples/qml/tutorials/extending/chapter2-methods/main.cpp
index d30628fd5a..4e719d2722 100644
--- a/examples/qml/tutorials/extending/chapter2-methods/main.cpp
+++ b/examples/qml/tutorials/extending/chapter2-methods/main.cpp
@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
QQuickView view;
view.setResizeMode(QQuickView::SizeRootObjectToView);
- view.setSource(QUrl::fromLocalFile("app.qml"));
+ view.setSource(QUrl("qrc:///app.qml"));
view.show();
return app.exec();
}
diff --git a/examples/qml/tutorials/extending/chapter3-bindings/chapter3-binding.qrc b/examples/qml/tutorials/extending/chapter3-bindings/chapter3-binding.qrc
new file mode 100644
index 0000000000..f1168aef3b
--- /dev/null
+++ b/examples/qml/tutorials/extending/chapter3-bindings/chapter3-binding.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>app.qml</file>
+ </qresource>
+</RCC>
diff --git a/examples/qml/tutorials/extending/chapter3-bindings/chapter3-bindings.pro b/examples/qml/tutorials/extending/chapter3-bindings/chapter3-bindings.pro
index 8ed66f8b66..6193f466c1 100644
--- a/examples/qml/tutorials/extending/chapter3-bindings/chapter3-bindings.pro
+++ b/examples/qml/tutorials/extending/chapter3-bindings/chapter3-bindings.pro
@@ -3,3 +3,13 @@ QT += qml quick
HEADERS += piechart.h
SOURCES += piechart.cpp \
main.cpp
+
+RESOURCES += chapter3-binding.qrc
+
+DESTPATH = $$[QT_INSTALL_EXAMPLES]/qml/tutorials/extending/chapter3-binding
+target.path = $$DESTPATH
+
+qml.files = *.qml
+qml.path = $$DESTPATH
+
+INSTALLS += target qml
diff --git a/examples/qml/tutorials/extending/chapter3-bindings/main.cpp b/examples/qml/tutorials/extending/chapter3-bindings/main.cpp
index d30628fd5a..4e719d2722 100644
--- a/examples/qml/tutorials/extending/chapter3-bindings/main.cpp
+++ b/examples/qml/tutorials/extending/chapter3-bindings/main.cpp
@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
QQuickView view;
view.setResizeMode(QQuickView::SizeRootObjectToView);
- view.setSource(QUrl::fromLocalFile("app.qml"));
+ view.setSource(QUrl("qrc:///app.qml"));
view.show();
return app.exec();
}
diff --git a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro
index 23eb222ea3..6d5c7acb6c 100644
--- a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro
+++ b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.pro
@@ -5,3 +5,13 @@ HEADERS += piechart.h \
SOURCES += piechart.cpp \
pieslice.cpp \
main.cpp
+
+RESOURCES += chapter4-customPropertyTypes.qrc
+
+DESTPATH = $$[QT_INSTALL_EXAMPLES]/qml/tutorials/extending/chapter4-customPropertyTypes
+target.path = $$DESTPATH
+
+qml.files = *.qml
+qml.path = $$DESTPATH
+
+INSTALLS += target qml
diff --git a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.qrc b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.qrc
new file mode 100644
index 0000000000..f1168aef3b
--- /dev/null
+++ b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/chapter4-customPropertyTypes.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>app.qml</file>
+ </qresource>
+</RCC>
diff --git a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/main.cpp b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/main.cpp
index 5b6e1cf451..fc59a11987 100644
--- a/examples/qml/tutorials/extending/chapter4-customPropertyTypes/main.cpp
+++ b/examples/qml/tutorials/extending/chapter4-customPropertyTypes/main.cpp
@@ -57,7 +57,7 @@ int main(int argc, char *argv[])
QQuickView view;
view.setResizeMode(QQuickView::SizeRootObjectToView);
- view.setSource(QUrl::fromLocalFile("app.qml"));
+ view.setSource(QUrl("qrc:///app.qml"));
view.show();
return app.exec();
diff --git a/examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro b/examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro
index 23eb222ea3..7cc2b40488 100644
--- a/examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro
+++ b/examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.pro
@@ -5,3 +5,13 @@ HEADERS += piechart.h \
SOURCES += piechart.cpp \
pieslice.cpp \
main.cpp
+
+RESOURCES += chapter5-listproperties.qrc
+
+DESTPATH = $$[QT_INSTALL_EXAMPLES]/qml/tutorials/extending/chapter5-listproperties
+target.path = $$DESTPATH
+
+qml.files = *.qml
+qml.path = $$DESTPATH
+
+INSTALLS += target qml
diff --git a/examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.qrc b/examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.qrc
new file mode 100644
index 0000000000..f1168aef3b
--- /dev/null
+++ b/examples/qml/tutorials/extending/chapter5-listproperties/chapter5-listproperties.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>app.qml</file>
+ </qresource>
+</RCC>
diff --git a/examples/qml/tutorials/extending/chapter5-listproperties/main.cpp b/examples/qml/tutorials/extending/chapter5-listproperties/main.cpp
index f8826f6c31..8a4afcf96d 100644
--- a/examples/qml/tutorials/extending/chapter5-listproperties/main.cpp
+++ b/examples/qml/tutorials/extending/chapter5-listproperties/main.cpp
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
QQuickView view;
view.setResizeMode(QQuickView::SizeRootObjectToView);
- view.setSource(QUrl::fromLocalFile("app.qml"));
+ view.setSource(QUrl("qrc:///app.qml"));
view.show();
return app.exec();
}
diff --git a/examples/qml/tutorials/extending/chapter6-plugins/app.pro b/examples/qml/tutorials/extending/chapter6-plugins/app.pro
new file mode 100644
index 0000000000..c55db00d27
--- /dev/null
+++ b/examples/qml/tutorials/extending/chapter6-plugins/app.pro
@@ -0,0 +1,10 @@
+TARGET = chapter6-plugins
+QT += qml quick
+
+# Avoid going to debug/release subdirectory
+# so that our application will see the
+# import path for the Charts module.
+win32: DESTDIR = ./
+
+SOURCES += main.cpp
+RESOURCES += app.qrc
diff --git a/examples/qml/tutorials/extending/chapter6-plugins/app.qrc b/examples/qml/tutorials/extending/chapter6-plugins/app.qrc
new file mode 100644
index 0000000000..f1168aef3b
--- /dev/null
+++ b/examples/qml/tutorials/extending/chapter6-plugins/app.qrc
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/">
+ <file>app.qml</file>
+ </qresource>
+</RCC>
diff --git a/examples/qml/tutorials/extending/chapter6-plugins/chapter6-plugins.pro b/examples/qml/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
index 6bf44b4d15..f858c80876 100644
--- a/examples/qml/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
+++ b/examples/qml/tutorials/extending/chapter6-plugins/chapter6-plugins.pro
@@ -1,18 +1,5 @@
-TEMPLATE = lib
-CONFIG += plugin
-QT += qml quick
-
-DESTDIR = Charts
-TARGET = chartsplugin
-
-OBJECTS_DIR = tmp
-MOC_DIR = tmp
-
-HEADERS += piechart.h \
- pieslice.h \
- chartsplugin.h
-
-SOURCES += piechart.cpp \
- pieslice.cpp \
- chartsplugin.cpp
-
+TEMPLATE = subdirs
+CONFIG += ordered
+SUBDIRS = \
+ import \
+ app.pro
diff --git a/examples/qml/tutorials/extending/chapter6-plugins/chartsplugin.cpp b/examples/qml/tutorials/extending/chapter6-plugins/import/chartsplugin.cpp
index fea4c1aa85..fea4c1aa85 100644
--- a/examples/qml/tutorials/extending/chapter6-plugins/chartsplugin.cpp
+++ b/examples/qml/tutorials/extending/chapter6-plugins/import/chartsplugin.cpp
diff --git a/examples/qml/tutorials/extending/chapter6-plugins/chartsplugin.h b/examples/qml/tutorials/extending/chapter6-plugins/import/chartsplugin.h
index d768306967..d768306967 100644
--- a/examples/qml/tutorials/extending/chapter6-plugins/chartsplugin.h
+++ b/examples/qml/tutorials/extending/chapter6-plugins/import/chartsplugin.h
diff --git a/examples/qml/tutorials/extending/chapter6-plugins/import/import.pro b/examples/qml/tutorials/extending/chapter6-plugins/import/import.pro
new file mode 100644
index 0000000000..83cfb96ab5
--- /dev/null
+++ b/examples/qml/tutorials/extending/chapter6-plugins/import/import.pro
@@ -0,0 +1,26 @@
+TEMPLATE = lib
+CONFIG += plugin
+QT += qml quick
+
+DESTDIR = ../Charts
+TARGET = $$qtLibraryTarget(chartsplugin)
+
+HEADERS += piechart.h \
+ pieslice.h \
+ chartsplugin.h
+
+SOURCES += piechart.cpp \
+ pieslice.cpp \
+ chartsplugin.cpp
+
+DESTPATH=$$[QT_INSTALL_EXAMPLES]/qml/tutorials/extending/chapter6-plugins/Charts
+
+target.path=$$DESTPATH
+qmldir.files=$$PWD/qmldir
+qmldir.path=$$DESTPATH
+INSTALLS += target qmldir
+
+OTHER_FILES += qmldir
+
+# Copy the qmldir file to the same folder as the plugin binary
+QMAKE_POST_LINK += $$QMAKE_COPY $$replace($$list($$quote($$PWD/qmldir) $$DESTDIR), /, $$QMAKE_DIR_SEP)
diff --git a/examples/qml/tutorials/extending/chapter6-plugins/piechart.cpp b/examples/qml/tutorials/extending/chapter6-plugins/import/piechart.cpp
index 295bb8961d..295bb8961d 100644
--- a/examples/qml/tutorials/extending/chapter6-plugins/piechart.cpp
+++ b/examples/qml/tutorials/extending/chapter6-plugins/import/piechart.cpp
diff --git a/examples/qml/tutorials/extending/chapter6-plugins/piechart.h b/examples/qml/tutorials/extending/chapter6-plugins/import/piechart.h
index b37bcdd411..b37bcdd411 100644
--- a/examples/qml/tutorials/extending/chapter6-plugins/piechart.h
+++ b/examples/qml/tutorials/extending/chapter6-plugins/import/piechart.h
diff --git a/examples/qml/tutorials/extending/chapter6-plugins/pieslice.cpp b/examples/qml/tutorials/extending/chapter6-plugins/import/pieslice.cpp
index 52b409aa22..52b409aa22 100644
--- a/examples/qml/tutorials/extending/chapter6-plugins/pieslice.cpp
+++ b/examples/qml/tutorials/extending/chapter6-plugins/import/pieslice.cpp
diff --git a/examples/qml/tutorials/extending/chapter6-plugins/pieslice.h b/examples/qml/tutorials/extending/chapter6-plugins/import/pieslice.h
index 0b488b4835..0b488b4835 100644
--- a/examples/qml/tutorials/extending/chapter6-plugins/pieslice.h
+++ b/examples/qml/tutorials/extending/chapter6-plugins/import/pieslice.h
diff --git a/examples/qml/tutorials/extending/chapter6-plugins/Charts/qmldir b/examples/qml/tutorials/extending/chapter6-plugins/import/qmldir
index d9e8471b3c..d9e8471b3c 100644
--- a/examples/qml/tutorials/extending/chapter6-plugins/Charts/qmldir
+++ b/examples/qml/tutorials/extending/chapter6-plugins/import/qmldir
diff --git a/examples/qml/tutorials/extending/chapter6-plugins/main.cpp b/examples/qml/tutorials/extending/chapter6-plugins/main.cpp
new file mode 100644
index 0000000000..60d8c6cd7a
--- /dev/null
+++ b/examples/qml/tutorials/extending/chapter6-plugins/main.cpp
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+//![0]
+#include <QtQuick/QQuickView>
+#include <QGuiApplication>
+
+int main(int argc, char *argv[])
+{
+ QGuiApplication app(argc, argv);
+ QQuickView view;
+ view.setResizeMode(QQuickView::SizeRootObjectToView);
+ view.setSource(QUrl("qrc:///app.qml"));
+ view.show();
+ return app.exec();
+}
+//![0]
diff --git a/src/qml/doc/qtqml.qdocconf b/src/qml/doc/qtqml.qdocconf
index 1b11fa1bf7..74aaae7724 100644
--- a/src/qml/doc/qtqml.qdocconf
+++ b/src/qml/doc/qtqml.qdocconf
@@ -48,6 +48,10 @@ exampledirs += ../../../examples/qml \
imagedirs += images
+# Add a thumbnail for examples that do not have images
+manifestmeta.thumbnail.names += "QtQml/Chapter 4*" \
+ "QtQml/Chapter 6*"
+
navigation.landingpage = "Qt QML"
navigation.cppclassespage = "Qt QML C++ Classes"
navigation.qmltypespage = "Qt QML QML Types"
diff --git a/src/qml/doc/src/cppintegration/extending-tutorial.qdoc b/src/qml/doc/src/cppintegration/extending-tutorial.qdoc
index d0fb03a03c..ecfcf8f106 100644
--- a/src/qml/doc/src/cppintegration/extending-tutorial.qdoc
+++ b/src/qml/doc/src/cppintegration/extending-tutorial.qdoc
@@ -397,36 +397,50 @@ The complete code can be seen in the updated \c examples/qml/tutorials/extending
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
way to use our QML extension is to create a plugin library to make it available
-to the QML engine. This would allow the \c PieChart and \c PieSlice types to be
-registered into a type namespace which could be imported by any QML application,
-instead of restricting these types to be only used by the one application.
+to the QML engine as a new QML import module. This allows the \c PieChart and
+\c PieSlice types to be registered into a type namespace which can be imported
+by any QML application, instead of restricting these types to be only used by
+the one application.
-The setps for creating a plugin are described in \l {Creating C++ Plugins for QML}.
+The steps for creating a plugin are described in \l {Creating C++ Plugins for QML}.
To start with, we create a plugin class named \c ChartsPlugin. It subclasses QQmlExtensionPlugin
and registers our QML types in the inherited \l{QQmlExtensionPlugin::}{registerTypes()} method.
Here is the \c ChartsPlugin definition in \c chartsplugin.h:
-\snippet tutorials/extending/chapter6-plugins/chartsplugin.h 0
+\snippet tutorials/extending/chapter6-plugins/import/chartsplugin.h 0
And its implementation in \c chartsplugin.cpp:
-\snippet tutorials/extending/chapter6-plugins/chartsplugin.cpp 0
+\snippet tutorials/extending/chapter6-plugins/import/chartsplugin.cpp 0
Then, we write a \c .pro project file that defines the project as a plugin library
-and specifies with DESTDIR that library files should be built into a "lib" subdirectory:
+and specifies with DESTDIR that library files should be built into a \c {../Charts}
+directory.
-\quotefile tutorials/extending/chapter6-plugins/chapter6-plugins.pro
+\quotefile tutorials/extending/chapter6-plugins/import/import.pro
-Finally, we add a \l{qtqml-modules-qmldir.html}{qmldir} file that is
-parsed by the QML engine. In this file, we specify that a plugin named
-"chapter6-plugin" (the name of the example project) can be found in the "lib" subdirectory:
+In this example, the \c Charts directory is located at the same level as the application
+that uses our new import module. This way, the QML engine will find our module
+as the default search path for QML imports includes the directory of the application
+executable. Alternatively, we could control what directories the \l {QML Import Path}
+{QML import path} contains, useful if there are multiple QML applications using the
+same QML imports.
-\quotefile tutorials/extending/chapter6-plugins/Charts/qmldir
+The \c .pro file also contains additional magic to ensure that the
+\l {Module Definition qmldir Files}{module definition qmldir file} is always copied
+to the same location as the plugin binary.
-Now we have a plugin, and instead of having a main.cpp and an executable, we can build
-the project and then load the QML file using the \l{Prototyping with qmlscene}{qmlscene tool},
-setting the import path to the current directory so that it finds the \c qmldir file:
+The \c qmldir file declares the module name and the plugin that is made available
+by the module:
+
+\quotefile tutorials/extending/chapter6-plugins/import/qmldir
+
+Now we have a QML module that can be imported to any application, provided that the
+QML engine knows where to find it. The example contains an executable that loads
+\c app.qml, which uses the \c {import Charts 1.0} statement. Alternatively, you can
+load the QML file using the \l{Prototyping with qmlscene}{qmlscene tool}, setting the
+import path to the current directory so that it finds the \c qmldir file:
\code
qmlscene -I . app.qml
@@ -434,7 +448,6 @@ setting the import path to the current directory so that it finds the \c qmldir
The module "Charts" will be loaded by the QML engine, and the types provided by that
module will be available for use in any QML document which imports it.
-
*/
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index c11bf904be..a0329f7afc 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -7012,7 +7012,10 @@ bool QQuickItem::event(QEvent *ev)
} else
#endif // QT_NO_IM
if (ev->type() == QEvent::StyleAnimationUpdate) {
- update();
+ if (isVisible()) {
+ ev->accept();
+ update();
+ }
return true;
}
return QObject::event(ev);
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index d62bf8efa1..ad904a2579 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -297,44 +297,6 @@ qreal QQuickTextPrivate::getImplicitHeight() const
return implicitHeight;
}
-/*!
- \qmlproperty enumeration QtQuick::Text::renderType
-
- Override the default rendering type for this component.
-
- Supported render types are:
- \list
- \li Text.QtRendering - the default
- \li Text.NativeRendering
- \endlist
-
- Select Text.NativeRendering if you prefer text to look native on the target platform and do
- not require advanced features such as transformation of the text. Using such features in
- combination with the NativeRendering render type will lend poor and sometimes pixelated
- results.
-
- On HighDpi "retina" displays and mobile and embedded platforms, this property is ignored
- and QtRendering is always used.
-*/
-QQuickText::RenderType QQuickText::renderType() const
-{
- Q_D(const QQuickText);
- return d->renderType;
-}
-
-void QQuickText::setRenderType(QQuickText::RenderType renderType)
-{
- Q_D(QQuickText);
- if (d->renderType == renderType)
- return;
-
- d->renderType = renderType;
- emit renderTypeChanged();
-
- if (isComponentComplete())
- d->updateLayout();
-}
-
void QQuickText::q_imagesLoaded()
{
Q_D(QQuickText);
@@ -641,17 +603,6 @@ void QQuickTextLine::setY(qreal y)
m_line->setPosition(QPointF(m_line->x(), y));
}
-/*!
- \qmlmethod QtQuick::Text::doLayout()
-
- Triggers a re-layout of the displayed text.
-*/
-void QQuickText::doLayout()
-{
- Q_D(QQuickText);
- d->updateSize();
-}
-
bool QQuickTextPrivate::isLineLaidOutConnected()
{
Q_Q(QQuickText);
@@ -2665,4 +2616,53 @@ void QQuickText::hoverLeaveEvent(QHoverEvent *event)
d->processHoverEvent(event);
}
+/*!
+ \qmlproperty enumeration QtQuick::Text::renderType
+
+ Override the default rendering type for this component.
+
+ Supported render types are:
+ \list
+ \li Text.QtRendering - the default
+ \li Text.NativeRendering
+ \endlist
+
+ Select Text.NativeRendering if you prefer text to look native on the target platform and do
+ not require advanced features such as transformation of the text. Using such features in
+ combination with the NativeRendering render type will lend poor and sometimes pixelated
+ results.
+
+ On HighDpi "retina" displays and mobile and embedded platforms, this property is ignored
+ and QtRendering is always used.
+*/
+QQuickText::RenderType QQuickText::renderType() const
+{
+ Q_D(const QQuickText);
+ return d->renderType;
+}
+
+void QQuickText::setRenderType(QQuickText::RenderType renderType)
+{
+ Q_D(QQuickText);
+ if (d->renderType == renderType)
+ return;
+
+ d->renderType = renderType;
+ emit renderTypeChanged();
+
+ if (isComponentComplete())
+ d->updateLayout();
+}
+
+/*!
+ \qmlmethod QtQuick::Text::doLayout()
+
+ Triggers a re-layout of the displayed text.
+*/
+void QQuickText::doLayout()
+{
+ Q_D(QQuickText);
+ d->updateSize();
+}
+
QT_END_NAMESPACE
diff --git a/src/quick/items/qquickwindowmodule.cpp b/src/quick/items/qquickwindowmodule.cpp
index b91edc2fd5..cd1b68991d 100644
--- a/src/quick/items/qquickwindowmodule.cpp
+++ b/src/quick/items/qquickwindowmodule.cpp
@@ -45,12 +45,50 @@
#include <QtCore/QCoreApplication>
#include <QtQml/QQmlEngine>
+#include <private/qguiapplication_p.h>
+#include <private/qqmlengine_p.h>
+#include <qpa/qplatformintegration.h>
+
QT_BEGIN_NAMESPACE
class QQuickWindowQmlImpl : public QQuickWindow, public QQmlParserStatus
{
Q_INTERFACES(QQmlParserStatus)
Q_OBJECT
+
+ Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged)
+ Q_PROPERTY(Visibility visibility READ visibility WRITE setVisibility NOTIFY visibilityChanged)
+
+public:
+ QQuickWindowQmlImpl(QWindow *parent = 0)
+ : QQuickWindow(parent)
+ , m_complete(false)
+ , m_visible(isVisible())
+ , m_visibility(AutomaticVisibility)
+ {
+ connect(this, &QWindow::visibleChanged, this, &QQuickWindowQmlImpl::visibleChanged);
+ connect(this, &QWindow::visibilityChanged, this, &QQuickWindowQmlImpl::visibilityChanged);
+ }
+
+ void setVisible(bool visible) {
+ if (!m_complete)
+ m_visible = visible;
+ else
+ QQuickWindow::setVisible(visible);
+ }
+
+ void setVisibility(Visibility visibility)
+ {
+ if (!m_complete)
+ m_visibility = visibility;
+ else
+ QQuickWindow::setVisibility(m_visibility);
+ }
+
+Q_SIGNALS:
+ void visibleChanged(bool arg);
+ void visibilityChanged(QWindow::Visibility visibility);
+
protected:
void classBegin() {
//Give QQuickView behavior when created from QML with QQmlApplicationEngine
@@ -61,7 +99,47 @@ protected:
}
}
- void componentComplete() {}
+ void componentComplete() {
+ m_complete = true;
+
+ // We have deferred window creation until we have the full picture of what
+ // the user wanted in terms of window state, geometry, visibility, etc.
+
+ if ((m_visibility == Hidden && m_visible) || (m_visibility > AutomaticVisibility && !m_visible)) {
+ QQmlData *data = QQmlData::get(this);
+ Q_ASSERT(data && data->context);
+
+ QQmlError error;
+ error.setObject(this);
+
+ const QQmlContextData* urlContext = data->context;
+ while (urlContext && urlContext->url.isEmpty())
+ urlContext = urlContext->parent;
+ error.setUrl(urlContext ? urlContext->url : QUrl());
+
+ QString objectId = data->context->findObjectId(this);
+ if (!objectId.isEmpty())
+ error.setDescription(QCoreApplication::translate("QQuickWindowQmlImpl",
+ "Conflicting properties 'visible' and 'visibility' for Window '%1'").arg(objectId));
+ else
+ error.setDescription(QCoreApplication::translate("QQuickWindowQmlImpl",
+ "Conflicting properties 'visible' and 'visibility'"));
+
+ QQmlEnginePrivate::get(data->context->engine)->warning(error);
+ }
+
+ if (m_visibility == AutomaticVisibility) {
+ setWindowState(QGuiApplicationPrivate::platformIntegration()->defaultWindowState(flags()));
+ setVisible(m_visible);
+ } else {
+ setVisibility(m_visibility);
+ }
+ }
+
+private:
+ bool m_complete;
+ bool m_visible;
+ Visibility m_visibility;
};
void QQuickWindowModule::defineModule()
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
index 79b5de72c0..676efe84bc 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
@@ -590,15 +590,18 @@ void Element::computeBounds()
}
bounds.map(*node->matrix());
- if (!qIsFinite(bounds.tl.x))
+ if (!qIsFinite(bounds.tl.x) || bounds.tl.x == FLT_MAX)
bounds.tl.x = -FLT_MAX;
- if (!qIsFinite(bounds.tl.y))
+ if (!qIsFinite(bounds.tl.y) || bounds.tl.y == FLT_MAX)
bounds.tl.y = -FLT_MAX;
- if (!qIsFinite(bounds.br.x))
+ if (!qIsFinite(bounds.br.x) || bounds.br.x == -FLT_MAX)
bounds.br.x = FLT_MAX;
- if (!qIsFinite(bounds.br.y))
+ if (!qIsFinite(bounds.br.y) || bounds.br.y == -FLT_MAX)
bounds.br.y = FLT_MAX;
+ Q_ASSERT(bounds.tl.x <= bounds.br.x);
+ Q_ASSERT(bounds.tl.y <= bounds.br.y);
+
boundsOutsideFloatRange = bounds.isOutsideFloatRange();
}
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
index 95e111552d..5404b669a0 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer_p.h
@@ -104,8 +104,6 @@ struct Rect {
tl.y = pt.y;
if (pt.y > br.y)
br.y = pt.y;
- Q_ASSERT(tl.x <= br.x);
- Q_ASSERT(tl.y <= br.y);
}
void operator |= (const Rect &r) {
@@ -117,8 +115,6 @@ struct Rect {
br.x = r.br.x;
if (r.br.y > br.y)
br.y = r.br.y;
- Q_ASSERT(tl.x <= br.x);
- Q_ASSERT(tl.y <= br.y);
}
void map(const QMatrix4x4 &m);
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index bfd24e727a..2759d82e77 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -817,7 +817,6 @@ void QSGThreadedRenderLoop::show(QQuickWindow *window)
win.thread = new QSGRenderThread(this, QQuickWindowPrivate::get(window)->context);
win.timerId = 0;
win.updateDuringSync = false;
- win.gotBrokenExposeFromPlatformPlugin = false;
m_windows << win;
}
@@ -883,19 +882,6 @@ void QSGThreadedRenderLoop::exposureChanged(QQuickWindow *window)
}
}
-void QSGThreadedRenderLoop::resize(QQuickWindow *window)
-{
- Window *w = windowFor(m_windows, window);
- if (w
- && w->gotBrokenExposeFromPlatformPlugin
- && window->width() > 0 && window->height() > 0
- && w->window->geometry().intersects(w->window->screen()->availableGeometry())) {
- w->gotBrokenExposeFromPlatformPlugin = false;
- handleExposure(w);
- }
-}
-
-
/*!
Will post an event to the render thread that this window should
start to render.
@@ -909,8 +895,6 @@ void QSGThreadedRenderLoop::handleExposure(Window *w)
#ifndef QT_NO_DEBUG
qWarning("QSGThreadedRenderLoop: expose event received for window with invalid geometry.");
#endif
- w->gotBrokenExposeFromPlatformPlugin = true;
- return;
}
// Because we are going to bind a GL context to it, make sure it
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop_p.h b/src/quick/scenegraph/qsgthreadedrenderloop_p.h
index 844d180788..5943d0bd08 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop_p.h
+++ b/src/quick/scenegraph/qsgthreadedrenderloop_p.h
@@ -60,7 +60,6 @@ public:
void show(QQuickWindow *window);
void hide(QQuickWindow *window);
- void resize(QQuickWindow *window);
void windowDestroyed(QQuickWindow *window);
void exposureChanged(QQuickWindow *window);
@@ -90,7 +89,6 @@ private:
QSGRenderThread *thread;
int timerId;
uint updateDuringSync : 1;
- uint gotBrokenExposeFromPlatformPlugin : 1;
};
friend class QSGRenderThread;
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index 984881c8da..b09f80a634 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -304,6 +304,7 @@ private slots:
void qmlCreation();
void clearColor();
+ void defaultState();
void grab_data();
void grab();
@@ -955,6 +956,25 @@ void tst_qquickwindow::clearColor()
QCOMPARE(window->color(), QColor(Qt::blue));
}
+void tst_qquickwindow::defaultState()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.setData("import QtQuick 2.0; import QtQuick.Window 2.1; Window { }", QUrl());
+ QObject *created = component.create();
+ QScopedPointer<QObject> cleanup(created);
+ QVERIFY(created);
+
+ QQuickWindow *qmlWindow = qobject_cast<QQuickWindow*>(created);
+ QVERIFY(qmlWindow);
+
+ QQuickWindow cppWindow;
+ cppWindow.show();
+ QTest::qWaitForWindowExposed(&cppWindow);
+
+ QCOMPARE(qmlWindow->windowState(), cppWindow.windowState());
+}
+
void tst_qquickwindow::grab_data()
{
QTest::addColumn<bool>("visible");
diff --git a/tools/qmljs/qmljs.pro b/tools/qmljs/qmljs.pro
index 3f984951f3..bbffb4eb05 100644
--- a/tools/qmljs/qmljs.pro
+++ b/tools/qmljs/qmljs.pro
@@ -1,5 +1,6 @@
TEMPLATE = app
QT = qml-private core-private
+CONFIG += no_import_scan
SOURCES = main.cpp
include($$PWD/../../src/3rdparty/masm/masm-defs.pri)