aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/builtins/builtins.qmltypes4
-rw-r--r--src/imports/folderlistmodel/fileinfothread.cpp58
-rw-r--r--src/imports/folderlistmodel/fileinfothread_p.h3
-rw-r--r--src/imports/folderlistmodel/plugins.qmltypes4
-rw-r--r--src/imports/imports.pro2
-rw-r--r--src/imports/layouts/plugins.qmltypes4
-rw-r--r--src/imports/layouts/qquickstacklayout.cpp4
-rw-r--r--src/imports/layouts/qquickstacklayout_p.h4
-rw-r--r--src/imports/localstorage/plugin.cpp27
-rw-r--r--src/imports/localstorage/plugins.qmltypes2
-rw-r--r--src/imports/models/plugins.qmltypes2
-rw-r--r--src/imports/particles/plugins.qmltypes4
-rw-r--r--src/imports/qtqml/plugins.qmltypes2
-rw-r--r--src/imports/qtquick2/plugins.qmltypes33
-rw-r--r--src/imports/settings/plugins.qmltypes1
-rw-r--r--src/imports/settings/qqmlsettings.cpp19
-rw-r--r--src/imports/settings/qqmlsettings_p.h1
-rw-r--r--src/imports/shapes/plugins.qmltypes4
-rw-r--r--src/imports/sharedimage/plugins.qmltypes2
-rw-r--r--src/imports/sharedimage/qsharedimageloader.cpp3
-rw-r--r--src/imports/statemachine/plugins.qmltypes2
-rw-r--r--src/imports/testlib/TestCase.qml106
-rw-r--r--src/imports/testlib/main.cpp1
-rw-r--r--src/imports/testlib/plugins.qmltypes23
-rw-r--r--src/imports/testlib/toucheventsequence.qdoc6
-rw-r--r--src/imports/wavefrontmesh/plugins.qmltypes4
-rw-r--r--src/imports/window/plugins.qmltypes13
27 files changed, 261 insertions, 77 deletions
diff --git a/src/imports/builtins/builtins.qmltypes b/src/imports/builtins/builtins.qmltypes
index f2179aaf7a..4ad103f8de 100644
--- a/src/imports/builtins/builtins.qmltypes
+++ b/src/imports/builtins/builtins.qmltypes
@@ -1493,10 +1493,10 @@ Module {
"WhatsThisRole": 5,
"FontRole": 6,
"TextAlignmentRole": 7,
- "BackgroundColorRole": 8,
"BackgroundRole": 8,
- "TextColorRole": 9,
"ForegroundRole": 9,
+ "BackgroundColorRole": 8,
+ "TextColorRole": 9,
"CheckStateRole": 10,
"AccessibleTextRole": 11,
"AccessibleDescriptionRole": 12,
diff --git a/src/imports/folderlistmodel/fileinfothread.cpp b/src/imports/folderlistmodel/fileinfothread.cpp
index a006f659c9..a93edd3b1b 100644
--- a/src/imports/folderlistmodel/fileinfothread.cpp
+++ b/src/imports/folderlistmodel/fileinfothread.cpp
@@ -39,6 +39,8 @@
#include "fileinfothread_p.h"
#include <qdiriterator.h>
+#include <qpointer.h>
+#include <qtimer.h>
#include <QDebug>
@@ -46,6 +48,7 @@
FileInfoThread::FileInfoThread(QObject *parent)
: QThread(parent),
abort(false),
+ scanPending(false),
#if QT_CONFIG(filesystemwatcher)
watcher(nullptr),
#endif
@@ -109,7 +112,7 @@ void FileInfoThread::setPath(const QString &path)
#endif
currentPath = path;
needUpdate = true;
- condition.wakeAll();
+ initiateScan();
}
void FileInfoThread::setRootPath(const QString &path)
@@ -126,7 +129,7 @@ void FileInfoThread::dirChanged(const QString &directoryPath)
Q_UNUSED(directoryPath);
QMutexLocker locker(&mutex);
folderUpdate = true;
- condition.wakeAll();
+ initiateScan();
}
#endif
@@ -136,7 +139,7 @@ void FileInfoThread::setSortFlags(QDir::SortFlags flags)
sortFlags = flags;
sortUpdate = true;
needUpdate = true;
- condition.wakeAll();
+ initiateScan();
}
void FileInfoThread::setNameFilters(const QStringList & filters)
@@ -144,7 +147,7 @@ void FileInfoThread::setNameFilters(const QStringList & filters)
QMutexLocker locker(&mutex);
nameFilters = filters;
folderUpdate = true;
- condition.wakeAll();
+ initiateScan();
}
void FileInfoThread::setShowFiles(bool show)
@@ -152,7 +155,7 @@ void FileInfoThread::setShowFiles(bool show)
QMutexLocker locker(&mutex);
showFiles = show;
folderUpdate = true;
- condition.wakeAll();
+ initiateScan();
}
void FileInfoThread::setShowDirs(bool showFolders)
@@ -160,7 +163,7 @@ void FileInfoThread::setShowDirs(bool showFolders)
QMutexLocker locker(&mutex);
showDirs = showFolders;
folderUpdate = true;
- condition.wakeAll();
+ initiateScan();
}
void FileInfoThread::setShowDirsFirst(bool show)
@@ -168,7 +171,7 @@ void FileInfoThread::setShowDirsFirst(bool show)
QMutexLocker locker(&mutex);
showDirsFirst = show;
folderUpdate = true;
- condition.wakeAll();
+ initiateScan();
}
void FileInfoThread::setShowDotAndDotDot(bool on)
@@ -177,7 +180,7 @@ void FileInfoThread::setShowDotAndDotDot(bool on)
showDotAndDotDot = on;
folderUpdate = true;
needUpdate = true;
- condition.wakeAll();
+ initiateScan();
}
void FileInfoThread::setShowHidden(bool on)
@@ -186,7 +189,7 @@ void FileInfoThread::setShowHidden(bool on)
showHidden = on;
folderUpdate = true;
needUpdate = true;
- condition.wakeAll();
+ initiateScan();
}
void FileInfoThread::setShowOnlyReadable(bool on)
@@ -194,7 +197,7 @@ void FileInfoThread::setShowOnlyReadable(bool on)
QMutexLocker locker(&mutex);
showOnlyReadable = on;
folderUpdate = true;
- condition.wakeAll();
+ initiateScan();
}
void FileInfoThread::setCaseSensitive(bool on)
@@ -202,7 +205,7 @@ void FileInfoThread::setCaseSensitive(bool on)
QMutexLocker locker(&mutex);
caseSensitive = on;
folderUpdate = true;
- condition.wakeAll();
+ initiateScan();
}
#if QT_CONFIG(filesystemwatcher)
@@ -211,7 +214,7 @@ void FileInfoThread::updateFile(const QString &path)
Q_UNUSED(path);
QMutexLocker locker(&mutex);
folderUpdate = true;
- condition.wakeAll();
+ initiateScan();
}
#endif
@@ -242,6 +245,37 @@ void FileInfoThread::run()
}
}
+void FileInfoThread::runOnce()
+{
+ if (scanPending)
+ return;
+ scanPending = true;
+ QPointer<FileInfoThread> guardedThis(this);
+
+ auto getFileInfosAsync = [guardedThis](){
+ if (!guardedThis)
+ return;
+ guardedThis->scanPending = false;
+ if (guardedThis->currentPath.isEmpty()) {
+ emit guardedThis->statusChanged(QQuickFolderListModel::Null);
+ return;
+ }
+ emit guardedThis->statusChanged(QQuickFolderListModel::Loading);
+ guardedThis->getFileInfos(guardedThis->currentPath);
+ emit guardedThis->statusChanged(QQuickFolderListModel::Ready);
+ };
+
+ QTimer::singleShot(0, getFileInfosAsync);
+}
+
+void FileInfoThread::initiateScan()
+{
+#if QT_CONFIG(thread)
+ condition.wakeAll();
+#else
+ runOnce();
+#endif
+}
void FileInfoThread::getFileInfos(const QString &path)
{
diff --git a/src/imports/folderlistmodel/fileinfothread_p.h b/src/imports/folderlistmodel/fileinfothread_p.h
index 438dea6faa..923cb29e03 100644
--- a/src/imports/folderlistmodel/fileinfothread_p.h
+++ b/src/imports/folderlistmodel/fileinfothread_p.h
@@ -99,6 +99,8 @@ public Q_SLOTS:
protected:
void run() override;
+ void runOnce();
+ void initiateScan();
void getFileInfos(const QString &path);
void findChangeRange(const QList<FileProperty> &list, int &fromIndex, int &toIndex);
@@ -106,6 +108,7 @@ private:
QMutex mutex;
QWaitCondition condition;
volatile bool abort;
+ bool scanPending;
#if QT_CONFIG(filesystemwatcher)
QFileSystemWatcher *watcher;
diff --git a/src/imports/folderlistmodel/plugins.qmltypes b/src/imports/folderlistmodel/plugins.qmltypes
index fd92ab9960..6f5466dbda 100644
--- a/src/imports/folderlistmodel/plugins.qmltypes
+++ b/src/imports/folderlistmodel/plugins.qmltypes
@@ -4,10 +4,10 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable Qt.labs.folderlistmodel 2.12'
+// 'qmlplugindump -nonrelocatable Qt.labs.folderlistmodel 2.13'
Module {
- dependencies: ["QtQuick 2.12"]
+ dependencies: ["QtQuick 2.0"]
Component {
name: "QQuickFolderListModel"
prototype: "QAbstractListModel"
diff --git a/src/imports/imports.pro b/src/imports/imports.pro
index 24e93fec1c..54e52b1103 100644
--- a/src/imports/imports.pro
+++ b/src/imports/imports.pro
@@ -6,7 +6,7 @@ SUBDIRS += \
models \
labsmodels
-qtConfig(thread): SUBDIRS += folderlistmodel
+SUBDIRS += folderlistmodel
qtHaveModule(sql): SUBDIRS += localstorage
qtConfig(settings): SUBDIRS += settings
qtConfig(statemachine): SUBDIRS += statemachine
diff --git a/src/imports/layouts/plugins.qmltypes b/src/imports/layouts/plugins.qmltypes
index f8d7b9acfe..22e8d79ece 100644
--- a/src/imports/layouts/plugins.qmltypes
+++ b/src/imports/layouts/plugins.qmltypes
@@ -4,10 +4,10 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable QtQuick.Layouts 1.12'
+// 'qmlplugindump -nonrelocatable QtQuick.Layouts 1.13'
Module {
- dependencies: ["QtQuick 2.12"]
+ dependencies: ["QtQuick 2.0"]
Component {
name: "QQuickColumnLayout"
defaultProperty: "data"
diff --git a/src/imports/layouts/qquickstacklayout.cpp b/src/imports/layouts/qquickstacklayout.cpp
index 0b51d79bef..116e162aa9 100644
--- a/src/imports/layouts/qquickstacklayout.cpp
+++ b/src/imports/layouts/qquickstacklayout.cpp
@@ -97,6 +97,8 @@
\sa StackView
*/
+QT_BEGIN_NAMESPACE
+
QQuickStackLayout::QQuickStackLayout(QQuickItem *parent) :
QQuickLayout(*new QQuickStackLayoutPrivate, parent)
{
@@ -345,4 +347,6 @@ bool QQuickStackLayout::shouldIgnoreItem(QQuickItem *item) const
return ignored;
}
+QT_END_NAMESPACE
+
#include "moc_qquickstacklayout_p.cpp"
diff --git a/src/imports/layouts/qquickstacklayout_p.h b/src/imports/layouts/qquickstacklayout_p.h
index 8ba41720aa..46181c6f50 100644
--- a/src/imports/layouts/qquickstacklayout_p.h
+++ b/src/imports/layouts/qquickstacklayout_p.h
@@ -42,6 +42,8 @@
#include <qquicklayout_p.h>
+QT_BEGIN_NAMESPACE
+
class QQuickStackLayoutPrivate;
class QQuickStackLayout : public QQuickLayout
@@ -105,4 +107,6 @@ private:
bool explicitCurrentIndex;
};
+QT_END_NAMESPACE
+
#endif // QQUICKSTACKLAYOUT_H
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index e7e8d130bb..3c34d8e45a 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -399,23 +399,23 @@ static ReturnedValue qmlsqldatabase_changeVersion(const FunctionObject *b, const
if (from_version != *r->d()->version)
V4THROW_SQL(SQLEXCEPTION_VERSION_ERR, QQmlEngine::tr("Version mismatch: expected %1, found %2").arg(from_version).arg(*r->d()->version));
- Scoped<QQmlSqlDatabaseWrapper> w(scope, QQmlSqlDatabaseWrapper::create(scope.engine));
- ScopedObject p(scope, databaseData(scope.engine)->queryProto.value());
- w->setPrototypeUnchecked(p.getPointer());
- w->d()->type = Heap::QQmlSqlDatabaseWrapper::Query;
- *w->d()->database = db;
- *w->d()->version = *r->d()->version;
-
bool ok = true;
if (!!callback) {
+ Scoped<QQmlSqlDatabaseWrapper> query(scope, QQmlSqlDatabaseWrapper::create(scope.engine));
+ ScopedObject p(scope, databaseData(scope.engine)->queryProto.value());
+ query->setPrototypeUnchecked(p.getPointer());
+ query->d()->type = Heap::QQmlSqlDatabaseWrapper::Query;
+ *query->d()->database = db;
+ *query->d()->version = *r->d()->version;
+
ok = false;
db.transaction();
JSCallData jsCall(scope, 1);
*jsCall->thisObject = scope.engine->globalObject;
- jsCall->args[0] = w;
+ jsCall->args[0] = query;
- TransactionRollback rollbackOnException(&db, &w->d()->inTransaction);
+ TransactionRollback rollbackOnException(&db, &query->d()->inTransaction);
callback->call(jsCall);
rollbackOnException.clear();
if (!db.commit()) {
@@ -427,12 +427,18 @@ static ReturnedValue qmlsqldatabase_changeVersion(const FunctionObject *b, const
}
if (ok) {
+ Scoped<QQmlSqlDatabaseWrapper> w(scope, QQmlSqlDatabaseWrapper::create(scope.engine));
+ ScopedObject p(scope, databaseData(scope.engine)->databaseProto.value());
+ w->setPrototypeUnchecked(p.getPointer());
+ w->d()->type = Heap::QQmlSqlDatabaseWrapper::Database;
+ *w->d()->database = db;
*w->d()->version = to_version;
#if QT_CONFIG(settings)
const QQmlEnginePrivate *enginePrivate = QQmlEnginePrivate::get(scope.engine->qmlEngine());
QSettings ini(enginePrivate->offlineStorageDatabaseDirectory() + db.connectionName() + QLatin1String(".ini"), QSettings::IniFormat);
ini.setValue(QLatin1String("Version"), to_version);
#endif
+ RETURN_RESULT(w.asReturnedValue());
}
RETURN_UNDEFINED();
@@ -599,7 +605,8 @@ This data can be used by application tools.
\section3 db.changeVersion(from, to, callback(tx))
-This method allows you to perform a \e{Scheme Upgrade}.
+This method allows you to perform a \e{Scheme Upgrade}. If it succeeds it returns a new
+database object of version \e to. Otherwise it returns \e undefined.
If the current version of \e db is not \e from, then an exception is thrown.
diff --git a/src/imports/localstorage/plugins.qmltypes b/src/imports/localstorage/plugins.qmltypes
index 59944328d6..3c8c1404f2 100644
--- a/src/imports/localstorage/plugins.qmltypes
+++ b/src/imports/localstorage/plugins.qmltypes
@@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.LocalStorage 2.12'
+// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.LocalStorage 2.13'
Module {
dependencies: []
diff --git a/src/imports/models/plugins.qmltypes b/src/imports/models/plugins.qmltypes
index 87ec0fee76..6e112c41b6 100644
--- a/src/imports/models/plugins.qmltypes
+++ b/src/imports/models/plugins.qmltypes
@@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQml.Models 2.12'
+// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQml.Models 2.13'
Module {
dependencies: []
diff --git a/src/imports/particles/plugins.qmltypes b/src/imports/particles/plugins.qmltypes
index b68be6c5da..b6db00e683 100644
--- a/src/imports/particles/plugins.qmltypes
+++ b/src/imports/particles/plugins.qmltypes
@@ -4,10 +4,10 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable QtQuick.Particles 2.12'
+// 'qmlplugindump -nonrelocatable QtQuick.Particles 2.13'
Module {
- dependencies: ["QtQuick 2.12"]
+ dependencies: ["QtQuick 2.0"]
Component {
name: "QQuickAgeAffector"
defaultProperty: "data"
diff --git a/src/imports/qtqml/plugins.qmltypes b/src/imports/qtqml/plugins.qmltypes
index 1ffe4a78ca..d548a78dd0 100644
--- a/src/imports/qtqml/plugins.qmltypes
+++ b/src/imports/qtqml/plugins.qmltypes
@@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable -noforceqtquick QtQml 2.12'
+// 'qmlplugindump -nonrelocatable -noforceqtquick QtQml 2.13'
Module {
dependencies: []
diff --git a/src/imports/qtquick2/plugins.qmltypes b/src/imports/qtquick2/plugins.qmltypes
index 035c13a4d3..f006c874da 100644
--- a/src/imports/qtquick2/plugins.qmltypes
+++ b/src/imports/qtquick2/plugins.qmltypes
@@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick 2.12'
+// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick 2.13'
Module {
dependencies: []
@@ -1234,10 +1234,11 @@ Module {
name: "QQuickBehavior"
defaultProperty: "animation"
prototype: "QObject"
- exports: ["QtQuick/Behavior 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: ["QtQuick/Behavior 2.0", "QtQuick/Behavior 2.13"]
+ exportMetaObjectRevisions: [0, 13]
Property { name: "animation"; type: "QQuickAbstractAnimation"; isPointer: true }
Property { name: "enabled"; type: "bool" }
+ Property { name: "targetValue"; revision: 13; type: "QVariant"; isReadonly: true }
}
Component {
name: "QQuickBorderImage"
@@ -2083,9 +2084,10 @@ Module {
exports: [
"QtQuick/GridView 2.0",
"QtQuick/GridView 2.1",
+ "QtQuick/GridView 2.13",
"QtQuick/GridView 2.7"
]
- exportMetaObjectRevisions: [0, 1, 7]
+ exportMetaObjectRevisions: [0, 1, 13, 7]
attachedType: "QQuickGridViewAttached"
Enum {
name: "Flow"
@@ -2495,11 +2497,12 @@ Module {
prototype: "QQuickFlickable"
exports: [
"QtQuick/ItemView 2.1",
+ "QtQuick/ItemView 2.13",
"QtQuick/ItemView 2.3",
"QtQuick/ItemView 2.7"
]
isCreatable: false
- exportMetaObjectRevisions: [1, 2, 7]
+ exportMetaObjectRevisions: [1, 13, 2, 7]
Enum {
name: "LayoutDirection"
values: {
@@ -2593,6 +2596,12 @@ Module {
Parameter { name: "x"; type: "double" }
Parameter { name: "y"; type: "double" }
}
+ Method {
+ name: "itemAtIndex"
+ revision: 13
+ type: "QQuickItem*"
+ Parameter { name: "index"; type: "int" }
+ }
Method { name: "positionViewAtBeginning" }
Method { name: "positionViewAtEnd" }
Method { name: "forceLayout"; revision: 1 }
@@ -3340,8 +3349,12 @@ Module {
name: "QQuickPathView"
defaultProperty: "data"
prototype: "QQuickItem"
- exports: ["QtQuick/PathView 2.0", "QtQuick/PathView 2.7"]
- exportMetaObjectRevisions: [0, 7]
+ exports: [
+ "QtQuick/PathView 2.0",
+ "QtQuick/PathView 2.13",
+ "QtQuick/PathView 2.7"
+ ]
+ exportMetaObjectRevisions: [0, 13, 7]
attachedType: "QQuickPathViewAttached"
Enum {
name: "HighlightRangeMode"
@@ -3428,6 +3441,12 @@ Module {
Parameter { name: "x"; type: "double" }
Parameter { name: "y"; type: "double" }
}
+ Method {
+ name: "itemAtIndex"
+ revision: 13
+ type: "QQuickItem*"
+ Parameter { name: "index"; type: "int" }
+ }
}
Component {
name: "QQuickPathViewAttached"
diff --git a/src/imports/settings/plugins.qmltypes b/src/imports/settings/plugins.qmltypes
index d6cd1c6635..bbc5c1cf8f 100644
--- a/src/imports/settings/plugins.qmltypes
+++ b/src/imports/settings/plugins.qmltypes
@@ -31,5 +31,6 @@ Module {
Parameter { name: "key"; type: "string" }
Parameter { name: "value"; type: "QVariant" }
}
+ Method { name: "sync" }
}
}
diff --git a/src/imports/settings/qqmlsettings.cpp b/src/imports/settings/qqmlsettings.cpp
index f7a7d8b055..287a70363a 100644
--- a/src/imports/settings/qqmlsettings.cpp
+++ b/src/imports/settings/qqmlsettings.cpp
@@ -487,6 +487,25 @@ void QQmlSettings::setValue(const QString &key, const QVariant &value)
qCDebug(lcSettings) << "QQmlSettings: setValue" << key << ":" << value;
}
+/*!
+ \qmlmethod Settings::sync()
+
+ Writes any unsaved changes to permanent storage, and reloads any
+ settings that have been changed in the meantime by another
+ application.
+
+ This function is called automatically from QSettings's destructor and
+ by the event loop at regular intervals, so you normally don't need to
+ call it yourself.
+
+ \sa QSettings::sync
+*/
+void QQmlSettings::sync()
+{
+ Q_D(QQmlSettings);
+ d->instance()->sync();
+}
+
void QQmlSettings::classBegin()
{
}
diff --git a/src/imports/settings/qqmlsettings_p.h b/src/imports/settings/qqmlsettings_p.h
index f9122a58f7..a86c8b4751 100644
--- a/src/imports/settings/qqmlsettings_p.h
+++ b/src/imports/settings/qqmlsettings_p.h
@@ -79,6 +79,7 @@ public:
Q_INVOKABLE QVariant value(const QString &key, const QVariant &defaultValue = QVariant()) const;
Q_INVOKABLE void setValue(const QString &key, const QVariant &value);
+ Q_INVOKABLE void sync();
protected:
void timerEvent(QTimerEvent *event) override;
diff --git a/src/imports/shapes/plugins.qmltypes b/src/imports/shapes/plugins.qmltypes
index a851b20ed2..b78c5a1130 100644
--- a/src/imports/shapes/plugins.qmltypes
+++ b/src/imports/shapes/plugins.qmltypes
@@ -4,10 +4,10 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable QtQuick.Shapes 1.12'
+// 'qmlplugindump -nonrelocatable QtQuick.Shapes 1.13'
Module {
- dependencies: ["QtQuick 2.12"]
+ dependencies: ["QtQuick 2.0"]
Component {
name: "QQuickShape"
defaultProperty: "data"
diff --git a/src/imports/sharedimage/plugins.qmltypes b/src/imports/sharedimage/plugins.qmltypes
index 504186936b..29639e7697 100644
--- a/src/imports/sharedimage/plugins.qmltypes
+++ b/src/imports/sharedimage/plugins.qmltypes
@@ -7,5 +7,5 @@ import QtQuick.tooling 1.2
// 'qmlplugindump -nonrelocatable Qt.labs.sharedimage 1.0'
Module {
- dependencies: ["QtQuick 2.12"]
+ dependencies: ["QtQuick 2.0"]
}
diff --git a/src/imports/sharedimage/qsharedimageloader.cpp b/src/imports/sharedimage/qsharedimageloader.cpp
index dcd28cb0b2..c9e3ef3eb3 100644
--- a/src/imports/sharedimage/qsharedimageloader.cpp
+++ b/src/imports/sharedimage/qsharedimageloader.cpp
@@ -173,8 +173,7 @@ QImage QSharedImageLoaderPrivate::load(const QString &path, QSharedImageLoader::
if (img.isNull())
return nil;
size_t size = sizeof(SharedImageHeader) + img.sizeInBytes();
- const size_t intMax = std::numeric_limits<int>::max();
- if (size > intMax) {
+ if (size > size_t(std::numeric_limits<int>::max())) {
qCDebug(lcSharedImage) << "Image" << path << "to large to load";
return nil;
} else if (shm->create(int(size))) {
diff --git a/src/imports/statemachine/plugins.qmltypes b/src/imports/statemachine/plugins.qmltypes
index 001efd3847..f92aeaa080 100644
--- a/src/imports/statemachine/plugins.qmltypes
+++ b/src/imports/statemachine/plugins.qmltypes
@@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQml.StateMachine 1.12'
+// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQml.StateMachine 1.13'
Module {
dependencies: []
diff --git a/src/imports/testlib/TestCase.qml b/src/imports/testlib/TestCase.qml
index 1e06f604d5..e7669fd03d 100644
--- a/src/imports/testlib/TestCase.qml
+++ b/src/imports/testlib/TestCase.qml
@@ -521,6 +521,75 @@ Item {
}
/*!
+ \since 5.13
+ \qmlmethod bool TestCase::isPolishScheduled(object item)
+
+ Returns \c true if \l {QQuickItem::}{updatePolish()} has not been called
+ on \a item since the last call to \l {QQuickItem::}{polish()},
+ otherwise returns \c false.
+
+ When assigning values to properties in QML, any layouting the item
+ must do as a result of the assignment might not take effect immediately,
+ but can instead be postponed until the item is polished. For these cases,
+ you can use this function to ensure that the item has been polished
+ before the execution of the test continues. For example:
+
+ \code
+ verify(isPolishScheduled(item))
+ verify(waitForItemPolished(item))
+ \endcode
+
+ Without the call to \c isPolishScheduled() above, the
+ call to \c waitForItemPolished() might see that no polish
+ was scheduled and therefore pass instantly, assuming that
+ the item had already been polished. This function
+ makes it obvious why an item wasn't polished and allows tests to
+ fail early under such circumstances.
+
+ \sa waitForItemPolished(), QQuickItem::polish(), QQuickItem::updatePolish()
+ */
+ function isPolishScheduled(item) {
+ if (!item || typeof item !== "object") {
+ qtest_results.fail("Argument must be a valid Item; actual type is " + typeof item,
+ util.callerFile(), util.callerLine())
+ throw new Error("QtQuickTest::fail")
+ }
+
+ return qtest_results.isPolishScheduled(item)
+ }
+
+ /*!
+ \since 5.13
+ \qmlmethod bool waitForItemPolished(object item, int timeout = 5000)
+
+ Waits for \a timeout milliseconds or until
+ \l {QQuickItem::}{updatePolish()} has been called on \a item.
+
+ Returns \c true if \c updatePolish() was called on \a item within
+ \a timeout milliseconds, otherwise returns \c false.
+
+ \sa isPolishScheduled(), QQuickItem::polish(), QQuickItem::updatePolish()
+ */
+ function waitForItemPolished(item, timeout) {
+ if (!item || typeof item !== "object") {
+ qtest_results.fail("First argument must be a valid Item; actual type is " + typeof item,
+ util.callerFile(), util.callerLine())
+ throw new Error("QtQuickTest::fail")
+ }
+
+ if (timeout !== undefined && typeof(timeout) != "number") {
+ qtest_results.fail("Second argument must be a number; actual type is " + typeof timeout,
+ util.callerFile(), util.callerLine())
+ throw new Error("QtQuickTest::fail")
+ }
+
+ if (!timeout)
+ timeout = 5000
+
+ return qtest_results.waitForItemPolished(item, timeout)
+ }
+
+ /*!
\since 5.9
\qmlmethod object TestCase::createTemporaryQmlObject(string qml, object parent, string filePath)
@@ -850,12 +919,12 @@ Item {
Additionally, the returned image object has the following methods:
\list
- \li red(x, y) Returns the red channel value of the pixel at \a x, \a y position
- \li green(x, y) Returns the green channel value of the pixel at \a x, \a y position
- \li blue(x, y) Returns the blue channel value of the pixel at \a x, \a y position
- \li alpha(x, y) Returns the alpha channel value of the pixel at \a x, \a y position
- \li pixel(x, y) Returns the color value of the pixel at \a x, \a y position
- \li equals(image) Returns \c true if this image is identical to \a image -
+ \li \c {red(x, y)} Returns the red channel value of the pixel at \e x, \e y position
+ \li \c {green(x, y)} Returns the green channel value of the pixel at \e x, \e y position
+ \li \c {blue(x, y)} Returns the blue channel value of the pixel at \e x, \e y position
+ \li \c {alpha(x, y)} Returns the alpha channel value of the pixel at \e x, \e y position
+ \li \c {pixel(x, y)} Returns the color value of the pixel at \e x, \e y position
+ \li \c {equals(image)} Returns \c true if this image is identical to \e image -
see \l QImage::operator== (since 5.6)
For example:
@@ -869,7 +938,8 @@ Item {
var newImage = grabImage(rect);
verify(!newImage.equals(image));
\endcode
- \li save(path) Saves the image to the given \a path. If the image cannot
+
+ \li \c {save(path)} Saves the image to the given \e path. If the image cannot
be saved, an exception will be thrown. (since 5.10)
This can be useful to perform postmortem analysis on failing tests, for
@@ -886,8 +956,6 @@ Item {
\endcode
\endlist
-
- \sa
*/
function grabImage(item) {
return qtest_results.grabImage(item);
@@ -1152,7 +1220,7 @@ Item {
/*!
\qmlmethod TestCase::keyPress(key, modifiers = Qt.NoModifier, delay = -1)
- Simulates pressing a \a key with an optional \a modifier on the currently
+ Simulates pressing a \a key with optional \a modifiers on the currently
focused item. If \a delay is larger than 0, the test will wait for
\a delay milliseconds.
@@ -1180,7 +1248,7 @@ Item {
/*!
\qmlmethod TestCase::keyRelease(key, modifiers = Qt.NoModifier, delay = -1)
- Simulates releasing a \a key with an optional \a modifier on the currently
+ Simulates releasing a \a key with optional \a modifiers on the currently
focused item. If \a delay is larger than 0, the test will wait for
\a delay milliseconds.
@@ -1206,7 +1274,7 @@ Item {
/*!
\qmlmethod TestCase::keyClick(key, modifiers = Qt.NoModifier, delay = -1)
- Simulates clicking of \a key with an optional \a modifier on the currently
+ Simulates clicking of \a key with optional \a modifiers on the currently
focused item. If \a delay is larger than 0, the test will wait for
\a delay milliseconds.
@@ -1252,7 +1320,7 @@ Item {
/*!
\qmlmethod TestCase::mousePress(item, x = item.width / 2, y = item.height / 2, button = Qt.LeftButton, modifiers = Qt.NoModifier, delay = -1)
- Simulates pressing a mouse \a button with an optional \a modifier
+ Simulates pressing a mouse \a button with optional \a modifiers
on an \a item. The position is defined by \a x and \a y.
If \a x or \a y are not defined the position will be the center of \a item.
If \a delay is specified, the test will wait for the specified amount of
@@ -1286,7 +1354,7 @@ Item {
/*!
\qmlmethod TestCase::mouseRelease(item, x = item.width / 2, y = item.height / 2, button = Qt.LeftButton, modifiers = Qt.NoModifier, delay = -1)
- Simulates releasing a mouse \a button with an optional \a modifier
+ Simulates releasing a mouse \a button with optional \a modifiers
on an \a item. The position of the release is defined by \a x and \a y.
If \a x or \a y are not defined the position will be the center of \a item.
If \a delay is specified, the test will wait for the specified amount of
@@ -1320,7 +1388,7 @@ Item {
/*!
\qmlmethod TestCase::mouseDrag(item, x, y, dx, dy, button = Qt.LeftButton, modifiers = Qt.NoModifier, delay = -1)
- Simulates dragging the mouse on an \a item with \a button pressed and an optional \a modifier.
+ Simulates dragging the mouse on an \a item with \a button pressed and optional \a modifiers
The initial drag position is defined by \a x and \a y,
and drag distance is defined by \a dx and \a dy. If \a delay is specified,
the test will wait for the specified amount of milliseconds before releasing the button.
@@ -1370,7 +1438,7 @@ Item {
/*!
\qmlmethod TestCase::mouseClick(item, x = item.width / 2, y = item.height / 2, button = Qt.LeftButton, modifiers = Qt.NoModifier, delay = -1)
- Simulates clicking a mouse \a button with an optional \a modifier
+ Simulates clicking a mouse \a button with optional \a modifiers
on an \a item. The position of the click is defined by \a x and \a y.
If \a x and \a y are not defined the position will be the center of \a item.
If \a delay is specified, the test will wait for the specified amount of
@@ -1404,7 +1472,7 @@ Item {
/*!
\qmlmethod TestCase::mouseDoubleClick(item, x = item.width / 2, y = item.height / 2, button = Qt.LeftButton, modifiers = Qt.NoModifier, delay = -1)
- Simulates double-clicking a mouse \a button with an optional \a modifier
+ Simulates double-clicking a mouse \a button with optional \a modifiers
on an \a item. The position of the click is defined by \a x and \a y.
If \a x and \a y are not defined the position will be the center of \a item.
If \a delay is specified, the test will wait for the specified amount of
@@ -1439,7 +1507,7 @@ Item {
\qmlmethod TestCase::mouseDoubleClickSequence(item, x = item.width / 2, y = item.height / 2, button = Qt.LeftButton, modifiers = Qt.NoModifier, delay = -1)
Simulates the full sequence of events generated by double-clicking a mouse
- \a button with an optional \a modifier on an \a item.
+ \a button with optional \a modifiers on an \a item.
This method reproduces the sequence of mouse events generated when a user makes
a double click: Press-Release-Press-DoubleClick-Release.
@@ -1505,7 +1573,7 @@ Item {
/*!
\qmlmethod TestCase::mouseWheel(item, x, y, xDelta, yDelta, button = Qt.LeftButton, modifiers = Qt.NoModifier, delay = -1)
- Simulates rotating the mouse wheel on an \a item with \a button pressed and an optional \a modifier.
+ Simulates rotating the mouse wheel on an \a item with \a button pressed and optional \a modifiers.
The position of the wheel event is defined by \a x and \a y.
If \a delay is specified, the test will wait for the specified amount of milliseconds before releasing the button.
diff --git a/src/imports/testlib/main.cpp b/src/imports/testlib/main.cpp
index af15a44012..c625c87db7 100644
--- a/src/imports/testlib/main.cpp
+++ b/src/imports/testlib/main.cpp
@@ -149,6 +149,7 @@ public:
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtTest"));
qmlRegisterType<QuickTestResult, 0>(uri,1,0,"TestResult");
qmlRegisterType<QuickTestResult, 1>(uri,1,1,"TestResult");
+ qmlRegisterType<QuickTestResult, 13>(uri,1,13,"TestResult");
qmlRegisterType<QuickTestEvent>(uri,1,0,"TestEvent");
qmlRegisterType<QuickTestEvent>(uri,1,2,"TestEvent");
qmlRegisterType<QuickTestUtil>(uri,1,0,"TestUtil");
diff --git a/src/imports/testlib/plugins.qmltypes b/src/imports/testlib/plugins.qmltypes
index e51371d176..1e081d82ff 100644
--- a/src/imports/testlib/plugins.qmltypes
+++ b/src/imports/testlib/plugins.qmltypes
@@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable QtTest 1.12'
+// 'qmlplugindump -nonrelocatable QtTest 1.13'
Module {
dependencies: ["QtQuick 2.0", "QtQuick.Window 2.0"]
@@ -177,8 +177,12 @@ Module {
Component {
name: "QuickTestResult"
prototype: "QObject"
- exports: ["QtTest/TestResult 1.0", "QtTest/TestResult 1.1"]
- exportMetaObjectRevisions: [0, 1]
+ exports: [
+ "QtTest/TestResult 1.0",
+ "QtTest/TestResult 1.1",
+ "QtTest/TestResult 1.13"
+ ]
+ exportMetaObjectRevisions: [0, 1, 13]
Enum {
name: "RunMode"
values: {
@@ -316,6 +320,19 @@ Module {
Parameter { name: "parent"; type: "QObject"; isPointer: true }
Parameter { name: "objectName"; type: "string" }
}
+ Method {
+ name: "isPolishScheduled"
+ revision: 13
+ type: "bool"
+ Parameter { name: "item"; type: "QQuickItem"; isPointer: true }
+ }
+ Method {
+ name: "waitForItemPolished"
+ revision: 13
+ type: "bool"
+ Parameter { name: "item"; type: "QQuickItem"; isPointer: true }
+ Parameter { name: "timeout"; type: "int" }
+ }
}
Component {
name: "QuickTestUtil"
diff --git a/src/imports/testlib/toucheventsequence.qdoc b/src/imports/testlib/toucheventsequence.qdoc
index 92c5836d49..bd3551a669 100644
--- a/src/imports/testlib/toucheventsequence.qdoc
+++ b/src/imports/testlib/toucheventsequence.qdoc
@@ -57,7 +57,7 @@
/*!
\qmlmethod TouchEventSequence TouchEventSequence::press(int touchId, object item, real x = item.width / 2, real y = item.height / 2)
- Creates a new point identified as \a touchId, at the point indicated by \a x and \a y relative to \a item.
+ Creates a new point identified as \a touchId, at the point indicated by \e x and \e y relative to \a item.
Further use of the same touch point should maintain the same touchId.
Item defaults to the value provided via touchEvent().
@@ -67,7 +67,7 @@
/*!
\qmlmethod TouchEventSequence TouchEventSequence::move(int touchId, object item, real x = item.width / 2, real y = item.height / 2)
- Moves \a touchId to the point indicated by \a x and \a y relative to \a item.
+ Moves \a touchId to the point indicated by \e x and \e y relative to \a item.
Item defaults to the value provided via touchEvent().
X and y default to the midpoint of the item.
@@ -76,7 +76,7 @@
/*!
\qmlmethod TouchEventSequence TouchEventSequence::release(int touchId, object item, real x = item.width / 2, real y = item.height / 2)
- Removes \a touchId at the point indicated by \a x and \a y relative to \a item.
+ Removes \a touchId at the point indicated by \e x and \e y relative to \a item.
Item defaults to the value provided via touchEvent().
X and y default to the midpoint of the item.
diff --git a/src/imports/wavefrontmesh/plugins.qmltypes b/src/imports/wavefrontmesh/plugins.qmltypes
index a0c4e22271..b9dd9e4c46 100644
--- a/src/imports/wavefrontmesh/plugins.qmltypes
+++ b/src/imports/wavefrontmesh/plugins.qmltypes
@@ -4,10 +4,10 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable Qt.labs.wavefrontmesh 1.12'
+// 'qmlplugindump -nonrelocatable Qt.labs.wavefrontmesh 1.13'
Module {
- dependencies: ["QtQuick 2.12"]
+ dependencies: ["QtQuick 2.0"]
Component {
name: "QWavefrontMesh"
prototype: "QQuickShaderEffectMesh"
diff --git a/src/imports/window/plugins.qmltypes b/src/imports/window/plugins.qmltypes
index 79fa40dbb2..b5786ed5a6 100644
--- a/src/imports/window/plugins.qmltypes
+++ b/src/imports/window/plugins.qmltypes
@@ -4,10 +4,10 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -nonrelocatable QtQuick.Window 2.12'
+// 'qmlplugindump -nonrelocatable QtQuick.Window 2.13'
Module {
- dependencies: ["QtQuick 2.12"]
+ dependencies: ["QtQuick 2.0"]
Component {
name: "QQuickRootItem"
defaultProperty: "data"
@@ -160,10 +160,11 @@ Module {
prototype: "QQuickWindow"
exports: [
"QtQuick.Window/Window 2.1",
+ "QtQuick.Window/Window 2.13",
"QtQuick.Window/Window 2.2",
"QtQuick.Window/Window 2.3"
]
- exportMetaObjectRevisions: [0, 1, 2]
+ exportMetaObjectRevisions: [0, 13, 1, 2]
attachedType: "QQuickWindowAttached"
Property { name: "visible"; type: "bool" }
Property { name: "visibility"; type: "Visibility" }
@@ -215,6 +216,7 @@ Module {
Property { name: "visibility"; revision: 1; type: "Visibility" }
Property { name: "contentOrientation"; type: "Qt::ScreenOrientation" }
Property { name: "opacity"; revision: 1; type: "double" }
+ Property { name: "transientParent"; revision: 13; type: "QWindow"; isPointer: true }
Signal {
name: "screenChanged"
Parameter { name: "screen"; type: "QScreen"; isPointer: true }
@@ -287,6 +289,11 @@ Module {
revision: 1
Parameter { name: "opacity"; type: "double" }
}
+ Signal {
+ name: "transientParentChanged"
+ revision: 13
+ Parameter { name: "transientParent"; type: "QWindow"; isPointer: true }
+ }
Method { name: "requestActivate"; revision: 1 }
Method {
name: "setVisible"