diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-03 13:27:13 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-11-03 13:27:13 +0100 |
commit | f2244103ff7a9b61fc7bcb7e920d8cc6b2f5f226 (patch) | |
tree | 8fe753743c46d4a652f582a7a2a49e5709eaa6e0 /tests/auto/qml/qqmltypeloader | |
parent | 57430b2bdad32150e0ed8ceb6893430363ee6670 (diff) | |
parent | 164af37710e5721cbc7d79a0af20f2387181c59c (diff) |
Merge remote-tracking branch 'origin/5.6' into dev
Conflicts:
tools/qmlprofiler/qmlprofilerclient.cpp
Change-Id: I1de8832fefd0e45fea16ca072b6c7ae44fa376d4
Diffstat (limited to 'tests/auto/qml/qqmltypeloader')
-rw-r--r-- | tests/auto/qml/qqmltypeloader/data/load_synchronous.qml | 42 | ||||
-rw-r--r-- | tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp | 11 |
2 files changed, 53 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmltypeloader/data/load_synchronous.qml b/tests/auto/qml/qqmltypeloader/data/load_synchronous.qml new file mode 100644 index 0000000000..5e9c4c2bdc --- /dev/null +++ b/tests/auto/qml/qqmltypeloader/data/load_synchronous.qml @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL21$ +** 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. +** +** 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. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQml 2.2 + +QtObject { + id: top + + Component.onCompleted: { + Qt.createQmlObject('QtObject {}', top, 'nonprotocol:'); + } +} diff --git a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp index 77cdaae9f0..4c5b1f7e63 100644 --- a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp +++ b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp @@ -43,6 +43,7 @@ class tst_QQMLTypeLoader : public QQmlDataTest private slots: void testLoadComplete(); + void loadComponentSynchronously(); }; void tst_QQMLTypeLoader::testLoadComplete() @@ -62,6 +63,16 @@ void tst_QQMLTypeLoader::testLoadComplete() delete window; } +void tst_QQMLTypeLoader::loadComponentSynchronously() +{ + QQmlEngine engine; + QTest::ignoreMessage(QtWarningMsg, QRegularExpression( + QLatin1String(".*nonprotocol::1:1: QtObject is not a type.*"))); + QQmlComponent component(&engine, testFileUrl("load_synchronous.qml")); + QObject *o = component.create(); + QVERIFY(o); +} + QTEST_MAIN(tst_QQMLTypeLoader) #include "tst_qqmltypeloader.moc" |