aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml')
-rw-r--r--tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp8
-rwxr-xr-xtests/auto/qml/ecmascripttests/test262.py1
-rw-r--r--tests/auto/qml/qqmlconnections/data/disabled-at-start.qml14
-rw-r--r--tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp18
-rw-r--r--tests/auto/qml/qqmlecmascript/data/qtbug60547/TestObject.qml11
-rw-r--r--tests/auto/qml/qqmlecmascript/data/qtbug60547/components/Counter.qml4
-rw-r--r--tests/auto/qml/qqmlecmascript/data/qtbug60547/main.qml8
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp11
-rw-r--r--tests/auto/qml/qqmlengine/tst_qqmlengine.cpp1
-rw-r--r--tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp27
-rw-r--r--tests/auto/qml/qqmllanguage/data/ConcurrentLoadA.qml7
-rw-r--r--tests/auto/qml/qqmllanguage/data/ConcurrentLoadB.qml7
-rw-r--r--tests/auto/qml/qqmllanguage/data/concurrentLoad_main.qml5
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp16
-rw-r--r--tests/auto/qml/qqmlparser/tst_qqmlparser.cpp12
-rw-r--r--tests/auto/qml/qqmlsettings/data/aliases.qml4
-rw-r--r--tests/auto/qml/qqmlsettings/data/cpp-aliases.qml2
-rw-r--r--tests/auto/qml/qqmlsettings/data/types.qml6
-rw-r--r--tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp206
-rw-r--r--tests/auto/qml/qqmlxmlhttprequest/data/send_patch.qml29
-rw-r--r--tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp2
21 files changed, 208 insertions, 191 deletions
diff --git a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
index 584bd10151..441f8c113f 100644
--- a/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
+++ b/tests/auto/qml/debugger/qv4debugger/tst_qv4debugger.cpp
@@ -46,7 +46,7 @@
using namespace QV4;
using namespace QV4::Debugging;
-typedef QV4::ReturnedValue (*InjectedFunction)(QV4::CallContext*);
+typedef void (*InjectedFunction)(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *callData);
Q_DECLARE_METATYPE(InjectedFunction)
static bool waitForSignal(QObject* obj, const char* signal, int timeout = 10000)
@@ -438,11 +438,11 @@ void tst_qv4debugger::addBreakPointWhilePaused()
QCOMPARE(state.lineNumber, 2);
}
-static QV4::ReturnedValue someCall(QV4::CallContext *ctx)
+static void someCall(const QV4::BuiltinFunction *, QV4::Scope &scope, QV4::CallData *)
{
- static_cast<QV4Debugger *>(ctx->d()->engine->debugger())
+ static_cast<QV4Debugger *>(scope.engine->debugger())
->removeBreakPoint("removeBreakPointForNextInstruction", 2);
- return QV4::Encode::undefined();
+ RETURN_UNDEFINED();
}
void tst_qv4debugger::removeBreakPointForNextInstruction()
diff --git a/tests/auto/qml/ecmascripttests/test262.py b/tests/auto/qml/ecmascripttests/test262.py
index 99f029cffd..9f0a7c1dee 100755
--- a/tests/auto/qml/ecmascripttests/test262.py
+++ b/tests/auto/qml/ecmascripttests/test262.py
@@ -569,6 +569,7 @@ def Main():
#logging.basicConfig(level=logging.DEBUG)
os.environ["TZ"] = "PST8PDT"
os.environ["LANG"] = "en_US.UTF-8"
+ os.environ["LC_TIME"] = "en_US.UTF-8"
parser = BuildOptions()
(options, args) = parser.parse_args()
ValidateOptions(options)
diff --git a/tests/auto/qml/qqmlconnections/data/disabled-at-start.qml b/tests/auto/qml/qqmlconnections/data/disabled-at-start.qml
new file mode 100644
index 0000000000..1a823f87f6
--- /dev/null
+++ b/tests/auto/qml/qqmlconnections/data/disabled-at-start.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.9
+
+Item {
+ id: root
+
+ property bool tested: false
+ signal testMe()
+
+ Connections {
+ target: root
+ enabled: false
+ onTestMe: root.tested = true;
+ }
+}
diff --git a/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp b/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
index 1ed94fcb93..22e9724c61 100644
--- a/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
+++ b/tests/auto/qml/qqmlconnections/tst_qqmlconnections.cpp
@@ -52,6 +52,7 @@ private slots:
void rewriteErrors();
void singletonTypeTarget();
void enableDisable_QTBUG_36350();
+ void disabledAtStart();
void clearImplicitTarget();
void onWithoutASignal();
@@ -354,6 +355,23 @@ void tst_qqmlconnections::enableDisable_QTBUG_36350()
delete item;
}
+void tst_qqmlconnections::disabledAtStart()
+{
+ QQmlEngine engine;
+ QQmlComponent c(&engine, testFileUrl("disabled-at-start.qml"));
+ QObject * const object = c.create();
+
+ QVERIFY(object != 0);
+
+ QCOMPARE(object->property("tested").toBool(), false);
+ const int index = object->metaObject()->indexOfSignal("testMe()");
+ const QMetaMethod method = object->metaObject()->method(index);
+ method.invoke(object, Qt::DirectConnection);
+ QCOMPARE(object->property("tested").toBool(), false);
+
+ delete object;
+}
+
//QTBUG-56499
void tst_qqmlconnections::clearImplicitTarget()
{
diff --git a/tests/auto/qml/qqmlecmascript/data/qtbug60547/TestObject.qml b/tests/auto/qml/qqmlecmascript/data/qtbug60547/TestObject.qml
new file mode 100644
index 0000000000..5f022f605a
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/qtbug60547/TestObject.qml
@@ -0,0 +1,11 @@
+import QtQuick 2.0
+import "components"
+
+QtObject {
+ id: root
+ property int counter
+ function increment() {
+ counter++
+ return counter
+ }
+}
diff --git a/tests/auto/qml/qqmlecmascript/data/qtbug60547/components/Counter.qml b/tests/auto/qml/qqmlecmascript/data/qtbug60547/components/Counter.qml
new file mode 100644
index 0000000000..3c5e65a340
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/qtbug60547/components/Counter.qml
@@ -0,0 +1,4 @@
+import QtQuick 2.0
+
+QtObject {}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/qtbug60547/main.qml b/tests/auto/qml/qqmlecmascript/data/qtbug60547/main.qml
new file mode 100644
index 0000000000..b09366e9df
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/qtbug60547/main.qml
@@ -0,0 +1,8 @@
+import QtQml 2.0
+
+TestObject {
+ Component.onCompleted: {
+ increment()
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 07ae9821e9..45f312e934 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -341,6 +341,7 @@ private slots:
void redefineGlobalProp();
void freeze_empty_object();
void singleBlockLoops();
+ void qtbug_60547();
private:
// static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -8358,6 +8359,16 @@ void tst_qqmlecmascript::singleBlockLoops()
QVERIFY(!component.isError());
}
+// 'counter' was incorrectly resolved as a type rather than a variable.
+// This fix ensures it looks up the right thing.
+void tst_qqmlecmascript::qtbug_60547()
+{
+ QQmlComponent component(&engine, testFileUrl("qtbug60547/main.qml"));
+ QScopedPointer<QObject> object(component.create());
+ QVERIFY2(!object.isNull(), qPrintable(component.errorString()));
+ QCOMPARE(object->property("counter"), QVariant(int(1)));
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"
diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
index 3f6107ab2b..07569efc72 100644
--- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
+++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp
@@ -36,6 +36,7 @@
#include <QSignalSpy>
#include <QDebug>
#include <QBuffer>
+#include <QCryptographicHash>
#include <QQmlComponent>
#include <QQmlNetworkAccessManagerFactory>
#include <QQmlExpression>
diff --git a/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp b/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp
index 124a107a37..268010ead8 100644
--- a/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp
+++ b/tests/auto/qml/qqmlextensionplugin/tst_qqmlextensionplugin.cpp
@@ -1,31 +1,26 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2017 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** 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 The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/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 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company 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 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/tests/auto/qml/qqmllanguage/data/ConcurrentLoadA.qml b/tests/auto/qml/qqmllanguage/data/ConcurrentLoadA.qml
new file mode 100644
index 0000000000..3d538c7572
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/ConcurrentLoadA.qml
@@ -0,0 +1,7 @@
+import QtQuick 2.0
+import testModule 1.0
+
+Item {
+ Test {}
+}
+
diff --git a/tests/auto/qml/qqmllanguage/data/ConcurrentLoadB.qml b/tests/auto/qml/qqmllanguage/data/ConcurrentLoadB.qml
new file mode 100644
index 0000000000..3d538c7572
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/ConcurrentLoadB.qml
@@ -0,0 +1,7 @@
+import QtQuick 2.0
+import testModule 1.0
+
+Item {
+ Test {}
+}
+
diff --git a/tests/auto/qml/qqmllanguage/data/concurrentLoad_main.qml b/tests/auto/qml/qqmllanguage/data/concurrentLoad_main.qml
new file mode 100644
index 0000000000..8cfc90ac96
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/concurrentLoad_main.qml
@@ -0,0 +1,5 @@
+import QtQuick 2.0
+Rectangle {
+ConcurrentLoadA {}
+ConcurrentLoadB {}
+}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index cc5b8cacbc..15f19d550b 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -267,6 +267,8 @@ private slots:
void instanceof_data();
void instanceof();
+ void concurrentLoadQmlDir();
+
private:
QQmlEngine engine;
QStringList defaultImportPathList;
@@ -4559,6 +4561,20 @@ void tst_qqmllanguage::instanceof()
}
}
+void tst_qqmllanguage::concurrentLoadQmlDir()
+{
+ ThreadedTestHTTPServer server(dataDirectory());
+ QString serverdir = server.urlString("/lib/");
+ engine.setImportPathList(QStringList(defaultImportPathList) << serverdir);
+
+ QQmlComponent component(&engine, testFileUrl("concurrentLoad_main.qml"));
+ QTRY_VERIFY(component.isReady());
+ VERIFY_ERRORS(0);
+ QScopedPointer<QObject> o(component.create());
+ QVERIFY(!o.isNull());
+ engine.setImportPathList(defaultImportPathList);
+}
+
QTEST_MAIN(tst_qqmllanguage)
#include "tst_qqmllanguage.moc"
diff --git a/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp b/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
index 357482b93f..ba2b836a6d 100644
--- a/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
+++ b/tests/auto/qml/qqmlparser/tst_qqmlparser.cpp
@@ -49,6 +49,7 @@ private slots:
void qmlParser_data();
void qmlParser();
#endif
+ void invalidEscapeSequence();
private:
QStringList excludedDirs;
@@ -192,6 +193,17 @@ void tst_qqmlparser::qmlParser()
}
#endif
+void tst_qqmlparser::invalidEscapeSequence()
+{
+ using namespace QQmlJS;
+
+ Engine engine;
+ Lexer lexer(&engine);
+ lexer.setCode(QLatin1String("\"\\"), 1);
+ Parser parser(&engine);
+ parser.parse();
+}
+
QTEST_MAIN(tst_qqmlparser)
#include "tst_qqmlparser.moc"
diff --git a/tests/auto/qml/qqmlsettings/data/aliases.qml b/tests/auto/qml/qqmlsettings/data/aliases.qml
index 18bd7a0e07..dd11147532 100644
--- a/tests/auto/qml/qqmlsettings/data/aliases.qml
+++ b/tests/auto/qml/qqmlsettings/data/aliases.qml
@@ -38,8 +38,10 @@ QtObject {
property double doubleProperty: 3.45
property string stringProperty: "foo"
property url urlProperty: "http://www.qt-project.org"
+ property var objectProperty: {"foo":"bar"}
property var intListProperty: [1, 2, 3]
property var stringListProperty: ["a", "b", "c"]
+ property var objectListProperty: [{"a":"b"}, {"c":"d"}]
property date dateProperty: "2000-01-02"
// QTBUG-32295: Expected property type
//property time timeProperty: "12:34:56"
@@ -58,8 +60,10 @@ QtObject {
property alias doubleProperty: root.doubleProperty
property alias stringProperty: root.stringProperty
property alias urlProperty: root.urlProperty
+ property alias objectProperty: root.objectProperty
property alias intListProperty: root.intListProperty
property alias stringListProperty: root.stringListProperty
+ property alias objectListProperty: root.objectListProperty
property alias dateProperty: root.dateProperty
// QTBUG-32295: Expected property type
//property alias timeProperty: root.timeProperty
diff --git a/tests/auto/qml/qqmlsettings/data/cpp-aliases.qml b/tests/auto/qml/qqmlsettings/data/cpp-aliases.qml
index 8540838fb9..f5b18d1825 100644
--- a/tests/auto/qml/qqmlsettings/data/cpp-aliases.qml
+++ b/tests/auto/qml/qqmlsettings/data/cpp-aliases.qml
@@ -40,8 +40,10 @@ CppObject {
property alias doubleProperty: obj.doubleProperty
property alias stringProperty: obj.stringProperty
property alias urlProperty: obj.urlProperty
+ property alias objectProperty: obj.objectProperty
property alias intListProperty: obj.intListProperty
property alias stringListProperty: obj.stringListProperty
+ property alias objectListProperty: obj.objectListProperty
property alias dateProperty: obj.dateProperty
// QTBUG-32295: Expected property type
//property alias timeProperty: obj.timeProperty
diff --git a/tests/auto/qml/qqmlsettings/data/types.qml b/tests/auto/qml/qqmlsettings/data/types.qml
index d1301af057..c4efa0be7c 100644
--- a/tests/auto/qml/qqmlsettings/data/types.qml
+++ b/tests/auto/qml/qqmlsettings/data/types.qml
@@ -38,8 +38,10 @@ QtObject {
property double doubleProperty
property string stringProperty
property url urlProperty
+ property var objectProperty
property var intListProperty
property var stringListProperty
+ property var objectListProperty
property date dateProperty
// QTBUG-32295: Expected property type
// property time timeProperty
@@ -64,8 +66,10 @@ QtObject {
to.doubleProperty = from.doubleProperty
to.stringProperty = from.stringProperty
to.urlProperty = from.urlProperty
+ to.objectProperty = from.objectProperty
to.intListProperty = from.intListProperty
to.stringListProperty = from.stringListProperty
+ to.objectListProperty = from.objectListProperty
to.dateProperty = from.dateProperty
//to.timeProperty = from.timeProperty
to.sizeProperty = from.sizeProperty
@@ -84,8 +88,10 @@ QtObject {
property double doubleProperty: 3.45
property string stringProperty: "foo"
property url urlProperty: "http://www.qt-project.org"
+ property var objectProperty: {"foo":"bar"}
property var intListProperty: [1, 2, 3]
property var stringListProperty: ["a", "b", "c"]
+ property var objectListProperty: [{"a":"b"}, {"c":"d"}]
property date dateProperty: "2000-01-02"
// QTBUG-32295: Expected property type
//property time timeProperty: "12:34:56"
diff --git a/tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp b/tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp
index c2e20f8892..e08389045c 100644
--- a/tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp
+++ b/tests/auto/qml/qqmlsettings/tst_qqmlsettings.cpp
@@ -55,25 +55,36 @@ private slots:
void initial();
};
+// ### Replace keyValueMap("foo", "bar") with QVariantMap({{"foo", "bar"}})
+// when C++11 uniform initialization can be used (not supported by MSVC 2013).
+static QVariantMap keyValueMap(const QString &key, const QString &value)
+{
+ QVariantMap var;
+ var.insert(key, value);
+ return var;
+}
+
class CppObject : public QObject
{
Q_OBJECT
- Q_PROPERTY(int intProperty READ intProperty WRITE setIntProperty NOTIFY intPropertyChanged)
- Q_PROPERTY(bool boolProperty READ boolProperty WRITE setBoolProperty NOTIFY boolPropertyChanged)
- Q_PROPERTY(qreal realProperty READ realProperty WRITE setRealProperty NOTIFY realPropertyChanged)
- Q_PROPERTY(double doubleProperty READ doubleProperty WRITE setDoubleProperty NOTIFY doublePropertyChanged)
- Q_PROPERTY(QString stringProperty READ stringProperty WRITE setStringProperty NOTIFY stringPropertyChanged)
- Q_PROPERTY(QUrl urlProperty READ urlProperty WRITE setUrlProperty NOTIFY urlPropertyChanged)
- Q_PROPERTY(QVariant varProperty READ varProperty WRITE setVarProperty NOTIFY varPropertyChanged)
- Q_PROPERTY(QVariantList intListProperty READ intListProperty WRITE setIntListProperty NOTIFY intListPropertyChanged)
- Q_PROPERTY(QVariantList stringListProperty READ stringListProperty WRITE setStringListProperty NOTIFY stringListPropertyChanged)
- Q_PROPERTY(QDate dateProperty READ dateProperty WRITE setDateProperty NOTIFY datePropertyChanged)
- // QTBUG-32295: Q_PROPERTY(QTime timeProperty READ timeProperty WRITE setTimeProperty NOTIFY timePropertyChanged)
- Q_PROPERTY(QSizeF sizeProperty READ sizeProperty WRITE setSizeProperty NOTIFY sizePropertyChanged)
- Q_PROPERTY(QPointF pointProperty READ pointProperty WRITE setPointProperty NOTIFY pointPropertyChanged)
- Q_PROPERTY(QRectF rectProperty READ rectProperty WRITE setRectProperty NOTIFY rectPropertyChanged)
- Q_PROPERTY(QColor colorProperty READ colorProperty WRITE setColorProperty NOTIFY colorPropertyChanged)
- Q_PROPERTY(QFont fontProperty READ fontProperty WRITE setFontProperty NOTIFY fontPropertyChanged)
+ Q_PROPERTY(int intProperty MEMBER m_intProperty NOTIFY intPropertyChanged)
+ Q_PROPERTY(bool boolProperty MEMBER m_boolProperty NOTIFY boolPropertyChanged)
+ Q_PROPERTY(qreal realProperty MEMBER m_realProperty NOTIFY realPropertyChanged)
+ Q_PROPERTY(double doubleProperty MEMBER m_doubleProperty NOTIFY doublePropertyChanged)
+ Q_PROPERTY(QString stringProperty MEMBER m_stringProperty NOTIFY stringPropertyChanged)
+ Q_PROPERTY(QUrl urlProperty MEMBER m_urlProperty NOTIFY urlPropertyChanged)
+ Q_PROPERTY(QVariant varProperty MEMBER m_varProperty NOTIFY varPropertyChanged)
+ Q_PROPERTY(QVariantMap objectProperty MEMBER m_objectProperty NOTIFY objectPropertyChanged)
+ Q_PROPERTY(QVariantList intListProperty MEMBER m_intListProperty NOTIFY intListPropertyChanged)
+ Q_PROPERTY(QVariantList stringListProperty MEMBER m_stringListProperty NOTIFY stringListPropertyChanged)
+ Q_PROPERTY(QVariantList objectListProperty MEMBER m_objectListProperty NOTIFY objectListPropertyChanged)
+ Q_PROPERTY(QDate dateProperty MEMBER m_dateProperty NOTIFY datePropertyChanged)
+ // QTBUG-32295: Q_PROPERTY(QTime timeProperty MEMBER m_timeProperty NOTIFY timePropertyChanged)
+ Q_PROPERTY(QSizeF sizeProperty MEMBER m_sizeProperty NOTIFY sizePropertyChanged)
+ Q_PROPERTY(QPointF pointProperty MEMBER m_pointProperty NOTIFY pointPropertyChanged)
+ Q_PROPERTY(QRectF rectProperty MEMBER m_rectProperty NOTIFY rectPropertyChanged)
+ Q_PROPERTY(QColor colorProperty MEMBER m_colorProperty NOTIFY colorPropertyChanged)
+ Q_PROPERTY(QFont fontProperty MEMBER m_fontProperty NOTIFY fontPropertyChanged)
public:
CppObject(QObject *parent = 0) : QObject(parent),
@@ -83,8 +94,10 @@ public:
m_doubleProperty(3.45),
m_stringProperty("foo"),
m_urlProperty("http://www.qt-project.org"),
+ m_objectProperty(keyValueMap("foo", "bar")),
m_intListProperty(QVariantList() << 1 << 2 << 3),
m_stringListProperty(QVariantList() << "a" << "b" << "c"),
+ m_objectListProperty(QVariantList() << keyValueMap("a", "b") << keyValueMap("c", "d")),
m_dateProperty(2000, 1, 2),
// QTBUG-32295: m_timeProperty(12, 34, 56),
m_sizeProperty(12, 34),
@@ -94,143 +107,6 @@ public:
{
}
- int intProperty() const { return m_intProperty; }
- bool boolProperty() const { return m_boolProperty; }
- qreal realProperty() const { return m_realProperty; }
- double doubleProperty() const { return m_doubleProperty; }
- QString stringProperty() const { return m_stringProperty; }
- QUrl urlProperty() const { return m_urlProperty; }
- QVariant varProperty() const { return m_varProperty; }
- QVariantList intListProperty() const { return m_intListProperty; }
- QVariantList stringListProperty() const { return m_stringListProperty; }
- QDate dateProperty() const { return m_dateProperty; }
- QSizeF sizeProperty() const { return m_sizeProperty; }
- QPointF pointProperty() const { return m_pointProperty; }
- QRectF rectProperty() const { return m_rectProperty; }
- QColor colorProperty() const { return m_colorProperty; }
- QFont fontProperty() const { return m_fontProperty; }
-
-public slots:
- void setIntProperty(int arg)
- {
- if (m_intProperty != arg) {
- m_intProperty = arg;
- emit intPropertyChanged(arg);
- }
- }
-
- void setBoolProperty(bool arg)
- {
- if (m_boolProperty != arg) {
- m_boolProperty = arg;
- emit boolPropertyChanged(arg);
- }
- }
-
- void setRealProperty(qreal arg)
- {
- if (m_realProperty != arg) {
- m_realProperty = arg;
- emit realPropertyChanged(arg);
- }
- }
-
- void setDoubleProperty(double arg)
- {
- if (m_doubleProperty != arg) {
- m_doubleProperty = arg;
- emit doublePropertyChanged(arg);
- }
- }
-
- void setStringProperty(const QString &arg)
- {
- if (m_stringProperty != arg) {
- m_stringProperty = arg;
- emit stringPropertyChanged(arg);
- }
- }
-
- void setUrlProperty(const QUrl &arg)
- {
- if (m_urlProperty != arg) {
- m_urlProperty = arg;
- emit urlPropertyChanged(arg);
- }
- }
-
- void setVarProperty(const QVariant &arg)
- {
- if (m_varProperty != arg) {
- m_varProperty = arg;
- emit varPropertyChanged(arg);
- }
- }
-
- void setIntListProperty(const QVariantList &arg)
- {
- if (m_intListProperty != arg) {
- m_intListProperty = arg;
- emit intListPropertyChanged(arg);
- }
- }
-
- void setStringListProperty(const QVariantList &arg)
- {
- if (m_stringListProperty != arg) {
- m_stringListProperty = arg;
- emit stringListPropertyChanged(arg);
- }
- }
-
- void setDateProperty(const QDate &arg)
- {
- if (m_dateProperty != arg) {
- m_dateProperty = arg;
- emit datePropertyChanged(arg);
- }
- }
-
- void setSizeProperty(const QSizeF &arg)
- {
- if (m_sizeProperty != arg) {
- m_sizeProperty = arg;
- emit sizePropertyChanged(arg);
- }
- }
-
- void setPointProperty(const QPointF &arg)
- {
- if (m_pointProperty != arg) {
- m_pointProperty = arg;
- emit pointPropertyChanged(arg);
- }
- }
-
- void setRectProperty(const QRectF &arg)
- {
- if (m_rectProperty != arg) {
- m_rectProperty = arg;
- emit rectPropertyChanged(arg);
- }
- }
-
- void setColorProperty(const QColor &arg)
- {
- if (m_colorProperty != arg) {
- m_colorProperty = arg;
- emit colorPropertyChanged(arg);
- }
- }
-
- void setFontProperty(const QFont &arg)
- {
- if (m_fontProperty != arg) {
- m_fontProperty = arg;
- emit fontPropertyChanged(arg);
- }
- }
-
signals:
void intPropertyChanged(int arg);
void boolPropertyChanged(bool arg);
@@ -239,8 +115,10 @@ signals:
void stringPropertyChanged(const QString &arg);
void urlPropertyChanged(const QUrl &arg);
void varPropertyChanged(const QVariant &arg);
+ void objectPropertyChanged(const QVariantMap &arg);
void intListPropertyChanged(const QVariantList &arg);
void stringListPropertyChanged(const QVariantList &arg);
+ void objectListPropertyChanged(const QVariantList &arg);
void datePropertyChanged(const QDate &arg);
void sizePropertyChanged(const QSizeF &arg);
void pointPropertyChanged(const QPointF &arg);
@@ -256,8 +134,10 @@ private:
QString m_stringProperty;
QUrl m_urlProperty;
QVariant m_varProperty;
+ QVariantMap m_objectProperty;
QVariantList m_intListProperty;
QVariantList m_stringListProperty;
+ QVariantList m_objectListProperty;
QDate m_dateProperty;
QSizeF m_sizeProperty;
QPointF m_pointProperty;
@@ -316,8 +196,10 @@ void tst_QQmlSettings::types()
QCOMPARE(root->property("doubleProperty").toDouble(), static_cast<double>(0.0));
QCOMPARE(root->property("stringProperty").toString(), QString());
QCOMPARE(root->property("urlProperty").toUrl(), QUrl());
+ QCOMPARE(root->property("objectProperty").toMap(), QVariantMap());
QCOMPARE(root->property("intListProperty").toList(), QVariantList());
QCOMPARE(root->property("stringListProperty").toList(), QVariantList());
+ QCOMPARE(root->property("objectListProperty").toList(), QVariantList());
QCOMPARE(root->property("dateProperty").toDate(), QDate());
// QTBUG-32295: QCOMPARE(root->property("timeProperty").toDate(), QTime());
QCOMPARE(root->property("sizeProperty").toSizeF(), QSizeF());
@@ -333,8 +215,10 @@ void tst_QQmlSettings::types()
QCOMPARE(settings->property("doubleProperty").toDouble(), static_cast<double>(3.45));
QCOMPARE(settings->property("stringProperty").toString(), QStringLiteral("foo"));
QCOMPARE(settings->property("urlProperty").toUrl(), QUrl("http://www.qt-project.org"));
+ QCOMPARE(settings->property("objectProperty").toMap(), keyValueMap("foo","bar"));
QCOMPARE(settings->property("intListProperty").toList(), QVariantList() << 1 << 2 << 3);
QCOMPARE(settings->property("stringListProperty").toList(), QVariantList() << QStringLiteral("a") << QStringLiteral("b") << QStringLiteral("c"));
+ QCOMPARE(settings->property("objectListProperty").toList(), QVariantList() << keyValueMap("a", "b") << keyValueMap("c","d"));
QCOMPARE(settings->property("dateProperty").toDate(), QDate(2000, 01, 02));
// QTBUG-32295: QCOMPARE(settings->property("timeProperty").toDate(), QTime(12, 34, 56));
QCOMPARE(settings->property("sizeProperty").toSizeF(), QSizeF(12, 34));
@@ -351,9 +235,11 @@ void tst_QQmlSettings::types()
QCOMPARE(root->property("doubleProperty").toDouble(), static_cast<double>(3.45));
QCOMPARE(root->property("stringProperty").toString(), QStringLiteral("foo"));
QCOMPARE(root->property("urlProperty").toUrl(), QUrl("http://www.qt-project.org"));
+ QCOMPARE(root->property("objectProperty").toMap(), keyValueMap("foo","bar"));
QCOMPARE(root->property("intListProperty").toList(), QVariantList() << 1 << 2 << 3);
QCOMPARE(root->property("stringListProperty").toList(), QVariantList() << QStringLiteral("a") << QStringLiteral("b") << QStringLiteral("c"));
QCOMPARE(root->property("dateProperty").toDate(), QDate(2000, 01, 02));
+ QCOMPARE(root->property("objectListProperty").toList(), QVariantList() << keyValueMap("a", "b") << keyValueMap("c","d"));
// QTBUG-32295: QCOMPARE(root->property("timeProperty").toDate(), QTime(12, 34, 56));
QCOMPARE(root->property("sizeProperty").toSizeF(), QSizeF(12, 34));
QCOMPARE(root->property("pointProperty").toPointF(), QPointF(12, 34));
@@ -368,8 +254,10 @@ void tst_QQmlSettings::types()
QVERIFY(root->setProperty("doubleProperty", static_cast<double>(6.78)));
QVERIFY(root->setProperty("stringProperty", QStringLiteral("bar")));
QVERIFY(root->setProperty("urlProperty", QUrl("https://codereview.qt-project.org")));
+ QVERIFY(root->setProperty("objectProperty", keyValueMap("bar", "baz")));
QVERIFY(root->setProperty("intListProperty", QVariantList() << 4 << 5 << 6));
QVERIFY(root->setProperty("stringListProperty", QVariantList() << QStringLiteral("d") << QStringLiteral("e") << QStringLiteral("f")));
+ QVERIFY(root->setProperty("objectListProperty", QVariantList() << keyValueMap("e", "f") << keyValueMap("g", "h")));
QVERIFY(root->setProperty("dateProperty", QDate(2010, 02, 01)));
// QTBUG-32295: QVERIFY(root->setProperty("timeProperty", QTime(6, 56, 34)));
QVERIFY(root->setProperty("sizeProperty", QSizeF(56, 78)));
@@ -387,8 +275,10 @@ void tst_QQmlSettings::types()
QTRY_COMPARE(settings->property("doubleProperty").toDouble(), static_cast<double>(6.78));
QTRY_COMPARE(settings->property("stringProperty").toString(), QStringLiteral("bar"));
QTRY_COMPARE(settings->property("urlProperty").toUrl(), QUrl("https://codereview.qt-project.org"));
+ QTRY_COMPARE(settings->property("objectProperty").toMap(), keyValueMap("bar", "baz"));
QTRY_COMPARE(settings->property("intListProperty").toList(), QVariantList() << 4 << 5 << 6);
QTRY_COMPARE(settings->property("stringListProperty").toList(), QVariantList() << QStringLiteral("d") << QStringLiteral("e") << QStringLiteral("f"));
+ QTRY_COMPARE(settings->property("objectListProperty").toList(), QVariantList() << keyValueMap("e", "f") << keyValueMap("g", "h"));
QTRY_COMPARE(settings->property("dateProperty").toDate(), QDate(2010, 02, 01));
// QTBUG-32295: QTRY_COMPARE(settings->property("timeProperty").toDate(), QTime(6, 56, 34));
QTRY_COMPARE(settings->property("sizeProperty").toSizeF(), QSizeF(56, 78));
@@ -404,8 +294,10 @@ void tst_QQmlSettings::types()
QTRY_COMPARE(qs.value("doubleProperty").toDouble(), static_cast<double>(6.78));
QTRY_COMPARE(qs.value("stringProperty").toString(), QStringLiteral("bar"));
QTRY_COMPARE(qs.value("urlProperty").toUrl(), QUrl("https://codereview.qt-project.org"));
+ QTRY_COMPARE(qs.value("objectProperty").toMap(), keyValueMap("bar", "baz"));
QTRY_COMPARE(qs.value("intListProperty").toList(), QVariantList() << 4 << 5 << 6);
QTRY_COMPARE(qs.value("stringListProperty").toList(), QVariantList() << QStringLiteral("d") << QStringLiteral("e") << QStringLiteral("f"));
+ QTRY_COMPARE(qs.value("objectListProperty").toList(), QVariantList() << keyValueMap("e", "f") << keyValueMap("g", "h"));
QTRY_COMPARE(qs.value("dateProperty").toDate(), QDate(2010, 02, 01));
// QTBUG-32295: QTRY_COMPARE(qs.value("timeProperty").toDate(), QTime(6, 56, 34));
QTRY_COMPARE(qs.value("sizeProperty").toSizeF(), QSizeF(56, 78));
@@ -440,8 +332,10 @@ void tst_QQmlSettings::aliases()
QCOMPARE(root->property("doubleProperty").toDouble(), static_cast<double>(3.45));
QCOMPARE(root->property("stringProperty").toString(), QStringLiteral("foo"));
QCOMPARE(root->property("urlProperty").toUrl(), QUrl("http://www.qt-project.org"));
+ QCOMPARE(root->property("objectProperty").toMap(), keyValueMap("foo","bar"));
QCOMPARE(root->property("intListProperty").toList(), QVariantList() << 1 << 2 << 3);
QCOMPARE(root->property("stringListProperty").toList(), QVariantList() << QStringLiteral("a") << QStringLiteral("b") << QStringLiteral("c"));
+ QCOMPARE(root->property("objectListProperty").toList(), QVariantList() << keyValueMap("a", "b") << keyValueMap("c","d"));
QCOMPARE(root->property("dateProperty").toDate(), QDate(2000, 01, 02));
// QTBUG-32295: QCOMPARE(root->property("timeProperty").toDate(), QTime(12, 34, 56));
QCOMPARE(root->property("sizeProperty").toSizeF(), QSizeF(12, 34));
@@ -457,8 +351,10 @@ void tst_QQmlSettings::aliases()
QCOMPARE(settings->property("doubleProperty").toDouble(), static_cast<double>(3.45));
QCOMPARE(settings->property("stringProperty").toString(), QStringLiteral("foo"));
QCOMPARE(settings->property("urlProperty").toUrl(), QUrl("http://www.qt-project.org"));
+ QCOMPARE(settings->property("objectProperty").toMap(), keyValueMap("foo","bar"));
QCOMPARE(settings->property("intListProperty").toList(), QVariantList() << 1 << 2 << 3);
QCOMPARE(settings->property("stringListProperty").toList(), QVariantList() << QStringLiteral("a") << QStringLiteral("b") << QStringLiteral("c"));
+ QCOMPARE(settings->property("objectListProperty").toList(), QVariantList() << keyValueMap("a", "b") << keyValueMap("c","d"));
QCOMPARE(settings->property("dateProperty").toDate(), QDate(2000, 01, 02));
// QTBUG-32295: QCOMPARE(settings->property("timeProperty").toDate(), QTime(12, 34, 56));
QCOMPARE(settings->property("sizeProperty").toSizeF(), QSizeF(12, 34));
@@ -474,8 +370,10 @@ void tst_QQmlSettings::aliases()
QVERIFY(settings->setProperty("doubleProperty", static_cast<double>(6.78)));
QVERIFY(settings->setProperty("stringProperty", QStringLiteral("bar")));
QVERIFY(settings->setProperty("urlProperty", QUrl("https://codereview.qt-project.org")));
+ QVERIFY(settings->setProperty("objectProperty", keyValueMap("bar", "baz")));
QVERIFY(settings->setProperty("intListProperty", QVariantList() << 4 << 5 << 6));
QVERIFY(settings->setProperty("stringListProperty", QVariantList() << QStringLiteral("d") << QStringLiteral("e") << QStringLiteral("f")));
+ QVERIFY(settings->setProperty("objectListProperty", QVariantList() << keyValueMap("e", "f") << keyValueMap("g", "h")));
QVERIFY(settings->setProperty("dateProperty", QDate(2010, 02, 01)));
// QTBUG-32295: QVERIFY(settings->setProperty("timeProperty", QTime(6, 56, 34)));
QVERIFY(settings->setProperty("sizeProperty", QSizeF(56, 78)));
@@ -492,8 +390,10 @@ void tst_QQmlSettings::aliases()
QTRY_COMPARE(qs.value("doubleProperty").toDouble(), static_cast<double>(6.78));
QTRY_COMPARE(qs.value("stringProperty").toString(), QStringLiteral("bar"));
QTRY_COMPARE(qs.value("urlProperty").toUrl(), QUrl("https://codereview.qt-project.org"));
+ QTRY_COMPARE(qs.value("objectProperty").toMap(), keyValueMap("bar", "baz"));
QTRY_COMPARE(qs.value("intListProperty").toList(), QVariantList() << 4 << 5 << 6);
QTRY_COMPARE(qs.value("stringListProperty").toList(), QVariantList() << QStringLiteral("d") << QStringLiteral("e") << QStringLiteral("f"));
+ QTRY_COMPARE(qs.value("objectListProperty").toList(), QVariantList() << keyValueMap("e", "f") << keyValueMap("g", "h"));
QTRY_COMPARE(qs.value("dateProperty").toDate(), QDate(2010, 02, 01));
// QTBUG-32295: QTRY_COMPARE(qs.value("timeProperty").toDate(), QTime(6, 56, 34));
QTRY_COMPARE(qs.value("sizeProperty").toSizeF(), QSizeF(56, 78));
diff --git a/tests/auto/qml/qqmlxmlhttprequest/data/send_patch.qml b/tests/auto/qml/qqmlxmlhttprequest/data/send_patch.qml
index 2abf1c60a8..dd4dd435a5 100644
--- a/tests/auto/qml/qqmlxmlhttprequest/data/send_patch.qml
+++ b/tests/auto/qml/qqmlxmlhttprequest/data/send_patch.qml
@@ -1,31 +1,26 @@
/****************************************************************************
**
-** Copyright (C) 2015 Canonical Limited and/or its subsidiary(-ies).
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2017 Canonical Limited and/or its subsidiary(-ies).
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL21$
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
** 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 The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/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 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company 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 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
index 63da28b7ba..49135ca920 100644
--- a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
+++ b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
@@ -250,7 +250,7 @@ void tst_QQuickWorkerScript::scriptError_onLoad()
QVERIFY(worker != 0);
QTRY_COMPARE(qquickworkerscript_lastWarning,
- testFileUrl("script_error_onLoad.js").toString() + QLatin1String(":3:10: Expected token `,'"));
+ testFileUrl("script_error_onLoad.js").toString() + QLatin1String(":3:10: SyntaxError: Expected token `,'"));
qInstallMessageHandler(previousMsgHandler);
qApp->processEvents();