diff options
author | Karsten Heimrich <karsten.heimrich@qt.io> | 2020-08-14 13:04:22 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@qt.io> | 2020-08-23 20:56:31 +0200 |
commit | ae36d94c2f385e272ae25fcd0fe780edb70cf7d9 (patch) | |
tree | 5812b2a57c9f355313755b95a09358f9c19cd7d4 /tests/auto/qml/qqmlstatemachine | |
parent | 48b4c1f450109b148f03f62574d78b460859c4a1 (diff) |
Remove qml statemachine plugin from qtdeclarative
Task-number: QTBUG-80316
Change-Id: I584b699a1eec88117f343870bd2cd01075da64f7
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlstatemachine')
-rw-r--r-- | tests/auto/qml/qqmlstatemachine/CMakeLists.txt | 32 | ||||
-rw-r--r-- | tests/auto/qml/qqmlstatemachine/data/cppsignal.qml | 65 | ||||
-rw-r--r-- | tests/auto/qml/qqmlstatemachine/qqmlstatemachine.pro | 9 | ||||
-rw-r--r-- | tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp | 110 |
4 files changed, 0 insertions, 216 deletions
diff --git a/tests/auto/qml/qqmlstatemachine/CMakeLists.txt b/tests/auto/qml/qqmlstatemachine/CMakeLists.txt deleted file mode 100644 index 4ffe1c3906..0000000000 --- a/tests/auto/qml/qqmlstatemachine/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -# Generated from qqmlstatemachine.pro. - -##################################################################### -## tst_qqmlstatemachine Test: -##################################################################### - -qt_add_test(tst_qqmlstatemachine - SOURCES - ../../shared/util.cpp ../../shared/util.h - tst_qqmlstatemachine.cpp - INCLUDE_DIRECTORIES - ../../shared - PUBLIC_LIBRARIES - Qt::CorePrivate - Qt::Gui - Qt::GuiPrivate - Qt::QmlPrivate - Qt::QuickPrivate -) - -## Scopes: -##################################################################### - -qt_extend_target(tst_qqmlstatemachine CONDITION ANDROID OR IOS - DEFINES - QT_QMLTEST_DATADIR=\\\":/data\\\" -) - -qt_extend_target(tst_qqmlstatemachine CONDITION NOT ANDROID AND NOT IOS - DEFINES - QT_QMLTEST_DATADIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}/data\\\" -) diff --git a/tests/auto/qml/qqmlstatemachine/data/cppsignal.qml b/tests/auto/qml/qqmlstatemachine/data/cppsignal.qml deleted file mode 100644 index a469185cbc..0000000000 --- a/tests/auto/qml/qqmlstatemachine/data/cppsignal.qml +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Ford Motor Company -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite module 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$ -** -****************************************************************************/ - -import QtQml 2.0 - -import QtQml.StateMachine 1.0 - -import CppObjectEnum 1.0 - -StateMachine { - id: stateMachine - initialState: state0 - - State { - id: state0 - SignalTransition { - targetState: state1 - signal: _cppObject.mySignal - // signalState is mySignal's parameter - guard: signalState === CppObject.State1 - } - } - - State { - id: state1 - SignalTransition { - targetState: state2 - signal: _cppObject.mySignal - // signalState is mySignal's parameter - guard: signalState === CppObject.State2 - } - onEntered: _cppObject.objectState = CppObject.State1 - } - - FinalState { - id: state2 - onEntered: _cppObject.objectState = CppObject.State2 - } - Component.onCompleted: stateMachine.running = true -} diff --git a/tests/auto/qml/qqmlstatemachine/qqmlstatemachine.pro b/tests/auto/qml/qqmlstatemachine/qqmlstatemachine.pro deleted file mode 100644 index 635f2fa5e0..0000000000 --- a/tests/auto/qml/qqmlstatemachine/qqmlstatemachine.pro +++ /dev/null @@ -1,9 +0,0 @@ -CONFIG += testcase -TARGET = tst_qqmlstatemachine -osx:CONFIG -= app_bundle - -SOURCES += tst_qqmlstatemachine.cpp - -include (../../shared/util.pri) - -QT += core-private gui-private qml-private quick-private gui testlib diff --git a/tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp b/tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp deleted file mode 100644 index a6f0d65453..0000000000 --- a/tests/auto/qml/qqmlstatemachine/tst_qqmlstatemachine.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 Ford Motor Company -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite module 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$ -** -****************************************************************************/ -#include <QQmlComponent> -#include <QQmlContext> -#include <QQmlEngine> -#include <QTest> -#include "../../shared/util.h" - -class tst_qqmlstatemachine : public QQmlDataTest -{ - Q_OBJECT -public: - tst_qqmlstatemachine(); - -private slots: - void tst_cppObjectSignal(); -}; - - -class CppObject : public QObject -{ - Q_OBJECT - Q_PROPERTY(ObjectState objectState READ objectState WRITE setObjectState NOTIFY objectStateChanged) - Q_ENUMS(ObjectState) -public: - enum ObjectState { - State0, - State1, - State2 - }; - -public: - CppObject() {} - - ObjectState objectState() const { return m_objectState; } - void setObjectState(ObjectState objectState) { m_objectState = objectState; emit objectStateChanged();} - -signals: - void objectStateChanged(); - void mySignal(int signalState); - -private: - ObjectState m_objectState = State0; -}; - -tst_qqmlstatemachine::tst_qqmlstatemachine() -{ - QVERIFY(-1 != qmlRegisterUncreatableType<CppObject>("CppObjectEnum", 1, 0, "CppObject", QString())); -} - -void tst_qqmlstatemachine::tst_cppObjectSignal() -{ - CppObject cppObject; - QQmlEngine engine; - QQmlComponent component(&engine, testFileUrl("cppsignal.qml")); - QVERIFY2(!component.isError(), qPrintable(component.errorString())); - - QQmlContext *ctxt = engine.rootContext(); - ctxt->setContextProperty("_cppObject", &cppObject); - QScopedPointer<QObject> rootObject(component.create()); - QVERIFY(rootObject != nullptr); - - // wait for state machine to start - QTRY_VERIFY(rootObject->property("running").toBool()); - - // emit signal from cpp - emit cppObject.mySignal(CppObject::State1); - - // check if the signal was propagated - QTRY_COMPARE(cppObject.objectState(), CppObject::State1); - - // emit signal from cpp - emit cppObject.mySignal(CppObject::State2); - - // check if the signal was propagated - QTRY_COMPARE(cppObject.objectState(), CppObject::State2); - - // wait for state machine to finish - QTRY_VERIFY(!rootObject->property("running").toBool()); -} - - -QTEST_MAIN(tst_qqmlstatemachine) - -#include "tst_qqmlstatemachine.moc" |