diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-02-21 01:00:10 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2020-02-21 09:00:37 +0100 |
commit | f6808f89a8c17e046f53b0bb5ff36cd9e24e9772 (patch) | |
tree | 43df8901d99f1e134d7688bdf0d30d28c1679147 /tools | |
parent | e33e250080dbbb01015daafc8a79b569806d9467 (diff) | |
parent | 5054bb49a88a8ab76f586f79b6ef62a9142e6c83 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
tests/auto/quick/qquickmousearea/BLACKLIST
Change-Id: I3de2c6377d57f5f9204d2cfc688d50a7a0b4150c
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qml/main.cpp | 1 | ||||
-rw-r--r-- | tools/qml/qml.pro | 4 | ||||
-rw-r--r-- | tools/qmltime/qmltime.cpp | 39 | ||||
-rw-r--r-- | tools/qmltime/qmltime.h | 68 | ||||
-rw-r--r-- | tools/qmltime/qmltime.pro | 6 |
5 files changed, 81 insertions, 37 deletions
diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index bd7a33482d..e8c471e22e 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -436,7 +436,6 @@ int main(int argc, char *argv[]) app->setOrganizationDomain("qt-project.org"); QCoreApplication::setApplicationVersion(QLatin1String(QT_VERSION_STR)); - qmlRegisterTypesAndRevisions<Config, PartialScene>("QmlRuntime.Config", 1); QQmlApplicationEngine e; QStringList files; QString confFile; diff --git a/tools/qml/qml.pro b/tools/qml/qml.pro index 5dcbb3567a..83e2e1bf80 100644 --- a/tools/qml/qml.pro +++ b/tools/qml/qml.pro @@ -5,6 +5,10 @@ qtHaveModule(widgets): QT += widgets HEADERS += conf.h SOURCES += main.cpp RESOURCES += qml.qrc +CONFIG += qmltypes + +QML_IMPORT_NAME = QmlRuntime.Config +QML_IMPORT_VERSION = 1.0 QMAKE_TARGET_DESCRIPTION = QML Runtime diff --git a/tools/qmltime/qmltime.cpp b/tools/qmltime/qmltime.cpp index b0761a54d4..ca10fdde53 100644 --- a/tools/qmltime/qmltime.cpp +++ b/tools/qmltime/qmltime.cpp @@ -25,47 +25,18 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + +#include "qmltime.h" + #include <QQmlEngine> -#include <QQmlComponent> #include <QDebug> #include <QGuiApplication> #include <QElapsedTimer> #include <QQmlContext> -#include <QQuickView> #include <QQuickItem> #include <private/qquickview_p.h> -class Timer : public QObject -{ - Q_OBJECT - Q_PROPERTY(QQmlComponent *component READ component WRITE setComponent) - -public: - Timer(); - - QQmlComponent *component() const; - void setComponent(QQmlComponent *); - - static Timer *timerInstance(); - - void run(uint); - - bool willParent() const; - void setWillParent(bool p); - -private: - void runTest(QQmlContext *, uint); - - QQmlComponent *m_component; - static Timer *m_timer; - - bool m_willparent; - QQuickView m_view; - QQuickItem *m_item; -}; -QML_DECLARE_TYPE(Timer); - Timer *Timer::m_timer = nullptr; Timer::Timer() @@ -207,8 +178,6 @@ int main(int argc, char ** argv) QGuiApplication app(argc, argv); QCoreApplication::setApplicationVersion(QLatin1String(QT_VERSION_STR)); - qmlRegisterTypesAndRevisions<Timer>("QmlTime", 1); - uint iterations = 1024; QString filename; bool willParent = false; @@ -269,5 +238,3 @@ int main(int argc, char ** argv) return 0; } - -#include "qmltime.moc" diff --git a/tools/qmltime/qmltime.h b/tools/qmltime/qmltime.h new file mode 100644 index 0000000000..a23dc902e2 --- /dev/null +++ b/tools/qmltime/qmltime.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2020 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: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 https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** 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$ +** +****************************************************************************/ + +#ifndef QMLTIME_H +#define QMLTIME_H + +#include <QtCore/qobject.h> +#include <QtQml/qqml.h> +#include <QtQml/qqmlcomponent.h> +#include <QtQuick/qquickview.h> + +class Timer : public QObject +{ + Q_OBJECT + Q_PROPERTY(QQmlComponent *component READ component WRITE setComponent) + QML_ELEMENT + +public: + Timer(); + + QQmlComponent *component() const; + void setComponent(QQmlComponent *); + + static Timer *timerInstance(); + + void run(uint); + + bool willParent() const; + void setWillParent(bool p); + +private: + void runTest(QQmlContext *, uint); + + QQmlComponent *m_component; + static Timer *m_timer; + + bool m_willparent; + QQuickView m_view; + QQuickItem *m_item; +}; +QML_DECLARE_TYPE(Timer); + +#endif // QMLTIME_H diff --git a/tools/qmltime/qmltime.pro b/tools/qmltime/qmltime.pro index 04a5fd5957..c915f6e8c1 100644 --- a/tools/qmltime/qmltime.pro +++ b/tools/qmltime/qmltime.pro @@ -4,5 +4,11 @@ QT += qml quick QT += quick-private macx:CONFIG -= app_bundle +CONFIG += qmltypes +QML_IMPORT_NAME = QmlTime +QML_IMPORT_VERSION = 1.0 + QMAKE_TARGET_DESCRIPTION = QML Time + SOURCES += qmltime.cpp +HEADERS += qmltime.h |