aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.qmake.conf2
-rw-r--r--src/imports/folderlistmodel/qquickfolderlistmodel.cpp16
-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/qml/qml/qqmltypeloader.cpp18
-rw-r--r--src/quick/items/qquickflickable.cpp10
-rw-r--r--src/quick/items/qquickimplicitsizeitem.cpp16
-rw-r--r--src/quick/items/qquicklistview.cpp12
-rw-r--r--src/quick/items/qquickpainteditem.cpp3
-rw-r--r--src/quick/items/qquickpathview.cpp35
-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/qsgdefaultrectanglenode.cpp2
-rw-r--r--src/quick/scenegraph/qsgdistancefieldglyphnode.cpp2
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp9
-rw-r--r--src/quick/scenegraph/util/qsgtexturematerial.h8
-rw-r--r--tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp28
-rw-r--r--tests/auto/qmltest/fontloader/tst_fontloader.qml8
-rw-r--r--tests/auto/quick/qquickdrag/tst_qquickdrag.cpp46
-rw-r--r--tests/auto/quick/qquickflickable/data/ratios.qml71
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp23
-rw-r--r--tests/auto/quick/qquickgridview/qquickgridview.pro2
-rw-r--r--tests/auto/quick/qquickimage/data/qtbug_32513.qml63
-rw-r--r--tests/auto/quick/qquickimage/tst_qquickimage.cpp10
-rw-r--r--tests/auto/quick/qquickitem/tst_qquickitem.cpp167
-rw-r--r--tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml67
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp38
-rw-r--r--tests/auto/quick/qquickpath/tst_qquickpath.cpp4
-rw-r--r--tests/auto/quick/qquickpathview/tst_qquickpathview.cpp10
-rw-r--r--tests/auto/quick/qquicktextedit/data/hAlignVisual.qml1
-rw-r--r--tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp14
-rw-r--r--tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp13
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp2
-rw-r--r--tests/auto/quick/rendernode/tst_rendernode.cpp2
-rw-r--r--tests/auto/quick/touchmouse/touchmouse.pro2
37 files changed, 616 insertions, 310 deletions
diff --git a/.qmake.conf b/.qmake.conf
index a7e09bffc3..89914d2047 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -1,4 +1,4 @@
load(qt_build_config)
CONFIG += qt_example_installs
-MODULE_VERSION = 5.1.1
+MODULE_VERSION = 5.1.2
diff --git a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
index 7ba2981a4e..2f61a9abe7 100644
--- a/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
+++ b/src/imports/folderlistmodel/qquickfolderlistmodel.cpp
@@ -483,16 +483,12 @@ QUrl QQuickFolderListModel::parentFolder() const
QString localFile = d->currentDir.toLocalFile();
if (!localFile.isEmpty()) {
QDir dir(localFile);
-#if defined(Q_OS_WIN)
- if (dir.isRoot())
- dir.setPath("");
- else
-#endif
- dir.cdUp();
+ if (dir.isRoot() || !dir.cdUp())
+ return QUrl();
localFile = dir.path();
} else {
- int pos = d->currentDir.path().lastIndexOf(QLatin1Char('/'));
- if (pos == -1)
+ const int pos = d->currentDir.path().lastIndexOf(QLatin1Char('/'));
+ if (pos <= 0)
return QUrl();
localFile = d->currentDir.path().left(pos);
}
@@ -536,8 +532,8 @@ void QQuickFolderListModel::componentComplete()
{
Q_D(QQuickFolderListModel);
- if (!d->currentDir.isValid() || d->currentDir.toLocalFile().isEmpty() || !QDir().exists(d->currentDir.toLocalFile()))
- setFolder(QUrl(QLatin1String("file://")+QDir::currentPath()));
+ if (!d->currentDir.isValid() || !d->currentDir.isLocalFile() || !QDir().exists(d->currentDir.toLocalFile()))
+ setFolder(QUrl::fromLocalFile(QDir::currentPath()));
}
/*!
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 df1e7f420e..c7b2f146c2 100644
--- a/src/qml/qml/qqmlcomponent.cpp
+++ b/src/qml/qml/qqmlcomponent.cpp
@@ -154,12 +154,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.
@@ -217,8 +217,8 @@ static inline QString buildTypeNameForDebug(const QMetaObject *metaObject)
two \l Loader objects).
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
@@ -256,12 +256,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
@@ -277,13 +277,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
@@ -303,10 +303,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}.
*/
/*!
@@ -315,7 +315,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.
*/
@@ -402,7 +402,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.
@@ -482,14 +483,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.
*/
@@ -523,7 +524,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
@@ -557,7 +558,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()
@@ -587,7 +588,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.
*/
@@ -614,7 +615,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
@@ -696,7 +697,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
{
@@ -710,10 +711,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.
*/
@@ -738,13 +739,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
{
@@ -761,8 +762,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
@@ -791,8 +792,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:
@@ -802,7 +803,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
@@ -1010,7 +1011,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
@@ -1019,7 +1020,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
@@ -1135,20 +1136,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");
@@ -1228,31 +1229,31 @@ 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
- 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/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 8d8503f344..38ee9211f8 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -1683,14 +1683,7 @@ QString QQmlTypeLoader::absoluteFilePath(const QString &path)
StringSet **fileSet = m_importDirCache.value(QHashedStringRef(dirPath.constData(), dirPath.length()));
if (!fileSet) {
QHashedString dirPathString(dirPath.toString());
- bool exists = false;
-#ifdef Q_OS_UNIX
- struct stat statBuf;
- if (::stat(QFile::encodeName(dirPathString).constData(), &statBuf) == 0)
- exists = S_ISDIR(statBuf.st_mode);
-#else
- exists = QDir(dirPathString).exists();
-#endif
+ bool exists = QDir(dirPathString).exists();
QStringHash<bool> *files = exists ? new QStringHash<bool> : 0;
m_importDirCache.insert(dirPathString, files);
fileSet = m_importDirCache.value(dirPathString);
@@ -1755,14 +1748,7 @@ bool QQmlTypeLoader::directoryExists(const QString &path)
StringSet **fileSet = m_importDirCache.value(QHashedStringRef(dirPath.constData(), dirPath.length()));
if (!fileSet) {
QHashedString dirPathString(dirPath.toString());
- bool exists = false;
-#ifdef Q_OS_UNIX
- struct stat statBuf;
- if (::stat(QFile::encodeName(dirPathString).constData(), &statBuf) == 0)
- exists = S_ISDIR(statBuf.st_mode);
-#else
- exists = QDir(dirPathString).exists();
-#endif
+ bool exists = QDir(dirPathString).exists();
QStringHash<bool> *files = exists ? new QStringHash<bool> : 0;
m_importDirCache.insert(dirPathString, files);
fileSet = m_importDirCache.value(dirPathString);
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index 374d4397ff..46f95f16cb 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -881,8 +881,10 @@ QQuickItem *QQuickFlickable::contentItem()
QQuickFlickableVisibleArea *QQuickFlickable::visibleArea()
{
Q_D(QQuickFlickable);
- if (!d->visibleArea)
+ if (!d->visibleArea) {
d->visibleArea = new QQuickFlickableVisibleArea(this);
+ d->visibleArea->updateVisible(); // calculate initial ratios
+ }
return d->visibleArea;
}
@@ -1518,8 +1520,7 @@ void QQuickFlickable::geometryChanged(const QRectF &newGeometry,
bool changed = false;
if (newGeometry.width() != oldGeometry.width()) {
- if (xflick())
- changed = true;
+ changed = true; // we must update visualArea.widthRatio
if (d->hData.viewSize < 0) {
d->contentItem->setWidth(width());
emit contentWidthChanged();
@@ -1531,8 +1532,7 @@ void QQuickFlickable::geometryChanged(const QRectF &newGeometry,
}
}
if (newGeometry.height() != oldGeometry.height()) {
- if (yflick())
- changed = true;
+ changed = true; // we must update visualArea.heightRatio
if (d->vData.viewSize < 0) {
d->contentItem->setHeight(height());
emit contentHeightChanged();
diff --git a/src/quick/items/qquickimplicitsizeitem.cpp b/src/quick/items/qquickimplicitsizeitem.cpp
index b330b3929f..62dddb4a3b 100644
--- a/src/quick/items/qquickimplicitsizeitem.cpp
+++ b/src/quick/items/qquickimplicitsizeitem.cpp
@@ -47,32 +47,20 @@ QT_BEGIN_NAMESPACE
void QQuickImplicitSizeItemPrivate::implicitWidthChanged()
{
Q_Q(QQuickImplicitSizeItem);
- for (int ii = 0; ii < changeListeners.count(); ++ii) {
- const QQuickItemPrivate::ChangeListener &change = changeListeners.at(ii);
- if (change.types & QQuickItemPrivate::ImplicitWidth) {
- change.listener->itemImplicitWidthChanged(q);
- }
- }
+ QQuickItemPrivate::implicitWidthChanged();
emit q->implicitWidthChanged2();
}
void QQuickImplicitSizeItemPrivate::implicitHeightChanged()
{
Q_Q(QQuickImplicitSizeItem);
- for (int ii = 0; ii < changeListeners.count(); ++ii) {
- const QQuickItemPrivate::ChangeListener &change = changeListeners.at(ii);
- if (change.types & QQuickItemPrivate::ImplicitHeight) {
- change.listener->itemImplicitHeightChanged(q);
- }
- }
+ QQuickItemPrivate::implicitHeightChanged();
emit q->implicitHeightChanged2();
}
QQuickImplicitSizeItem::QQuickImplicitSizeItem(QQuickImplicitSizeItemPrivate &dd, QQuickItem *parent)
: QQuickItem(dd, parent)
{
- connect(this, SIGNAL(implicitHeightChanged2()), this, SIGNAL(implicitHeightChanged()));
- connect(this, SIGNAL(implicitWidthChanged2()), this, SIGNAL(implicitWidthChanged()));
}
QT_END_NAMESPACE
diff --git a/src/quick/items/qquicklistview.cpp b/src/quick/items/qquicklistview.cpp
index f0e39c5e5a..d79f535fd4 100644
--- a/src/quick/items/qquicklistview.cpp
+++ b/src/quick/items/qquicklistview.cpp
@@ -1023,7 +1023,7 @@ void QQuickListViewPrivate::updateInlineSection(FxListItemSG *listItem)
void QQuickListViewPrivate::updateStickySections()
{
- if (!sectionCriteria
+ if (!sectionCriteria || !sectionCriteria->delegate()
|| (!sectionCriteria->labelPositioning() && !currentSectionItem && !nextSectionItem))
return;
@@ -1360,16 +1360,18 @@ void QQuickListViewPrivate::itemGeometryChanged(QQuickItem *item, const QRectF &
if (visibleItems.count() && item == visibleItems.first()->item) {
FxListItemSG *listItem = static_cast<FxListItemSG*>(visibleItems.first());
if (orient == QQuickListView::Vertical) {
+ const qreal oldItemEndPosition = verticalLayoutDirection == QQuickItemView::BottomToTop ? -oldGeometry.y() : oldGeometry.y() + oldGeometry.height();
qreal diff = newGeometry.height() - oldGeometry.height();
- if (verticalLayoutDirection == QQuickListView::TopToBottom && listItem->endPosition() < q->contentY())
+ if (verticalLayoutDirection == QQuickListView::TopToBottom && oldItemEndPosition < q->contentY())
listItem->setPosition(listItem->position() - diff, true);
- else if (verticalLayoutDirection == QQuickListView::BottomToTop && listItem->endPosition() > q->contentY())
+ else if (verticalLayoutDirection == QQuickListView::BottomToTop && oldItemEndPosition > q->contentY())
listItem->setPosition(listItem->position() + diff, true);
} else {
+ const qreal oldItemEndPosition = q->effectiveLayoutDirection() == Qt::RightToLeft ? -oldGeometry.x() : oldGeometry.x() + oldGeometry.width();
qreal diff = newGeometry.width() - oldGeometry.width();
- if (q->effectiveLayoutDirection() == Qt::LeftToRight && listItem->endPosition() < q->contentX())
+ if (q->effectiveLayoutDirection() == Qt::LeftToRight && oldItemEndPosition < q->contentX())
listItem->setPosition(listItem->position() - diff, true);
- else if (q->effectiveLayoutDirection() == Qt::RightToLeft && listItem->endPosition() > q->contentX())
+ else if (q->effectiveLayoutDirection() == Qt::RightToLeft && oldItemEndPosition > q->contentX())
listItem->setPosition(listItem->position() + diff, true);
}
}
diff --git a/src/quick/items/qquickpainteditem.cpp b/src/quick/items/qquickpainteditem.cpp
index 15abb75352..25a2b93229 100644
--- a/src/quick/items/qquickpainteditem.cpp
+++ b/src/quick/items/qquickpainteditem.cpp
@@ -67,9 +67,6 @@ QT_BEGIN_NAMESPACE
To enable QPainter to do anti-aliased rendering, use setAntialiasing().
- QQuickPaintedItem is meant to make it easier to port old code that is using the
- QPainter API to the QML Scene Graph API and it should be used only for that purpose.
-
To write your own painted item, you first create a subclass of QQuickPaintedItem, and then
start by implementing its only pure virtual public function: paint(), which implements
the actual painting. To get the size of the area painted by the item, use
diff --git a/src/quick/items/qquickpathview.cpp b/src/quick/items/qquickpathview.cpp
index 7798641fcd..091fb3eb4d 100644
--- a/src/quick/items/qquickpathview.cpp
+++ b/src/quick/items/qquickpathview.cpp
@@ -922,34 +922,37 @@ QQuickItem *QQuickPathView::highlightItem()
\qmlproperty enumeration QtQuick2::PathView::highlightRangeMode
These properties set the preferred range of the highlight (current item)
- within the view. The preferred values must be in the range 0.0-1.0.
+ within the view. The preferred values must be in the range 0.0-1.0.
- If highlightRangeMode is set to \e PathView.NoHighlightRange
+ Valid values for \c highlightRangeMode are:
- If highlightRangeMode is set to \e PathView.ApplyRange the view will
- attempt to maintain the highlight within the range, however
- the highlight can move outside of the range at the ends of the path
- or due to a mouse interaction.
+ \list
+ \li \e PathView.NoHighlightRange - no range is applied and the
+ highlight will move freely within the view.
+ \li \e PathView.ApplyRange - the view will attempt to maintain
+ the highlight within the range, however the highlight can
+ move outside of the range at the ends of the path or due to
+ a mouse interaction.
+ \li \e PathView.StrictlyEnforceRange - the highlight will never
+ move outside of the range. This means that the current item
+ will change if a keyboard or mouse action would cause the
+ highlight to move outside of the range.
+ \endlist
- If highlightRangeMode is set to \e PathView.StrictlyEnforceRange the highlight will never
- move outside of the range. This means that the current item will change
- if a keyboard or mouse action would cause the highlight to move
- outside of the range.
+ The default value is \e PathView.StrictlyEnforceRange.
- Note that this is the correct way to influence where the
+ Defining a highlight range is the correct way to influence where the
current item ends up when the view moves. For example, if you want the
currently selected item to be in the middle of the path, then set the
- highlight range to be 0.5,0.5 and highlightRangeMode to PathView.StrictlyEnforceRange.
+ highlight range to be 0.5,0.5 and highlightRangeMode to \e PathView.StrictlyEnforceRange.
Then, when the path scrolls,
the currently selected item will be the item at that position. This also applies to
when the currently selected item changes - it will scroll to within the preferred
highlight range. Furthermore, the behaviour of the current item index will occur
whether or not a highlight exists.
- The default value is \e PathView.StrictlyEnforceRange.
-
- Note that a valid range requires preferredHighlightEnd to be greater
- than or equal to preferredHighlightBegin.
+ \note A valid range requires \c preferredHighlightEnd to be greater
+ than or equal to \c preferredHighlightBegin.
*/
qreal QQuickPathView::preferredHighlightBegin() const
{
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/qsgdefaultrectanglenode.cpp b/src/quick/scenegraph/qsgdefaultrectanglenode.cpp
index 76fbbb4209..276041d144 100644
--- a/src/quick/scenegraph/qsgdefaultrectanglenode.cpp
+++ b/src/quick/scenegraph/qsgdefaultrectanglenode.cpp
@@ -339,7 +339,7 @@ void QSGDefaultRectangleNode::update()
m_dirty_geometry = false;
}
m_material.setFlag(QSGMaterial::Blending, (m_gradient_stops.size() > 0 && !m_gradient_is_opaque)
- || m_color.alpha() < 255
+ || (m_color.alpha() < 255 && m_color.alpha() != 0)
|| (m_pen_width > 0 && m_border_color.alpha() < 255));
}
diff --git a/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp b/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp
index cc4aa4bada..1b10b8b894 100644
--- a/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp
+++ b/src/quick/scenegraph/qsgdistancefieldglyphnode.cpp
@@ -213,7 +213,7 @@ void QSGDistanceFieldGlyphNode::updateGeometry()
QVector<ushort> ip;
ip.reserve(indexes.size() * 6);
- qreal maxTexMargin = m_glyph_cache->distanceFieldRadius() / 2;
+ qreal maxTexMargin = m_glyph_cache->distanceFieldRadius();
qreal fontScale = m_glyph_cache->fontScale(fontPixelSize);
qreal margin = 2;
qreal texMargin = margin / fontScale;
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index bfd9a2fb20..15b6bdc52a 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -535,12 +535,12 @@ void QSGRenderThread::sync()
}
}
+ QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
+
RLDEBUG(" Render: - unlocking after sync");
waitCondition.wakeOne();
mutex.unlock();
-
- QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
}
@@ -963,8 +963,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;
diff --git a/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp b/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
index 9230608622..ef24e0a2d2 100644
--- a/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
+++ b/tests/auto/qml/qquickfolderlistmodel/tst_qquickfolderlistmodel.cpp
@@ -73,6 +73,7 @@ private slots:
void basicProperties();
void resetFiltering();
void refresh();
+ void cdUp();
#if defined (Q_OS_WIN) && !defined (Q_OS_WINCE)
// WinCE does not have drive concept, so lets execute this test only on desktop Windows.
void changeDrive();
@@ -182,6 +183,33 @@ void tst_qquickfolderlistmodel::refresh()
QTRY_COMPARE(removeEnd, count-1); // wait for refresh
}
+void tst_qquickfolderlistmodel::cdUp()
+{
+ enum { maxIterations = 50 };
+ QQmlComponent component(&engine, testFileUrl("basic.qml"));
+ checkNoErrors(component);
+
+ QAbstractListModel *flm = qobject_cast<QAbstractListModel*>(component.create());
+ QVERIFY(flm != 0);
+ const QUrl startFolder = flm->property("folder").toUrl();
+ QVERIFY(startFolder.isValid());
+
+ // QTBUG-32139: Ensure navigating upwards terminates cleanly and does not
+ // return invalid Urls like "file:".
+ for (int i = 0; ; ++i) {
+ const QVariant folderV = flm->property("parentFolder");
+ const QUrl folder = folderV.toUrl();
+ if (!folder.isValid())
+ break;
+ QVERIFY(folder.toString() != QLatin1String("file:"));
+ QVERIFY2(i < maxIterations,
+ qPrintable(QString::fromLatin1("Unable to reach root after %1 iterations starting from %2, stuck at %3")
+ .arg(maxIterations).arg(QDir::toNativeSeparators(startFolder.toLocalFile()),
+ QDir::toNativeSeparators(folder.toLocalFile()))));
+ flm->setProperty("folder", folderV);
+ }
+}
+
#if defined (Q_OS_WIN) && !defined (Q_OS_WINCE)
void tst_qquickfolderlistmodel::changeDrive()
{
diff --git a/tests/auto/qmltest/fontloader/tst_fontloader.qml b/tests/auto/qmltest/fontloader/tst_fontloader.qml
index 33307a3702..59aa72a8eb 100644
--- a/tests/auto/qmltest/fontloader/tst_fontloader.qml
+++ b/tests/auto/qmltest/fontloader/tst_fontloader.qml
@@ -63,8 +63,8 @@ Item {
name: "FontLoader"
function test_fontloading() {
- if (Qt.platform.os === "mac")
- skip("Skipped for QTBUG-25306")
+ if (Qt.platform.os === "osx")
+ skip("See QTBUG-32650")
compare(fontloader.status, FontLoader.Null)
compare(testinput.font.family, "")
@@ -81,8 +81,8 @@ Item {
}
function test_fontswitching() {
- if (Qt.platform.os === "mac")
- skip("Skipped for QTBUG-25306")
+ if (Qt.platform.os === "osx")
+ skip("See QTBUG-32650")
compare(fontswitch.status, FontLoader.Null)
fontswitch.source = "tarzeau_ocr_a.ttf";
diff --git a/tests/auto/quick/qquickdrag/tst_qquickdrag.cpp b/tests/auto/quick/qquickdrag/tst_qquickdrag.cpp
index dbb4736c05..15282d4b02 100644
--- a/tests/auto/quick/qquickdrag/tst_qquickdrag.cpp
+++ b/tests/auto/quick/qquickdrag/tst_qquickdrag.cpp
@@ -1070,106 +1070,131 @@ void tst_QQuickDrag::recursion_data()
{
QTest::addColumn<QString>("script");
QTest::addColumn<int>("type");
+ QTest::addColumn<int>("moveEvents");
QTest::addColumn<QByteArray>("warning");
QTest::newRow("Drag.start() in Enter")
<< QString("Drag.start()")
<< int(QEvent::DragEnter)
+ << 1
<< QByteArray("<Unknown File>: QML QQuickDragAttached: start() cannot be called from within a drag event handler");
QTest::newRow("Drag.cancel() in Enter")
<< QString("Drag.cancel()")
<< int(QEvent::DragEnter)
+ << 1
<< QByteArray("<Unknown File>: QML QQuickDragAttached: cancel() cannot be called from within a drag event handler");
QTest::newRow("Drag.drop() in Enter")
<< QString("Drag.drop()")
<< int(QEvent::DragEnter)
+ << 1
<< QByteArray("<Unknown File>: QML QQuickDragAttached: drop() cannot be called from within a drag event handler");
QTest::newRow("Drag.active = true in Enter")
<< QString("Drag.active = true")
<< int(QEvent::DragEnter)
+ << 1
<< QByteArray();
QTest::newRow("Drag.active = false in Enter")
<< QString("Drag.active = false")
<< int(QEvent::DragEnter)
+ << 1
<< QByteArray("<Unknown File>: QML QQuickDragAttached: active cannot be changed from within a drag event handler");
QTest::newRow("move in Enter")
<< QString("x = 23")
<< int(QEvent::DragEnter)
+ << 1
<< QByteArray();
QTest::newRow("Drag.start() in Move")
<< QString("Drag.start()")
<< int(QEvent::DragMove)
+ << 1
<< QByteArray("<Unknown File>: QML QQuickDragAttached: start() cannot be called from within a drag event handler");
QTest::newRow("Drag.cancel() in Move")
<< QString("Drag.cancel()")
<< int(QEvent::DragMove)
+ << 1
<< QByteArray("<Unknown File>: QML QQuickDragAttached: cancel() cannot be called from within a drag event handler");
QTest::newRow("Drag.drop() in Move")
<< QString("Drag.drop()")
<< int(QEvent::DragMove)
+ << 1
<< QByteArray("<Unknown File>: QML QQuickDragAttached: drop() cannot be called from within a drag event handler");
QTest::newRow("Drag.active = true in Move")
<< QString("Drag.active = true")
<< int(QEvent::DragMove)
+ << 1
<< QByteArray();
QTest::newRow("Drag.active = false in Move")
<< QString("Drag.active = false")
<< int(QEvent::DragMove)
+ << 1
<< QByteArray("<Unknown File>: QML QQuickDragAttached: active cannot be changed from within a drag event handler");
QTest::newRow("move in Move")
<< QString("x = 23")
<< int(QEvent::DragMove)
+ << 2
<< QByteArray();
QTest::newRow("Drag.start() in Leave")
<< QString("Drag.start()")
<< int(QEvent::DragLeave)
+ << 1
<< QByteArray("<Unknown File>: QML QQuickDragAttached: start() cannot be called from within a drag event handler");
QTest::newRow("Drag.cancel() in Leave")
<< QString("Drag.cancel()")
<< int(QEvent::DragLeave)
+ << 1
<< QByteArray("<Unknown File>: QML QQuickDragAttached: cancel() cannot be called from within a drag event handler");
QTest::newRow("Drag.drop() in Leave")
<< QString("Drag.drop()")
<< int(QEvent::DragLeave)
+ << 1
<< QByteArray("<Unknown File>: QML QQuickDragAttached: drop() cannot be called from within a drag event handler");
QTest::newRow("Drag.active = true in Leave")
<< QString("Drag.active = true")
<< int(QEvent::DragLeave)
+ << 1
<< QByteArray("<Unknown File>: QML QQuickDragAttached: active cannot be changed from within a drag event handler");
QTest::newRow("Drag.active = false in Leave")
<< QString("Drag.active = false")
<< int(QEvent::DragLeave)
+ << 1
<< QByteArray();
QTest::newRow("move in Leave")
<< QString("x = 23")
<< int(QEvent::DragLeave)
+ << 1
<< QByteArray();
QTest::newRow("Drag.start() in Drop")
<< QString("Drag.start()")
<< int(QEvent::Drop)
+ << 1
<< QByteArray("<Unknown File>: QML QQuickDragAttached: start() cannot be called from within a drag event handler");
QTest::newRow("Drag.cancel() in Drop")
<< QString("Drag.cancel()")
<< int(QEvent::Drop)
+ << 1
<< QByteArray("<Unknown File>: QML QQuickDragAttached: cancel() cannot be called from within a drag event handler");
QTest::newRow("Drag.drop() in Drop")
<< QString("Drag.drop()")
<< int(QEvent::Drop)
+ << 1
<< QByteArray("<Unknown File>: QML QQuickDragAttached: drop() cannot be called from within a drag event handler");
QTest::newRow("Drag.active = true in Drop")
<< QString("Drag.active = true")
<< int(QEvent::Drop)
+ << 1
<< QByteArray("<Unknown File>: QML QQuickDragAttached: active cannot be changed from within a drag event handler");
QTest::newRow("Drag.active = false in Drop")
<< QString("Drag.active = false")
<< int(QEvent::Drop)
+ << 1
<< QByteArray();
QTest::newRow("move in Drop")
<< QString("x = 23")
<< int(QEvent::Drop)
+ << 1
<< QByteArray();
}
@@ -1177,6 +1202,7 @@ void tst_QQuickDrag::recursion()
{
QFETCH(QString, script);
QFETCH(int, type);
+ QFETCH(int, moveEvents);
QFETCH(QByteArray, warning);
if (!warning.isEmpty())
@@ -1206,22 +1232,36 @@ void tst_QQuickDrag::recursion()
QCOMPARE(dropTarget.leaveEvents, 0);
evaluate<void>(item, "y = 15");
+
+ // the evaluate statement above, y = 15, will cause
+ // QQuickItem::setY(15) to be called, leading to an
+ // event being posted that will be delivered
+ // to RecursingDropTarget::dragMoveEvent(), hence
+ // the following call to QCoreApplication::processEvents()
QCoreApplication::processEvents();
+
+
+ // Regarding 'move in Move' when
+ // RecursingDropTarget::dragMoveEvent() runs,
+ // its call 'evaluate' triggers a second
+ // move event (x = 23) that needs to be delivered.
+ QCoreApplication::processEvents();
+
QCOMPARE(dropTarget.enterEvents, 1);
- QCOMPARE(dropTarget.moveEvents, 1);
+ QCOMPARE(dropTarget.moveEvents, moveEvents);
QCOMPARE(dropTarget.dropEvents, 0);
QCOMPARE(dropTarget.leaveEvents, 0);
if (type == QEvent::Drop) {
QCOMPARE(evaluate<bool>(item, "Drag.drop() == Qt.MoveAction"), true);
QCOMPARE(dropTarget.enterEvents, 1);
- QCOMPARE(dropTarget.moveEvents, 1);
+ QCOMPARE(dropTarget.moveEvents, moveEvents);
QCOMPARE(dropTarget.dropEvents, 1);
QCOMPARE(dropTarget.leaveEvents, 0);
} else {
evaluate<void>(item, "Drag.cancel()");
QCOMPARE(dropTarget.enterEvents, 1);
- QCOMPARE(dropTarget.moveEvents, 1);
+ QCOMPARE(dropTarget.moveEvents, moveEvents);
QCOMPARE(dropTarget.dropEvents, 0);
QCOMPARE(dropTarget.leaveEvents, 1);
}
diff --git a/tests/auto/quick/qquickflickable/data/ratios.qml b/tests/auto/quick/qquickflickable/data/ratios.qml
new file mode 100644
index 0000000000..1291cada72
--- /dev/null
+++ b/tests/auto/quick/qquickflickable/data/ratios.qml
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Rectangle {
+ width: 400
+ height: 400
+
+ property bool forceNoFlicking: true
+ property double heightRatioIs: flickable.visibleArea.heightRatio
+ property double heightRatioShould: flickable.height / flickable.contentHeight
+ property double widthRatioIs: flickable.visibleArea.widthRatio
+ property double widthRatioShould: flickable.height / flickable.contentWidth
+
+ Flickable {
+ id: flickable
+ flickableDirection: Flickable.AutoFlickDirection
+ width: forceNoFlicking ? contentItem.width /* so xflick() returns false */ : 20
+ height: forceNoFlicking ? contentItem.height /* likewise */ : 20
+ contentHeight: contentItem.height
+ contentWidth: contentItem.width
+ clip: true
+
+ Rectangle {
+ id: contentItem
+ color: "red"
+ width: 300
+ height: 300
+ }
+ }
+}
+
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index 3575dfa012..a8055b3467 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -67,6 +67,7 @@ private slots:
void create();
void horizontalViewportSize();
void verticalViewportSize();
+ void visibleAreaRatiosUpdate();
void properties();
void boundsBehavior();
void rebound();
@@ -158,6 +159,28 @@ void tst_qquickflickable::verticalViewportSize()
delete obj;
}
+void tst_qquickflickable::visibleAreaRatiosUpdate()
+{
+ QQmlEngine engine;
+ QQmlComponent c(&engine, testFileUrl("ratios.qml"));
+ QQuickItem *obj = qobject_cast<QQuickItem*>(c.create());
+
+ QVERIFY(obj != 0);
+ // check initial ratio values
+ QCOMPARE(obj->property("heightRatioIs").toDouble(), obj->property("heightRatioShould").toDouble());
+ QCOMPARE(obj->property("widthRatioIs").toDouble(), obj->property("widthRatioShould").toDouble());
+ // change flickable geometry so that flicking is enabled (content size > flickable size)
+ obj->setProperty("forceNoFlicking", false);
+ QCOMPARE(obj->property("heightRatioIs").toDouble(), obj->property("heightRatioShould").toDouble());
+ QCOMPARE(obj->property("widthRatioIs").toDouble(), obj->property("widthRatioShould").toDouble());
+ // change flickable geometry so that flicking is disabled (content size == flickable size)
+ obj->setProperty("forceNoFlicking", true);
+ QCOMPARE(obj->property("heightRatioIs").toDouble(), obj->property("heightRatioShould").toDouble());
+ QCOMPARE(obj->property("widthRatioIs").toDouble(), obj->property("widthRatioShould").toDouble());
+
+ delete obj;
+}
+
void tst_qquickflickable::properties()
{
QQmlEngine engine;
diff --git a/tests/auto/quick/qquickgridview/qquickgridview.pro b/tests/auto/quick/qquickgridview/qquickgridview.pro
index dd69cda49e..0e679387cc 100644
--- a/tests/auto/quick/qquickgridview/qquickgridview.pro
+++ b/tests/auto/quick/qquickgridview/qquickgridview.pro
@@ -12,5 +12,3 @@ TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
-
-mac:CONFIG+=insignificant_test # QTBUG-27890
diff --git a/tests/auto/quick/qquickimage/data/qtbug_32513.qml b/tests/auto/quick/qquickimage/data/qtbug_32513.qml
new file mode 100644
index 0000000000..b6cbe33eec
--- /dev/null
+++ b/tests/auto/quick/qquickimage/data/qtbug_32513.qml
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+
+Item {
+ width: 200; height: 200
+
+ Image {
+ cache: false
+
+ NumberAnimation on opacity {
+ loops: Animation.Infinite
+ from: 1; to: 0
+ }
+
+ SequentialAnimation on source {
+ loops: Animation.Infinite
+ PropertyAction { value: "green.png" }
+ PauseAnimation { duration: 100 }
+ PropertyAction { value: "pattern.png" }
+ PauseAnimation { duration: 100 }
+ }
+ }
+}
diff --git a/tests/auto/quick/qquickimage/tst_qquickimage.cpp b/tests/auto/quick/qquickimage/tst_qquickimage.cpp
index 0804c7b900..8bdb9c9de5 100644
--- a/tests/auto/quick/qquickimage/tst_qquickimage.cpp
+++ b/tests/auto/quick/qquickimage/tst_qquickimage.cpp
@@ -99,6 +99,7 @@ private slots:
void sourceSize_QTBUG_16389();
void nullPixmapPaint();
void imageCrash_QTBUG_22125();
+ void imageCrash_QTBUG_32513();
void sourceSize_data();
void sourceSize();
void progressAndStatusChanges();
@@ -704,6 +705,15 @@ void tst_qquickimage::imageCrash_QTBUG_22125()
QCoreApplication::processEvents();
}
+void tst_qquickimage::imageCrash_QTBUG_32513()
+{
+ QQuickView view(testFileUrl("qtbug_32513.qml"));
+ view.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&view));
+ QTest::qWait(1000);
+ // shouldn't crash when the image changes sources
+}
+
void tst_qquickimage::sourceSize_data()
{
QTest::addColumn<int>("sourceWidth");
diff --git a/tests/auto/quick/qquickitem/tst_qquickitem.cpp b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
index a7343f686f..79f08d5147 100644
--- a/tests/auto/quick/qquickitem/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
@@ -718,24 +718,24 @@ void tst_qquickitem::changeParent()
void tst_qquickitem::multipleFocusClears()
{
//Multiple clears of focus inside a focus scope shouldn't crash. QTBUG-24714
- QQuickView *view = new QQuickView;
- view->setSource(testFileUrl("multipleFocusClears.qml"));
- view->show();
- ensureFocus(view);
- QTRY_VERIFY(QGuiApplication::focusWindow() == view);
+ QQuickView view;
+ view.setSource(testFileUrl("multipleFocusClears.qml"));
+ view.show();
+ ensureFocus(&view);
+ QTRY_VERIFY(QGuiApplication::focusWindow() == &view);
}
void tst_qquickitem::focusSubItemInNonFocusScope()
{
- QQuickView *view = new QQuickView;
- view->setSource(testFileUrl("focusSubItemInNonFocusScope.qml"));
- view->show();
- QTest::qWaitForWindowActive(view);
+ QQuickView view;
+ view.setSource(testFileUrl("focusSubItemInNonFocusScope.qml"));
+ view.show();
+ QTest::qWaitForWindowActive(&view);
- QQuickItem *dummyItem = view->rootObject()->findChild<QQuickItem *>("dummyItem");
+ QQuickItem *dummyItem = view.rootObject()->findChild<QQuickItem *>("dummyItem");
QVERIFY(dummyItem);
- QQuickItem *textInput = view->rootObject()->findChild<QQuickItem *>("textInput");
+ QQuickItem *textInput = view.rootObject()->findChild<QQuickItem *>("textInput");
QVERIFY(textInput);
QVERIFY(dummyItem->hasFocus());
@@ -747,8 +747,6 @@ void tst_qquickitem::focusSubItemInNonFocusScope()
QVERIFY(!dummyItem->hasFocus());
QVERIFY(textInput->hasFocus());
QVERIFY(textInput->hasActiveFocus());
-
- delete view;
}
void tst_qquickitem::parentItemWithFocus()
@@ -880,24 +878,22 @@ void tst_qquickitem::reparentFocusedItem()
void tst_qquickitem::constructor()
{
- QQuickItem *root = new QQuickItem;
+ QScopedPointer<QQuickItem> root(new QQuickItem);
QVERIFY(root->parent() == 0);
QVERIFY(root->parentItem() == 0);
- QQuickItem *child1 = new QQuickItem(root);
- QVERIFY(child1->parent() == root);
- QVERIFY(child1->parentItem() == root);
+ QQuickItem *child1 = new QQuickItem(root.data());
+ QVERIFY(child1->parent() == root.data());
+ QVERIFY(child1->parentItem() == root.data());
QCOMPARE(root->childItems().count(), 1);
QCOMPARE(root->childItems().at(0), child1);
- QQuickItem *child2 = new QQuickItem(root);
- QVERIFY(child2->parent() == root);
- QVERIFY(child2->parentItem() == root);
+ QQuickItem *child2 = new QQuickItem(root.data());
+ QVERIFY(child2->parent() == root.data());
+ QVERIFY(child2->parentItem() == root.data());
QCOMPARE(root->childItems().count(), 2);
QCOMPARE(root->childItems().at(0), child1);
QCOMPARE(root->childItems().at(1), child2);
-
- delete root;
}
void tst_qquickitem::setParentItem()
@@ -1157,80 +1153,87 @@ void tst_qquickitem::enabledFocus()
QCOMPARE(window.activeFocusItem(), static_cast<QQuickItem *>(&child1));
}
+static inline QByteArray msgItem(const QQuickItem *item)
+{
+ QString result;
+ QDebug(&result) << item;
+ return result.toLocal8Bit();
+}
+
void tst_qquickitem::mouseGrab()
{
- QQuickWindow *window = new QQuickWindow;
- window->resize(200, 200);
- window->show();
+ QQuickWindow window;
+ window.setFramePosition(QPoint(100, 100));
+ window.resize(200, 200);
+ window.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
- TestItem *child1 = new TestItem;
+ QScopedPointer<TestItem> child1(new TestItem);
+ child1->setObjectName(QStringLiteral("child1"));
child1->setAcceptedMouseButtons(Qt::LeftButton);
child1->setSize(QSizeF(200, 100));
- child1->setParentItem(window->contentItem());
+ child1->setParentItem(window.contentItem());
- TestItem *child2 = new TestItem;
+ QScopedPointer<TestItem> child2(new TestItem);
+ child2->setObjectName(QStringLiteral("child2"));
child2->setAcceptedMouseButtons(Qt::LeftButton);
child2->setY(51);
child2->setSize(QSizeF(200, 100));
- child2->setParentItem(window->contentItem());
+ child2->setParentItem(window.contentItem());
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(50,50));
+ QTest::mousePress(&window, Qt::LeftButton, 0, QPoint(50,50));
QTest::qWait(100);
- QVERIFY(window->mouseGrabberItem() == child1);
+ QVERIFY2(window.mouseGrabberItem() == child1.data(), msgItem(window.mouseGrabberItem()).constData());
QTest::qWait(100);
QCOMPARE(child1->pressCount, 1);
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(50,50));
+ QTest::mouseRelease(&window, Qt::LeftButton, 0, QPoint(50,50));
QTest::qWait(50);
- QVERIFY(window->mouseGrabberItem() == 0);
+ QVERIFY2(window.mouseGrabberItem() == 0, msgItem(window.mouseGrabberItem()).constData());
QCOMPARE(child1->releaseCount, 1);
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(50,50));
+ QTest::mousePress(&window, Qt::LeftButton, 0, QPoint(50,50));
QTest::qWait(50);
- QVERIFY(window->mouseGrabberItem() == child1);
+ QVERIFY2(window.mouseGrabberItem() == child1.data(), msgItem(window.mouseGrabberItem()).constData());
QCOMPARE(child1->pressCount, 2);
child1->setEnabled(false);
- QVERIFY(window->mouseGrabberItem() == 0);
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(50,50));
+ QVERIFY2(window.mouseGrabberItem() == 0, msgItem(window.mouseGrabberItem()).constData());
+ QTest::mouseRelease(&window, Qt::LeftButton, 0, QPoint(50,50));
QTest::qWait(50);
QCOMPARE(child1->releaseCount, 1);
child1->setEnabled(true);
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(50,50));
+ QTest::mousePress(&window, Qt::LeftButton, 0, QPoint(50,50));
QTest::qWait(50);
- QVERIFY(window->mouseGrabberItem() == child1);
+ QVERIFY2(window.mouseGrabberItem() == child1.data(), msgItem(window.mouseGrabberItem()).constData());
QCOMPARE(child1->pressCount, 3);
child1->setVisible(false);
- QVERIFY(window->mouseGrabberItem() == 0);
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(50,50));
+ QVERIFY2(window.mouseGrabberItem() == 0, msgItem(window.mouseGrabberItem()));
+ QTest::mouseRelease(&window, Qt::LeftButton, 0, QPoint(50,50));
QCOMPARE(child1->releaseCount, 1);
child1->setVisible(true);
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(50,50));
+ QTest::mousePress(&window, Qt::LeftButton, 0, QPoint(50,50));
QTest::qWait(50);
- QVERIFY(window->mouseGrabberItem() == child1);
+ QVERIFY2(window.mouseGrabberItem() == child1.data(), msgItem(window.mouseGrabberItem()).constData());
QCOMPARE(child1->pressCount, 4);
child2->grabMouse();
- QVERIFY(window->mouseGrabberItem() == child2);
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(50,50));
+ QVERIFY2(window.mouseGrabberItem() == child2.data(), msgItem(window.mouseGrabberItem()).constData());
+ QTest::mouseRelease(&window, Qt::LeftButton, 0, QPoint(50,50));
QTest::qWait(50);
QCOMPARE(child1->releaseCount, 1);
QCOMPARE(child2->releaseCount, 1);
child2->grabMouse();
- QVERIFY(window->mouseGrabberItem() == child2);
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(50,50));
+ QVERIFY2(window.mouseGrabberItem() == child2.data(), msgItem(window.mouseGrabberItem()).constData());
+ QTest::mousePress(&window, Qt::LeftButton, 0, QPoint(50,50));
QTest::qWait(50);
QCOMPARE(child1->pressCount, 4);
QCOMPARE(child2->pressCount, 1);
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(50,50));
+ QTest::mouseRelease(&window, Qt::LeftButton, 0, QPoint(50,50));
QTest::qWait(50);
QCOMPARE(child1->releaseCount, 1);
QCOMPARE(child2->releaseCount, 2);
-
- delete child1;
- delete child2;
- delete window;
}
void tst_qquickitem::touchEventAcceptIgnore_data()
@@ -1245,13 +1248,14 @@ void tst_qquickitem::touchEventAcceptIgnore()
{
QFETCH(bool, itemSupportsTouch);
- TestWindow *window = new TestWindow;
- window->resize(100, 100);
- window->show();
+ TestWindow window;
+ window.resize(100, 100);
+ window.show();
+ QTest::qWaitForWindowExposed(&window);
- TestItem *item = new TestItem;
+ QScopedPointer<TestItem> item(new TestItem);
item->setSize(QSizeF(100, 100));
- item->setParentItem(window->contentItem());
+ item->setParentItem(window.contentItem());
item->acceptIncomingTouchEvents = itemSupportsTouch;
static QTouchDevice* device = 0;
@@ -1277,7 +1281,7 @@ void tst_qquickitem::touchEventAcceptIgnore()
item->touchEventReached = false;
- bool accepted = window->event(&event);
+ bool accepted = window.event(&event);
QVERIFY(item->touchEventReached);
QCOMPARE(accepted && event.isAccepted(), itemSupportsTouch);
@@ -1297,7 +1301,7 @@ void tst_qquickitem::touchEventAcceptIgnore()
item->touchEventReached = false;
- bool accepted = window->event(&event);
+ bool accepted = window.event(&event);
QCOMPARE(item->touchEventReached, itemSupportsTouch);
QCOMPARE(accepted && event.isAccepted(), itemSupportsTouch);
@@ -1317,14 +1321,11 @@ void tst_qquickitem::touchEventAcceptIgnore()
item->touchEventReached = false;
- bool accepted = window->event(&event);
+ bool accepted = window.event(&event);
QCOMPARE(item->touchEventReached, itemSupportsTouch);
QCOMPARE(accepted && event.isAccepted(), itemSupportsTouch);
}
-
- delete item;
- delete window;
}
void tst_qquickitem::polishOutsideAnimation()
@@ -1346,16 +1347,15 @@ void tst_qquickitem::polishOutsideAnimation()
void tst_qquickitem::polishOnCompleted()
{
- QQuickView *view = new QQuickView;
- view->setSource(testFileUrl("polishOnCompleted.qml"));
- view->show();
+ QQuickView view;
+ view.setSource(testFileUrl("polishOnCompleted.qml"));
+ view.show();
+ QTest::qWaitForWindowExposed(&view);
- TestPolishItem *item = qobject_cast<TestPolishItem*>(view->rootObject());
+ TestPolishItem *item = qobject_cast<TestPolishItem*>(view.rootObject());
QVERIFY(item);
QTRY_VERIFY(item->wasPolished);
-
- delete view;
}
void tst_qquickitem::wheelEvent_data()
@@ -1376,20 +1376,21 @@ void tst_qquickitem::wheelEvent()
const bool shouldReceiveWheelEvents = visible && enabled;
- QQuickWindow *window = new QQuickWindow;
- window->resize(200, 200);
- window->show();
+ QQuickWindow window;
+ window.resize(200, 200);
+ window.show();
+ QTest::qWaitForWindowExposed(&window);
TestItem *item = new TestItem;
item->setSize(QSizeF(200, 100));
- item->setParentItem(window->contentItem());
+ item->setParentItem(window.contentItem());
item->setEnabled(enabled);
item->setVisible(visible);
QWheelEvent event(QPoint(100, 50), -120, Qt::NoButton, Qt::NoModifier, Qt::Vertical);
event.setAccepted(false);
- QGuiApplication::sendEvent(window, &event);
+ QGuiApplication::sendEvent(&window, &event);
if (shouldReceiveWheelEvents) {
QVERIFY(event.isAccepted());
@@ -1398,8 +1399,6 @@ void tst_qquickitem::wheelEvent()
QVERIFY(!event.isAccepted());
QCOMPARE(item->wheelCount, 0);
}
-
- delete window;
}
class HoverItem : public QQuickItem
@@ -1503,11 +1502,11 @@ void tst_qquickitem::hoverEvent()
void tst_qquickitem::hoverEventInParent()
{
- QQuickWindow *window = new QQuickWindow();
- window->resize(200, 200);
- window->show();
+ QQuickWindow window;
+ window.resize(200, 200);
+ window.show();
- HoverItem *parentItem = new HoverItem(window->contentItem());
+ HoverItem *parentItem = new HoverItem(window.contentItem());
parentItem->setSize(QSizeF(200, 200));
parentItem->setAcceptHoverEvents(true);
@@ -1523,12 +1522,12 @@ void tst_qquickitem::hoverEventInParent()
const QPoint insideLeft(50, 100);
const QPoint insideRight(150, 100);
- sendMouseMove(window, insideLeft);
+ sendMouseMove(&window, insideLeft);
parentItem->resetCounters();
leftItem->resetCounters();
rightItem->resetCounters();
- sendMouseMove(window, insideRight);
+ sendMouseMove(&window, insideRight);
QCOMPARE(parentItem->hoverEnterCount, 0);
QCOMPARE(parentItem->hoverLeaveCount, 0);
QCOMPARE(leftItem->hoverEnterCount, 0);
@@ -1536,15 +1535,13 @@ void tst_qquickitem::hoverEventInParent()
QCOMPARE(rightItem->hoverEnterCount, 1);
QCOMPARE(rightItem->hoverLeaveCount, 0);
- sendMouseMove(window, insideLeft);
+ sendMouseMove(&window, insideLeft);
QCOMPARE(parentItem->hoverEnterCount, 0);
QCOMPARE(parentItem->hoverLeaveCount, 0);
QCOMPARE(leftItem->hoverEnterCount, 1);
QCOMPARE(leftItem->hoverLeaveCount, 1);
QCOMPARE(rightItem->hoverEnterCount, 1);
QCOMPARE(rightItem->hoverLeaveCount, 1);
-
- delete window;
}
void tst_qquickitem::paintOrder_data()
diff --git a/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml b/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml
new file mode 100644
index 0000000000..7903c392d1
--- /dev/null
+++ b/tests/auto/quick/qquicklistview/data/outsideViewportChangeNotAffectingView.qml
@@ -0,0 +1,67 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.1
+import QtTest 1.0
+
+Item {
+ function resizeThirdItem(size) {
+ resizingListModel.setProperty(3, "size", size)
+ }
+
+ ListView {
+ width: 300
+ height: 542
+ model: ListModel {
+ id: resizingListModel
+ ListElement { size: 300; }
+ ListElement { size: 300; }
+ ListElement { size: 300; }
+ ListElement { size: 300; }
+ ListElement { size: 300; }
+ ListElement { size: 300; }
+ }
+ delegate: Rectangle {
+ width: parent.width
+ color: index % 2 == 0 ? "red" : "blue"
+ height: size
+ }
+ }
+}
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
index bec61eaccb..2268f0754c 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -209,6 +209,7 @@ private slots:
void defaultHighlightMoveDuration();
void accessEmptyCurrentItem_QTBUG_30227();
void delayedChanges_QTBUG_30555();
+ void outsideViewportChangeNotAffectingView();
private:
template <class T> void items(const QUrl &source);
@@ -6880,6 +6881,43 @@ void tst_QQuickListView::delayedChanges_QTBUG_30555()
delete window;
}
+void tst_QQuickListView::outsideViewportChangeNotAffectingView()
+{
+ QQuickView *window = createView();
+ window->setSource(testFileUrl("outsideViewportChangeNotAffectingView.qml"));
+
+ QQuickListView *listview = window->rootObject()->findChild<QQuickListView*>();
+ QTRY_VERIFY(listview != 0);
+
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window));
+
+ flick(window, QPoint(20, 200), QPoint(20, 20), 10);
+
+ QTRY_COMPARE(listview->isFlicking(), false);
+
+ QTRY_COMPARE(listview->indexAt(0, listview->contentY()), 4);
+ QTRY_COMPARE(listview->itemAt(0, listview->contentY())->y(), 1200.);
+
+ QMetaObject::invokeMethod(window->rootObject(), "resizeThirdItem", Q_ARG(QVariant, 290));
+ QTRY_COMPARE(listview->indexAt(0, listview->contentY()), 4);
+ QTRY_COMPARE(listview->itemAt(0, listview->contentY())->y(), 1200.);
+
+ QMetaObject::invokeMethod(window->rootObject(), "resizeThirdItem", Q_ARG(QVariant, 300));
+ QTRY_COMPARE(listview->indexAt(0, listview->contentY()), 4);
+ QTRY_COMPARE(listview->itemAt(0, listview->contentY())->y(), 1200.);
+
+ QMetaObject::invokeMethod(window->rootObject(), "resizeThirdItem", Q_ARG(QVariant, 310));
+ QTRY_COMPARE(listview->indexAt(0, listview->contentY()), 4);
+ QTRY_COMPARE(listview->itemAt(0, listview->contentY())->y(), 1200.);
+
+ QMetaObject::invokeMethod(window->rootObject(), "resizeThirdItem", Q_ARG(QVariant, 400));
+ QTRY_COMPARE(listview->indexAt(0, listview->contentY()), 4);
+ QTRY_COMPARE(listview->itemAt(0, listview->contentY())->y(), 1200.);
+
+ delete window;
+}
+
QTEST_MAIN(tst_QQuickListView)
#include "tst_qquicklistview.moc"
diff --git a/tests/auto/quick/qquickpath/tst_qquickpath.cpp b/tests/auto/quick/qquickpath/tst_qquickpath.cpp
index fa68442329..6ecc5cee50 100644
--- a/tests/auto/quick/qquickpath/tst_qquickpath.cpp
+++ b/tests/auto/quick/qquickpath/tst_qquickpath.cpp
@@ -128,7 +128,7 @@ void tst_QuickPath::catmullromCurve()
pos = obj->pointAt(.75);
QCOMPARE(pos.toPoint(), QPoint(51,105)); //fuzzy compare
pos = obj->pointAt(1);
- QCOMPARE(pos, QPointF(100,150));
+ QCOMPARE(pos.toPoint(), QPoint(100,150));
}
void tst_QuickPath::closedCatmullromCurve()
@@ -227,7 +227,7 @@ void tst_QuickPath::line()
QCOMPARE(p1.x(), p1.y());
QPointF p2 = path2->pointAt(t);
- QCOMPARE(p1, p2);
+ QCOMPARE(p1.toPoint(), p2.toPoint());
}
}
diff --git a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
index 274b93e81a..e4ad7b9c40 100644
--- a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
+++ b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
@@ -1725,6 +1725,14 @@ void tst_QQuickPathView::missingPercent()
delete obj;
}
+static inline bool hasFraction(qreal o)
+{
+ const bool result = o != qFloor(o);
+ if (!result)
+ qDebug() << "o != qFloor(o)" << o;
+ return result;
+}
+
void tst_QQuickPathView::cancelDrag()
{
QScopedPointer<QQuickView> window(createView());
@@ -1747,7 +1755,7 @@ void tst_QQuickPathView::cancelDrag()
QTest::mouseMove(window.data(), QPoint(30, 100));
QTest::mouseMove(window.data(), QPoint(85, 100));
- QTRY_VERIFY(pathview->offset() != qFloor(pathview->offset()));
+ QTRY_VERIFY(hasFraction(pathview->offset()));
QTRY_VERIFY(pathview->isMoving());
QVERIFY(pathview->isDragging());
QCOMPARE(draggingSpy.count(), 1);
diff --git a/tests/auto/quick/qquicktextedit/data/hAlignVisual.qml b/tests/auto/quick/qquicktextedit/data/hAlignVisual.qml
index 9c9318d3cc..017bab97a7 100644
--- a/tests/auto/quick/qquicktextedit/data/hAlignVisual.qml
+++ b/tests/auto/quick/qquicktextedit/data/hAlignVisual.qml
@@ -9,5 +9,6 @@ Rectangle {
text: "AA\nBBBBBBB\nCCCCCCCCCCCCCCCC"
anchors.centerIn: parent
horizontalAlignment: Text.AlignLeft
+ font.pointSize: 12
}
}
diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
index 6e74d840aa..a5cf91603b 100644
--- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
+++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
@@ -654,7 +654,7 @@ void tst_qquicktextedit::hAlign_RightToLeft()
QQuickView window(testFileUrl("horizontalAlignment_RightToLeft.qml"));
QQuickTextEdit *textEdit = window.rootObject()->findChild<QQuickTextEdit*>("text");
QVERIFY(textEdit != 0);
- window.show();
+ window.showNormal();
const QString rtlText = textEdit->text();
@@ -832,7 +832,7 @@ void tst_qquicktextedit::hAlignVisual()
{
QQuickView view(testFileUrl("hAlignVisual.qml"));
view.setFlags(view.flags() | Qt::WindowStaysOnTopHint); // Prevent being obscured by other windows.
- view.show();
+ view.showNormal();
QVERIFY(QTest::qWaitForWindowExposed(&view));
QQuickText *text = view.rootObject()->findChild<QQuickText*>("textItem");
@@ -1262,7 +1262,7 @@ void tst_qquicktextedit::focusOnPress()
QQuickWindow window;
window.resize(100, 50);
textEditObject->setParentItem(window.contentItem());
- window.show();
+ window.showNormal();
window.requestActivate();
QTest::qWaitForWindowActive(&window);
@@ -2530,7 +2530,7 @@ void tst_qquicktextedit::remoteCursorDelegate()
view.rootContext()->setContextProperty("contextDelegate", &component);
view.setSource(testFileUrl("cursorTestRemote.qml"));
- view.show();
+ view.showNormal();
view.requestActivate();
QTest::qWaitForWindowActive(&view);
QQuickTextEdit *textEditObject = view.rootObject()->findChild<QQuickTextEdit*>("textEditObject");
@@ -2544,10 +2544,6 @@ void tst_qquicktextedit::remoteCursorDelegate()
textEditObject->setFocus(true);
QVERIFY(textEditObject->isCursorVisible());
- QCOMPARE(component.status(), QQmlComponent::Loading);
- QVERIFY(!textEditObject->findChild<QQuickItem*>("cursorInstance"));
- server.sendDelayedItem();
-
// Wait for component to load.
QTRY_COMPARE(component.status(), QQmlComponent::Ready);
QVERIFY(textEditObject->findChild<QQuickItem*>("cursorInstance"));
@@ -3057,7 +3053,7 @@ void tst_qquicktextedit::openInputPanel()
inputMethodPrivate->testContext = &platformInputContext;
QQuickView view(testFileUrl("openInputPanel.qml"));
- view.show();
+ view.showNormal();
view.requestActivate();
QTest::qWaitForWindowActive(&view);
diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
index 8c72be56a4..06b757d198 100644
--- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
+++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
@@ -1573,7 +1573,7 @@ void tst_qquicktextinput::verticalAlignment()
QQuickView window(testFileUrl("horizontalAlignment.qml"));
QQuickTextInput *textInput = window.rootObject()->findChild<QQuickTextInput*>("text");
QVERIFY(textInput != 0);
- window.show();
+ window.showNormal();
QCOMPARE(textInput->vAlign(), QQuickTextInput::AlignTop);
QVERIFY(textInput->boundingRect().bottom() < window.height() / 2);
@@ -2775,7 +2775,6 @@ void tst_qquicktextinput::cursorDelegate()
void tst_qquicktextinput::remoteCursorDelegate()
{
- QSKIP("This test is unstable");
TestHTTPServer server(SERVER_PORT);
server.serveDirectory(dataDirectory(), TestHTTPServer::Delay);
@@ -2799,10 +2798,6 @@ void tst_qquicktextinput::remoteCursorDelegate()
textInputObject->setFocus(true);
QVERIFY(textInputObject->isCursorVisible());
- QCOMPARE(component.status(), QQmlComponent::Loading);
- QVERIFY(!textInputObject->findChild<QQuickItem*>("cursorInstance"));
- server.sendDelayedItem();
-
// Wait for component to load.
QTRY_COMPARE(component.status(), QQmlComponent::Ready);
QVERIFY(textInputObject->findChild<QQuickItem*>("cursorInstance"));
@@ -3314,7 +3309,7 @@ void tst_qquicktextinput::focusOnPress()
QQuickWindow window;
window.resize(100, 50);
textInputObject->setParentItem(window.contentItem());
- window.show();
+ window.showNormal();
window.requestActivate();
QTest::qWaitForWindowActive(&window);
@@ -3377,7 +3372,7 @@ void tst_qquicktextinput::openInputPanel()
inputMethodPrivate->testContext = &platformInputContext;
QQuickView view(testFileUrl("openInputPanel.qml"));
- view.show();
+ view.showNormal();
view.requestActivate();
QTest::qWaitForWindowActive(&view);
@@ -3769,7 +3764,7 @@ void tst_qquicktextinput::inputContextMouseHandler()
input->setFocus(true);
input->setText("");
- view.show();
+ view.showNormal();
view.requestActivate();
QTest::qWaitForWindowActive(&view);
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index e2bb6b431c..fbbc77c31c 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -1072,7 +1072,7 @@ void tst_qquickwindow::noUpdateWhenNothingChanges()
QQuickRectangle rect(window.contentItem());
- window.show();
+ window.showNormal();
QTRY_VERIFY(window.isExposed());
if (window.openglContext()->thread() == QGuiApplication::instance()->thread()) {
diff --git a/tests/auto/quick/rendernode/tst_rendernode.cpp b/tests/auto/quick/rendernode/tst_rendernode.cpp
index 509b209654..04b32499ff 100644
--- a/tests/auto/quick/rendernode/tst_rendernode.cpp
+++ b/tests/auto/quick/rendernode/tst_rendernode.cpp
@@ -59,7 +59,7 @@ public:
QQuickView view;
view.setSource(testFileUrl(fileName));
- view.show();
+ view.showNormal();
QTest::qWaitForWindowExposed(&view);
return view.grabWindow();
diff --git a/tests/auto/quick/touchmouse/touchmouse.pro b/tests/auto/quick/touchmouse/touchmouse.pro
index 378e199bf5..af6d536cbc 100644
--- a/tests/auto/quick/touchmouse/touchmouse.pro
+++ b/tests/auto/quick/touchmouse/touchmouse.pro
@@ -14,5 +14,3 @@ TESTDATA = data/*
# OTHER_FILES += data/foo.qml
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
-
-mac:CONFIG+=insignificant_test # QTBUG-27890