summaryrefslogtreecommitdiffstats
path: root/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-08-16 17:50:08 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2018-08-16 18:59:13 +0000
commitd98106d1d5a9ac68f0e4d20429d2d41b3dbcc131 (patch)
tree98af6e7d8be4bc026f0c2734a855580bf3e4bef2 /tests/auto/other/qfocusevent/tst_qfocusevent.cpp
parent30b0701c9b50ec718ec858d7777a01c66e333a9c (diff)
parent8559bf934def636ccff487464adb600d219f8778 (diff)
Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev
Diffstat (limited to 'tests/auto/other/qfocusevent/tst_qfocusevent.cpp')
-rw-r--r--tests/auto/other/qfocusevent/tst_qfocusevent.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
index 1b02c9e8ab..260ba12a97 100644
--- a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
+++ b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp
@@ -38,6 +38,9 @@
#include <QBoxLayout>
#include <QSysInfo>
+#include <qpa/qplatformintegration.h>
+#include <private/qguiapplication_p.h>
+
QT_FORWARD_DECLARE_CLASS(QWidget)
class FocusLineEdit : public QLineEdit
@@ -92,13 +95,16 @@ private slots:
void checkReason_ActiveWindow();
private:
- QWidget* testFocusWidget;
+ QWidget* testFocusWidget = nullptr;
FocusLineEdit* childFocusWidgetOne;
FocusLineEdit* childFocusWidgetTwo;
};
void tst_QFocusEvent::initTestCase()
{
+ if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation))
+ QSKIP("QWindow::requestActivate() is not supported on this platform.");
+
testFocusWidget = new QWidget( 0 );
childFocusWidgetOne = new FocusLineEdit( testFocusWidget );
childFocusWidgetOne->setGeometry( 10, 10, 180, 20 );