aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/HACKING2
-rw-r--r--src/imports/window/plugins.qmltypes65
-rw-r--r--src/imports/xmllistmodel/qqmlxmllistmodel.cpp2
-rw-r--r--src/particles/qquickimageparticle.cpp9
-rw-r--r--src/plugins/accessible/quick/qaccessiblequickview.cpp7
-rw-r--r--src/plugins/accessible/shared/qqmlaccessible.cpp7
-rw-r--r--src/qml/debugger/qqmldebugserver.cpp2
-rw-r--r--src/qml/debugger/qqmldebugserver_p.h2
-rw-r--r--src/qml/debugger/qv8debugservice_p.h5
-rw-r--r--src/qml/doc/src/cppintegration/definetypes.qdoc6
-rw-r--r--src/qml/doc/src/cppintegration/extending-tutorial.qdoc2
-rw-r--r--src/qml/doc/src/cppintegration/topic.qdoc10
-rw-r--r--src/qml/doc/src/javascript/date.qdoc3
-rw-r--r--src/qml/doc/src/javascript/number.qdoc3
-rw-r--r--src/qml/doc/src/javascript/string.qdoc3
-rw-r--r--src/qml/doc/src/qmlfunctions.qdoc12
-rw-r--r--src/qml/doc/src/whatsnew.qdoc3
-rw-r--r--src/qml/qml/qqmlcomponent.cpp90
-rw-r--r--src/qml/qml/qqmlengine.cpp2
-rw-r--r--src/qml/qml/qqmllocale.cpp2
-rw-r--r--src/qml/qml/qqmlvme.cpp3
-rw-r--r--src/qml/types/qqmlbind.cpp2
-rw-r--r--src/qml/types/qqmlconnections.cpp2
-rw-r--r--src/qml/types/qqmldelegatemodel.cpp8
-rw-r--r--src/qml/types/qqmllistmodel.cpp6
-rw-r--r--src/qml/types/qqmlobjectmodel.cpp3
-rw-r--r--src/qml/types/qquickpackage.cpp3
-rw-r--r--src/quick/doc/src/advtutorial.qdoc5
-rw-r--r--src/quick/doc/src/appdevguide/porting.qdoc12
-rw-r--r--src/quick/doc/src/appdevguide/qtquicktest.qdoc1
-rw-r--r--src/quick/doc/src/concepts/effects/particles.qdoc2
-rw-r--r--src/quick/doc/src/concepts/input/focus.qdoc21
-rw-r--r--src/quick/doc/src/dynamicview-tutorial.qdoc5
-rw-r--r--src/quick/doc/src/examples.qdoc1
-rw-r--r--src/quick/doc/src/tutorial.qdoc34
-rw-r--r--src/quick/doc/src/whatsnew.qdoc1
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp2
-rw-r--r--src/quick/items/qquickitem.cpp3
-rw-r--r--src/quick/items/qquickpositioners.cpp44
-rw-r--r--src/quick/items/qquickrepeater.cpp4
-rw-r--r--src/quick/items/qquickrepeater_p_p.h2
-rw-r--r--src/quick/items/qquicktextinput.cpp14
-rw-r--r--src/quick/items/qquicktextnode.cpp6
-rw-r--r--src/quick/items/qquicktextnode_p.h4
-rw-r--r--src/quick/items/qquickwindow.cpp36
-rw-r--r--src/quick/items/qquickwindow_p.h3
-rw-r--r--src/quick/scenegraph/qsgdefaultglyphnode_p.cpp5
-rw-r--r--src/quick/scenegraph/qsgrenderloop.cpp32
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp6
-rw-r--r--src/quick/scenegraph/util/qsgpainternode.cpp31
-rw-r--r--src/quick/util/qquickanimation.cpp2
-rw-r--r--src/quick/util/qquickbehavior.cpp2
-rw-r--r--src/quick/util/qquickpropertychanges.cpp2
-rw-r--r--src/quick/util/qquickstate.cpp2
-rw-r--r--src/quick/util/qquickstategroup.cpp2
-rw-r--r--src/quick/util/qquicktransition.cpp2
-rw-r--r--tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp5
-rw-r--r--tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs.pro2
-rw-r--r--tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp4
-rw-r--r--tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp9
-rw-r--r--tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp9
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp11
-rw-r--r--tests/auto/qml/debugger/shared/debugutil_p.h2
-rw-r--r--tests/auto/qml/qmlmin/tst_qmlmin.cpp2
-rw-r--r--tests/auto/quick/qquickrepeater/data/visualitemmodel.qml23
-rw-r--r--tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp12
-rw-r--r--tools/qmlplugindump/main.cpp8
67 files changed, 322 insertions, 315 deletions
diff --git a/examples/HACKING b/examples/HACKING
index 9539d2d129..7d2a61a481 100644
--- a/examples/HACKING
+++ b/examples/HACKING
@@ -1,4 +1,4 @@
-Some guidelines for QtQml examples
+Some guidelines for Qt QML examples
Snippets
---
diff --git a/src/imports/window/plugins.qmltypes b/src/imports/window/plugins.qmltypes
index ff29466670..b79702edb6 100644
--- a/src/imports/window/plugins.qmltypes
+++ b/src/imports/window/plugins.qmltypes
@@ -3,7 +3,7 @@ import QtQuick.tooling 1.1
// This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only.
//
-// This file was auto-generated with the command 'qmlplugindump QtQuick.Window 2.0'.
+// This file was auto-generated with the command '../../../bin/qmlplugindump.app/Contents/MacOS/qmlplugindump QtQuick.Window 2.1 -notrelocatable'.
Module {
Component {
@@ -22,7 +22,7 @@ Module {
Component {
name: "QQuickScreen"
prototype: "QObject"
- exports: ["Screen 2.0"]
+ exports: ["QtQuick.Window/Screen 2.0"]
attachedType: "QQuickScreenAttached"
}
Component {
@@ -43,10 +43,18 @@ Module {
name: "QQuickWindow"
defaultProperty: "data"
prototype: "QWindow"
- exports: ["Window 2.0"]
+ exports: ["QtQuick.Window/Window 2.0", "QtQuick.Window/Window 2.1"]
+ exportMetaObjectRevisions: [0, 1]
Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
Property { name: "color"; type: "QColor" }
Property { name: "contentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true }
+ Property {
+ name: "activeFocusItem"
+ revision: 1
+ type: "QQuickItem"
+ isReadonly: true
+ isPointer: true
+ }
Signal { name: "frameSwapped" }
Signal { name: "sceneGraphInitialized" }
Signal { name: "sceneGraphInvalidated" }
@@ -57,12 +65,24 @@ Module {
name: "colorChanged"
Parameter { type: "QColor" }
}
+ Signal { name: "activeFocusItemChanged"; revision: 1 }
Method { name: "update" }
Method { name: "releaseResources" }
}
Component {
name: "QWindow"
prototype: "QObject"
+ Enum {
+ name: "Visibility"
+ values: {
+ "Hidden": 0,
+ "AutomaticVisibility": 1,
+ "Windowed": 2,
+ "Minimized": 3,
+ "Maximized": 4,
+ "FullScreen": 5
+ }
+ }
Property { name: "title"; type: "string" }
Property { name: "modality"; type: "Qt::WindowModality" }
Property { name: "flags"; type: "Qt::WindowFlags" }
@@ -70,20 +90,14 @@ Module {
Property { name: "y"; type: "int" }
Property { name: "width"; type: "int" }
Property { name: "height"; type: "int" }
- Property { name: "minimumWidth"; type: "int" }
- Property { name: "minimumHeight"; type: "int" }
- Property { name: "maximumWidth"; type: "int" }
- Property { name: "maximumHeight"; type: "int" }
+ Property { name: "minimumWidth"; revision: 1; type: "int" }
+ Property { name: "minimumHeight"; revision: 1; type: "int" }
+ Property { name: "maximumWidth"; revision: 1; type: "int" }
+ Property { name: "maximumHeight"; revision: 1; type: "int" }
Property { name: "visible"; type: "bool" }
- Property { name: "contentOrientation"; type: "Qt::ScreenOrientation" }
- Property { name: "windowTitle"; type: "string" }
- Property { name: "windowFilePath"; type: "string" }
- Property { name: "windowIcon"; type: "QIcon" }
- Property { name: "windowModality"; type: "Qt::WindowModality" }
- Signal {
- name: "windowModalityChanged"
- Parameter { name: "windowModality"; type: "Qt::WindowModality" }
- }
+ Property { name: "visibility"; revision: 1; type: "Visibility" }
+ Property { name: "contentOrientation"; revision: 1; type: "Qt::ScreenOrientation" }
+ Property { name: "opacity"; revision: 1; type: "double" }
Signal {
name: "screenChanged"
Parameter { name: "screen"; type: "QScreen"; isPointer: true }
@@ -114,18 +128,22 @@ Module {
}
Signal {
name: "minimumWidthChanged"
+ revision: 1
Parameter { name: "arg"; type: "int" }
}
Signal {
name: "minimumHeightChanged"
+ revision: 1
Parameter { name: "arg"; type: "int" }
}
Signal {
name: "maximumWidthChanged"
+ revision: 1
Parameter { name: "arg"; type: "int" }
}
Signal {
name: "maximumHeightChanged"
+ revision: 1
Parameter { name: "arg"; type: "int" }
}
Signal {
@@ -133,13 +151,24 @@ Module {
Parameter { name: "arg"; type: "bool" }
}
Signal {
+ name: "visibilityChanged"
+ revision: 1
+ Parameter { name: "visibility"; type: "QWindow::Visibility" }
+ }
+ Signal {
name: "contentOrientationChanged"
+ revision: 1
Parameter { name: "orientation"; type: "Qt::ScreenOrientation" }
}
Signal {
name: "focusObjectChanged"
Parameter { name: "object"; type: "QObject"; isPointer: true }
}
+ Signal {
+ name: "opacityChanged"
+ revision: 1
+ Parameter { name: "opacity"; type: "double" }
+ }
Method {
name: "setVisible"
Parameter { name: "visible"; type: "bool" }
@@ -175,18 +204,22 @@ Module {
}
Method {
name: "setMinimumWidth"
+ revision: 1
Parameter { name: "w"; type: "int" }
}
Method {
name: "setMinimumHeight"
+ revision: 1
Parameter { name: "h"; type: "int" }
}
Method {
name: "setMaximumWidth"
+ revision: 1
Parameter { name: "w"; type: "int" }
}
Method {
name: "setMaximumHeight"
+ revision: 1
Parameter { name: "h"; type: "int" }
}
}
diff --git a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
index cc2b8d1548..856c063cbb 100644
--- a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
+++ b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
@@ -90,7 +90,7 @@ typedef QPair<int, int> QQuickXmlListRange;
\brief For specifying a role to an XmlListModel
\ingroup qtquick-models
- \sa {QtQml}
+ \sa {Qt QML}
*/
/*!
diff --git a/src/particles/qquickimageparticle.cpp b/src/particles/qquickimageparticle.cpp
index 9a0601b944..0145ce4edb 100644
--- a/src/particles/qquickimageparticle.cpp
+++ b/src/particles/qquickimageparticle.cpp
@@ -1379,6 +1379,15 @@ void QQuickImageParticle::finishBuildParticleNodes()
perfLevel = Deformable;
#endif
+#ifdef Q_OS_MAC
+ // Mac OS X 10.8.3 introduced a bug in the AMD drivers, for at least the 2011 macbook pros,
+ // causing point sprites who read gl_PointCoord in the frag shader to come out as
+ // green-red blobs.
+ if (perfLevel < Deformable && strstr((char *) glGetString(GL_VENDOR), "ATI")) {
+ perfLevel = Deformable;
+ }
+#endif
+
if (perfLevel >= Colored && !m_color.isValid())
m_color = QColor(Qt::white);//Hidden default, but different from unset
diff --git a/src/plugins/accessible/quick/qaccessiblequickview.cpp b/src/plugins/accessible/quick/qaccessiblequickview.cpp
index 4251a80b33..b85f23c48b 100644
--- a/src/plugins/accessible/quick/qaccessiblequickview.cpp
+++ b/src/plugins/accessible/quick/qaccessiblequickview.cpp
@@ -60,8 +60,11 @@ QAccessibleQuickWindow::QAccessibleQuickWindow(QQuickWindow *object)
QQuickItem *QAccessibleQuickWindow::rootItem() const
{
- if (window()->contentItem())
- return window()->contentItem()->childItems().first();
+ if (QQuickItem *ci = window()->contentItem()) {
+ const QList<QQuickItem *> &childItems = ci->childItems();
+ if (!childItems.isEmpty())
+ return childItems.first();
+ }
return 0;
}
diff --git a/src/plugins/accessible/shared/qqmlaccessible.cpp b/src/plugins/accessible/shared/qqmlaccessible.cpp
index c4daa3e014..3ee443c98f 100644
--- a/src/plugins/accessible/shared/qqmlaccessible.cpp
+++ b/src/plugins/accessible/shared/qqmlaccessible.cpp
@@ -129,7 +129,8 @@ QStringList QQmlAccessible::actionNames() const
break;
case QAccessible::RadioButton:
case QAccessible::CheckBox:
- actions << QAccessibleActionInterface::toggleAction();
+ actions << QAccessibleActionInterface::toggleAction()
+ << QAccessibleActionInterface::pressAction();
break;
case QAccessible::Slider:
case QAccessible::SpinBox:
@@ -163,7 +164,9 @@ void QQmlAccessible::doAction(const QString &actionName)
case QAccessible::CheckBox: {
QVariant checked = object()->property("checked");
if (checked.isValid()) {
- if (actionName == QAccessibleActionInterface::toggleAction()) {
+ if (actionName == QAccessibleActionInterface::toggleAction() ||
+ actionName == QAccessibleActionInterface::pressAction()) {
+
object()->setProperty("checked", QVariant(!checked.toBool()));
}
}
diff --git a/src/qml/debugger/qqmldebugserver.cpp b/src/qml/debugger/qqmldebugserver.cpp
index 27e3d226cd..e263343b0d 100644
--- a/src/qml/debugger/qqmldebugserver.cpp
+++ b/src/qml/debugger/qqmldebugserver.cpp
@@ -298,6 +298,7 @@ QQmlDebugServer *QQmlDebugServer::instance()
for (; argsIt != argsItEnd; ++argsIt) {
const QString strArgument = *argsIt;
if (strArgument.startsWith(QLatin1String("port:"))) {
+ pluginName = QLatin1String("qmldbg_tcp");
portFrom = strArgument.mid(5).toInt(&ok);
portTo = portFrom;
QStringList::const_iterator argsNext = argsIt + 1;
@@ -308,7 +309,6 @@ QQmlDebugServer *QQmlDebugServer::instance()
portTo = nextArgument.toInt(&ok);
++argsIt;
}
- pluginName = QLatin1String("qmldbg_tcp");
} else if (strArgument.startsWith(QLatin1String("host:"))) {
hostAddress = strArgument.mid(5);
} else if (strArgument == QLatin1String("block")) {
diff --git a/src/qml/debugger/qqmldebugserver_p.h b/src/qml/debugger/qqmldebugserver_p.h
index 27d54d6947..e285d7cfe7 100644
--- a/src/qml/debugger/qqmldebugserver_p.h
+++ b/src/qml/debugger/qqmldebugserver_p.h
@@ -71,8 +71,6 @@ public:
static QQmlDebugServer *instance();
- void setConnection(QQmlDebugServerConnection *connection);
-
bool hasDebuggingClient() const;
bool blockingMode() const;
diff --git a/src/qml/debugger/qv8debugservice_p.h b/src/qml/debugger/qv8debugservice_p.h
index 00ecf557c3..e6f05a2397 100644
--- a/src/qml/debugger/qv8debugservice_p.h
+++ b/src/qml/debugger/qv8debugservice_p.h
@@ -54,6 +54,11 @@
//
#include "qqmldebugservice_p.h"
+#ifdef Q_OS_WINCE
+# ifdef DebugBreak
+# undef DebugBreak
+# endif
+#endif
#include <private/qv8debug_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/qml/doc/src/cppintegration/definetypes.qdoc b/src/qml/doc/src/cppintegration/definetypes.qdoc
index be5f26a865..b8879ebb04 100644
--- a/src/qml/doc/src/cppintegration/definetypes.qdoc
+++ b/src/qml/doc/src/cppintegration/definetypes.qdoc
@@ -40,7 +40,7 @@ as an instantiable \l{qtqml-typesystem-objecttypes.html}{QML object type} from
QML, or enabling a singleton instance of the class to be imported and used
from QML.
-Additionally, the QtQml module provides mechanisms for implementing QML-specific
+Additionally, the \l {Qt QML} module provides mechanisms for implementing QML-specific
features such as \e{attached properties} and \e{default properties} in C++.
(Note that a number of the important concepts covered in this document are
@@ -133,7 +133,7 @@ not be instantiable
should not be instantiable from QML
\endlist
-The QtQml module provides several methods for registering non-instantiable
+The \l {Qt QML} module provides several methods for registering non-instantiable
types:
\list
@@ -699,7 +699,7 @@ its properties have been set. For example, this may be the case if the
initialization is costly, or if the initialization should not be performed until
all property values have been initialized.
-The QtQml module provides the QQmlParserStatus to be subclass for these
+The \l {Qt QML} module provides the QQmlParserStatus to be subclass for these
purposes. It defines a number of virtual methods that are invoked invoked at
various stages during component instantiation. To receive these notifications, a
C++ class should inherit QQmlParserStatus and also notify the Qt meta system
diff --git a/src/qml/doc/src/cppintegration/extending-tutorial.qdoc b/src/qml/doc/src/cppintegration/extending-tutorial.qdoc
index 3253752e47..ffa36c31ee 100644
--- a/src/qml/doc/src/cppintegration/extending-tutorial.qdoc
+++ b/src/qml/doc/src/cppintegration/extending-tutorial.qdoc
@@ -30,7 +30,7 @@
\title Writing QML Extensions with C++
\brief tutorial about extending QML with Qt C++
-The QtQml C++ module provides a set of APIs for extending QML through
+The \l Qt QML} C++ module provides a set of APIs for extending QML through
C++ extensions. You can write extensions to add your own QML types, extend existing
Qt types, or call C/C++ functions that are not accessible from ordinary QML code.
diff --git a/src/qml/doc/src/cppintegration/topic.qdoc b/src/qml/doc/src/cppintegration/topic.qdoc
index 48f430c919..41645e2379 100644
--- a/src/qml/doc/src/cppintegration/topic.qdoc
+++ b/src/qml/doc/src/cppintegration/topic.qdoc
@@ -29,7 +29,7 @@
\title Integrating QML and C++
\brief Description of how to integrate QML and C++ code
-QML is designed to be easily extensible through C++ code. The classes in the QtQml C++ module
+QML is designed to be easily extensible through C++ code. The classes in the \l {Qt QML} C++ module
enables QML objects to be loaded and manipulated from C++, and the nature of QML engine's
integration with Qt's \l{Meta Object System}{meta object system} enables C++ functionality to be
invoked directly from QML. This allows the development of hybrid applications which are implemented
@@ -43,7 +43,7 @@ with QML and JavaScript within \l{qtqml-documents-topic.html}{QML documents}, an
C++
\li Use and invoke some C++ functionality from QML (for example, to invoke your application logic,
use a data model implemented in C++, or call some functions in a third-party C++ library)
-\li Access functionality in the QtQml or QtQuick C++ API (for example, to dynamically generate
+\li Access functionality in the \l {Qt QML} or QtQuick C++ API (for example, to dynamically generate
images using QQuickImageProvider)
\li Implement your own \l{qtqml-typesystem-objecttypes.html}{QML object types} from C++
\unicode{0x2014} whether for use within your own specific application, or for distribution to others
@@ -71,7 +71,7 @@ methods and signals to be accessed from QML
These are the most common methods of accessing C++ functionality from QML code; for more options and
details, see the main documentation pages that are described in the sections further below.
-Additionally, aside from the ability to access C++ functionality from QML, the Qt QML module also
+Additionally, aside from the ability to access C++ functionality from QML, the \l {Qt QML} module also
provides ways to do the reverse and manipulate QML objects from C++ code. See
\l{qtqml-cppintegration-interactqmlfromcpp.html}{Interacting with QML Objects from C++} for more
details.
@@ -104,7 +104,7 @@ registered for other purposes: for example, it could be registered as a \e {Sing
single class instance to be imported by QML code, or it could be registered to enable the
enumeration values of a non-instantiable class to be accessible from QML.
-Additionally, the QtQml module provides mechanisms to define QML types that integrate with QML
+Additionally, the \l {Qt QML} module provides mechanisms to define QML types that integrate with QML
concepts like attached properties and default properties.
For more information on registering and creating custom QML types from C++, see the \l
@@ -115,7 +115,7 @@ For more information on registering and creating custom QML types from C++, see
C++ objects and values can be embedded directly into the context (or \e scope) of loaded QML objects
using \e {context properties} and \e {context objects}. This is achieved through the QQmlContext
-class provided by the QtQml module, which exposes data to the context of a QML component, allowing
+class provided by the \l {Qt QML} module, which exposes data to the context of a QML component, allowing
data to be injected from C++ into QML.
See \l{qtqml-cppintegration-contextproperties.html}{Embedding C++ Objects into QML with Context
diff --git a/src/qml/doc/src/javascript/date.qdoc b/src/qml/doc/src/javascript/date.qdoc
index 9f696930d2..7da24d4092 100644
--- a/src/qml/doc/src/javascript/date.qdoc
+++ b/src/qml/doc/src/javascript/date.qdoc
@@ -27,7 +27,7 @@
/*!
\qmltype Date
- \inqmlmodule QtQuick 2
+ \inqmlmodule QtQml 2
\brief Provides date functions
The QML Date object extends the JS Date object with
@@ -223,4 +223,3 @@
}
\endcode
*/
-
diff --git a/src/qml/doc/src/javascript/number.qdoc b/src/qml/doc/src/javascript/number.qdoc
index 1e7894f3d1..20fe40c86f 100644
--- a/src/qml/doc/src/javascript/number.qdoc
+++ b/src/qml/doc/src/javascript/number.qdoc
@@ -27,7 +27,7 @@
/*!
\qmltype Number
- \inqmlmodule QtQuick 2
+ \inqmlmodule QtQml 2
\brief The Number object provides represents a number value
The QML Number object extends the JS Number object with
@@ -102,4 +102,3 @@
d = Number.fromLocaleString(german, "1.234") // d == 1234.0
\endcode
*/
-
diff --git a/src/qml/doc/src/javascript/string.qdoc b/src/qml/doc/src/javascript/string.qdoc
index cc3004d93f..ab7d7a4ebe 100644
--- a/src/qml/doc/src/javascript/string.qdoc
+++ b/src/qml/doc/src/javascript/string.qdoc
@@ -27,7 +27,7 @@
/*!
\qmltype String
- \inqmlmodule QtQuick 2
+ \inqmlmodule QtQml 2
\brief The String object represents a string value
The QML String object extends the JS String object with
@@ -48,4 +48,3 @@
console.log(message.arg(count))
\endcode
*/
-
diff --git a/src/qml/doc/src/qmlfunctions.qdoc b/src/qml/doc/src/qmlfunctions.qdoc
index 4a4de0531c..5db275407d 100644
--- a/src/qml/doc/src/qmlfunctions.qdoc
+++ b/src/qml/doc/src/qmlfunctions.qdoc
@@ -222,7 +222,7 @@
Usage:
\code
- // first, define the singleton type provider function (callback).
+ // First, define the singleton type provider function (callback).
static QJSValue *example_qjsvalue_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine)
@@ -233,7 +233,8 @@
return example;
}
- // second, register the singleton type provider with QML by calling this function in an initialization function.
+ // Second, register the singleton type provider with QML by calling this function in an initialization function.
+ #include <QtQml>
...
qmlRegisterSingletonType("Qt.example.qjsvalueApi", 1, 0, "MyApi", example_qjsvalue_singletontype_provider);
...
@@ -299,7 +300,7 @@
Usage:
\code
- // first, define your QObject which provides the functionality.
+ // First, define your QObject which provides the functionality.
class SingletonTypeExample : public QObject
{
Q_OBJECT
@@ -325,7 +326,7 @@
int m_someProperty;
};
- // second, define the singleton type provider function (callback).
+ // Second, define the singleton type provider function (callback).
static QObject *example_qobject_singletontype_provider(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine)
@@ -335,7 +336,8 @@
return example;
}
- // third, register the singleton type provider with QML by calling this function in an initialization function.
+ // Third, register the singleton type provider with QML by calling this function in an initialization function.
+ #include <QtQml>
...
qmlRegisterSingletonType<SingletonTypeExample>("Qt.example.qobjectSingleton", 1, 0, "MyApi", example_qobject_singletontype_provider);
...
diff --git a/src/qml/doc/src/whatsnew.qdoc b/src/qml/doc/src/whatsnew.qdoc
index 361f6e61ee..b73b6436f1 100644
--- a/src/qml/doc/src/whatsnew.qdoc
+++ b/src/qml/doc/src/whatsnew.qdoc
@@ -28,7 +28,6 @@
/*!
\title Qt QML Release Notes
\page qtqml-releasenotes.html
-\inqmlmodule QtQuick 2.0
\section1 Qt QML in Qt 5
@@ -36,7 +35,7 @@ The \l{Qt QML} module is new in Qt 5.0. It provides the QML engine and
implements the QML language supporting infrastructure.
(Prior to Qt 5, this functionality was provided by the QtDeclarative module, which
-has now been replaced by the new QtQml and QtQuick C++ modules. See the
+has now been replaced by the new \l {Qt QML} and QtQuick C++ modules. See the
\l {Porting QML Applications to Qt 5} for more information.)
\section2 QML Engine
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index 5c123a678b..9cb444b75d 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -193,7 +193,7 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject)
\qmltype Component
\instantiates QQmlComponent
\ingroup qml-utility-elements
- \inqmlmodule QtQuick 2
+ \inqmlmodule QtQml 2
\brief Encapsulates a QML component definition
Components are reusable, encapsulated QML types with well-defined interfaces.
@@ -209,7 +209,7 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject)
\snippet qml/component.qml 0
- Notice that while a \l Rectangle by itself would be automatically
+ Notice that while a \l Rectangle by itself would be automatically
rendered and displayed, this is not the case for the above rectangle
because it is defined inside a \c Component. The component encapsulates the
QML types within, as if they were defined in a separate QML
@@ -295,12 +295,12 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject)
}
\endqml
- \sa QtQml
+ \sa {Qt QML}
*/
/*!
\enum QQmlComponent::Status
-
+
Specifies the loading status of the QQmlComponent.
\value Null This QQmlComponent has no data. Call loadUrl() or setData() to add QML content.
@@ -365,8 +365,8 @@ void QQmlComponentPrivate::clear()
typeData->release();
typeData = 0;
}
-
- if (cc) {
+
+ if (cc) {
cc->release();
cc = 0;
}
@@ -541,12 +541,12 @@ QQmlComponent::QQmlComponent(QQmlEngine *engine, const QUrl &url, CompilationMod
}
/*!
- Create a QQmlComponent from the given \a fileName and give it the specified
+ Create a QQmlComponent from the given \a fileName and give it the specified
\a parent and \a engine.
\sa loadUrl()
*/
-QQmlComponent::QQmlComponent(QQmlEngine *engine, const QString &fileName,
+QQmlComponent::QQmlComponent(QQmlEngine *engine, const QString &fileName,
QObject *parent)
: QObject(*(new QQmlComponentPrivate), parent)
{
@@ -600,7 +600,7 @@ void QQmlComponent::setData(const QByteArray &data, const QUrl &url)
d->url = url;
QQmlTypeData *typeData = QQmlEnginePrivate::get(d->engine)->typeLoader.getType(data, url);
-
+
if (typeData->isCompleteOrError()) {
d->fromTypeData(typeData);
} else {
@@ -763,7 +763,7 @@ QQmlComponent::QQmlComponent(QQmlComponentPrivate &dd, QObject *parent)
/*!
Create an object instance from this component. Returns 0 if creation
failed. \a context specifies the context within which to create the object
- instance.
+ instance.
If \a context is 0 (the default), it will create the instance in the
engine' s \l {QQmlEngine::rootContext()}{root context}.
@@ -784,21 +784,21 @@ QObject *QQmlComponent::create(QQmlContext *context)
/*!
This method provides advanced control over component instance creation.
- In general, programmers should use QQmlComponent::create() to create a
+ In general, programmers should use QQmlComponent::create() to create a
component.
Create an object instance from this component. Returns 0 if creation
failed. \a publicContext specifies the context within which to create the object
- instance.
+ instance.
When QQmlComponent constructs an instance, it occurs in three steps:
\list 1
\li The object hierarchy is created, and constant values are assigned.
\li Property bindings are evaluated for the first time.
\li If applicable, QQmlParserStatus::componentComplete() is called on objects.
- \endlist
+ \endlist
QQmlComponent::beginCreate() differs from QQmlComponent::create() in that it
- only performs step 1. QQmlComponent::completeCreate() must be called to
+ only performs step 1. QQmlComponent::completeCreate() must be called to
complete steps 2 and 3.
This breaking point is sometimes useful when using attached properties to
@@ -933,7 +933,7 @@ void QQmlComponentPrivate::complete(QQmlEnginePrivate *enginePriv, ConstructionS
/*!
This method provides advanced control over component instance creation.
- In general, programmers should use QQmlComponent::create() to create a
+ In general, programmers should use QQmlComponent::create() to create a
component.
This function completes the component creation begun with QQmlComponent::beginCreate()
@@ -1027,7 +1027,7 @@ void QQmlComponent::create(QQmlIncubator &incubator, QQmlContext *context,
{
Q_D(QQmlComponent);
- if (!context)
+ if (!context)
context = d->engine->rootContext();
QQmlContextData *contextData = QQmlContextData::get(context);
@@ -1068,17 +1068,17 @@ V8_RESOURCE_TYPE(IncubatorType)
public:
QV8IncubatorResource(QV8Engine *engine, IncubationMode = Asynchronous);
- static v8::Handle<v8::Value> StatusChangedGetter(v8::Local<v8::String>,
+ static v8::Handle<v8::Value> StatusChangedGetter(v8::Local<v8::String>,
const v8::AccessorInfo& info);
- static v8::Handle<v8::Value> StatusGetter(v8::Local<v8::String>,
+ static v8::Handle<v8::Value> StatusGetter(v8::Local<v8::String>,
const v8::AccessorInfo& info);
- static v8::Handle<v8::Value> ObjectGetter(v8::Local<v8::String>,
+ static v8::Handle<v8::Value> ObjectGetter(v8::Local<v8::String>,
const v8::AccessorInfo& info);
- static v8::Handle<v8::Value> ForceCompletionGetter(v8::Local<v8::String>,
+ static v8::Handle<v8::Value> ForceCompletionGetter(v8::Local<v8::String>,
const v8::AccessorInfo& info);
static v8::Handle<v8::Value> ForceCompletion(const v8::Arguments &args);
- static void StatusChangedSetter(v8::Local<v8::String>, v8::Local<v8::Value> value,
+ static void StatusChangedSetter(v8::Local<v8::String>, v8::Local<v8::Value> value,
const v8::AccessorInfo& info);
void dispose();
@@ -1109,7 +1109,7 @@ static void QQmlComponent_setQmlParent(QObject *me, QObject *parent)
needParent = true;
}
}
- if (needParent)
+ if (needParent)
qWarning("QQmlComponent: Created graphical object was not "
"placed in the graphics scene.");
}
@@ -1127,8 +1127,8 @@ static void QQmlComponent_setQmlParent(QObject *me, QObject *parent)
which were not created in QML.
If you wish to create an object without setting a parent, specify \c null for
- the \a parent value. Note that if the returned object is to be displayed, you
- must provide a valid \a parent value or set the returned object's \l{Item::parent}{parent}
+ the \a parent value. Note that if the returned object is to be displayed, you
+ must provide a valid \a parent value or set the returned object's \l{Item::parent}{parent}
property, or else the object will not be visible.
If a \a parent is not provided to createObject(), a reference to the returned object must be held so that
@@ -1168,7 +1168,7 @@ void QQmlComponent::createObject(QQmlV8Function *args)
QObject *parent = 0;
v8::Local<v8::Object> valuemap;
- if (args->Length() >= 1)
+ if (args->Length() >= 1)
parent = args->engine()->toQObject((*args)[0]);
if (args->Length() >= 2) {
@@ -1222,17 +1222,17 @@ void QQmlComponent::createObject(QQmlV8Function *args)
/*!
\qmlmethod object Component::incubateObject(Item parent, object properties, enumeration mode)
- Creates an incubator for instance of this component. Incubators allow new component
+ Creates an incubator for instance of this component. Incubators allow new component
instances to be instantiated asynchronously and not cause freezes in the UI.
- The \a parent argument specifies the parent the created instance will have. Omitting the
+ The \a parent argument specifies the parent the created instance will have. Omitting the
parameter or passing null will create anobject with no parent. In this case, a reference
to the created object must be maintained by the application of the object will eventually
be garbage collected.
The \a properties argument is specified as a map of property-value items which will be
- set on the created object during its construction. \a mode may be Qt.Synchronous or
- Qt.Asynchronous and controls whether the instance is created synchronously or asynchronously.
+ set on the created object during its construction. \a mode may be Qt.Synchronous or
+ Qt.Asynchronous and controls whether the instance is created synchronously or asynchronously.
The default is asynchronously. In some circumstances, even if Qt.Synchronous is specified,
the incubator may create the object asynchronously. This happens if the component calling
incubateObject() is itself being created asynchronously.
@@ -1289,7 +1289,7 @@ void QQmlComponent::incubateObject(QQmlV8Function *args)
v8::Local<v8::Object> valuemap;
QQmlIncubator::IncubationMode mode = QQmlIncubator::Asynchronous;
- if (args->Length() >= 1)
+ if (args->Length() >= 1)
parent = args->engine()->toQObject((*args)[0]);
if (args->Length() >= 2) {
@@ -1313,7 +1313,7 @@ void QQmlComponent::incubateObject(QQmlV8Function *args)
}
QQmlComponentExtension *e = componentExtension(args->engine());
-
+
QV8IncubatorResource *r = new QV8IncubatorResource(args->engine(), mode);
v8::Local<v8::Object> o = e->incubationConstructor->NewInstance();
o->SetExternalResource(r);
@@ -1368,15 +1368,15 @@ QQmlComponentExtension::QQmlComponentExtension(QV8Engine *engine)
v8::Local<v8::FunctionTemplate> ft = v8::FunctionTemplate::New();
ft->InstanceTemplate()->SetHasExternalResource(true);
ft->InstanceTemplate()->SetInternalFieldCount(1);
- ft->InstanceTemplate()->SetAccessor(v8::String::New("onStatusChanged"),
- QV8IncubatorResource::StatusChangedGetter,
+ ft->InstanceTemplate()->SetAccessor(v8::String::New("onStatusChanged"),
+ QV8IncubatorResource::StatusChangedGetter,
QV8IncubatorResource::StatusChangedSetter);
ft->InstanceTemplate()->SetAccessor(v8::String::New("status"),
QV8IncubatorResource::StatusGetter);
- ft->InstanceTemplate()->SetAccessor(v8::String::New("object"),
- QV8IncubatorResource::ObjectGetter);
- ft->InstanceTemplate()->SetAccessor(v8::String::New("forceCompletion"),
- QV8IncubatorResource::ForceCompletionGetter);
+ ft->InstanceTemplate()->SetAccessor(v8::String::New("object"),
+ QV8IncubatorResource::ObjectGetter);
+ ft->InstanceTemplate()->SetAccessor(v8::String::New("forceCompletion"),
+ QV8IncubatorResource::ForceCompletionGetter);
incubationConstructor = qPersistentNew(ft->GetFunction());
}
@@ -1401,21 +1401,21 @@ QQmlComponentExtension::QQmlComponentExtension(QV8Engine *engine)
}
}
-v8::Handle<v8::Value> QV8IncubatorResource::ObjectGetter(v8::Local<v8::String>,
+v8::Handle<v8::Value> QV8IncubatorResource::ObjectGetter(v8::Local<v8::String>,
const v8::AccessorInfo& info)
{
QV8IncubatorResource *r = v8_resource_check<QV8IncubatorResource>(info.This());
return r->engine->newQObject(r->object());
}
-v8::Handle<v8::Value> QV8IncubatorResource::ForceCompletionGetter(v8::Local<v8::String>,
+v8::Handle<v8::Value> QV8IncubatorResource::ForceCompletionGetter(v8::Local<v8::String>,
const v8::AccessorInfo& info)
{
QV8IncubatorResource *r = v8_resource_check<QV8IncubatorResource>(info.This());
return componentExtension(r->engine)->forceCompletion;
}
-v8::Handle<v8::Value> QV8IncubatorResource::ForceCompletion(const v8::Arguments &args)
+v8::Handle<v8::Value> QV8IncubatorResource::ForceCompletion(const v8::Arguments &args)
{
QV8IncubatorResource *r = v8_resource_cast<QV8IncubatorResource>(args.This());
if (!r)
@@ -1426,20 +1426,20 @@ v8::Handle<v8::Value> QV8IncubatorResource::ForceCompletion(const v8::Arguments
return v8::Undefined();
}
-v8::Handle<v8::Value> QV8IncubatorResource::StatusGetter(v8::Local<v8::String>,
+v8::Handle<v8::Value> QV8IncubatorResource::StatusGetter(v8::Local<v8::String>,
const v8::AccessorInfo& info)
{
QV8IncubatorResource *r = v8_resource_check<QV8IncubatorResource>(info.This());
return v8::Integer::NewFromUnsigned(r->status());
}
-v8::Handle<v8::Value> QV8IncubatorResource::StatusChangedGetter(v8::Local<v8::String>,
+v8::Handle<v8::Value> QV8IncubatorResource::StatusChangedGetter(v8::Local<v8::String>,
const v8::AccessorInfo& info)
{
return info.This()->GetInternalField(0);
}
-void QV8IncubatorResource::StatusChangedSetter(v8::Local<v8::String>, v8::Local<v8::Value> value,
+void QV8IncubatorResource::StatusChangedSetter(v8::Local<v8::String>, v8::Local<v8::Value> value,
const v8::AccessorInfo& info)
{
info.This()->SetInternalField(0, value);
@@ -1475,7 +1475,7 @@ void QV8IncubatorResource::setInitialState(QObject *o)
qPersistentDispose(qmlGlobal);
}
}
-
+
void QV8IncubatorResource::dispose()
{
qPersistentDispose(valuemap);
@@ -1513,7 +1513,7 @@ void QV8IncubatorResource::statusChanged(Status s)
}
}
- if (s == Ready || s == Error)
+ if (s == Ready || s == Error)
dispose();
}
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 25ef080cb5..f128e6684a 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -120,7 +120,7 @@ void qmlRegisterBaseTypes(const char *uri, int versionMajor, int versionMinor)
/*!
\qmltype QtObject
\instantiates QObject
- \inqmlmodule QtQuick 2
+ \inqmlmodule QtQml 2
\ingroup qml-utility-elements
\brief A basic QML type
diff --git a/src/qml/qml/qqmllocale.cpp b/src/qml/qml/qqmllocale.cpp
index c9ce4773c3..018c55a925 100644
--- a/src/qml/qml/qqmllocale.cpp
+++ b/src/qml/qml/qqmllocale.cpp
@@ -769,7 +769,7 @@ V8_DEFINE_EXTENSION(QV8LocaleDataDeletable, localeV8Data);
/*!
\qmltype Locale
\instantiates QQmlLocale
- \inqmlmodule QtQuick 2
+ \inqmlmodule QtQml 2
\brief Provides locale specific properties and formatted data
The Locale object may only be created via the \l{QML:Qt::locale()}{Qt.locale()} function.
diff --git a/src/qml/qml/qqmlvme.cpp b/src/qml/qml/qqmlvme.cpp
index c34b922ab7..ad76b702ce 100644
--- a/src/qml/qml/qqmlvme.cpp
+++ b/src/qml/qml/qqmlvme.cpp
@@ -1376,7 +1376,8 @@ QQmlContextData *QQmlVME::complete(const Interrupt &interrupt)
Q_ASSERT(d);
Q_ASSERT(d->context);
a->add(&d->context->componentAttached);
- emit a->completed();
+ if (componentCompleteEnabled())
+ emit a->completed();
if (watcher.hasRecursed() || interrupt.shouldInterrupt())
return 0;
diff --git a/src/qml/types/qqmlbind.cpp b/src/qml/types/qqmlbind.cpp
index fcb3079891..4c4e541e11 100644
--- a/src/qml/types/qqmlbind.cpp
+++ b/src/qml/types/qqmlbind.cpp
@@ -139,7 +139,7 @@ public:
If the binding target or binding property is changed, the bound value is
immediately pushed onto the new target.
- \sa QtQml
+ \sa {Qt QML}
*/
QQmlBind::QQmlBind(QObject *parent)
: QObject(*(new QQmlBindPrivate), parent)
diff --git a/src/qml/types/qqmlconnections.cpp b/src/qml/types/qqmlconnections.cpp
index 286933e557..93df0842fe 100644
--- a/src/qml/types/qqmlconnections.cpp
+++ b/src/qml/types/qqmlconnections.cpp
@@ -126,7 +126,7 @@ public:
}
\endqml
- \sa QtQml
+ \sa {Qt QML}
*/
QQmlConnections::QQmlConnections(QObject *parent) :
QObject(*(new QQmlConnectionsPrivate), parent)
diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp
index efbd98bdbc..ad2b6f91e4 100644
--- a/src/qml/types/qqmldelegatemodel.cpp
+++ b/src/qml/types/qqmldelegatemodel.cpp
@@ -121,7 +121,7 @@ QQmlDelegateModelParts::QQmlDelegateModelParts(QQmlDelegateModel *parent)
/*!
\qmltype VisualDataModel
\instantiates QQmlDelegateModel
- \inqmlmodule QtQuick 2
+ \inqmlmodule QtQml 2
\ingroup qtquick-models
\brief Encapsulates a model and delegate
@@ -817,10 +817,12 @@ void QQmlDelegateModelPrivate::incubatorStatusChanged(QQDMIncubationTask *incuba
releaseIncubator(incubationTask);
if (status == QQmlIncubator::Ready) {
+ cacheItem->referenceObject();
if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(cacheItem->object))
emitCreatedPackage(incubationTask, package);
else
emitCreatedItem(incubationTask, cacheItem->object);
+ cacheItem->releaseObject();
} else if (status == QQmlIncubator::Error) {
qmlInfo(q, m_delegate->errors()) << "Error creating delegate";
}
@@ -835,6 +837,7 @@ void QQmlDelegateModelPrivate::incubatorStatusChanged(QQDMIncubationTask *incuba
cacheItem->scriptRef -= 1;
cacheItem->contextData->destroy();
cacheItem->contextData = 0;
+
if (!cacheItem->isReferenced()) {
removeCacheItem(cacheItem);
delete cacheItem;
@@ -2140,7 +2143,7 @@ void QQmlDelegateModelGroupPrivate::destroyingPackage(QQuickPackage *package)
/*!
\qmltype DelegateModelGroup
\instantiates QQmlDelegateModelGroup
- \inqmlmodule QtQuick 2
+ \inqmlmodule QtQml 2
\ingroup qtquick-models
\brief Encapsulates a filtered set of visual data items
@@ -3186,4 +3189,3 @@ v8::Local<v8::Object> QQmlDelegateModelEngineData::array(
}
QT_END_NAMESPACE
-
diff --git a/src/qml/types/qqmllistmodel.cpp b/src/qml/types/qqmllistmodel.cpp
index 9609e91b1c..5b8cb436c0 100644
--- a/src/qml/types/qqmllistmodel.cpp
+++ b/src/qml/types/qqmllistmodel.cpp
@@ -1436,7 +1436,7 @@ QQmlListModelParser::ListInstruction *QQmlListModelParser::ListModelData::instru
/*!
\qmltype ListModel
\instantiates QQmlListModel
- \inqmlmodule QtQuick 2
+ \inqmlmodule QtQml 2
\brief Defines a free-form list data source
\ingroup qtquick-models
@@ -1523,7 +1523,7 @@ QQmlListModelParser::ListInstruction *QQmlListModelParser::ListModelData::instru
handler. You must call sync() or else the changes made to the list from the external
thread will not be reflected in the list model in the main thread.
- \sa {qml-data-models}{Data Models}, {declarative/threading/threadedlistmodel}{Threaded ListModel example}, QtQml
+ \sa {qml-data-models}{Data Models}, {declarative/threading/threadedlistmodel}{Threaded ListModel example}, {Qt QML}
*/
QQmlListModel::QQmlListModel(QObject *parent)
@@ -2545,7 +2545,7 @@ bool QQmlListModelParser::definesEmptyList(const QString &s)
/*!
\qmltype ListElement
\instantiates QQmlListElement
- \inqmlmodule QtQuick 2
+ \inqmlmodule QtQml 2
\brief Defines a data item in a ListModel
\ingroup qtquick-models
diff --git a/src/qml/types/qqmlobjectmodel.cpp b/src/qml/types/qqmlobjectmodel.cpp
index 7f7bf92fa3..b60dae4126 100644
--- a/src/qml/types/qqmlobjectmodel.cpp
+++ b/src/qml/types/qqmlobjectmodel.cpp
@@ -169,7 +169,7 @@ public:
/*!
\qmltype VisualItemModel
\instantiates QQmlObjectModel
- \inqmlmodule QtQuick 2
+ \inqmlmodule QtQml 2
\brief Defines a set of objects to be used as a model
The VisualItemModel type encapsulates contains the objects to be used
@@ -266,4 +266,3 @@ QQmlObjectModelAttached *QQmlObjectModel::qmlAttachedProperties(QObject *obj)
}
QT_END_NAMESPACE
-
diff --git a/src/qml/types/qquickpackage.cpp b/src/qml/types/qquickpackage.cpp
index e885524b27..bdb8a4bc15 100644
--- a/src/qml/types/qquickpackage.cpp
+++ b/src/qml/types/qquickpackage.cpp
@@ -73,7 +73,8 @@ QT_BEGIN_NAMESPACE
\snippet quick/views/package/view.qml 0
- \sa {quick/views/package}{Package example}, {quick/demos/photoviewer}{Photo Viewer example}, QtQml
+ \sa {quick/views/package}{Package example}, {quick/demos/photoviewer}{Photo
+ Viewer example}, {Qt QML}
*/
/*!
diff --git a/src/quick/doc/src/advtutorial.qdoc b/src/quick/doc/src/advtutorial.qdoc
index 966233c371..a27cb78eba 100644
--- a/src/quick/doc/src/advtutorial.qdoc
+++ b/src/quick/doc/src/advtutorial.qdoc
@@ -27,7 +27,6 @@
/*!
\page qml-advtutorial.html tutorial
-\inqmlmodule QtQuick 2
\title QML Advanced Tutorial
\brief A more advanced tutorial, showing how to use QML to create a game.
\nextpage QML Advanced Tutorial 1 - Creating the Game Canvas and Blocks
@@ -65,7 +64,6 @@ directory.
/*!
\page qml-advtutorial1.html
-\inqmlmodule QtQuick 2
\title QML Advanced Tutorial 1 - Creating the Game Canvas and Blocks
\contentspage QML Advanced Tutorial
\previouspage QML Advanced Tutorial
@@ -135,7 +133,6 @@ types to get started. Next, we will populate the game canvas with some blocks.
/*!
\page qml-advtutorial2.html
-\inqmlmodule QtQuick 2
\title QML Advanced Tutorial 2 - Populating the Game Canvas
\contentspage QML Advanced Tutorial
\previouspage QML Advanced Tutorial 1 - Creating the Game Canvas and Blocks
@@ -211,7 +208,6 @@ Now, we have a screen of blocks, and we can begin to add the game mechanics.
/*!
\page qml-advtutorial3.html
-\inqmlmodule QtQuick 2
\title QML Advanced Tutorial 3 - Implementing the Game Logic
\contentspage QML Advanced Tutorial
\previouspage QML Advanced Tutorial 2 - Populating the Game Canvas
@@ -300,7 +296,6 @@ until the next chapter - where your application becomes alive!
/*!
\page qml-advtutorial4.html
-\inqmlmodule QtQuick 2
\title QML Advanced Tutorial 4 - Finishing Touches
\contentspage QML Advanced Tutorial
\previouspage QML Advanced Tutorial 3 - Implementing the Game Logic
diff --git a/src/quick/doc/src/appdevguide/porting.qdoc b/src/quick/doc/src/appdevguide/porting.qdoc
index 907f7403b9..750a0e1242 100644
--- a/src/quick/doc/src/appdevguide/porting.qdoc
+++ b/src/quick/doc/src/appdevguide/porting.qdoc
@@ -139,16 +139,16 @@ ShaderEffectItem type has been renamed to \l ShaderEffect.
In Qt 5, all QML applications are rendered with an OpenGL scenegraph architecture rather than the
Graphics View framework used in Qt 4. Due to the scale of this architectural change, the C++ API has
been extensively restructured and the \c QtDeclarative module has been deprecated in favour of two
-new modules: \l QtQml, which implements the QML engine and language infrastructure, and \l QtQuick,
+new modules: \l {Qt QML}, which implements the QML engine and language infrastructure, and \l QtQuick,
which implements the visual canvas and scenegraph backend.
-All classes that were previously in the \c QtDeclarative module have been moved into the \l QtQml
+All classes that were previously in the \c QtDeclarative module have been moved into the \l {Qt QML}
and \l QtQuick modules, and their class names have been changed to reflect their new module
locations. The class name changes are as follows:
\table
\header
- \li QtQml
+ \li Qt QML
\li QtQuick
\row
\li
@@ -176,8 +176,8 @@ locations. The class name changes are as follows:
\endlist
\endtable
-To use the new \c QtQml* and \c QtQuick* classes in Qt 5, link against the approprate module from
-your qmake \c .pro file. For example the following will link against both the QtQml and QtQuick
+To use the new \c QQml* and \c QtQuick* classes in Qt 5, link against the approprate module from
+your qmake \c .pro file. For example the following will link against both the \l {Qt QML} and QtQuick
modules:
\code
@@ -237,7 +237,7 @@ an overview of creating QML plugins in Qt 5.
For the purposes of porting older applications, the \c QtDeclarative module is still available in Qt
5 but has been renamed to \c QtQuick1. Applications that required QtQuick 1 specific API (e.g.
QDeclarativeView or QDeclarativeItem and the Graphics View integration) can use this module. Note
-that new applications should use the new \l QtQml and \l QtQuick modules instead.
+that new applications should use the new \l {Qt QML} and \l QtQuick modules instead.
To use the \c QtQuick1 module, add “quick1” module to your qmake \c .pro file:
diff --git a/src/quick/doc/src/appdevguide/qtquicktest.qdoc b/src/quick/doc/src/appdevguide/qtquicktest.qdoc
index 6d434279e6..a5712cab8a 100644
--- a/src/quick/doc/src/appdevguide/qtquicktest.qdoc
+++ b/src/quick/doc/src/appdevguide/qtquicktest.qdoc
@@ -27,7 +27,6 @@
/*!
\page qtquick-qtquicktest.html
- \inqmlmodule QtQuick 2
\title Qt Quick Test Reference Documentation
\brief unit testing framework for QML
diff --git a/src/quick/doc/src/concepts/effects/particles.qdoc b/src/quick/doc/src/concepts/effects/particles.qdoc
index 708e8d2740..ec49c6df43 100644
--- a/src/quick/doc/src/concepts/effects/particles.qdoc
+++ b/src/quick/doc/src/concepts/effects/particles.qdoc
@@ -44,7 +44,6 @@
/*!
\page qtquick-effects-particles.html
- \inqmlmodule QtQuick.Particles 2.0
\title Using the Qt Quick Particle System
Documentation for all Particle System types can be found on the \l{QtQuick.Particles 2}{QtQuick.Particles} module page.
@@ -132,7 +131,6 @@
/*!
\page qtquick-particles-performance.html
- \inqmlmodule QtQuick 2.0
\title Particle System Performance Guide
The performance of the particle system scales with the number of particles it is maintaining. After prototyping the desired
diff --git a/src/quick/doc/src/concepts/input/focus.qdoc b/src/quick/doc/src/concepts/input/focus.qdoc
index 1c73c9b5ba..4807921dc0 100644
--- a/src/quick/doc/src/concepts/input/focus.qdoc
+++ b/src/quick/doc/src/concepts/input/focus.qdoc
@@ -33,8 +33,8 @@
When a key is pressed or released, a key event is generated and delivered to the
focused Qt Quick \l Item. To facilitate the construction of reusable components
-and to address some of the cases unique to fluid user interfaces, the Qt Quick items add aged
-\e scope based extension to Qt's traditional keyboard focus model.
+and to address some of the cases unique to fluid user interfaces, the Qt Quick items add a
+scope based extension to Qt's traditional keyboard focus model.
\tableofcontents
@@ -43,17 +43,16 @@ and to address some of the cases unique to fluid user interfaces, the Qt Quick i
When the user presses or releases a key, the following occurs:
\list 1
\li Qt receives the key action and generates a key event.
-\li If the Qt widget containing the \l QQuickView has focus, the key event
-is delivered to it. Otherwise, regular Qt key handling continues.
-\li The key event is delivered by the scene to the QML \l Item with
-\e {active focus}. If no Item has active focus, the key event is
-\l {QEvent::ignore()}{ignored} and regular Qt key handling continues.
-\li If the QML Item with active focus accepts the key event, propagation
-stops. Otherwise the event is "bubbled up", by recursively passing it to each
-Item's parent until either the event is accepted, or the root Item is reached.
+\li If a \l QQuickWindow is the active window, the key event
+is delivered to it.
+\li The key event is delivered by the scene to the \l Item with
+\e {active focus}. If no item has active focus, the key event is ignored.
+\li If the \l QQuickItem with active focus accepts the key event, propagation
+stops. Otherwise the event is send to the Item's parent until
+the event is accepted, or the root item is reached.
If the \c {Rectangle} type in the following example has active focus and the \c A key is pressed,
-it will bubble up to its parent. However, pressing the \c B key will bubble up to the root
+the event will not be propagated further. Pressing the \c B key the event will propagate to the root
item and thus subsequently be ignored.
\snippet qml/focus/rectangle.qml simple key event
diff --git a/src/quick/doc/src/dynamicview-tutorial.qdoc b/src/quick/doc/src/dynamicview-tutorial.qdoc
index daa14a6973..a04f057c72 100644
--- a/src/quick/doc/src/dynamicview-tutorial.qdoc
+++ b/src/quick/doc/src/dynamicview-tutorial.qdoc
@@ -27,7 +27,6 @@
/*!
\page qml-dynamicview-tutorial.html tutorial
-\inqmlmodule QtQuick 2
\title QML Dynamic View Ordering Tutorial
\brief A tutorial describing how to re-arrange items in a QML ListView
\nextpage QML Dynamic View Ordering Tutorial 1 - A Simple ListView and Delegate
@@ -51,7 +50,6 @@ directory.
/*!
\page qml-dynamicview-tutorial1.html
-\inqmlmodule QtQuick 2
\title QML Dynamic View Ordering Tutorial 1 - A Simple ListView and Delegate
\contentspage QML Dynamic View Ordering Tutorial
\previouspage QML Dynamic View Ordering Tutorial
@@ -88,7 +86,6 @@ The second part of the application is the ListView itself to which we bind the m
/*!
\page qml-dynamicview-tutorial2.html
-\inqmlmodule QtQuick 2
\title QML Dynamic View Ordering Tutorial 2 - Dragging View Items
\contentspage QML Dynamic View Ordering Tutorial
\previouspage QML Dynamic View Ordering Tutorial 1 - A Simple ListView and Delegate
@@ -133,7 +130,6 @@ so that is above other items in the stacking order and isn't obscured as it is d
/*!
\page qml-dynamicview-tutorial3.html
-\inqmlmodule QtQuick 2
\title QML Dynamic View Ordering Tutorial 3 - Moving Dragged Items
\contentspage QML Dynamic View Ordering Tutorial
\previouspage QML Dynamic View Ordering Tutorial 2 - Dragging View Items
@@ -187,7 +183,6 @@ property of the view and bind the \l {QtQuick2::VisualDataModel::model}{model} a
/*!
\page qml-dynamicview-tutorial4.html
-\inqmlmodule QtQuick 2
\title QML Dynamic View Ordering Tutorial 4 - Sorting Items
\contentspage QML Dynamic View Ordering Tutorial
\previouspage QML Dynamic View Ordering Tutorial 3 - Moving Dragged Items
diff --git a/src/quick/doc/src/examples.qdoc b/src/quick/doc/src/examples.qdoc
index aad8cfc3c4..6db53082fa 100644
--- a/src/quick/doc/src/examples.qdoc
+++ b/src/quick/doc/src/examples.qdoc
@@ -33,7 +33,6 @@
\ingroup all-examples
\ingroup qtquick
\target qtquick-samples
-\inqmlmodule QtQuick 2
These are code samples that show how to use various aspects of Qt Quick. Larger
compound interfaces are grouped as applications as they demonstrate more Qt
diff --git a/src/quick/doc/src/tutorial.qdoc b/src/quick/doc/src/tutorial.qdoc
index b1f2304529..46125ede18 100644
--- a/src/quick/doc/src/tutorial.qdoc
+++ b/src/quick/doc/src/tutorial.qdoc
@@ -27,7 +27,6 @@
/*!
\page qml-tutorial.html
-\inqmlmodule QtQuick 2
\title QML Tutorial
\brief An introduction to the basic concepts and features of QML.
\previouspage Introduction to the QML Language
@@ -55,7 +54,6 @@ Tutorial chapters:
/*!
\page qml-tutorial1.html
-\inqmlmodule QtQuick 2
\title QML Tutorial 1 - Basic Types
\contentspage QML Tutorial
\previouspage QML Tutorial
@@ -68,7 +66,7 @@ The picture below is a screenshot of this program.
Here is the QML code for the application:
-\snippet quick/tutorials/helloworld/tutorial1.qml 0
+\snippet tutorials/helloworld/tutorial1.qml 0
\section1 Walkthrough
@@ -77,11 +75,11 @@ Here is the QML code for the application:
First, we need to import the types that we need for this example. Most QML files will import the built-in QML
types (like \l{Rectangle}, \l{Image}, ...) that come with Qt, using:
-\snippet quick/tutorials/helloworld/tutorial1.qml 3
+\snippet tutorials/helloworld/tutorial1.qml 3
\section2 Rectangle Type
-\snippet quick/tutorials/helloworld/tutorial1.qml 1
+\snippet tutorials/helloworld/tutorial1.qml 1
We declare a root object of type \l{Rectangle}. It is one of the basic building blocks you can use to create an application in QML.
We give it an \c{id} to be able to refer to it later. In this case, we call it "page".
@@ -90,7 +88,7 @@ The \l{Rectangle} type contains many other properties (such as \c x and \c y), b
\section2 Text Type
-\snippet quick/tutorials/helloworld/tutorial1.qml 2
+\snippet tutorials/helloworld/tutorial1.qml 2
We add a \l Text type as a child of the root Rectangle type that displays the text 'Hello world!'.
@@ -114,7 +112,6 @@ qmlscene tutorials/helloworld/tutorial1.qml
/*!
\page qml-tutorial2.html
-\inqmlmodule QtQuick 2
\title QML Tutorial 2 - QML Components
\contentspage QML Tutorial
\previouspage QML Tutorial 1 - Basic Types
@@ -133,37 +130,37 @@ The component's filename must always start with a capital letter.
Here is the QML code for \c Cell.qml:
-\snippet quick/tutorials/helloworld/Cell.qml 0
+\snippet tutorials/helloworld/Cell.qml 0
\section1 Walkthrough
\section2 The Cell Component
-\snippet quick/tutorials/helloworld/Cell.qml 1
+\snippet tutorials/helloworld/Cell.qml 1
The root type of our component is an \l Item with the \c id \e container.
An \l Item is the most basic visual type in QML and is often used as a container for other types.
-\snippet quick/tutorials/helloworld/Cell.qml 4
+\snippet tutorials/helloworld/Cell.qml 4
We declare a \c cellColor property. This property is accessible from \e outside our component, this allows us
to instantiate the cells with different colors.
This property is just an alias to an existing property - the color of the rectangle that compose the cell
(see \l{Property Binding in QML}).
-\snippet quick/tutorials/helloworld/Cell.qml 5
+\snippet tutorials/helloworld/Cell.qml 5
We want our component to also have a signal that we call \e clicked with a \e cellColor parameter of type \e color.
We will use this signal to change the color of the text in the main QML file later.
-\snippet quick/tutorials/helloworld/Cell.qml 2
+\snippet tutorials/helloworld/Cell.qml 2
Our cell component is basically a colored rectangle with the \c id \e rectangle.
The \c anchors.fill property is a convenient way to set the size of a visual type.
In this case the rectangle will have the same size as its parent (see \l{anchor-layout}{Anchor-Based Layout}).
-\snippet quick/tutorials/helloworld/Cell.qml 3
+\snippet tutorials/helloworld/Cell.qml 3
In order to change the color of the text when clicking on a cell, we create a \l MouseArea type with
the same size as its parent.
@@ -175,11 +172,11 @@ When this signal is triggered we want to emit our own \e clicked signal with the
In our main QML file, we use our \c Cell component to create the color picker:
-\snippet quick/tutorials/helloworld/tutorial2.qml 0
+\snippet tutorials/helloworld/tutorial2.qml 0
We create the color picker by putting 6 cells with different colors in a grid.
-\snippet quick/tutorials/helloworld/tutorial2.qml 1
+\snippet tutorials/helloworld/tutorial2.qml 1
When the \e clicked signal of our cell is triggered, we want to set the color of the text to the \e cellColor passed as a parameter.
We can react to any signal of our component through a property of the name \e 'onSignalName' (see \l{Signal Attributes}).
@@ -187,7 +184,6 @@ We can react to any signal of our component through a property of the name \e 'o
/*!
\page qml-tutorial3.html
-\inqmlmodule QtQuick 2
\title QML Tutorial 3 - States and Transitions
\contentspage QML Tutorial
\previouspage QML Tutorial 2 - QML Components
@@ -200,11 +196,11 @@ We want our text to move to the bottom of the screen, rotate and become red when
Here is the QML code:
-\snippet quick/tutorials/helloworld/tutorial3.qml 0
+\snippet tutorials/helloworld/tutorial3.qml 0
\section1 Walkthrough
-\snippet quick/tutorials/helloworld/tutorial3.qml 2
+\snippet tutorials/helloworld/tutorial3.qml 2
First, we create a new \e down state for our text type.
This state will be activated when the \l MouseArea is pressed, and deactivated when it is released.
@@ -213,7 +209,7 @@ The \e down state includes a set of property changes from our implicit \e {defau
(the items as they were initially defined in the QML).
Specifically, we set the \c y property of the text to \c 160, the rotation to \c 180 and the \c color to red.
-\snippet quick/tutorials/helloworld/tutorial3.qml 3
+\snippet tutorials/helloworld/tutorial3.qml 3
Because we don't want the text to appear at the bottom instantly but rather move smoothly,
we add a transition between our two states.
diff --git a/src/quick/doc/src/whatsnew.qdoc b/src/quick/doc/src/whatsnew.qdoc
index 3959a1b5eb..7651fceaaa 100644
--- a/src/quick/doc/src/whatsnew.qdoc
+++ b/src/quick/doc/src/whatsnew.qdoc
@@ -28,7 +28,6 @@
/*!
\title Qt Quick Release Notes
\page qtquick-releasenotes.html
-\inqmlmodule QtQuick 2.0
\section1 Qt 5.0 - QtQuick C++ Module
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index 995d951a8a..2859388e0b 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -3457,7 +3457,7 @@ QImage QQuickContext2D::toImage(const QRectF& bounds)
if (m_texture->thread() == QThread::currentThread())
m_texture->grabImage(bounds);
else if (m_renderStrategy == QQuickCanvasItem::Cooperative) {
- qWarning() << "Pixel read back is not support in Cooperative mode, please try Theaded or Immediate mode";
+ qWarning() << "Pixel readback is not supported in Cooperative mode, please try Threaded or Immediate mode";
return QImage();
} else {
QMetaObject::invokeMethod(m_texture,
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index d31e142035..59ab56dc66 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -2252,7 +2252,8 @@ void QQuickItem::setParentItem(QQuickItem *parentItem)
}
}
- d->resolveLayoutMirror();
+ if (d->parentItem)
+ d->resolveLayoutMirror();
d->itemChange(ItemParentHasChanged, d->parentItem);
diff --git a/src/quick/items/qquickpositioners.cpp b/src/quick/items/qquickpositioners.cpp
index 4a74c0bfba..d8dc0f1856 100644
--- a/src/quick/items/qquickpositioners.cpp
+++ b/src/quick/items/qquickpositioners.cpp
@@ -452,7 +452,6 @@ void QQuickBasePositioner::updateAttachedProperties(QQuickPositionerAttached *sp
QQuickPositionerAttached *prevLastProperty = 0;
QQuickPositionerAttached *lastProperty = 0;
- int visibleItemIndex = 0;
for (int ii = 0; ii < positionedItems.count(); ++ii) {
const PositionedItem &child = positionedItems.at(ii);
if (!child.item)
@@ -468,28 +467,47 @@ void QQuickBasePositioner::updateAttachedProperties(QQuickPositionerAttached *sp
property = static_cast<QQuickPositionerAttached *>(qmlAttachedPropertiesObject<QQuickBasePositioner>(child.item, false));
}
- if (child.isVisible) {
- if (property) {
- property->setIndex(visibleItemIndex);
- property->setIsFirstItem(visibleItemIndex == 0);
+ if (property) {
+ property->setIndex(ii);
+ property->setIsFirstItem(ii == 0);
- if (property->isLastItem())
+ if (property->isLastItem()) {
+ if (prevLastProperty)
+ prevLastProperty->setIsLastItem(false); // there can be only one last property
prevLastProperty = property;
}
-
- lastProperty = property;
- ++visibleItemIndex;
- } else if (property) {
- property->setIndex(-1);
- property->setIsFirstItem(false);
- property->setIsLastItem(false);
}
+
+ lastProperty = property;
}
if (prevLastProperty && prevLastProperty != lastProperty)
prevLastProperty->setIsLastItem(false);
if (lastProperty)
lastProperty->setIsLastItem(true);
+
+ // clear attached properties for unpositioned items
+ for (int ii = 0; ii < unpositionedItems.count(); ++ii) {
+ const PositionedItem &child = unpositionedItems.at(ii);
+ if (!child.item)
+ continue;
+
+ QQuickPositionerAttached *property = 0;
+
+ if (specificProperty) {
+ if (specificPropertyOwner == child.item) {
+ property = specificProperty;
+ }
+ } else {
+ property = static_cast<QQuickPositionerAttached *>(qmlAttachedPropertiesObject<QQuickBasePositioner>(child.item, false));
+ }
+
+ if (property) {
+ property->setIndex(-1);
+ property->setIsFirstItem(false);
+ property->setIsLastItem(false);
+ }
+ }
}
/*!
diff --git a/src/quick/items/qquickrepeater.cpp b/src/quick/items/qquickrepeater.cpp
index 35e37d1246..bf6d3c495b 100644
--- a/src/quick/items/qquickrepeater.cpp
+++ b/src/quick/items/qquickrepeater.cpp
@@ -217,7 +217,7 @@ void QQuickRepeater::setModel(const QVariant &model)
d->model = new QQmlDelegateModel(qmlContext(this));
d->ownModel = true;
if (isComponentComplete())
- static_cast<QQmlDelegateModel *>(d->model)->componentComplete();
+ static_cast<QQmlDelegateModel *>(d->model.data())->componentComplete();
}
if (QQmlDelegateModel *dataModel = qobject_cast<QQmlDelegateModel*>(d->model))
dataModel->setModel(model);
@@ -329,7 +329,7 @@ void QQuickRepeater::componentComplete()
{
Q_D(QQuickRepeater);
if (d->model && d->ownModel)
- static_cast<QQmlDelegateModel *>(d->model)->componentComplete();
+ static_cast<QQmlDelegateModel *>(d->model.data())->componentComplete();
QQuickItem::componentComplete();
regenerate();
if (d->model && d->model->count())
diff --git a/src/quick/items/qquickrepeater_p_p.h b/src/quick/items/qquickrepeater_p_p.h
index f220eb4fcb..a642f6479a 100644
--- a/src/quick/items/qquickrepeater_p_p.h
+++ b/src/quick/items/qquickrepeater_p_p.h
@@ -73,7 +73,7 @@ public:
private:
void createItems();
- QQmlInstanceModel *model;
+ QPointer<QQmlInstanceModel> model;
QVariant dataSource;
QQmlGuard<QObject> dataSourceAsObject;
bool ownModel : 1;
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index 52f991b475..0d0d0a17e0 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -777,7 +777,10 @@ QRectF QQuickTextInput::cursorRectangle() const
QTextLine l = d->m_textLayout.lineForTextPosition(c);
if (!l.isValid())
return QRectF();
- return QRectF(l.cursorToX(c) - d->hscroll, l.y() - d->vscroll, 1, l.height());
+ qreal x = l.cursorToX(c) - d->hscroll;
+ qreal y = l.y() - d->vscroll;
+ qreal height = l.ascent() + l.descent();
+ return QRectF(x, y, 1, height);
}
/*!
@@ -1371,9 +1374,12 @@ QRectF QQuickTextInput::positionToRectangle(int pos) const
pos += d->preeditAreaText().length();
#endif
QTextLine l = d->m_textLayout.lineForTextPosition(pos);
- return l.isValid()
- ? QRectF(l.cursorToX(pos) - d->hscroll, l.y() - d->vscroll, 1, l.height())
- : QRectF();
+ if (!l.isValid())
+ return QRectF();
+ qreal x = l.cursorToX(pos) - d->hscroll;
+ qreal y = l.y() - d->vscroll;
+ qreal height = l.ascent() + l.descent();
+ return QRectF(x, y, 1, height);
}
/*!
diff --git a/src/quick/items/qquicktextnode.cpp b/src/quick/items/qquicktextnode.cpp
index 4952a37082..d8040a1110 100644
--- a/src/quick/items/qquicktextnode.cpp
+++ b/src/quick/items/qquicktextnode.cpp
@@ -176,7 +176,7 @@ void QQuickTextNode::setCursor(const QRectF &rect, const QColor &color)
appendChildNode(m_cursorNode);
}
-void QQuickTextNode::initEngine(const QColor& textColor, const QColor& selectedTextColor, const QColor& selectionColor, const QColor& anchorColor)
+void QQuickTextNode::initEngine(const QColor& textColor, const QColor& selectedTextColor, const QColor& selectionColor, const QColor& anchorColor, const QPointF &position)
{
m_engine.reset(new QQuickTextNodeEngine);
m_engine->m_hasContents = false;
@@ -184,6 +184,7 @@ void QQuickTextNode::initEngine(const QColor& textColor, const QColor& selectedT
m_engine->setSelectedTextColor(selectedTextColor);
m_engine->setSelectionColor(selectionColor);
m_engine->setAnchorColor(anchorColor);
+ m_engine->setPosition(position);
}
void QQuickTextNode::addImage(const QRectF &rect, const QImage &image)
@@ -249,8 +250,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);
+ initEngine(color, selectedTextColor, selectionColor, anchorColor, position);
#ifndef QT_NO_IM
int preeditLength = textLayout->preeditAreaText().length();
diff --git a/src/quick/items/qquicktextnode_p.h b/src/quick/items/qquicktextnode_p.h
index 16da3ce685..2031669639 100644
--- a/src/quick/items/qquicktextnode_p.h
+++ b/src/quick/items/qquicktextnode_p.h
@@ -107,8 +107,8 @@ public:
void setUseNativeRenderer(bool on) { m_useNativeRenderer = on; }
private:
- void initEngine(const QColor &textColor, const QColor &selectedTextColor, const QColor &selectionColor, const QColor& anchorColor = QColor());
-
+ void initEngine(const QColor &textColor, const QColor &selectedTextColor, const QColor &selectionColor, const QColor& anchorColor = QColor()
+ , const QPointF &position = QPointF());
QSGContext *m_context;
QSGSimpleRectNode *m_cursorNode;
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 97a257614f..abd325e153 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -149,8 +149,6 @@ private:
/*!
Returns an accessibility interface for this window, or 0 if such an
interface cannot be created.
-
- \warning The caller is responsible for deleting the returned interface.
*/
QAccessibleInterface *QQuickWindow::accessibleRoot() const
{
@@ -258,29 +256,6 @@ void QQuickWindowPrivate::polishItems()
updateFocusItemTransform();
}
-/**
- * This parameter enables that this window can be rendered without
- * being shown on screen. This feature is very limited in what it supports.
- *
- * For this feature to be useful one needs to hook into beforeRender()
- * and set the render target.
- *
- */
-void QQuickWindowPrivate::setRenderWithoutShowing(bool render)
-{
- if (render == renderWithoutShowing)
- return;
-
- Q_Q(QQuickWindow);
- renderWithoutShowing = render;
-
- if (render)
- windowManager->show(q);
- else
- windowManager->hide(q);
-}
-
-
/*!
* Schedules the window to render another frame.
*
@@ -361,7 +336,6 @@ QQuickWindowPrivate::QQuickWindowPrivate()
#endif
, touchMouseId(-1)
, touchMousePressTimestamp(0)
- , renderWithoutShowing(false)
, dirtyItemList(0)
, context(0)
, renderer(0)
@@ -2117,14 +2091,8 @@ void QQuickWindowPrivate::data_clear(QQmlListProperty<QObject> *property)
bool QQuickWindowPrivate::isRenderable() const
{
- const QQuickWindow *q = q_func();
- QRect geom = q->geometry();
- if (geom.width() <= 0 || geom.height() <= 0)
- return false;
- // Change to be applied after the visibility property is integrated in qtbase:
-// return visibility != QWindow::Hidden || (renderWithoutShowing && platformWindow);
- // Temporary version which is implementation-agnostic but slightly less efficient:
- return q->isVisible() || (renderWithoutShowing && platformWindow);
+ Q_Q(const QQuickWindow);
+ return q->isExposed() && q->isVisible() && q->geometry().isValid();
}
/*!
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h
index ed2ff3b902..afcf4a995a 100644
--- a/src/quick/items/qquickwindow_p.h
+++ b/src/quick/items/qquickwindow_p.h
@@ -178,9 +178,6 @@ public:
bool isRenderable() const;
- bool renderWithoutShowing;
- void setRenderWithoutShowing(bool enabled);
-
QQuickItem::UpdatePaintNodeData updatePaintNodeData;
QQuickItem *dirtyItemList;
diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
index 419062d025..3df11532e4 100644
--- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
+++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp
@@ -95,7 +95,8 @@ const char *QSGTextMaskMaterialData::fragmentShader() const {
"uniform sampler2D texture; \n"
"uniform lowp vec4 color; \n"
"void main() { \n"
- " gl_FragColor = vec4(texture2D(texture, sampleCoord).rgb * color.a, 1.0); \n"
+ " lowp vec4 glyph = texture2D(texture, sampleCoord); \n"
+ " gl_FragColor = vec4(glyph.rgb * color.a, glyph.a); \n"
"}";
}
@@ -162,7 +163,7 @@ void QSGTextMaskMaterialData::updateState(const RenderState &state, QSGMaterial
state.context()->functions()->glBlendColor(c.redF(),
c.greenF(),
c.blueF(),
- 1.0f);
+ c.alphaF());
}
}
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp
index 33a99d1506..04981b54e7 100644
--- a/src/quick/scenegraph/qsgrenderloop.cpp
+++ b/src/quick/scenegraph/qsgrenderloop.cpp
@@ -215,49 +215,25 @@ void QSGGuiThreadRenderLoop::windowDestroyed(QQuickWindow *window)
void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
{
- bool renderWithoutShowing = QQuickWindowPrivate::get(window)->renderWithoutShowing;
- if ((!window->isExposed() && !renderWithoutShowing) || !m_windows.contains(window))
+ if (!QQuickWindowPrivate::get(window)->isRenderable() || !m_windows.contains(window))
return;
WindowData &data = const_cast<WindowData &>(m_windows[window]);
- QQuickWindow *masterWindow = 0;
- if (!window->isVisible() && !renderWithoutShowing) {
- // Find a "proper surface" to bind...
- for (QHash<QQuickWindow *, WindowData>::const_iterator it = m_windows.constBegin();
- it != m_windows.constEnd() && !masterWindow; ++it) {
- if (it.key()->isVisible())
- masterWindow = it.key();
- }
- } else {
- masterWindow = window;
- }
-
- if (!masterWindow)
- return;
-
- if (!QQuickWindowPrivate::get(masterWindow)->isRenderable()) {
- qWarning().nospace()
- << "Unable to find a renderable master window "
- << masterWindow << "when trying to render"
- << window << " (" << window->geometry() << ").";
- return;
- }
-
bool current = false;
if (!gl) {
gl = new QOpenGLContext();
- gl->setFormat(masterWindow->requestedFormat());
+ gl->setFormat(window->requestedFormat());
if (!gl->create()) {
delete gl;
gl = 0;
}
- current = gl->makeCurrent(masterWindow);
+ current = gl->makeCurrent(window);
if (current)
sg->initialize(gl);
} else {
- current = gl->makeCurrent(masterWindow);
+ current = gl->makeCurrent(window);
}
bool alsoSwap = data.updatePending;
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index b457c33bed..4cca87e990 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -328,9 +328,9 @@ public:
QEventLoop eventLoop;
- uint pendingUpdate : 2;
- uint sleeping : 1;
- uint syncResultedInChanges : 1;
+ uint pendingUpdate;
+ uint sleeping;
+ uint syncResultedInChanges;
volatile bool guiIsLocked;
volatile bool shouldExit;
diff --git a/src/quick/scenegraph/util/qsgpainternode.cpp b/src/quick/scenegraph/util/qsgpainternode.cpp
index e5cf6b8295..97b3500ad0 100644
--- a/src/quick/scenegraph/util/qsgpainternode.cpp
+++ b/src/quick/scenegraph/util/qsgpainternode.cpp
@@ -73,10 +73,6 @@ QSGPainterTexture::QSGPainterTexture()
m_retain_image = true;
}
-#ifdef QT_OPENGL_ES
-extern void qsg_swizzleBGRAToRGBA(QImage *image);
-#endif
-
void QSGPainterTexture::bind()
{
if (m_dirty_rect.isNull()) {
@@ -84,33 +80,8 @@ void QSGPainterTexture::bind()
return;
}
- bool oldMipmapsGenerated = m_mipmaps_generated;
- m_mipmaps_generated = true;
+ setImage(m_image);
QSGPlainTexture::bind();
- m_mipmaps_generated = oldMipmapsGenerated;
-
- QImage subImage = m_image.copy(m_dirty_rect);
-
- int w = m_dirty_rect.width();
- int h = m_dirty_rect.height();
-
-#ifdef QT_OPENGL_ES
- qsg_swizzleBGRAToRGBA(&subImage);
- glTexSubImage2D(GL_TEXTURE_2D, 0, m_dirty_rect.x(), m_dirty_rect.y(), w, h,
- GL_RGBA, GL_UNSIGNED_BYTE, subImage.constBits());
-#else
- glTexSubImage2D(GL_TEXTURE_2D, 0, m_dirty_rect.x(), m_dirty_rect.y(), w, h,
- GL_BGRA, GL_UNSIGNED_BYTE, subImage.constBits());
-#endif
-
- if (m_has_mipmaps && !m_mipmaps_generated) {
- QOpenGLContext *ctx = QOpenGLContext::currentContext();
- ctx->functions()->glGenerateMipmap(GL_TEXTURE_2D);
- m_mipmaps_generated = true;
- }
-
- m_dirty_texture = false;
- m_dirty_bind_options = false;
m_dirty_rect = QRect();
}
diff --git a/src/quick/util/qquickanimation.cpp b/src/quick/util/qquickanimation.cpp
index f74ad20bc6..2f9ca7409f 100644
--- a/src/quick/util/qquickanimation.cpp
+++ b/src/quick/util/qquickanimation.cpp
@@ -1025,7 +1025,7 @@ QAbstractAnimationJob* QQuickScriptAction::transition(QQuickStateActions &action
PropertyAction object) so that the rotation animation begins with the
correct transform origin.
- \sa {Animation and Transitions in Qt Quick}, QtQml
+ \sa {Animation and Transitions in Qt Quick}, {Qt QML}
*/
QQuickPropertyAction::QQuickPropertyAction(QObject *parent)
: QQuickAbstractAnimation(*(new QQuickPropertyActionPrivate), parent)
diff --git a/src/quick/util/qquickbehavior.cpp b/src/quick/util/qquickbehavior.cpp
index e332f37493..1e77084e42 100644
--- a/src/quick/util/qquickbehavior.cpp
+++ b/src/quick/util/qquickbehavior.cpp
@@ -98,7 +98,7 @@ public:
state change. For general advice on using Behaviors to animate state changes, see
\l{Using Qt Quick Behaviors with States}.
- \sa {Animation and Transitions in Qt Quick}, {declarative/animation/behaviors}{Behavior example}, QtQml
+ \sa {Animation and Transitions in Qt Quick}, {declarative/animation/behaviors}{Behavior example}, {Qt QML}
*/
diff --git a/src/quick/util/qquickpropertychanges.cpp b/src/quick/util/qquickpropertychanges.cpp
index 0193d3def0..1c014635f4 100644
--- a/src/quick/util/qquickpropertychanges.cpp
+++ b/src/quick/util/qquickpropertychanges.cpp
@@ -129,7 +129,7 @@ QT_BEGIN_NAMESPACE
See the PropertyAction documentation for more details.
- \sa {declarative/animation/states}{states example}, {Qt Quick States}{Qt Quick States}, QtQml
+ \sa {declarative/animation/states}{states example}, {Qt Quick States}{Qt Quick States}, {Qt QML}
*/
/*!
diff --git a/src/quick/util/qquickstate.cpp b/src/quick/util/qquickstate.cpp
index 491146660b..c89cea6767 100644
--- a/src/quick/util/qquickstate.cpp
+++ b/src/quick/util/qquickstate.cpp
@@ -151,7 +151,7 @@ QQuickStateOperation::QQuickStateOperation(QObjectPrivate &dd, QObject *parent)
not allowed.
\sa {declarative/animation/states}{states example}, {Qt Quick States}{Qt Quick States},
- {Animation and Transitions in Qt Quick}{Transitions}, QtQml
+ {Animation and Transitions in Qt Quick}{Transitions}, {Qt QML}
*/
QQuickState::QQuickState(QObject *parent)
: QObject(*(new QQuickStatePrivate), parent)
diff --git a/src/quick/util/qquickstategroup.cpp b/src/quick/util/qquickstategroup.cpp
index b4c8f214b9..a72a45e96b 100644
--- a/src/quick/util/qquickstategroup.cpp
+++ b/src/quick/util/qquickstategroup.cpp
@@ -119,7 +119,7 @@ public:
}
\endqml
- \sa {Qt Quick States}{Qt Quick States}, {Animation and Transitions in Qt Quick}{Transitions}, {QtQml}
+ \sa {Qt Quick States}{Qt Quick States}, {Animation and Transitions in Qt Quick}{Transitions}, {Qt QML}
*/
QQuickStateGroup::QQuickStateGroup(QObject *parent)
diff --git a/src/quick/util/qquicktransition.cpp b/src/quick/util/qquicktransition.cpp
index 025c7d7b03..ead28fe496 100644
--- a/src/quick/util/qquicktransition.cpp
+++ b/src/quick/util/qquicktransition.cpp
@@ -94,7 +94,7 @@ QT_BEGIN_NAMESPACE
\l Behavior, the Transition animation overrides the \l Behavior for that
state change.
- \sa {Animation and Transitions in Qt Quick}, {declarative/animation/states}{states example}, {Qt Quick States}{Qt Quick States}, {QtQml}
+ \sa {Animation and Transitions in Qt Quick}, {declarative/animation/states}{states example}, {Qt Quick States}{Qt Quick States}, {Qt QML}
*/
//ParallelAnimationWrapper allows us to do a "callback" when the animation finishes, rather than connecting
diff --git a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp
index 363efeabbc..e6cbd41b8e 100644
--- a/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp
+++ b/tests/auto/qml/debugger/qdebugmessageservice/tst_qdebugmessageservice.cpp
@@ -48,7 +48,7 @@
#include <QtCore/QString>
#include <QtTest/QtTest>
-const char *NORMALMODE = "-qmljsdebugger=port:3777,block";
+const char *NORMALMODE = "-qmljsdebugger=port:3777,3787,block";
const char *QMLFILE = "test.qml";
class QQmlDebugMsgClient;
@@ -186,7 +186,8 @@ void tst_QDebugMessageService::init()
QVERIFY2(m_process->waitForSessionStart(),
"Could not launch application, or did not get 'Waiting for connection'.");
- m_connection->connectToHost("127.0.0.1", 3777);
+ const int port = m_process->debugPort();
+ m_connection->connectToHost("127.0.0.1", port);
QVERIFY(m_connection->waitForConnected());
if (m_client->state() != QQmlDebugClient::Enabled)
diff --git a/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs.pro b/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs.pro
index eb5f17a55d..d4ce36dc4a 100644
--- a/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs.pro
+++ b/tests/auto/qml/debugger/qqmldebugjs/qqmldebugjs.pro
@@ -22,3 +22,5 @@ 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/qqmldebugservice/tst_qqmldebugservice.cpp b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp
index dd4dd003ec..1c1d84f37b 100644
--- a/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp
+++ b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp
@@ -104,7 +104,7 @@ void tst_QQmlDebugService::checkPortRange()
QQmlDebugConnection *connection1 = new QQmlDebugConnection();
QQmlDebugProcess *process1 = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this);
- process1->start(QStringList() << QLatin1String("-qmljsdebugger=port:3772, 3774 ") << testFile("test.qml"));
+ process1->start(QStringList() << QLatin1String("-qmljsdebugger=port:3782,3792") << testFile("test.qml"));
if (!process1->waitForSessionStart())
QFAIL("could not launch application, or did not get 'Waiting for connection'.");
@@ -118,7 +118,7 @@ void tst_QQmlDebugService::checkPortRange()
QQmlDebugConnection *connection2 = new QQmlDebugConnection();
QQmlDebugProcess *process2 = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this);
- process2->start(QStringList() << QLatin1String("-qmljsdebugger=port:3772,3774") << testFile("test.qml"));
+ process2->start(QStringList() << QLatin1String("-qmljsdebugger=port:3782,3792") << testFile("test.qml"));
if (!process2->waitForSessionStart())
QFAIL("could not launch application, or did not get 'Waiting for connection'.");
diff --git a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
index 6f99afd917..5badcaa3ae 100644
--- a/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
+++ b/tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp
@@ -52,8 +52,8 @@
#include "qqmlinspectorclient.h"
#include "qqmlenginedebugclient.h"
-#define PORT 3776
-#define STR_PORT "3776"
+#define STR_PORT_FROM "3776"
+#define STR_PORT_TO "3786"
class tst_QQmlEngineDebugInspectorIntegration : public QQmlDataTest
{
@@ -105,7 +105,7 @@ QmlDebugObjectReference tst_QQmlEngineDebugInspectorIntegration::findRootObject(
void tst_QQmlEngineDebugInspectorIntegration::init()
{
- const QString argument = "-qmljsdebugger=port:" STR_PORT ",block";
+ const QString argument = "-qmljsdebugger=port:" STR_PORT_FROM "," STR_PORT_TO ",block";
m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath)
+ "/qmlscene", this);
@@ -117,7 +117,8 @@ void tst_QQmlEngineDebugInspectorIntegration::init()
m_inspectorClient = new QQmlInspectorClient(m_connection);
m_engineDebugClient = new QQmlEngineDebugClient(m_connection);
- m_connection->connectToHost(QLatin1String("127.0.0.1"), PORT);
+ const int port = m_process->debugPort();
+ m_connection->connectToHost(QLatin1String("127.0.0.1"), port);
bool ok = m_connection->waitForConnected();
QVERIFY(ok);
}
diff --git a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp
index f1fbdd20a9..e430875355 100644
--- a/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp
+++ b/tests/auto/qml/debugger/qqmlinspector/tst_qqmlinspector.cpp
@@ -50,8 +50,8 @@
#include "../../../shared/util.h"
#include "qqmlinspectorclient.h"
-#define PORT 3772
-#define STR_PORT "3772"
+#define STR_PORT_FROM "3772"
+#define STR_PORT_TO "3782"
@@ -87,7 +87,7 @@ private slots:
void tst_QQmlInspector::startQmlsceneProcess(const char * /* qmlFile */)
{
- const QString argument = "-qmljsdebugger=port:" STR_PORT ",block";
+ const QString argument = "-qmljsdebugger=port:" STR_PORT_FROM "," STR_PORT_TO ",block";
m_process = new QQmlDebugProcess(QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmlscene", this);
m_process->start(QStringList() << argument << testFile("qtquick2.qml"));
@@ -97,7 +97,8 @@ void tst_QQmlInspector::startQmlsceneProcess(const char * /* qmlFile */)
QQmlDebugConnection *m_connection = new QQmlDebugConnection();
m_client = new QQmlInspectorClient(m_connection);
- m_connection->connectToHost(QLatin1String("127.0.0.1"), PORT);
+ const int port = m_process->debugPort();
+ m_connection->connectToHost(QLatin1String("127.0.0.1"), port);
}
void tst_QQmlInspector::init()
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
index 3a925e2905..9982e5d629 100644
--- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
@@ -46,8 +46,8 @@
#include "qqmldebugclient.h"
#include "../../../shared/util.h"
-#define PORT 13773
-#define STR_PORT "13773"
+#define STR_PORT_FROM "13773"
+#define STR_PORT_TO "13783"
struct QQmlProfilerData
{
@@ -234,9 +234,9 @@ void tst_QQmlProfilerService::connect(bool block, const QString &testFile)
QStringList arguments;
if (block)
- arguments << QString("-qmljsdebugger=port:" STR_PORT ",block");
+ arguments << QString("-qmljsdebugger=port:" STR_PORT_FROM "," STR_PORT_TO ",block");
else
- arguments << QString("-qmljsdebugger=port:" STR_PORT);
+ arguments << QString("-qmljsdebugger=port:" STR_PORT_FROM "," STR_PORT_TO );
arguments << QQmlDataTest::instance()->testFile(testFile);
@@ -247,7 +247,8 @@ void tst_QQmlProfilerService::connect(bool block, const QString &testFile)
QQmlDebugConnection *m_connection = new QQmlDebugConnection();
m_client = new QQmlProfilerClient(m_connection);
- m_connection->connectToHost(QLatin1String("127.0.0.1"), PORT);
+ const int port = m_process->debugPort();
+ m_connection->connectToHost(QLatin1String("127.0.0.1"), port);
}
void tst_QQmlProfilerService::cleanup()
diff --git a/tests/auto/qml/debugger/shared/debugutil_p.h b/tests/auto/qml/debugger/shared/debugutil_p.h
index 2b9a94366a..363aabbf39 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 = 10000);
+ static bool waitForSignal(QObject *receiver, const char *member, int timeout = 5000);
};
class QQmlDebugTestClient : public QQmlDebugClient
diff --git a/tests/auto/qml/qmlmin/tst_qmlmin.cpp b/tests/auto/qml/qmlmin/tst_qmlmin.cpp
index 65549efddc..c9ef8b257c 100644
--- a/tests/auto/qml/qmlmin/tst_qmlmin.cpp
+++ b/tests/auto/qml/qmlmin/tst_qmlmin.cpp
@@ -168,7 +168,7 @@ bool tst_qmlmin::isInvalidFile(const QFileInfo &fileName) const
}
/*
-This test runs all the examples in the QtQml UI source tree and ensures
+This test runs all the examples in the Qt QML UI source tree and ensures
that they start and exit cleanly.
Examples are any .qml files under the examples/ directory that start
diff --git a/tests/auto/quick/qquickrepeater/data/visualitemmodel.qml b/tests/auto/quick/qquickrepeater/data/visualitemmodel.qml
new file mode 100644
index 0000000000..b1b7b97881
--- /dev/null
+++ b/tests/auto/quick/qquickrepeater/data/visualitemmodel.qml
@@ -0,0 +1,23 @@
+import QtQuick 2.0
+
+Rectangle {
+ width: 360
+ height: 360
+
+ VisualItemModel {
+ id: visItemModel
+ Rectangle {
+ width: 20
+ height: 20
+ color: "red"
+ }
+ }
+
+ Column {
+ anchors.fill: parent
+ Repeater {
+ model: visItemModel
+ }
+ }
+}
+
diff --git a/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp b/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
index 582503f938..9fb76f9584 100644
--- a/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
+++ b/tests/auto/quick/qquickrepeater/tst_qquickrepeater.cpp
@@ -78,6 +78,7 @@ private slots:
void asynchronous();
void initParent();
void dynamicModelCrash();
+ void visualItemModelCrash();
};
class TestObject : public QObject
@@ -732,6 +733,17 @@ void tst_QQuickRepeater::dynamicModelCrash()
QVERIFY(qvariant_cast<QObject *>(repeater->model()) == 0);
}
+void tst_QQuickRepeater::visualItemModelCrash()
+{
+ // This used to crash because the model would get
+ // deleted before the repeater, leading to double-deletion
+ // of the items.
+ QQuickView *window = createView();
+ window->setSource(testFileUrl("visualitemmodel.qml"));
+ qApp->processEvents();
+ delete window;
+}
+
QTEST_MAIN(tst_QQuickRepeater)
#include "tst_qquickrepeater.moc"
diff --git a/tools/qmlplugindump/main.cpp b/tools/qmlplugindump/main.cpp
index e05c77cbfa..3d816e562d 100644
--- a/tools/qmlplugindump/main.cpp
+++ b/tools/qmlplugindump/main.cpp
@@ -330,17 +330,13 @@ public:
qSort(exportStrings);
qml->writeArrayBinding(QLatin1String("exports"), exportStrings);
- // write meta object revisions unless they're all zero
+ // write meta object revisions
QStringList metaObjectRevisions;
- bool shouldWriteMetaObjectRevisions = false;
foreach (const QString &exportString, exportStrings) {
int metaObjectRevision = exports[exportString]->metaObjectRevision();
- if (metaObjectRevision != 0)
- shouldWriteMetaObjectRevisions = true;
metaObjectRevisions += QString::number(metaObjectRevision);
}
- if (shouldWriteMetaObjectRevisions)
- qml->writeArrayBinding(QLatin1String("exportMetaObjectRevisions"), metaObjectRevisions);
+ qml->writeArrayBinding(QLatin1String("exportMetaObjectRevisions"), metaObjectRevisions);
if (const QMetaObject *attachedType = (*qmlTypes.begin())->attachedPropertiesType()) {
// Can happen when a type is registered that returns itself as attachedPropertiesType()