aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-02-07 17:06:03 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-02-07 17:07:44 +0100
commitb907a01b467b551756b108f6c9a04d7e7382ae64 (patch)
tree2d21d785186ce485f615034e6667d9673b62a4fc /src
parent4f8537ff8c9427705e3587861a62fe81cf3e503b (diff)
parent1d29d8edf8e4e709ca2f27791cdf8672c15488f3 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: examples/quick/textureprovider/etcprovider.h src/plugins/qmltooling/qmldbg_ost/qmlostplugin.cpp src/qml/doc/qtqml.qdocconf src/quick/doc/qtquick.qdocconf tests/auto/quick/qquickflickable/tst_qquickflickable.cpp Change-Id: I5027b0ee024e00b9525bd45516b7f401ff7d4ae4
Diffstat (limited to 'src')
-rw-r--r--src/particles/qquickimageparticle.cpp4
-rw-r--r--src/particles/qquickparticleemitter.cpp2
-rw-r--r--src/qml/doc/qtqml.qdocconf12
-rw-r--r--src/qml/qml/qqmlcomponent.cpp2
-rw-r--r--src/qml/qml/qqmlextensionplugin.cpp6
-rw-r--r--src/qml/qml/qqmlimport.cpp23
-rw-r--r--src/qml/qml/qqmlrewrite.cpp16
-rw-r--r--src/qml/qml/qqmltypeloader.cpp2
-rw-r--r--src/qml/qml/v8/qjsengine.cpp1
-rw-r--r--src/qml/qml/v8/qv8engine.cpp6
-rw-r--r--src/quick/doc/images/declarative-colors.pngbin0 -> 4993 bytes
-rw-r--r--src/quick/doc/qtquick.qdocconf14
-rw-r--r--src/quick/doc/src/appdevguide/deployment.qdoc2
-rw-r--r--src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc4
-rw-r--r--src/quick/doc/src/tutorial.qdoc2
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp2
-rw-r--r--src/quick/items/qquickimagebase.cpp1
-rw-r--r--src/quick/items/qquickitem.cpp90
-rw-r--r--src/quick/items/qquickloader.cpp2
-rw-r--r--src/quick/items/qquicktext.cpp5
-rw-r--r--src/quick/items/qquicktextinput.cpp4
-rw-r--r--src/quick/items/qquickwindow.cpp4
-rw-r--r--src/quick/util/qquickimageprovider.cpp4
-rw-r--r--src/quick/util/qquickpixmapcache.cpp2
24 files changed, 158 insertions, 52 deletions
diff --git a/src/particles/qquickimageparticle.cpp b/src/particles/qquickimageparticle.cpp
index bb6edb26a5..e0572ef424 100644
--- a/src/particles/qquickimageparticle.cpp
+++ b/src/particles/qquickimageparticle.cpp
@@ -128,7 +128,11 @@ static const char vertexShaderCode[] =
" fTex = vPosTex.zw;\n"
"#endif\n"
" highp float currentSize = mix(vData.z, vData.w, t * t);\n"
+#if defined (Q_OS_BLACKBERRY)
+ " highp float fade = 1.;\n"
+#else
" lowp float fade = 1.;\n"
+#endif
" highp float fadeIn = min(t * 10., 1.);\n"
" highp float fadeOut = 1. - clamp((t - 0.75) * 4.,0., 1.);\n"
"\n"
diff --git a/src/particles/qquickparticleemitter.cpp b/src/particles/qquickparticleemitter.cpp
index eeb0aef715..b4e3a82cb2 100644
--- a/src/particles/qquickparticleemitter.cpp
+++ b/src/particles/qquickparticleemitter.cpp
@@ -88,7 +88,7 @@ QT_BEGIN_NAMESPACE
box of the Emitter.
*/
/*!
- \qmlproperty bool QtQuick.Particles2::Emitter::emitting
+ \qmlproperty bool QtQuick.Particles2::Emitter::enabled
If set to false, the emitter will cease emissions until it is set to true.
diff --git a/src/qml/doc/qtqml.qdocconf b/src/qml/doc/qtqml.qdocconf
index 45fecc1896..ecd6b81823 100644
--- a/src/qml/doc/qtqml.qdocconf
+++ b/src/qml/doc/qtqml.qdocconf
@@ -2,20 +2,20 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtQml
description = Qt QML Reference Documentation
-url = http://qt-project.org/doc/qt-5.0/qtqml
-version = 5.1.0
+url = http://qt-project.org/doc/qt-$QT_VER/qtqml
+version = $QT_VERSION
qhp.projects = QtQml
qhp.QtQml.file = qtqml.qhp
-qhp.QtQml.namespace = org.qt-project.qtqml.510
+qhp.QtQml.namespace = org.qt-project.qtqml.$QT_VERSION_TAG
qhp.QtQml.virtualFolder = qtqml
qhp.QtQml.indexTitle = Qt QML
qhp.QtQml.indexRoot =
-qhp.QtQml.filterAttributes = qtqml 5.1.0 qtrefdoc
-qhp.QtQml.customFilters.Qt.name = QtQml 5.1.0
-qhp.QtQml.customFilters.Qt.filterAttributes = qtqml 5.1.0
+qhp.QtQml.filterAttributes = qtqml $QT_VERSION qtrefdoc
+qhp.QtQml.customFilters.Qt.name = QtQml $QT_VERSION
+qhp.QtQml.customFilters.Qt.filterAttributes = qtqml $QT_VERSION
qhp.QtQml.subprojects = classes examples
qhp.QtQml.subprojects.classes.title = C++ Classes
qhp.QtQml.subprojects.classes.indexTitle = Qt QML Module C++ Classes
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index 1928bcb4b5..b335d6f402 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -664,7 +664,7 @@ void QQmlComponentPrivate::loadUrl(const QUrl &newUrl, QQmlComponent::Compilatio
if (newUrl.isEmpty()) {
QQmlError error;
- error.setDescription(q->tr("Invalid empty URL"));
+ error.setDescription(QQmlComponent::tr("Invalid empty URL"));
state.errors << error;
return;
}
diff --git a/src/qml/qml/qqmlextensionplugin.cpp b/src/qml/qml/qqmlextensionplugin.cpp
index f824da2bbd..bbc0fed768 100644
--- a/src/qml/qml/qqmlextensionplugin.cpp
+++ b/src/qml/qml/qqmlextensionplugin.cpp
@@ -58,8 +58,8 @@ QT_BEGIN_NAMESPACE
To write a QML extension plugin:
\list
- \li Subclass QQmlExtensionPlugin, implement registerTypes() method
- to register types using qmlRegisterType(), and export the class using the Q_EXPORT_PLUGIN2() macro
+ \li Subclass QQmlExtensionPlugin, implement registerTypes() method to register types
+ using qmlRegisterType(), and export the class using the Q_PLUGIN_METADATA() macro
\li Write an appropriate project file for the plugin
\li Create a \l{Module Definition qmldir Files}{qmldir file} to describe the plugin
\endlist
@@ -140,7 +140,7 @@ QT_BEGIN_NAMESPACE
Constructs a QML extension plugin with the given \a parent.
Note that this constructor is invoked automatically by the
- Q_EXPORT_PLUGIN2() macro, so there is no need for calling it
+ Q_PLUGIN_METADATA() macro, so there is no need for calling it
explicitly.
*/
QQmlExtensionPlugin::QQmlExtensionPlugin(QObject *parent)
diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp
index f2573895c6..52d07b23ec 100644
--- a/src/qml/qml/qqmlimport.cpp
+++ b/src/qml/qml/qqmlimport.cpp
@@ -208,10 +208,6 @@ public:
QQmlTypeLoader *typeLoader;
- static inline QString tr(const char *str) {
- return QQmlImportDatabase::tr(str);
- }
-
static bool locateQmldir(const QString &uri, int vmaj, int vmin,
QQmlImportDatabase *database,
QString *outQmldirFilePath, QString *outUrl);
@@ -735,7 +731,7 @@ bool QQmlImportsPrivate::importExtension(const QString &qmldirFilePath,
// The reason is that the lower level may add url and line/column numbering information.
QQmlError poppedError = errors->takeFirst();
QQmlError error;
- error.setDescription(tr("plugin cannot be loaded for module \"%1\": %2").arg(uri).arg(poppedError.description()));
+ error.setDescription(QQmlImportDatabase::tr("plugin cannot be loaded for module \"%1\": %2").arg(uri).arg(poppedError.description()));
error.setUrl(QUrl::fromLocalFile(qmldirFilePath));
errors->prepend(error);
}
@@ -744,7 +740,7 @@ bool QQmlImportsPrivate::importExtension(const QString &qmldirFilePath,
} else {
if (errors) {
QQmlError error;
- error.setDescription(tr("module \"%1\" plugin \"%2\" not found").arg(uri).arg(plugin.name));
+ error.setDescription(QQmlImportDatabase::tr("module \"%1\" plugin \"%2\" not found").arg(uri).arg(plugin.name));
error.setUrl(QUrl::fromLocalFile(qmldirFilePath));
errors->prepend(error);
}
@@ -1035,9 +1031,9 @@ bool QQmlImportsPrivate::addLibraryImport(const QString& uri, const QString &pre
if (inserted->qmlDirComponents.isEmpty() && inserted->qmlDirScripts.isEmpty()) {
QQmlError error;
if (QQmlMetaType::isAnyModule(uri))
- error.setDescription(tr("module \"%1\" version %2.%3 is not installed").arg(uri).arg(vmaj).arg(vmin));
+ error.setDescription(QQmlImportDatabase::tr("module \"%1\" version %2.%3 is not installed").arg(uri).arg(vmaj).arg(vmin));
else
- error.setDescription(tr("module \"%1\" is not installed").arg(uri));
+ error.setDescription(QQmlImportDatabase::tr("module \"%1\" is not installed").arg(uri));
errors->prepend(error);
return false;
} else if ((vmaj >= 0) && (vmin >= 0) && qmldir) {
@@ -1082,7 +1078,7 @@ bool QQmlImportsPrivate::addFileImport(const QString& uri, const QString &prefix
if (!QQmlFile::bundleDirectoryExists(dir, typeLoader->engine())) {
if (!isImplicitImport) {
QQmlError error;
- error.setDescription(tr("\"%1\": no such directory").arg(uri));
+ error.setDescription(QQmlImportDatabase::tr("\"%1\": no such directory").arg(uri));
error.setUrl(QUrl(qmldirUrl));
errors->prepend(error);
}
@@ -1107,7 +1103,7 @@ bool QQmlImportsPrivate::addFileImport(const QString& uri, const QString &prefix
if (!typeLoader->directoryExists(dir)) {
if (!isImplicitImport) {
QQmlError error;
- error.setDescription(tr("\"%1\": no such directory").arg(uri));
+ error.setDescription(QQmlImportDatabase::tr("\"%1\": no such directory").arg(uri));
error.setUrl(QUrl(qmldirUrl));
errors->prepend(error);
}
@@ -1127,7 +1123,7 @@ bool QQmlImportsPrivate::addFileImport(const QString& uri, const QString &prefix
if (!isImplicitImport) {
QQmlError error;
- error.setDescription(tr("import \"%1\" has no qmldir and no namespace").arg(importUri));
+ error.setDescription(QQmlImportDatabase::tr("import \"%1\" has no qmldir and no namespace").arg(importUri));
error.setUrl(QUrl(qmldirUrl));
errors->prepend(error);
}
@@ -1187,9 +1183,9 @@ bool QQmlImportsPrivate::updateQmldirContent(const QString &uri, const QString &
if (uri != QLatin1String(".")) {
QQmlError error;
if (QQmlMetaType::isAnyModule(uri))
- error.setDescription(tr("module \"%1\" version %2.%3 is not installed").arg(uri).arg(vmaj).arg(vmin));
+ error.setDescription(QQmlImportDatabase::tr("module \"%1\" version %2.%3 is not installed").arg(uri).arg(vmaj).arg(vmin));
else
- error.setDescription(tr("module \"%1\" is not installed").arg(uri));
+ error.setDescription(QQmlImportDatabase::tr("module \"%1\" is not installed").arg(uri));
errors->prepend(error);
return false;
}
@@ -1344,6 +1340,7 @@ QQmlImportDatabase::QQmlImportDatabase(QQmlEngine *e)
QQmlImportDatabase::~QQmlImportDatabase()
{
+ qDeleteAll(qmldirCache);
qmldirCache.clear();
}
diff --git a/src/qml/qml/qqmlrewrite.cpp b/src/qml/qml/qqmlrewrite.cpp
index 0913a8c224..0e281428ed 100644
--- a/src/qml/qml/qqmlrewrite.cpp
+++ b/src/qml/qml/qqmlrewrite.cpp
@@ -44,6 +44,7 @@
#include <private/qqmlglobal_p.h>
#include <QtCore/qdebug.h>
+#include <QtCore/qcoreapplication.h>
QT_BEGIN_NAMESPACE
@@ -513,8 +514,15 @@ bool RewriteSignalHandler::visit(AST::IdentifierExpression *e)
return false;
}
-static QString unnamed_error_string(QLatin1String(QT_TR_NOOP("Signal uses unnamed parameter followed by named parameter.")));
-static QString global_error_string(QLatin1String(QT_TR_NOOP("Signal parameter \"%1\" hides global variable.")));
+static inline QString msgUnnamedErrorString()
+{
+ return QCoreApplication::translate("QQmlRewrite", "Signal uses unnamed parameter followed by named parameter.");
+}
+
+static inline QString msgGlobalErrorString(const QString &p)
+{
+ return QCoreApplication::translate("QQmlRewrite", "Signal parameter \"%1\" hides global variable.").arg(p);
+}
#define EXIT_ON_ERROR(error) \
{ \
@@ -543,9 +551,9 @@ QString RewriteSignalHandler::createParameterString(const QList<QHashedString> &
if (param.isEmpty())
unnamedParam = true;
else if (unnamedParam)
- EXIT_ON_ERROR(unnamed_error_string)
+ EXIT_ON_ERROR(msgUnnamedErrorString())
else if (illegalNames.contains(param))
- EXIT_ON_ERROR(global_error_string.arg(param))
+ EXIT_ON_ERROR(msgGlobalErrorString(param))
++_parameterCountForJS;
parameters += param;
if (i < parameterNameList.count()-1)
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index dc63db1dea..aa7a2d95c7 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -2289,7 +2289,7 @@ void QQmlScriptBlob::done()
error.setUrl(finalUrl());
error.setLine(script.location.line);
error.setColumn(script.location.column);
- error.setDescription(typeLoader()->tr("Script %1 unavailable").arg(script.script->url().toString()));
+ error.setDescription(QQmlTypeLoader::tr("Script %1 unavailable").arg(script.script->url().toString()));
errors.prepend(error);
setError(errors);
}
diff --git a/src/qml/qml/v8/qjsengine.cpp b/src/qml/qml/v8/qjsengine.cpp
index acc734d549..5b1464afe6 100644
--- a/src/qml/qml/v8/qjsengine.cpp
+++ b/src/qml/qml/v8/qjsengine.cpp
@@ -349,7 +349,6 @@ QJSValue QJSEngine::create(int type, const void *ptr)
/*!
\internal
- \since 4.5
convert \a value to \a type, store the result in \a ptr
*/
bool QJSEngine::convertV2(const QJSValue &value, int type, void *ptr)
diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp
index 3fe3d28b67..2619c1a484 100644
--- a/src/qml/qml/v8/qv8engine.cpp
+++ b/src/qml/qml/v8/qv8engine.cpp
@@ -813,6 +813,12 @@ QDateTime QV8Engine::qtDateTimeFromJsDate(double jsDate)
v8::Persistent<v8::Object> *QV8Engine::findOwnerAndStrength(QObject *object, bool *shouldBeStrong)
{
+ QQmlData *data = QQmlData::get(object);
+ if (data && data->rootObjectInCreation) { // When the object is still being created it may not show up to the GC.
+ *shouldBeStrong = true;
+ return 0;
+ }
+
QObject *parent = object->parent();
if (!parent) {
// if the object has JS ownership, the object's v8object owns the lifetime of the persistent value.
diff --git a/src/quick/doc/images/declarative-colors.png b/src/quick/doc/images/declarative-colors.png
new file mode 100644
index 0000000000..f2eacd889b
--- /dev/null
+++ b/src/quick/doc/images/declarative-colors.png
Binary files differ
diff --git a/src/quick/doc/qtquick.qdocconf b/src/quick/doc/qtquick.qdocconf
index de50eb2375..7fba78da10 100644
--- a/src/quick/doc/qtquick.qdocconf
+++ b/src/quick/doc/qtquick.qdocconf
@@ -2,25 +2,25 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QtQuick
description = Qt Quick Reference Documentation
-url = http://qt-project.org/doc/qt-5.0/qtquick-index.html
-version = 5.1.0
+url = http://qt-project.org/doc/qt-$QT_VER/qtquick-index.html
+version = $QT_VERSION
qhp.projects = QtQuick
qhp.QtQuick.file = qtquick.qhp
-qhp.QtQuick.namespace = org.qt-project.qtquick.510
+qhp.QtQuick.namespace = org.qt-project.qtquick.$QT_VERSION_TAG
qhp.QtQuick.virtualFolder = qtquick
qhp.QtQuick.indexTitle = Qt Quick
qhp.QtQuick.indexRoot =
-qhp.QtQuick.filterAttributes = qtquick 5.1.0 qtrefdoc
-qhp.QtQuick.customFilters.Qt.name = QtQuick 5.1.0
-qhp.QtQuick.customFilters.Qt.filterAttributes = qtquick 5.1.0
+qhp.QtQuick.filterAttributes = qtquick $QT_VERSION qtrefdoc
+qhp.QtQuick.customFilters.Qt.name = QtQuick $QT_VERSION
+qhp.QtQuick.customFilters.Qt.filterAttributes = qtquick $QT_VERSION
qhp.QtQuick.subprojects = qmltypes classes examples
qhp.QtQuick.subprojects.qmltypes.title = QML Types
qhp.QtQuick.subprojects.qmltypes.indexTitle = Qt Quick QML Types
-qhp.QtQuick.subprojects.qmltypes.selectors = class fake:headerfile
+qhp.QtQuick.subprojects.qmltypes.selectors = fake:qmlclass
qhp.QtQuick.subprojects.qmltypes.sortPages = true
qhp.QtQuick.subprojects.classes.title = Classes
qhp.QtQuick.subprojects.classes.title = C++ Classes
diff --git a/src/quick/doc/src/appdevguide/deployment.qdoc b/src/quick/doc/src/appdevguide/deployment.qdoc
index a6a8d88841..bf98902c17 100644
--- a/src/quick/doc/src/appdevguide/deployment.qdoc
+++ b/src/quick/doc/src/appdevguide/deployment.qdoc
@@ -208,4 +208,4 @@ be used to build the application resources:
See \l {The Qt Resource System} for more information.
-
+*/
diff --git a/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc b/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc
index 724e94c5d7..e2753e47f4 100644
--- a/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc
+++ b/src/quick/doc/src/concepts/modelviewsdata/cppmodels.qdoc
@@ -178,6 +178,8 @@ created directly as elements within QML:
\code
class MyModelPlugin : public QQmlExtensionPlugin
{
+ Q_OBJECT
+ Q_PLUGIN_METADATA(IID "org.qt-project.QmlExtension.MyModel" FILE "mymodel.json")
public:
void registerTypes(const char *uri)
{
@@ -185,8 +187,6 @@ public:
"MyModel");
}
}
-
-Q_EXPORT_PLUGIN2(mymodelplugin, MyModelPlugin);
\endcode
\li
diff --git a/src/quick/doc/src/tutorial.qdoc b/src/quick/doc/src/tutorial.qdoc
index 21a5b8daee..7dbb211cb8 100644
--- a/src/quick/doc/src/tutorial.qdoc
+++ b/src/quick/doc/src/tutorial.qdoc
@@ -219,7 +219,7 @@ Because we don't want the text to appear at the bottom instantly but rather move
we add a transition between our two states.
\c from and \c to define the states between which the transition will run.
-In this case, we want a transition from the default state to our \li down state.
+In this case, we want a transition from the default state to our \e down state.
Because we want the same transition to be run in reverse when changing back from the \e down state to the default state,
we set \c reversible to \c true.
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index c857a69f75..17115ae8c4 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -2512,7 +2512,7 @@ v8::Handle<v8::Value> ctx2d_pixelArray_indexed_set(uint32_t index, v8::Local<v8:
QV8Context2DPixelArrayResource *r = v8_resource_cast<QV8Context2DPixelArrayResource>(info.This());
const int v = value->Uint32Value();
- if (r && index < static_cast<quint32>(r->image.width() * r->image.height() * 4) && v > 0 && v <= 255) {
+ if (r && index < static_cast<quint32>(r->image.width() * r->image.height() * 4) && v >= 0 && v <= 255) {
const quint32 w = r->image.width();
const quint32 row = (index / 4) / w;
const quint32 col = (index / 4) % w;
diff --git a/src/quick/items/qquickimagebase.cpp b/src/quick/items/qquickimagebase.cpp
index 2a9edb37d1..c07f7067f5 100644
--- a/src/quick/items/qquickimagebase.cpp
+++ b/src/quick/items/qquickimagebase.cpp
@@ -207,6 +207,7 @@ void QQuickImageBase::load()
options |= QQuickPixmap::Asynchronous;
if (d->cache)
options |= QQuickPixmap::Cache;
+ d->pix.clear(this);
d->pix.load(qmlEngine(this), d->url, d->sourcesize, options);
if (d->pix.isLoading()) {
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 8e2a8c2ddc..e87f870eb8 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -1706,15 +1706,91 @@ void QQuickItemPrivate::updateSubFocusItem(QQuickItem *scope, bool focus)
/*!
\enum QQuickItem::ItemChange
- \internal
+ \brief Used in conjunction with QQuickItem::itemChange() to notify
+ the item about certain types of changes.
+
+ \value ItemChildAddedChange A child was added. ItemChangeData::item contains
+ the added child.
+
+ \value ItemChildRemovedChange A child was removed. ItemChangeData::item
+ contains the removed child.
+
+ \value ItemSceneChange The item was added to or removed from a scene. The
+ QQuickWindow rendering the scene is specified in using ItemChangeData::window.
+ The window parameter is null when the item is removed from a scene.
+
+ \value ItemVisibleHasChanged The item's visibility has changed.
+ ItemChangeData::boolValue contains the new visibility.
+
+ \value ItemParentHasChanged The item's parent has changed.
+ ItemChangeData::item contains the new parent.
+
+ \value ItemOpacityHasChanged The item's opacity has changed.
+ ItemChangeData::realValue contains the new opacity.
+
+ \value ItemActiveFocusHasChanged The item's focus has changed.
+ ItemChangeData::boolValue contains whether the item has focus or not.
+
+ \value ItemRotationHasChanged The item's rotation has changed.
+ ItemChangeData::realValue contains the new rotation.
*/
/*!
\class QQuickItem::ItemChangeData
- \internal
+ \inmodule QtQuick
+ \brief Adds supplimentary information to the QQuickItem::itemChange()
+ function.
+
+ The meaning of each member of this class is defined by the change type.
+
+ \sa QQuickItem::ItemChange
*/
/*!
+ \fn QQuickItem::ItemChangeData::ItemChangeData(QQuickItem *)
+ \internal
+ */
+
+/*!
+ \fn QQuickItem::ItemChangeData::ItemChangeData(QQuickWindow *)
+ \internal
+ */
+
+/*!
+ \fn QQuickItem::ItemChangeData::ItemChangeData(qreal)
+ \internal
+ */
+
+/*!
+ \fn QQuickItem::ItemChangeData::ItemChangeData(bool)
+ \internal
+ */
+
+/*!
+ \variable QQuickItem::ItemChangeData::realValue
+ Contains supplimentary information to the QQuickItem::itemChange() function.
+ \sa QQuickItem::ItemChange
+ */
+
+/*!
+ \variable QQuickItem::ItemChangeData::boolValue
+ Contains supplimentary information to the QQuickItem::itemChange() function.
+ \sa QQuickItem::ItemChange
+ */
+
+/*!
+ \variable QQuickItem::ItemChangeData::item
+ Contains supplimentary information to the QQuickItem::itemChange() function.
+ \sa QQuickItem::ItemChange
+ */
+
+/*!
+ \variable QQuickItem::ItemChangeData::window
+ Contains supplimentary information to the QQuickItem::itemChange() function.
+ \sa QQuickItem::ItemChange
+ */
+
+/*!
\enum QQuickItem::TransformOrigin
Controls the point about which simple transforms like scale apply.
@@ -2161,6 +2237,11 @@ void QQuickItem::stackAfter(const QQuickItem *sibling)
/*!
Returns the window in which this item is rendered.
+
+ The item does not have a window until it has been assigned into a scene. To
+ get notification about this, reimplement the itemChange() function and
+ listen for the ItemSceneChange change. The itemChange() function is called
+ both when the item is entered into a scene and when it is removed from a scene.
*/
QQuickWindow *QQuickItem::window() const
{
@@ -4190,7 +4271,10 @@ void QQuickItemPrivate::deliverDragEvent(QEvent *e)
#endif // QT_NO_DRAGANDDROP
/*!
- \internal
+ Called when \a change occurs for this item.
+
+ \a value contains extra information relating to the change, when
+ applicable.
*/
void QQuickItem::itemChange(ItemChange change, const ItemChangeData &value)
{
diff --git a/src/quick/items/qquickloader.cpp b/src/quick/items/qquickloader.cpp
index 210132effc..61f9a27d3b 100644
--- a/src/quick/items/qquickloader.cpp
+++ b/src/quick/items/qquickloader.cpp
@@ -941,7 +941,7 @@ v8::Handle<v8::Object> QQuickLoaderPrivate::extractInitialPropertyValues(QQmlV8F
v8::Local<v8::Value> v = (*args)[1];
if (!v->IsObject() || v->IsArray()) {
*error = true;
- qmlInfo(loader) << loader->tr("setSource: value is not an object");
+ qmlInfo(loader) << QQuickLoader::tr("setSource: value is not an object");
} else {
*error = false;
valuemap = v8::Local<v8::Object>::Cast(v);
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index 5a97f77e56..917eaeadd8 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -527,10 +527,13 @@ void QQuickTextPrivate::updateSize()
}
if (internalWidthUpdate)
return;
- if (wrapMode != QQuickText::NoWrap && q->widthValid())
+
+ extra->doc->setPageSize(QSizeF());
+ if (q->widthValid() && (wrapMode != QQuickText::NoWrap || extra->doc->idealWidth() < q->width()))
extra->doc->setTextWidth(q->width());
else
extra->doc->setTextWidth(extra->doc->idealWidth()); // ### Text does not align if width is not set (QTextDoc bug)
+
widthExceeded = extra->doc->textWidth() < extra->doc->idealWidth();
QSizeF dsize = extra->doc->size();
layedOutTextRect = QRectF(QPointF(0,0), dsize);
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index 906758903d..b305ad116a 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -3275,6 +3275,7 @@ bool QQuickTextInputPrivate::finishChange(int validateFromState, bool update, bo
bool inputMethodAttributesChanged = m_textDirty || m_selDirty;
#endif
bool alignmentChanged = false;
+ bool textChanged = false;
if (m_textDirty) {
// do validation
@@ -3309,6 +3310,7 @@ bool QQuickTextInputPrivate::finishChange(int validateFromState, bool update, bo
}
if (m_textDirty) {
+ textChanged = true;
m_textDirty = false;
#ifndef QT_NO_IM
m_preeditDirty = false;
@@ -3344,7 +3346,7 @@ bool QQuickTextInputPrivate::finishChange(int validateFromState, bool update, bo
#endif
emitUndoRedoChanged();
- if (!emitCursorPositionChanged() && alignmentChanged)
+ if (!emitCursorPositionChanged() && (alignmentChanged || textChanged))
q->updateCursorRectangle();
return true;
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 086865aec3..ea454367a9 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -1155,8 +1155,6 @@ bool QQuickWindow::event(QEvent *e)
case QEvent::Leave:
d->clearHover();
d->lastMousePosition = QPoint();
- if (d->mouseGrabberItem)
- d->mouseGrabberItem->ungrabMouse();
break;
#ifndef QT_NO_DRAGANDDROP
case QEvent::DragEnter:
@@ -1174,6 +1172,8 @@ bool QQuickWindow::event(QEvent *e)
if (d->activeFocusItem)
qGuiApp->inputMethod()->commit();
#endif
+ if (d->mouseGrabberItem)
+ d->mouseGrabberItem->ungrabMouse();
break;
default:
break;
diff --git a/src/quick/util/qquickimageprovider.cpp b/src/quick/util/qquickimageprovider.cpp
index fb75a7669e..4e3748f78f 100644
--- a/src/quick/util/qquickimageprovider.cpp
+++ b/src/quick/util/qquickimageprovider.cpp
@@ -52,7 +52,7 @@ public:
/*!
\class QQuickTextureFactory
- \since 5.0
+ \since QtQuick 2.0
\brief The QQuickTextureFactory class provides an interface for loading custom textures from QML.
\inmodule QtQuick
@@ -127,7 +127,7 @@ QImage QQuickTextureFactory::image() const
/*!
\class QQuickImageProvider
- \since 5.0
+ \since QtQuick 2.0
\inmodule QtQuick
\brief The QQuickImageProvider class provides an interface for supporting pixmaps and threaded image requests in QML.
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
index e43c5e9b71..dda2fbe2b0 100644
--- a/src/quick/util/qquickpixmapcache.cpp
+++ b/src/quick/util/qquickpixmapcache.cpp
@@ -565,6 +565,8 @@ void QQuickPixmapReader::processJob(QQuickPixmapReply *runningJob, const QUrl &u
mutex.lock();
if (!cancelled.contains(runningJob))
runningJob->postReply(errorCode, errorStr, readSize, t);
+ else
+ delete t;
mutex.unlock();
}