diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-01-29 16:57:12 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-01-29 16:57:27 +0100 |
commit | a1dbdcbd6e818118f5fc28cdd39e47a02380adbd (patch) | |
tree | 0d813d9d72baeb1b5f7be048e775896c73f134f5 /tests/auto/widgets/kernel | |
parent | 67ea445f09db9feea4e863faa12c45fb007f53a4 (diff) | |
parent | 4cbadf699838406d14366ce61deec03cf45113f7 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
src/corelib/Qt5CoreConfigExtras.cmake.in
src/corelib/Qt5CoreMacros.cmake
src/dbus/Qt5DBusConfigExtras.cmake.in
src/widgets/Qt5WidgetsConfigExtras.cmake.in
Change-Id: Ib782f3b177c38b2cce83beebe15be9c0baa578f7
Diffstat (limited to 'tests/auto/widgets/kernel')
-rw-r--r-- | tests/auto/widgets/kernel/qwidget/BLACKLIST | 4 | ||||
-rw-r--r-- | tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 28 |
2 files changed, 29 insertions, 3 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/BLACKLIST b/tests/auto/widgets/kernel/qwidget/BLACKLIST index be19d8fd0b..cf35491ec0 100644 --- a/tests/auto/widgets/kernel/qwidget/BLACKLIST +++ b/tests/auto/widgets/kernel/qwidget/BLACKLIST @@ -24,9 +24,7 @@ opensuse-42.3 [childEvents] macos [renderInvisible] -osx-10.12 -osx-10.11 -osx-10.14 +macos [optimizedResizeMove] osx [optimizedResize_topLevel] diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index dd747a8616..c015bf85d0 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -72,6 +72,7 @@ #include <QtWidgets/QGraphicsProxyWidget> #include <QtGui/qwindow.h> #include <qtimer.h> +#include <QtWidgets/QDoubleSpinBox> #if defined(Q_OS_OSX) #include "tst_qwidget_mac_helpers.h" // Abstract the ObjC stuff out so not everyone must run an ObjC++ compile. @@ -187,6 +188,7 @@ private slots: void tabOrderNoChange2(); void appFocusWidgetWithFocusProxyLater(); void appFocusWidgetWhenLosingFocusProxy(); + void explicitTabOrderWithComplexWidget(); #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) void activation(); #endif @@ -2110,6 +2112,32 @@ void tst_QWidget::appFocusWidgetWhenLosingFocusProxy() QCOMPARE(QApplication::focusWidget(), lineEdit); } +void tst_QWidget::explicitTabOrderWithComplexWidget() +{ + // Check that handling tab/backtab with a widget comprimised of other widgets + // handles tabbing correctly + Container window; + auto lineEditOne = new QLineEdit; + window.box->addWidget(lineEditOne); + auto lineEditTwo = new QLineEdit; + window.box->addWidget(lineEditTwo); + QWidget::setTabOrder(lineEditOne, lineEditTwo); + lineEditOne->setFocus(); + window.show(); + QApplication::setActiveWindow(&window); + QVERIFY(QTest::qWaitForWindowActive(&window)); + QTRY_COMPARE(QApplication::focusWidget(), lineEditOne); + + window.tab(); + QTRY_COMPARE(QApplication::focusWidget(), lineEditTwo); + window.tab(); + QTRY_COMPARE(QApplication::focusWidget(), lineEditOne); + window.backTab(); + QTRY_COMPARE(QApplication::focusWidget(), lineEditTwo); + window.backTab(); + QTRY_COMPARE(QApplication::focusWidget(), lineEditOne); +} + #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) void tst_QWidget::activation() { |