aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2014-01-22 14:25:48 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-22 10:56:19 +0200
commite60d8a28034550ae08b258494726050ea9638602 (patch)
tree0a127ea27be7afd688149ef9170d2ca6bc6487af /tests
parent007683512faa65c0d575bf12b9b1a3251c03d857 (diff)
If a popup window is opened, do not change the focus
It's not working to have QQuickWindow lose focus every time a menu is opened. This doesn't happen on OSX because menus are implemented as special native ones, but on X11 a menu is another window. In QtQuick Controls it's useful for copy/cut/paste Actions to be enabled based on whether some text has focus. Change-Id: I092b46133b9a8a44639ad9d89ee2bdfe30206bd9 Task-number: QTBUG-36292 Task-number: QTBUG-36332 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp2
-rw-r--r--tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
index 91a6886bf0..45d23abbf6 100644
--- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
+++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
@@ -1296,7 +1296,7 @@ void tst_qquicktextedit::selectionOnFocusOut()
QVERIFY(edit2->hasActiveFocus());
edit2->setFocus(false, Qt::PopupFocusReason);
- QVERIFY(!edit2->hasActiveFocus());
+ QVERIFY(edit2->hasActiveFocus());
QCOMPARE(edit2->selectedText(), QLatin1String("text 2"));
}
diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
index 273c0de660..e125c33a56 100644
--- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
+++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
@@ -3605,7 +3605,8 @@ void tst_qquicktextinput::focusOutNotClearSelection()
input.setFocus(false, Qt::PopupFocusReason);
QGuiApplication::processEvents();
QTRY_COMPARE(input.selectedText(), QLatin1String("llo"));
- QTRY_COMPARE(input.hasActiveFocus(), false);
+ // QTBUG-36332 and 36292: a popup window does not take focus
+ QTRY_COMPARE(input.hasActiveFocus(), true);
input.setFocus(true);
QTRY_COMPARE(input.hasActiveFocus(), true);