From edbac716911e49a6b0f81b328e65756f95cb1f0a Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 9 Mar 2018 12:48:16 +0100 Subject: Skip all qfocusevent test on platforms that don't support window activation Task-number: QTBUG-66846 Change-Id: Ia8b69ede9154822f78ca28e0a2470b8bfb2abef0 Reviewed-by: Shawn Rutledge --- tests/auto/other/qfocusevent/qfocusevent.pro | 2 +- tests/auto/other/qfocusevent/tst_qfocusevent.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/auto/other/qfocusevent/qfocusevent.pro b/tests/auto/other/qfocusevent/qfocusevent.pro index 5f799291c6..95445f30fa 100644 --- a/tests/auto/other/qfocusevent/qfocusevent.pro +++ b/tests/auto/other/qfocusevent/qfocusevent.pro @@ -1,4 +1,4 @@ CONFIG += testcase TARGET = tst_qfocusevent -QT += widgets testlib +QT += widgets testlib gui-private SOURCES += tst_qfocusevent.cpp diff --git a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp index e82327bbb1..ceac02279e 100644 --- a/tests/auto/other/qfocusevent/tst_qfocusevent.cpp +++ b/tests/auto/other/qfocusevent/tst_qfocusevent.cpp @@ -38,6 +38,9 @@ #include #include +#include +#include + 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 ); -- cgit v1.2.3