From 6d45c28ed4b14e92c5ca17f206fcc173eb3749d4 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Thu, 1 Mar 2018 22:41:08 +0000 Subject: Document QFont::PreferNoShaping as being since 5.10 "since format" copied from QEvent's documentation. Change-Id: Ib11609cd11f9cb9906d947f46c2cd61c7abd853a Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfont.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 220e89a0c4..c7fff266ad 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -1328,7 +1328,7 @@ QFont::StyleHint QFont::styleHint() const order to display them correctly. In some writing systems, such as Brahmic scripts, this is required in order for the text to be legible, but in e.g. Latin script, it is merely a cosmetic feature. The PreferNoShaping flag will disable all such features when they - are not required, which will improve performance in most cases. + are not required, which will improve performance in most cases (since Qt 5.10). Any of these may be OR-ed with one of these flags: -- cgit v1.2.3 From 0e85b554ad147dc542790fb85629c7dae2ecb8ca Mon Sep 17 00:00:00 2001 From: Kimmo Ollila Date: Tue, 6 Feb 2018 11:15:42 +0200 Subject: Add WFD_DEVICE_CLIENT_TYPE attribute for INTEGRITY S820Am ADP This is needed to be compatible with latest Qualcomm BSP releases. This patch also makes it possible to select HW layer via QT_OPENWFD_CLIENT_ID and QT_OPENWFD_PIPELINE_ID environment variables. Change-Id: Ie795b21afc61a1de7c1d0b52cdb30a754e3f8266 Reviewed-by: Janne Koskinen Reviewed-by: Timo Aarnipuro Reviewed-by: Laszlo Agocs (cherry picked from commit 00f693d3e5046999270c92731e34a3e7fcd01c6b) Reviewed-by: Simon Hausmann --- .../devices/integrity-armv8-msm8996au/qmake.conf | 2 +- .../eglfs_openwfd/qeglfsopenwfdintegration.cpp | 24 +++++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/mkspecs/devices/integrity-armv8-msm8996au/qmake.conf b/mkspecs/devices/integrity-armv8-msm8996au/qmake.conf index 90299bf3e9..e78bde54b9 100644 --- a/mkspecs/devices/integrity-armv8-msm8996au/qmake.conf +++ b/mkspecs/devices/integrity-armv8-msm8996au/qmake.conf @@ -38,7 +38,7 @@ QMAKE_LIBDIR += $$(QCLIBS_DIR)/multimedia/display QMAKE_INCDIR += $$(QC_MULTIMEDIA_INC_DIR) -QMAKE_LIBS_EGL += -lESXEGL_Adreno -lESXGLESv2_Adreno -ladreno_utils -lGSLUser -lOSUser -lpanel -livfs -lposix -lpmem -ltzbsp -lpaged_alloc -lglnext-llvm -lopenwfd +QMAKE_LIBS_EGL += -lESXEGL_Adreno -lESXGLESv2_Adreno -ladreno_utils -lGSLUser -lOSUser -lpanel -livfs -lposix -lpmem -ltzbsp -lpaged_alloc -lglnext-llvm -lopenwfd -lplanedef -lmmosallibrary QMAKE_LIBS_OPENGL_ES2 += $${QMAKE_LIBS_EGL} QMAKE_CFLAGS += -DINTEGRITY diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/qeglfsopenwfdintegration.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/qeglfsopenwfdintegration.cpp index bb176a69d2..738c30c65a 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/qeglfsopenwfdintegration.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_openwfd/qeglfsopenwfdintegration.cpp @@ -46,7 +46,7 @@ QT_BEGIN_NAMESPACE #define MAX_NUM_OF_WFD_BUFFERS 3 #define MAX_NUM_OF_WFD_DEVICES 4 -#define MAX_NUM_OF_WFD_PIPELINES 4 +#define MAX_NUM_OF_WFD_PIPELINES 16 #define MAX_NUM_OF_WFD_PORT_MODES 64 #define MAX_NUM_OF_WFD_PORTS 4 @@ -77,7 +77,17 @@ void QEglFSOpenWFDIntegration::platformInit() wfdEnumerateDevices(devIds, numDevs, nullptr); // Create device - mDevice = wfdCreateDevice(WFD_DEFAULT_DEVICE_ID, nullptr); + WFDint dev_attribs[3] = {WFD_DEVICE_CLIENT_TYPE, + WFD_CLIENT_ID_CLUSTER, + WFD_NONE}; + + bool ok; + WFDint clientType = qgetenv("QT_OPENWFD_CLIENT_ID").toInt(&ok, 16); + + if (ok) + dev_attribs[1] = clientType; + + mDevice = wfdCreateDevice(WFD_DEFAULT_DEVICE_ID, dev_attribs); if (WFD_INVALID_HANDLE == mDevice) qFatal( "Failed to create wfd device"); @@ -138,9 +148,13 @@ EGLNativeWindowType QEglFSOpenWFDIntegration::createNativeWindow(QPlatformWindow WFDint pipelineIds[MAX_NUM_OF_WFD_PIPELINES]; wfdEnumeratePipelines(mDevice, pipelineIds, numPipelines, nullptr); - WFDint testId = 0; - testId = pipelineIds[0]; - WFDPipeline pipeline = wfdCreatePipeline(mDevice, testId, nullptr); + bool ok; + WFDint pipelineId = qgetenv("QT_OPENWFD_PIPELINE_ID").toInt(&ok); + + if (!ok) + pipelineId = pipelineIds[0]; + + WFDPipeline pipeline = wfdCreatePipeline(mDevice, pipelineId, nullptr); if (WFD_INVALID_HANDLE == pipeline) qFatal("Failed to create wfd pipeline"); -- cgit v1.2.3 From 1504dda57879b051cdcb6336e83a1868bdf5cee2 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Mon, 5 Mar 2018 10:28:24 +0100 Subject: Doc: Update example Embedded Dialogs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed old signal/slot syntax to new version Task-number: QTBUG-60635 Change-Id: I7cbe8851d321b7632a08c098b69a96cc346d5f83 Reviewed-by: Topi Reiniö --- .../graphicsview/embeddeddialogs/embeddeddialog.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.cpp b/examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.cpp index 2b77dc2fcc..0c3ed86565 100644 --- a/examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.cpp +++ b/examples/widgets/graphicsview/embeddeddialogs/embeddeddialog.cpp @@ -66,14 +66,14 @@ EmbeddedDialog::EmbeddedDialog(QWidget *parent) ui->style->setCurrentIndex(ui->style->count() - 1); } - connect(ui->layoutDirection, SIGNAL(activated(int)), - this, SLOT(layoutDirectionChanged(int))); - connect(ui->spacing, SIGNAL(valueChanged(int)), - this, SLOT(spacingChanged(int))); - connect(ui->fontComboBox, SIGNAL(currentFontChanged(QFont)), - this, SLOT(fontChanged(QFont))); - connect(ui->style, SIGNAL(activated(QString)), - this, SLOT(styleChanged(QString))); + connect(ui->layoutDirection, QOverload::of(&QComboBox::activated), + this, &EmbeddedDialog::layoutDirectionChanged); + connect(ui->spacing, &QSlider::valueChanged, + this, &EmbeddedDialog::spacingChanged); + connect(ui->fontComboBox, &QFontComboBox::currentFontChanged, + this, &EmbeddedDialog::fontChanged); + connect(ui->style, QOverload::of(&QComboBox::activated), + this, &EmbeddedDialog::styleChanged); } EmbeddedDialog::~EmbeddedDialog() -- cgit v1.2.3 From a4e67a303b411497857f3b909f2b9540f7bc20f3 Mon Sep 17 00:00:00 2001 From: Vyacheslav Koscheev Date: Thu, 1 Mar 2018 17:46:10 +0700 Subject: Android: add option `-mstackrealign` to clang-x86 mkspec Task-number: QTBUG-66770 Change-Id: I5e8ced0fa60c67d7908f21e5c486fea0d7a50004 Reviewed-by: Oswald Buddenhagen Reviewed-by: BogDan Vatra --- mkspecs/android-clang/qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/android-clang/qmake.conf b/mkspecs/android-clang/qmake.conf index 2f38e100b2..fae2c8ebd9 100644 --- a/mkspecs/android-clang/qmake.conf +++ b/mkspecs/android-clang/qmake.conf @@ -21,7 +21,7 @@ else: equals(ANDROID_TARGET_ARCH, armeabi): \ else: equals(ANDROID_TARGET_ARCH, arm64-v8a): \ QMAKE_CFLAGS += -target aarch64-none-linux-android else: equals(ANDROID_TARGET_ARCH, x86): \ - QMAKE_CFLAGS += -target i686-none-linux-android + QMAKE_CFLAGS += -target i686-none-linux-android -mstackrealign else: equals(ANDROID_TARGET_ARCH, x86_64): \ QMAKE_CFLAGS += -target x86_64-none-linux-android else: equals(ANDROID_TARGET_ARCH, mips): \ -- cgit v1.2.3 From 4b24a61ecc4a1dbd5f8d32c2078ccdaf53c134d1 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 5 Mar 2018 13:04:46 +0100 Subject: uic: Add the include for QIcon conditionally Task-number: QTBUG-66753 Change-Id: I31bd821396b59c8e83e19e02634cf1440a271215 Reviewed-by: Friedemann Kleint --- src/tools/uic/cpp/cppwriteincludes.cpp | 2 ++ src/tools/uic/qclass_lib_map.h | 14 +++++++------- tests/auto/tools/uic/baseline/icontheme.ui.h | 1 + tests/auto/tools/uic/baseline/languagesdialog.ui.h | 1 + tests/auto/tools/uic/baseline/qttrid.ui.h | 1 + tests/auto/tools/uic/baseline/remotecontrol.ui.h | 1 + tests/auto/tools/uic/baseline/tabbedbrowser.ui.h | 1 + 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/tools/uic/cpp/cppwriteincludes.cpp b/src/tools/uic/cpp/cppwriteincludes.cpp index 0ba9d28642..d51fddffea 100644 --- a/src/tools/uic/cpp/cppwriteincludes.cpp +++ b/src/tools/uic/cpp/cppwriteincludes.cpp @@ -150,6 +150,8 @@ void WriteIncludes::acceptProperty(DomProperty *node) add(QLatin1String("QDate")); if (node->kind() == DomProperty::Locale) add(QLatin1String("QLocale")); + if (node->kind() == DomProperty::IconSet) + add(QLatin1String("QIcon")); TreeWalker::acceptProperty(node); } diff --git a/src/tools/uic/qclass_lib_map.h b/src/tools/uic/qclass_lib_map.h index 810b326b30..8e1afa0878 100644 --- a/src/tools/uic/qclass_lib_map.h +++ b/src/tools/uic/qclass_lib_map.h @@ -628,13 +628,13 @@ QT_CLASS_LIB(QGraphicsRotation, QtWidgets, qgraphicstransform.h) QT_CLASS_LIB(QGraphicsView, QtWidgets, qgraphicsview.h) QT_CLASS_LIB(QGraphicsWidget, QtWidgets, qgraphicswidget.h) QT_CLASS_LIB(QBitmap, QtGui, qbitmap.h) -QT_CLASS_LIB(QIcon, QtWidgets, qicon.h) -QT_CLASS_LIB(QIconEngine, QtWidgets, qiconengine.h) -QT_CLASS_LIB(QIconEngineV2, QtWidgets, qiconengine.h) -QT_CLASS_LIB(QIconEngineFactoryInterface, QtWidgets, qiconengineplugin.h) -QT_CLASS_LIB(QIconEnginePlugin, QtWidgets, qiconengineplugin.h) -QT_CLASS_LIB(QIconEngineFactoryInterfaceV2, QtWidgets, qiconengineplugin.h) -QT_CLASS_LIB(QIconEnginePluginV2, QtWidgets, qiconengineplugin.h) +QT_CLASS_LIB(QIcon, QtGui, qicon.h) +QT_CLASS_LIB(QIconEngine, QtGui, qiconengine.h) +QT_CLASS_LIB(QIconEngineV2, QtGui, qiconengine.h) +QT_CLASS_LIB(QIconEngineFactoryInterface, QtGui, qiconengineplugin.h) +QT_CLASS_LIB(QIconEnginePlugin, QtGui, qiconengineplugin.h) +QT_CLASS_LIB(QIconEngineFactoryInterfaceV2, QtGui, qiconengineplugin.h) +QT_CLASS_LIB(QIconEnginePluginV2, QtGui, qiconengineplugin.h) QT_CLASS_LIB(QImageTextKeyLang, QtGui, qimage.h) QT_CLASS_LIB(QImage, QtGui, qimage.h) QT_CLASS_LIB(QImageIOHandler, QtGui, qimageiohandler.h) diff --git a/tests/auto/tools/uic/baseline/icontheme.ui.h b/tests/auto/tools/uic/baseline/icontheme.ui.h index 94122c01de..75a1b648cd 100644 --- a/tests/auto/tools/uic/baseline/icontheme.ui.h +++ b/tests/auto/tools/uic/baseline/icontheme.ui.h @@ -10,6 +10,7 @@ #define ICONTHEME_H #include +#include #include #include #include diff --git a/tests/auto/tools/uic/baseline/languagesdialog.ui.h b/tests/auto/tools/uic/baseline/languagesdialog.ui.h index 981ff20cbf..6f722a4e74 100644 --- a/tests/auto/tools/uic/baseline/languagesdialog.ui.h +++ b/tests/auto/tools/uic/baseline/languagesdialog.ui.h @@ -10,6 +10,7 @@ #define LANGUAGESDIALOG_H #include +#include #include #include #include diff --git a/tests/auto/tools/uic/baseline/qttrid.ui.h b/tests/auto/tools/uic/baseline/qttrid.ui.h index 3893ef3569..b7ec1062de 100644 --- a/tests/auto/tools/uic/baseline/qttrid.ui.h +++ b/tests/auto/tools/uic/baseline/qttrid.ui.h @@ -10,6 +10,7 @@ #define QTTRID_H #include +#include #include #include #include diff --git a/tests/auto/tools/uic/baseline/remotecontrol.ui.h b/tests/auto/tools/uic/baseline/remotecontrol.ui.h index c3a563f235..c883637dc4 100644 --- a/tests/auto/tools/uic/baseline/remotecontrol.ui.h +++ b/tests/auto/tools/uic/baseline/remotecontrol.ui.h @@ -10,6 +10,7 @@ #define REMOTECONTROL_H #include +#include #include #include #include diff --git a/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h b/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h index 4ebbf3c435..5d670b46af 100644 --- a/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h +++ b/tests/auto/tools/uic/baseline/tabbedbrowser.ui.h @@ -40,6 +40,7 @@ #define TABBEDBROWSER_H #include +#include #include #include #include -- cgit v1.2.3 From 9e9dc58847d57baeb6033237fa31c08894643ccc Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 6 Mar 2018 09:21:40 +0100 Subject: cocoa: add qCDebug in QNSview::scrollWheel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If you enable both qt.qpa.input.touch and qt.qpa.cocoa.mouse you can see the order and interleaving of the touch and scroll events. Task-number: QBUG-66329 Change-Id: I8e1a63e2958b85f7964bb597e49cf8529cb3f32e Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qnsview.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index ec1d126ab9..7b7b3f53d5 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -1334,6 +1334,7 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent) // "isInverted": natural OS X scrolling, inverted from the Qt/other platform/Jens perspective. bool isInverted = [theEvent isDirectionInvertedFromDevice]; + qCDebug(lcQpaCocoaMouse) << "scroll wheel @ window pos" << qt_windowPoint << "delta px" << pixelDelta << "angle" << angleDelta << "phase" << ph << (isInverted ? "inverted" : ""); QWindowSystemInterface::handleWheelEvent(m_platformWindow->window(), qt_timestamp, qt_windowPoint, qt_screenPoint, pixelDelta, angleDelta, currentWheelModifiers, ph, source, isInverted); } #endif // QT_CONFIG(wheelevent) -- cgit v1.2.3 From 8fc66907480d986a42ad980ee5a68e7098c5a9d2 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 2 Mar 2018 15:23:40 +0100 Subject: Skip failing tests in tst_QWindow on Wayland Task-number: QTBUG-66824 Change-Id: I33b826c2a373b264cc9b66444c52070eac1cdd5c Reviewed-by: Shawn Rutledge --- tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index d2c3f4a56b..f4097e36ff 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -1337,6 +1337,9 @@ void tst_QWindow::touchCancelWithTouchToMouse() void tst_QWindow::touchInterruptedByPopup() { + if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: This test crashes with xdg-shell unstable v6"); + InputTestWindow window; window.setGeometry(QRect(m_availableTopLeft + QPoint(80, 80), m_testWindowSize)); window.show(); @@ -2029,6 +2032,9 @@ void tst_QWindow::modalWindowPosition() #ifndef QT_NO_CURSOR void tst_QWindow::modalWindowEnterEventOnHide_QTBUG35109() { + if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) + QSKIP("Wayland: QWindow::requestActivate() is not supported"); + if (isPlatformOffscreenOrMinimal()) QSKIP("Can't test window focusing on offscreen/minimal"); -- cgit v1.2.3 From 499b4991f4a88afa85dd8803dbf8346182023b25 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 2 Mar 2018 15:28:24 +0100 Subject: Make platform checks for Wayland more readable And make it easier to fix if platformName == wayland-egl etc. Change-Id: Ia2d62ba003796e08f3e8a5bbfd0c3fd9d185e4e0 Reviewed-by: Pier Luigi Fiorini Reviewed-by: Shawn Rutledge --- tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index f4097e36ff..339335b3a7 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -466,6 +466,11 @@ static QString msgRectMismatch(const QRect &r1, const QRect &r2) return result; } +static bool isPlatformWayland() +{ + return !QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive); +} + void tst_QWindow::positioning() { if (!QGuiApplicationPrivate::platformIntegration()->hasCapability( @@ -473,7 +478,7 @@ void tst_QWindow::positioning() QSKIP("This platform does not support non-fullscreen windows"); } - if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) + if (isPlatformWayland()) QSKIP("Wayland: This fails. Figure out why."); // Some platforms enforce minimum widths for windows, which can cause extra resize @@ -779,7 +784,7 @@ void tst_QWindow::isExposed() window.hide(); - if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) + if (isPlatformWayland()) QSKIP("Wayland: This is flaky. Figure out why."); QCoreApplication::processEvents(); @@ -1337,7 +1342,7 @@ void tst_QWindow::touchCancelWithTouchToMouse() void tst_QWindow::touchInterruptedByPopup() { - if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) + if (isPlatformWayland()) QSKIP("Wayland: This test crashes with xdg-shell unstable v6"); InputTestWindow window; @@ -1834,7 +1839,7 @@ void tst_QWindow::mask() void tst_QWindow::initialSize() { - if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) + if (isPlatformWayland()) QSKIP("Wayland: This fails. Figure out why."); QSize defaultSize(0,0); @@ -1907,7 +1912,7 @@ void tst_QWindow::modalDialog() void tst_QWindow::modalDialogClosingOneOfTwoModal() { - if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) + if (isPlatformWayland()) QSKIP("Wayland: This fails. Figure out why."); QWindow normalWindow; -- cgit v1.2.3 From 3eb42abab6c7d1f3a32ca55c972b1d7a4a703658 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Fri, 2 Mar 2018 15:24:32 +0100 Subject: Check for WindowActivation capability instead of platform MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before running tests that depend on QWindow::requestActivate Gets rid of several Wayland platform checks in tst_QWindow. Change-Id: I7a5e029044a968dfcf87ecbb5105c01d52852d35 Reviewed-by: Shawn Rutledge Reviewed-by: Tor Arne Vestbø Reviewed-by: Pier Luigi Fiorini --- src/gui/kernel/qplatformintegration.cpp | 2 +- src/gui/kernel/qplatformintegration.h | 1 + tests/auto/gui/kernel/qwindow/tst_qwindow.cpp | 24 ++++++++++++------------ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index 866ce08a28..2aaa4c8510 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -265,7 +265,7 @@ QPlatformServices *QPlatformIntegration::services() const bool QPlatformIntegration::hasCapability(Capability cap) const { return cap == NonFullScreenWindows || cap == NativeWidgets || cap == WindowManagement - || cap == TopStackedNativeChildWindows; + || cap == TopStackedNativeChildWindows || cap == WindowActivation; } QPlatformPixmap *QPlatformIntegration::createPlatformPixmap(QPlatformPixmap::PixelType type) const diff --git a/src/gui/kernel/qplatformintegration.h b/src/gui/kernel/qplatformintegration.h index 37884e1f78..d88f818920 100644 --- a/src/gui/kernel/qplatformintegration.h +++ b/src/gui/kernel/qplatformintegration.h @@ -97,6 +97,7 @@ public: NonFullScreenWindows, NativeWidgets, WindowManagement, + WindowActivation, // whether requestActivate is supported SyncState, RasterGLSurface, AllGLFunctionsQueryable, diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp index 339335b3a7..5a87ae6067 100644 --- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp +++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp @@ -795,8 +795,8 @@ void tst_QWindow::isExposed() void tst_QWindow::isActive() { - if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) - QSKIP("Wayland: This fails. Figure out why."); + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("QWindow::requestActivate() is not supported."); Window window; // Some platforms enforce minimum widths for windows, which can cause extra resize @@ -1480,8 +1480,8 @@ void tst_QWindow::close() void tst_QWindow::activateAndClose() { - if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) - QSKIP("Wayland: This fails. Figure out why."); + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("QWindow::requestActivate() is not supported."); for (int i = 0; i < 10; ++i) { QWindow window; @@ -1876,8 +1876,8 @@ static bool isPlatformOffscreenOrMinimal() void tst_QWindow::modalDialog() { - if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) - QSKIP("Wayland: This fails. Figure out why."); + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("QWindow::requestActivate() is not supported."); if (QGuiApplication::platformName() == QLatin1String("cocoa")) QSKIP("Test fails due to QTBUG-61965, and is slow due to QTBUG-61964"); @@ -1957,8 +1957,8 @@ void tst_QWindow::modalDialogClosingOneOfTwoModal() void tst_QWindow::modalWithChildWindow() { - if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) - QSKIP("Wayland: This fails. Figure out why."); + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("QWindow::requestActivate() is not supported."); QWindow normalWindow; normalWindow.setFramePosition(m_availableTopLeft + QPoint(80, 80)); @@ -1991,8 +1991,8 @@ void tst_QWindow::modalWithChildWindow() void tst_QWindow::modalWindowModallity() { - if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) - QSKIP("Wayland: This fails. Figure out why."); + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("QWindow::requestActivate() is not supported."); QWindow normal_window; normal_window.setFramePosition(m_availableTopLeft + QPoint(80, 80)); @@ -2037,8 +2037,8 @@ void tst_QWindow::modalWindowPosition() #ifndef QT_NO_CURSOR void tst_QWindow::modalWindowEnterEventOnHide_QTBUG35109() { - if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive)) - QSKIP("Wayland: QWindow::requestActivate() is not supported"); + if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::WindowActivation)) + QSKIP("QWindow::requestActivate() is not supported."); if (isPlatformOffscreenOrMinimal()) QSKIP("Can't test window focusing on offscreen/minimal"); -- cgit v1.2.3