aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktextedit
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-10-18 11:00:53 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-10-18 13:55:02 +0200
commit164a890573dacf619f2b4c48714fae49f0ab9711 (patch)
tree0e5f49c872bb6325e94cfadf4fc49ad552572d47 /tests/auto/quick/qquicktextedit
parent77a433a21cde393783524fd3c242564e05dcbb5f (diff)
Handle -no-feature-shortcut
Preparing for the extraction of QGuiShortcut, the shortcut feature will changed to follow the convention of using QT_REQUIRE_CONFIG(shortcut) in the affected class headers. Add the required exclusions to prevent compile errors when disabling shortcuts. Task-number: QTBUG-76493 Change-Id: Icad95584ae12aa97a56b56ef27206cef1b1ba48f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/quick/qquicktextedit')
-rw-r--r--tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
index facd63027e..d03441e052 100644
--- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
+++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
@@ -131,8 +131,10 @@ private slots:
void mouseSelectionMode_accessors();
void selectByMouse();
void selectByKeyboard();
+#if QT_CONFIG(shortcut)
void keyboardSelection_data();
void keyboardSelection();
+#endif
void renderType();
void inputMethodHints();
@@ -190,16 +192,19 @@ private slots:
void insert();
void remove_data();
void remove();
-
+#if QT_CONFIG(shortcut)
void keySequence_data();
void keySequence();
+#endif
void undo_data();
void undo();
void redo_data();
void redo();
+#if QT_CONFIG(shortcut)
void undo_keypressevents_data();
void undo_keypressevents();
+#endif
void clear();
void baseUrl();
@@ -217,7 +222,9 @@ private slots:
private:
void simulateKeys(QWindow *window, const QList<Key> &keys);
+#if QT_CONFIG(shortcut)
void simulateKeys(QWindow *window, const QKeySequence &sequence);
+#endif
void simulateKey(QWindow *, int key, Qt::KeyboardModifiers modifiers = nullptr);
@@ -260,6 +267,8 @@ void tst_qquicktextedit::simulateKeys(QWindow *window, const QList<Key> &keys)
}
}
+#if QT_CONFIG(shortcut)
+
void tst_qquicktextedit::simulateKeys(QWindow *window, const QKeySequence &sequence)
{
for (int i = 0; i < sequence.count(); ++i) {
@@ -277,6 +286,8 @@ QList<Key> &operator <<(QList<Key> &keys, const QKeySequence &sequence)
return keys;
}
+#endif // QT_CONFIG(shortcut)
+
template <int N> QList<Key> &operator <<(QList<Key> &keys, const char (&characters)[N])
{
for (int i = 0; i < N - 1; ++i) {
@@ -2307,6 +2318,8 @@ void tst_qquicktextedit::selectByKeyboard()
QCOMPARE(spy.at(2).at(0).toBool(), false);
}
+#if QT_CONFIG(shortcut)
+
Q_DECLARE_METATYPE(QKeySequence::StandardKey)
void tst_qquicktextedit::keyboardSelection_data()
@@ -2391,6 +2404,8 @@ void tst_qquicktextedit::keyboardSelection()
QCOMPARE(edit->selectedText(), selectedText);
}
+#endif // QT_CONFIG(shortcut)
+
void tst_qquicktextedit::renderType()
{
QQmlComponent component(&engine);
@@ -4820,6 +4835,7 @@ void tst_qquicktextedit::remove()
QVERIFY(cursorPositionSpy.count() > 0);
}
+#if QT_CONFIG(shortcut)
void tst_qquicktextedit::keySequence_data()
{
@@ -4984,6 +5000,8 @@ void tst_qquicktextedit::keySequence()
QCOMPARE(textEdit->selectedText(), selectedText);
}
+#endif // QT_CONFIG(shortcut)
+
#define NORMAL 0
#define REPLACE_UNTIL_END 1
@@ -5257,6 +5275,8 @@ void tst_qquicktextedit::redo()
QCOMPARE(spy.count(), 2);
}
+#if QT_CONFIG(shortcut)
+
void tst_qquicktextedit::undo_keypressevents_data()
{
QTest::addColumn<KeyList>("keys");
@@ -5450,6 +5470,8 @@ void tst_qquicktextedit::undo_keypressevents()
QVERIFY(textEdit->text().isEmpty());
}
+#endif // QT_CONFIG(shortcut)
+
void tst_qquicktextedit::clear()
{
QString componentStr = "import QtQuick 2.0\nTextEdit { focus: true }";