summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/kernel/qkeysequence
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/kernel/qkeysequence')
-rw-r--r--tests/auto/gui/kernel/qkeysequence/CMakeLists.txt31
-rw-r--r--tests/auto/gui/kernel/qkeysequence/qkeysequence.qrc6
-rw-r--r--tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp38
3 files changed, 23 insertions, 52 deletions
diff --git a/tests/auto/gui/kernel/qkeysequence/CMakeLists.txt b/tests/auto/gui/kernel/qkeysequence/CMakeLists.txt
index 9d0e25d356..1676302d1b 100644
--- a/tests/auto/gui/kernel/qkeysequence/CMakeLists.txt
+++ b/tests/auto/gui/kernel/qkeysequence/CMakeLists.txt
@@ -1,17 +1,15 @@
-# Generated from qkeysequence.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_qkeysequence Test:
#####################################################################
-qt_internal_add_test(tst_qkeysequence
- SOURCES
- tst_qkeysequence.cpp
- PUBLIC_LIBRARIES
- Qt::CorePrivate
- Qt::Gui
- Qt::GuiPrivate
-)
+if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT)
+ cmake_minimum_required(VERSION 3.16)
+ project(tst_qkeysequence LANGUAGES CXX)
+ find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST)
+endif()
# Resources:
set(qkeysequence_resource_files
@@ -19,10 +17,13 @@ set(qkeysequence_resource_files
"qt_de.qm"
)
-qt_internal_add_resource(tst_qkeysequence "qkeysequence"
- PREFIX
- "/"
- FILES
- ${qkeysequence_resource_files}
+qt_internal_add_test(tst_qkeysequence
+ SOURCES
+ tst_qkeysequence.cpp
+ LIBRARIES
+ Qt::CorePrivate
+ Qt::Gui
+ Qt::GuiPrivate
+ TESTDATA ${qkeysequence_resource_files}
+ BUILTIN_TESTDATA
)
-
diff --git a/tests/auto/gui/kernel/qkeysequence/qkeysequence.qrc b/tests/auto/gui/kernel/qkeysequence/qkeysequence.qrc
deleted file mode 100644
index e224faaddd..0000000000
--- a/tests/auto/gui/kernel/qkeysequence/qkeysequence.qrc
+++ /dev/null
@@ -1,6 +0,0 @@
-<RCC>
- <qresource>
- <file>keys_de.qm</file>
- <file>qt_de.qm</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
index fb7296f834..67fef3cf44 100644
--- a/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
+++ b/tests/auto/gui/kernel/qkeysequence/tst_qkeysequence.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 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$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QTest>
@@ -498,10 +473,15 @@ void tst_QKeySequence::toStringFromKeycode_data()
QTest::newRow("A") << QKeySequence(Qt::Key_A) << "A";
QTest::newRow("-1") << QKeySequence(-1) << "";
QTest::newRow("Unknown") << QKeySequence(Qt::Key_unknown) << "";
+ QTest::newRow("Ctrl+Unknown") << QKeySequence(Qt::ControlModifier | Qt::Key_unknown) << "";
QTest::newRow("Ctrl+Num+Ins") << QKeySequence(Qt::ControlModifier | Qt::KeypadModifier | Qt::Key_Insert) << "Ctrl+Num+Ins";
QTest::newRow("Ctrl+Num+Del") << QKeySequence(Qt::ControlModifier | Qt::KeypadModifier | Qt::Key_Delete) << "Ctrl+Num+Del";
QTest::newRow("Ctrl+Alt+Num+Del") << QKeySequence(Qt::ControlModifier | Qt::AltModifier | Qt::KeypadModifier | Qt::Key_Delete) << "Ctrl+Alt+Num+Del";
QTest::newRow("Ctrl+Ins") << QKeySequence(Qt::ControlModifier | Qt::Key_Insert) << "Ctrl+Ins";
+ QTest::newRow("Ctrl") << QKeySequence(Qt::Key_Control) << "Control";
+ QTest::newRow("Alt") << QKeySequence(Qt::Key_Alt) << "Alt";
+ QTest::newRow("Shift") << QKeySequence(Qt::Key_Shift) << "Shift";
+ QTest::newRow("Meta") << QKeySequence(Qt::Key_Meta) << "Meta";
}
void tst_QKeySequence::toStringFromKeycode()
@@ -579,10 +559,6 @@ void tst_QKeySequence::parseString_data()
//QTest::newRow("Ctrl") << "Ctrl" << QKeySequence(Qt::CTRL);
//QTest::newRow("Shift") << "Shift" << QKeySequence(Qt::SHIFT);
- // Only Keys
- QTest::newRow("a") << "a" << QKeySequence(Qt::Key_A);
- QTest::newRow("A") << "A" << QKeySequence(Qt::Key_A);
-
// Incomplete
QTest::newRow("Meta+Shift+") << "Meta+Shift+" << QKeySequence(Qt::Key_unknown);
}