aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-08-12 12:51:49 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-12 13:29:27 +0200
commit1f4427dae80712d07a25f8f2d49c187adcbecc6c (patch)
tree2bc43475117bf9865f86ae00b2b080f2b17d1222 /src
parent2f9746fbc4ef5439e4c9709353aaf8fe71cff771 (diff)
parentde6851aca7b1d3d08a1b5759fc28f61af5d53243 (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src')
-rw-r--r--src/qml/debugger/qqmldebugservice.cpp36
-rw-r--r--src/qml/qml/qqmlcomponent.cpp103
-rw-r--r--src/qml/qml/qqmlfile.cpp43
-rw-r--r--src/quick/items/qquicktextnodeengine.cpp6
-rw-r--r--src/quick/items/qquicktextnodeengine_p.h10
-rw-r--r--src/quick/scenegraph/coreapi/qsggeometry.h24
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp5
-rw-r--r--src/quick/scenegraph/util/qsgtexturematerial.h8
8 files changed, 118 insertions, 117 deletions
diff --git a/src/qml/debugger/qqmldebugservice.cpp b/src/qml/debugger/qqmldebugservice.cpp
index f9a8090da2..f036dd9d69 100644
--- a/src/qml/debugger/qqmldebugservice.cpp
+++ b/src/qml/debugger/qqmldebugservice.cpp
@@ -215,25 +215,25 @@ QList<QObject*> QQmlDebugService::objectForLocationInfo(const QString &filename,
{
ObjectReferenceHash *hash = objectReferenceHash();
QList<QObject*> objects;
- QHash<int, QObject *>::Iterator iter;
- for (iter = hash->ids.begin(); iter != hash->ids.end(); ++iter) {
- QQmlData *ddata = QQmlData::get(iter.value());
- if (!ddata || !ddata->outerContext)
- continue;
- //column number may be different due to qmlrewriter
- if (QFileInfo(ddata->outerContext->urlString).fileName() == filename &&
- ddata->lineNumber == lineNumber &&
- ddata->columnNumber >= columnNumber) {
- QHash<QObject *, ObjectReference>::Iterator objIter =
- hash->objects.find(*iter);
- Q_ASSERT(objIter != hash->objects.end());
-
- if (objIter->object == 0) {
- hash->ids.erase(iter);
- hash->objects.erase(objIter);
- } else {
- objects << *iter;
+ QHash<int, QObject *>::Iterator iter = hash->ids.begin();
+ while (iter != hash->ids.end()) {
+ QHash<QObject *, ObjectReference>::Iterator objIter =
+ hash->objects.find(*iter);
+ Q_ASSERT(objIter != hash->objects.end());
+
+ if (objIter->object == 0) {
+ iter = hash->ids.erase(iter);
+ hash->objects.erase(objIter);
+ } else {
+ QQmlData *ddata = QQmlData::get(iter.value());
+ if (ddata && ddata->outerContext) {
+ if (QFileInfo(ddata->outerContext->urlString).fileName() == filename &&
+ ddata->lineNumber == lineNumber &&
+ ddata->columnNumber >= columnNumber) {
+ objects << *iter;
+ }
}
+ ++iter;
}
}
return objects;
diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp
index 850ee53ab7..8f1233555b 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -171,12 +171,12 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject)
If the URL passed to QQmlComponent is a network resource, or if the QML document references a
network resource, the QQmlComponent has to fetch the network data before it is able to create
- objects. In this case, the QQmlComponent will have a \l {QQmlComponent::Loading}{Loading}
- \l {QQmlComponent::status()}{status}. An application will have to wait until the component
+ objects. In this case, the QQmlComponent will have a \l {QQmlComponent::Loading}{Loading}
+ \l {QQmlComponent::status()}{status}. An application will have to wait until the component
is \l {QQmlComponent::Ready}{Ready} before calling \l {QQmlComponent::create()}.
- The following example shows how to load a QML file from a network resource. After creating
- the QQmlComponent, it tests whether the component is loading. If it is, it connects to the
+ The following example shows how to load a QML file from a network resource. After creating
+ the QQmlComponent, it tests whether the component is loading. If it is, it connects to the
QQmlComponent::statusChanged() signal and otherwise calls the \c {continueLoading()} method
directly. Note that QQmlComponent::isLoading() may be false for a network component if the
component has been cached and is ready immediately.
@@ -235,8 +235,8 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject)
anchor anything to it.
Defining a \c Component is similar to defining a \l {QML Document}{QML document}.
- A QML document has a single top-level item that defines the behaviors and
- properties of that component, and cannot define properties or behaviors outside
+ A QML document has a single top-level item that defines the behavior and
+ properties of that component, and cannot define properties or behavior outside
of that top-level item. In the same way, a \c Component definition contains a single
top level item (which in the above example is a \l Rectangle) and cannot define any
data outside of this item, with the exception of an \e id (which in the above example
@@ -274,12 +274,12 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject)
/*!
\qmlattachedsignal Component::onCompleted()
- Emitted after component "startup" has completed. This can be used to
+ Emitted after component "startup" has completed. This can be used to
execute script code at startup, once the full QML environment has been
established.
The \c {Component::onCompleted} attached property can be declared on
- any object. The order of running the \c onCompleted scripts is
+ any object. The order of running the \c onCompleted scripts is
undefined.
\qml
@@ -295,13 +295,13 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject)
/*!
\qmlattachedsignal Component::onDestruction()
- Emitted as the component begins destruction. This can be used to undo
+ Emitted as the component begins destruction. This can be used to undo
work done in the onCompleted signal, or other imperative code in your
application.
The \c {Component::onDestruction} attached property can be declared on
- any object. However, it applies to the destruction of the component as
- a whole, and not the destruction of the specific object. The order of
+ any object. However, it applies to the destruction of the component as
+ a whole, and not the destruction of the specific object. The order of
running the \c onDestruction scripts is undefined.
\qml
@@ -321,10 +321,10 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject)
Specifies the loading status of the QQmlComponent.
- \value Null This QQmlComponent has no data. Call loadUrl() or setData() to add QML content.
+ \value Null This QQmlComponent has no data. Call loadUrl() or setData() to add QML content.
\value Ready This QQmlComponent is ready and create() may be called.
\value Loading This QQmlComponent is loading network data.
- \value Error An error has occurred. Call errors() to retrieve a list of \{QQmlError}{errors}.
+ \value Error An error has occurred. Call errors() to retrieve a list of \{QQmlError}{errors}.
*/
/*!
@@ -333,7 +333,7 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject)
Specifies whether the QQmlComponent should load the component immediately, or asynchonously.
\value PreferSynchronous Prefer loading/compiling the component immediately, blocking the thread.
- This is not always possible, e.g. remote URLs will always load asynchronously.
+ This is not always possible; for example, remote URLs will always load asynchronously.
\value Asynchronous Load/compile the component in a background thread.
*/
@@ -420,7 +420,8 @@ QQmlComponent::~QQmlComponent()
/*!
\qmlproperty enumeration Component::status
- This property holds the status of component loading. It can be one of:
+ This property holds the status of component loading. The status can be one of the
+ following:
\list
\li Component.Null - no data is available for the component
\li Component.Ready - the component has been loaded, and can be used to create instances.
@@ -500,14 +501,14 @@ qreal QQmlComponent::progress() const
/*!
\fn void QQmlComponent::progressChanged(qreal progress)
- Emitted whenever the component's loading progress changes. \a progress will be the
+ Emitted whenever the component's loading progress changes. \a progress will be the
current progress between 0.0 (nothing loaded) and 1.0 (finished).
*/
/*!
\fn void QQmlComponent::statusChanged(QQmlComponent::Status status)
- Emitted whenever the component's status changes. \a status will be the
+ Emitted whenever the component's status changes. \a status will be the
new status.
*/
@@ -541,7 +542,7 @@ QQmlComponent::QQmlComponent(QQmlEngine *engine, const QUrl &url, QObject *paren
/*!
Create a QQmlComponent from the given \a url and give it the
- specified \a parent and \a engine. If \a mode is \l Asynchronous,
+ specified \a parent and \a engine. If \a mode is \l Asynchronous,
the component will be loaded and compiled asynchronously.
Ensure that the URL provided is full and correct, in particular, use
@@ -575,7 +576,7 @@ QQmlComponent::QQmlComponent(QQmlEngine *engine, const QString &fileName,
/*!
Create a QQmlComponent from the given \a fileName and give it the specified
- \a parent and \a engine. If \a mode is \l Asynchronous,
+ \a parent and \a engine. If \a mode is \l Asynchronous,
the component will be loaded and compiled asynchronously.
\sa loadUrl()
@@ -605,7 +606,7 @@ QQmlComponent::QQmlComponent(QQmlEngine *engine, QQmlCompiledData *cc, int start
}
/*!
- Sets the QQmlComponent to use the given QML \a data. If \a url
+ Sets the QQmlComponent to use the given QML \a data. If \a url
is provided, it is used to set the component name and to provide
a base path for items resolved by this component.
*/
@@ -632,7 +633,7 @@ void QQmlComponent::setData(const QByteArray &data, const QUrl &url)
}
/*!
-Returns the QQmlContext the component was created in. This is only
+Returns the QQmlContext the component was created in. This is only
valid for components created directly from QML.
*/
QQmlContext *QQmlComponent::creationContext() const
@@ -714,7 +715,7 @@ void QQmlComponentPrivate::loadUrl(const QUrl &newUrl, QQmlComponent::Compilatio
/*!
Return the list of errors that occurred during the last compile or create
- operation. An empty list is returned if isError() is not set.
+ operation. An empty list is returned if isError() is not set.
*/
QList<QQmlError> QQmlComponent::errors() const
{
@@ -728,10 +729,10 @@ QList<QQmlError> QQmlComponent::errors() const
/*!
\qmlmethod string Component::errorString()
- Returns a human-readable description of any errors.
+ Returns a human-readable description of any error.
The string includes the file, location, and description of each error.
- If multiple errors are present they are separated by a newline character.
+ If multiple errors are present, they are separated by a newline character.
If no errors are present, an empty string is returned.
*/
@@ -756,13 +757,13 @@ QString QQmlComponent::errorString() const
/*!
\qmlproperty url Component::url
- The component URL. This is the URL that was used to construct the component.
+ The component URL. This is the URL that was used to construct the component.
*/
/*!
\property QQmlComponent::url
- The component URL. This is the URL passed to either the constructor,
- or the loadUrl() or setData() methods.
+ The component URL. This is the URL passed to either the constructor,
+ or the loadUrl(), or setData() methods.
*/
QUrl QQmlComponent::url() const
{
@@ -779,8 +780,8 @@ 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
+ Create an object instance from this component. Returns 0 if creation
+ failed. \a context specifies the context within which to create the object
instance.
If \a context is 0 (the default), it will create the instance in the
@@ -809,8 +810,8 @@ QObject *QQmlComponent::create(QQmlContext *context)
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
+ Create an object instance from this component. Returns 0 if creation
+ failed. \a publicContext specifies the context within which to create the object
instance.
When QQmlComponent constructs an instance, it occurs in three steps:
@@ -820,7 +821,7 @@ QObject *QQmlComponent::create(QQmlContext *context)
\li If applicable, QQmlParserStatus::componentComplete() is called on objects.
\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
@@ -1028,7 +1029,7 @@ QQmlComponentAttached *QQmlComponent::qmlAttachedProperties(QObject *obj)
/*!
Create an object instance from this component using the provided
- \a incubator. \a context specifies the context within which to create the object
+ \a incubator. \a context specifies the context within which to create the object
instance.
If \a context is 0 (the default), it will create the instance in the
@@ -1037,7 +1038,7 @@ QQmlComponentAttached *QQmlComponent::qmlAttachedProperties(QObject *obj)
\a forContext specifies a context that this object creation depends upon.
If the \a forContext is being created asynchronously, and the
\l QQmlIncubator::IncubationMode is \l QQmlIncubator::AsynchronousIfNested,
- this object will also be created asynchronously. If \a forContext is 0
+ this object will also be created asynchronously. If \a forContext is 0
(the default), the \a context will be used for this decision.
The created object and its creation status are available via the
@@ -1149,20 +1150,20 @@ static void QQmlComponent_setQmlParent(QObject *me, QObject *parent)
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}
- property, or else the object will not be visible.
+ property, otherwise 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
- it is not destroyed by the garbage collector. This is true regardless of whether \l{Item::parent} is set afterwards,
- since setting the Item parent does not change object ownership; only the graphical parent is changed.
+ it is not destroyed by the garbage collector. This is true regardless of whether \l{Item::parent} is set afterwards,
+ because setting the Item parent does not change object ownership. Only the graphical parent is changed.
As of \c {QtQuick 1.1}, this method accepts an optional \a properties argument that specifies a
- map of initial property values for the created object. These values are applied before object
+ map of initial property values for the created object. These values are applied before the object
creation is finalized. This is more efficient than setting property values after object creation,
particularly where large sets of property values are defined, and also allows property bindings
to be set up (using \l{Qt::binding}{Qt.binding}) before the object is created.
The \a properties argument is specified as a map of property-value items. For example, the code
- below creates an object with initial \c x and \c y values of 100 and 200, respectively:
+ below creates an object with initial \c x and \c y values of 100 and 100, respectively:
\js
var component = Qt.createComponent("Button.qml");
@@ -1243,31 +1244,31 @@ void QQmlComponent::createObject(QQmlV4Function *args)
/*!
\qmlmethod object Component::incubateObject(Item parent, object properties, enumeration mode)
- Creates an incubator for instance of this component. Incubators allow new component
- instances to be instantiated asynchronously and not cause freezes in the UI.
+ Creates an incubator for an instance of this component. Incubators allow new component
+ instances to be instantiated asynchronously and do not cause freezes in the UI.
- The \a parent argument specifies the parent the created instance will have. Omitting the
- parameter or passing null will create an object with no parent. In this case, a reference
+ The \a parent argument specifies the parent the created instance will have. Omitting the
+ parameter or passing null will create an object with no parent. In this case, a reference
to the created object must be held so that it is not destroyed by the garbage collector.
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.
- 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
+ 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 asynchronous. 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.
All three arguments are optional.
- If successful, the method returns an incubator, otherwise null. The incubator has the following
+ If successful, the method returns an incubator, otherwise null. The incubator has the following
properties:
\list
- \li status The status of the incubator. Valid values are Component.Ready, Component.Loading and
+ \li status The status of the incubator. Valid values are Component.Ready, Component.Loading and
Component.Error.
- \li object The created object instance. Will only be available once the incubator is in the
+ \li object The created object instance. Will only be available once the incubator is in the
Ready status.
- \li onStatusChanged Specifies a callback function to be invoked when the status changes. The
+ \li onStatusChanged Specifies a callback function to be invoked when the status changes. The
status is passed as a parameter to the callback.
\li forceCompletion() Call to complete incubation synchronously.
\endlist
diff --git a/src/qml/qml/qqmlfile.cpp b/src/qml/qml/qqmlfile.cpp
index 4e76fbd2e5..be9b011dda 100644
--- a/src/qml/qml/qqmlfile.cpp
+++ b/src/qml/qml/qqmlfile.cpp
@@ -60,12 +60,12 @@ Supports file://, qrc:/, bundle:// uris and whatever QNetworkAccessManager suppo
QT_BEGIN_NAMESPACE
-static QString qrc_string(QLatin1String("qrc"));
-static QString file_string(QLatin1String("file"));
-static QString bundle_string(QLatin1String("bundle"));
+static char qrc_string[] = "qrc";
+static char file_string[] = "file";
+static char bundle_string[] = "bundle";
#if defined(Q_OS_ANDROID)
-static QString assets_string(QLatin1String("assets"));
+static char assets_string[] = "assets";
#endif
class QQmlFilePrivate;
@@ -326,8 +326,6 @@ void QQmlFile::load(QQmlEngine *engine, const QUrl &url)
{
Q_ASSERT(engine);
- QString scheme = url.scheme();
-
clear();
d->url = url;
@@ -495,13 +493,13 @@ bool QQmlFile::isSynchronous(const QUrl &url)
{
QString scheme = url.scheme();
- if ((scheme.length() == 4 && 0 == scheme.compare(file_string, Qt::CaseInsensitive)) ||
- (scheme.length() == 6 && 0 == scheme.compare(bundle_string, Qt::CaseInsensitive)) ||
- (scheme.length() == 3 && 0 == scheme.compare(qrc_string, Qt::CaseInsensitive))) {
+ if ((scheme.length() == 4 && 0 == scheme.compare(QLatin1String(file_string), Qt::CaseInsensitive)) ||
+ (scheme.length() == 6 && 0 == scheme.compare(QLatin1String(bundle_string), Qt::CaseInsensitive)) ||
+ (scheme.length() == 3 && 0 == scheme.compare(QLatin1String(qrc_string), Qt::CaseInsensitive))) {
return true;
#if defined(Q_OS_ANDROID)
- } else if (scheme.length() == 6 && 0 == scheme.compare(assets_string, Qt::CaseInsensitive)) {
+ } else if (scheme.length() == 6 && 0 == scheme.compare(QLatin1String(assets_string), Qt::CaseInsensitive)) {
return true;
#endif
@@ -527,19 +525,19 @@ bool QQmlFile::isSynchronous(const QString &url)
if (f == QLatin1Char('f') || f == QLatin1Char('F')) {
return url.length() >= 7 /* file:// */ &&
- url.startsWith(file_string, Qt::CaseInsensitive) &&
+ url.startsWith(QLatin1String(file_string), Qt::CaseInsensitive) &&
url[4] == QLatin1Char(':') && url[5] == QLatin1Char('/') && url[6] == QLatin1Char('/');
} else if (f == QLatin1Char('b') || f == QLatin1Char('B')) {
return url.length() >= 9 /* bundle:// */ &&
- url.startsWith(bundle_string, Qt::CaseInsensitive) &&
+ url.startsWith(QLatin1String(bundle_string), Qt::CaseInsensitive) &&
url[6] == QLatin1Char(':') && url[7] == QLatin1Char('/') && url[8] == QLatin1Char('/');
} else if (f == QLatin1Char('q') || f == QLatin1Char('Q')) {
return url.length() >= 5 /* qrc:/ */ &&
- url.startsWith(qrc_string, Qt::CaseInsensitive) &&
+ url.startsWith(QLatin1String(qrc_string), Qt::CaseInsensitive) &&
url[3] == QLatin1Char(':') && url[4] == QLatin1Char('/');
}
@@ -547,7 +545,7 @@ bool QQmlFile::isSynchronous(const QString &url)
#if defined(Q_OS_ANDROID)
else if (f == QLatin1Char('a') || f == QLatin1Char('A')) {
return url.length() >= 8 /* assets:/ */ &&
- url.startsWith(assets_string, Qt::CaseInsensitive) &&
+ url.startsWith(QLatin1String(assets_string), Qt::CaseInsensitive) &&
url[6] == QLatin1Char(':') && url[7] == QLatin1Char('/');
}
@@ -563,7 +561,7 @@ Bundle urls have a bundle:// scheme.
*/
bool QQmlFile::isBundle(const QString &url)
{
- return url.length() >= 9 && url.startsWith(bundle_string, Qt::CaseInsensitive) &&
+ return url.length() >= 9 && url.startsWith(QLatin1String(bundle_string), Qt::CaseInsensitive) &&
url[6] == QLatin1Char(':') && url[7] == QLatin1Char('/') && url[8] == QLatin1Char('/');
}
@@ -576,7 +574,7 @@ bool QQmlFile::isBundle(const QUrl &url)
{
QString scheme = url.scheme();
- return scheme.length() == 6 && 0 == scheme.compare(bundle_string, Qt::CaseInsensitive);
+ return scheme.length() == 6 && 0 == scheme.compare(QLatin1String(bundle_string), Qt::CaseInsensitive);
}
/*!
@@ -590,12 +588,12 @@ bool QQmlFile::isLocalFile(const QUrl &url)
{
QString scheme = url.scheme();
- if ((scheme.length() == 4 && 0 == scheme.compare(file_string, Qt::CaseInsensitive)) ||
- (scheme.length() == 3 && 0 == scheme.compare(qrc_string, Qt::CaseInsensitive))) {
+ if ((scheme.length() == 4 && 0 == scheme.compare(QLatin1String(file_string), Qt::CaseInsensitive)) ||
+ (scheme.length() == 3 && 0 == scheme.compare(QLatin1String(qrc_string), Qt::CaseInsensitive))) {
return true;
#if defined(Q_OS_ANDROID)
- } else if (scheme.length() == 6 && 0 == scheme.compare(assets_string, Qt::CaseInsensitive)) {
+ } else if (scheme.length() == 6 && 0 == scheme.compare(QLatin1String(assets_string), Qt::CaseInsensitive)) {
return true;
#endif
@@ -621,20 +619,20 @@ bool QQmlFile::isLocalFile(const QString &url)
if (f == QLatin1Char('f') || f == QLatin1Char('F')) {
return url.length() >= 7 /* file:// */ &&
- url.startsWith(file_string, Qt::CaseInsensitive) &&
+ url.startsWith(QLatin1String(file_string), Qt::CaseInsensitive) &&
url[4] == QLatin1Char(':') && url[5] == QLatin1Char('/') && url[6] == QLatin1Char('/');
} else if (f == QLatin1Char('q') || f == QLatin1Char('Q')) {
return url.length() >= 5 /* qrc:/ */ &&
- url.startsWith(qrc_string, Qt::CaseInsensitive) &&
+ url.startsWith(QLatin1String(qrc_string), Qt::CaseInsensitive) &&
url[3] == QLatin1Char(':') && url[4] == QLatin1Char('/');
}
#if defined(Q_OS_ANDROID)
else if (f == QLatin1Char('a') || f == QLatin1Char('A')) {
return url.length() >= 8 /* assets:/ */ &&
- url.startsWith(assets_string, Qt::CaseInsensitive) &&
+ url.startsWith(QLatin1String(assets_string), Qt::CaseInsensitive) &&
url[6] == QLatin1Char(':') && url[7] == QLatin1Char('/');
}
@@ -717,7 +715,6 @@ bool QQmlFile::bundleDirectoryExists(const QString &dir, QQmlEngine *e)
return false;
QStringRef identifier(&dir, 9, index - 9);
- QStringRef path(&dir, index + 1, dir.length() - index - 1);
QQmlBundleData *bundle = QQmlEnginePrivate::get(e)->typeLoader.getBundle(identifier);
diff --git a/src/quick/items/qquicktextnodeengine.cpp b/src/quick/items/qquicktextnodeengine.cpp
index 7bbfd1bcda..ce4506310a 100644
--- a/src/quick/items/qquicktextnodeengine.cpp
+++ b/src/quick/items/qquicktextnodeengine.cpp
@@ -58,7 +58,7 @@
QT_BEGIN_NAMESPACE
-void QQuickTextNodeEngine::BinaryTreeNode::insert(QVarLengthArray<BinaryTreeNode> *binaryTree, const QGlyphRun &glyphRun, SelectionState selectionState,
+void QQuickTextNodeEngine::BinaryTreeNode::insert(QVarLengthArray<BinaryTreeNode, 16> *binaryTree, const QGlyphRun &glyphRun, SelectionState selectionState,
QQuickTextNode::Decorations decorations, const QColor &textColor,
const QColor &backgroundColor, const QPointF &position)
{
@@ -78,7 +78,7 @@ void QQuickTextNodeEngine::BinaryTreeNode::insert(QVarLengthArray<BinaryTreeNode
textColor, backgroundColor, position, ascent));
}
-void QQuickTextNodeEngine::BinaryTreeNode::insert(QVarLengthArray<BinaryTreeNode> *binaryTree, const BinaryTreeNode &binaryTreeNode)
+void QQuickTextNodeEngine::BinaryTreeNode::insert(QVarLengthArray<BinaryTreeNode, 16> *binaryTree, const BinaryTreeNode &binaryTreeNode)
{
int newIndex = binaryTree->size();
binaryTree->append(binaryTreeNode);
@@ -106,7 +106,7 @@ void QQuickTextNodeEngine::BinaryTreeNode::insert(QVarLengthArray<BinaryTreeNode
}
}
-void QQuickTextNodeEngine::BinaryTreeNode::inOrder(const QVarLengthArray<BinaryTreeNode> &binaryTree,
+void QQuickTextNodeEngine::BinaryTreeNode::inOrder(const QVarLengthArray<BinaryTreeNode, 16> &binaryTree,
QVarLengthArray<int> *sortedIndexes, int currentIndex)
{
Q_ASSERT(currentIndex < binaryTree.size());
diff --git a/src/quick/items/qquicktextnodeengine_p.h b/src/quick/items/qquicktextnodeengine_p.h
index 6a98d6b470..9de71c6a40 100644
--- a/src/quick/items/qquicktextnodeengine_p.h
+++ b/src/quick/items/qquicktextnodeengine_p.h
@@ -103,13 +103,13 @@ public:
int leftChildIndex;
int rightChildIndex;
- static void insert(QVarLengthArray<BinaryTreeNode> *binaryTree, const QRectF &rect, const QImage &image, qreal ascent, SelectionState selectionState)
+ static void insert(QVarLengthArray<BinaryTreeNode, 16> *binaryTree, const QRectF &rect, const QImage &image, qreal ascent, SelectionState selectionState)
{ insert(binaryTree, BinaryTreeNode(rect, image, selectionState, ascent)); }
- static void insert(QVarLengthArray<BinaryTreeNode> *binaryTree, const QGlyphRun &glyphRun, SelectionState selectionState,
+ static void insert(QVarLengthArray<BinaryTreeNode, 16> *binaryTree, const QGlyphRun &glyphRun, SelectionState selectionState,
QQuickTextNode::Decorations decorations, const QColor &textColor, const QColor &backgroundColor, const QPointF &position);
- static void insert(QVarLengthArray<BinaryTreeNode> *binaryTree, const BinaryTreeNode &binaryTreeNode);
- static void inOrder(const QVarLengthArray<BinaryTreeNode> &binaryTree, QVarLengthArray<int> *sortedIndexes, int currentIndex = 0);
+ static void insert(QVarLengthArray<BinaryTreeNode, 16> *binaryTree, const BinaryTreeNode &binaryTreeNode);
+ static void inOrder(const QVarLengthArray<BinaryTreeNode, 16> &binaryTree, QVarLengthArray<int> *sortedIndexes, int currentIndex = 0);
};
QQuickTextNodeEngine() : m_hasSelection(false), m_hasContents(false) {}
@@ -216,7 +216,7 @@ private:
QList<QPair<QRectF, QColor> > m_backgrounds;
QList<QRectF> m_selectionRects;
- QVarLengthArray<BinaryTreeNode> m_currentLineTree;
+ QVarLengthArray<BinaryTreeNode, 16> m_currentLineTree;
QList<TextDecoration> m_lines;
QVector<BinaryTreeNode> m_processedNodes;
diff --git a/src/quick/scenegraph/coreapi/qsggeometry.h b/src/quick/scenegraph/coreapi/qsggeometry.h
index 78ad03e411..f1d8c875b6 100644
--- a/src/quick/scenegraph/coreapi/qsggeometry.h
+++ b/src/quick/scenegraph/coreapi/qsggeometry.h
@@ -151,10 +151,10 @@ public:
static void updateTexturedRectGeometry(QSGGeometry *g, const QRectF &rect, const QRectF &sourceRect);
void setIndexDataPattern(DataPattern p);
- DataPattern indexDataPattern() const { return (DataPattern) m_index_usage_pattern; }
+ DataPattern indexDataPattern() const { return DataPattern(m_index_usage_pattern); }
void setVertexDataPattern(DataPattern p);
- DataPattern vertexDataPattern() const { return (DataPattern) m_vertex_usage_pattern; }
+ DataPattern vertexDataPattern() const { return DataPattern(m_vertex_usage_pattern); }
void markIndexDataDirty();
void markVertexDataDirty();
@@ -190,25 +190,25 @@ private:
inline uint *QSGGeometry::indexDataAsUInt()
{
Q_ASSERT(m_index_type == GL_UNSIGNED_INT);
- return (uint *) indexData();
+ return static_cast<uint *>(indexData());
}
inline quint16 *QSGGeometry::indexDataAsUShort()
{
Q_ASSERT(m_index_type == GL_UNSIGNED_SHORT);
- return (quint16 *) indexData();
+ return static_cast<quint16 *>(indexData());
}
inline const uint *QSGGeometry::indexDataAsUInt() const
{
Q_ASSERT(m_index_type == GL_UNSIGNED_INT);
- return (uint *) indexData();
+ return static_cast<const uint *>(indexData());
}
inline const quint16 *QSGGeometry::indexDataAsUShort() const
{
Q_ASSERT(m_index_type == GL_UNSIGNED_SHORT);
- return (quint16 *) indexData();
+ return static_cast<const quint16 *>(indexData());
}
inline QSGGeometry::Point2D *QSGGeometry::vertexDataAsPoint2D()
@@ -218,7 +218,7 @@ inline QSGGeometry::Point2D *QSGGeometry::vertexDataAsPoint2D()
Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT);
Q_ASSERT(m_attributes.attributes[0].position == 0);
- return (Point2D *) m_data;
+ return static_cast<Point2D *>(m_data);
}
inline QSGGeometry::TexturedPoint2D *QSGGeometry::vertexDataAsTexturedPoint2D()
@@ -231,7 +231,7 @@ inline QSGGeometry::TexturedPoint2D *QSGGeometry::vertexDataAsTexturedPoint2D()
Q_ASSERT(m_attributes.attributes[1].position == 1);
Q_ASSERT(m_attributes.attributes[1].tupleSize == 2);
Q_ASSERT(m_attributes.attributes[1].type == GL_FLOAT);
- return (TexturedPoint2D *) m_data;
+ return static_cast<TexturedPoint2D *>(m_data);
}
inline QSGGeometry::ColoredPoint2D *QSGGeometry::vertexDataAsColoredPoint2D()
@@ -244,7 +244,7 @@ inline QSGGeometry::ColoredPoint2D *QSGGeometry::vertexDataAsColoredPoint2D()
Q_ASSERT(m_attributes.attributes[1].position == 1);
Q_ASSERT(m_attributes.attributes[1].tupleSize == 4);
Q_ASSERT(m_attributes.attributes[1].type == GL_UNSIGNED_BYTE);
- return (ColoredPoint2D *) m_data;
+ return static_cast<ColoredPoint2D *>(m_data);
}
inline const QSGGeometry::Point2D *QSGGeometry::vertexDataAsPoint2D() const
@@ -254,7 +254,7 @@ inline const QSGGeometry::Point2D *QSGGeometry::vertexDataAsPoint2D() const
Q_ASSERT(m_attributes.attributes[0].tupleSize == 2);
Q_ASSERT(m_attributes.attributes[0].type == GL_FLOAT);
Q_ASSERT(m_attributes.attributes[0].position == 0);
- return (const Point2D *) m_data;
+ return static_cast<const Point2D *>(m_data);
}
inline const QSGGeometry::TexturedPoint2D *QSGGeometry::vertexDataAsTexturedPoint2D() const
@@ -267,7 +267,7 @@ inline const QSGGeometry::TexturedPoint2D *QSGGeometry::vertexDataAsTexturedPoin
Q_ASSERT(m_attributes.attributes[1].position == 1);
Q_ASSERT(m_attributes.attributes[1].tupleSize == 2);
Q_ASSERT(m_attributes.attributes[1].type == GL_FLOAT);
- return (const TexturedPoint2D *) m_data;
+ return static_cast<const TexturedPoint2D *>(m_data);
}
inline const QSGGeometry::ColoredPoint2D *QSGGeometry::vertexDataAsColoredPoint2D() const
@@ -280,7 +280,7 @@ inline const QSGGeometry::ColoredPoint2D *QSGGeometry::vertexDataAsColoredPoint2
Q_ASSERT(m_attributes.attributes[1].position == 1);
Q_ASSERT(m_attributes.attributes[1].tupleSize == 4);
Q_ASSERT(m_attributes.attributes[1].type == GL_UNSIGNED_BYTE);
- return (const ColoredPoint2D *) m_data;
+ return static_cast<const ColoredPoint2D *>(m_data);
}
int QSGGeometry::sizeOfIndex() const
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index c8a1888a52..6edb3fe05d 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -964,8 +964,11 @@ void QSGThreadedRenderLoop::releaseResources(QQuickWindow *window, bool inDestru
void QSGThreadedRenderLoop::polishAndSync()
{
- if (!anyoneShowing())
+ if (!anyoneShowing()) {
+ killTimer(m_update_timer);
+ m_update_timer = 0;
return;
+ }
RLDEBUG("GUI: polishAndSync()");
diff --git a/src/quick/scenegraph/util/qsgtexturematerial.h b/src/quick/scenegraph/util/qsgtexturematerial.h
index b842779716..ff7933ec54 100644
--- a/src/quick/scenegraph/util/qsgtexturematerial.h
+++ b/src/quick/scenegraph/util/qsgtexturematerial.h
@@ -60,16 +60,16 @@ public:
QSGTexture *texture() const { return m_texture; }
void setMipmapFiltering(QSGTexture::Filtering filteringType) { m_mipmap_filtering = filteringType; }
- QSGTexture::Filtering mipmapFiltering() const { return (QSGTexture::Filtering) m_mipmap_filtering; }
+ QSGTexture::Filtering mipmapFiltering() const { return QSGTexture::Filtering(m_mipmap_filtering); }
void setFiltering(QSGTexture::Filtering filteringType) { m_filtering = filteringType; }
- QSGTexture::Filtering filtering() const { return (QSGTexture::Filtering) m_filtering; }
+ QSGTexture::Filtering filtering() const { return QSGTexture::Filtering(m_filtering); }
void setHorizontalWrapMode(QSGTexture::WrapMode mode) { m_horizontal_wrap = mode; }
- QSGTexture::WrapMode horizontalWrapMode() const { return (QSGTexture::WrapMode) m_horizontal_wrap; }
+ QSGTexture::WrapMode horizontalWrapMode() const { return QSGTexture::WrapMode(m_horizontal_wrap); }
void setVerticalWrapMode(QSGTexture::WrapMode mode) { m_vertical_wrap = mode; }
- QSGTexture::WrapMode verticalWrapMode() const { return (QSGTexture::WrapMode) m_vertical_wrap; }
+ QSGTexture::WrapMode verticalWrapMode() const { return QSGTexture::WrapMode(m_vertical_wrap); }
protected:
QSGTexture *m_texture;