From ab4c22d47d196d5eb28fc16cd7262c77bcb6875f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 3 Apr 2020 12:45:36 +0200 Subject: [PATCH] macOS: Remove all use of deprecated Q_OS_OSX define Change-Id: I49c285604694c93d37c9d1c7cd6d3b1509858319 Reviewed-by: Volker Hilsheimer --- examples/network/torrent/mainwindow.cpp | 2 +- examples/widgets/desktop/systray/window.cpp | 2 +- .../mainwindows/mainwindow/mainwindow.cpp | 4 +- .../widgets/richtext/textedit/textedit.cpp | 2 +- .../tools/settingseditor/mainwindow.cpp | 4 +- src/corelib/global/qglobal.cpp | 2 +- src/corelib/io/qfilesystemengine_unix.cpp | 2 +- src/corelib/io/qfilesystemwatcher.cpp | 4 +- src/corelib/io/qfilesystemwatcher_fsevents.mm | 2 +- src/corelib/io/qlockfile_unix.cpp | 4 +- src/corelib/kernel/qcore_mac.mm | 4 +- src/corelib/kernel/qeventdispatcher_cf.mm | 2 +- src/corelib/text/qcollator_p.h | 4 +- src/gui/kernel/qguiapplication.cpp | 2 +- src/gui/kernel/qkeysequence.cpp | 2 +- src/gui/kernel/qplatformdialoghelper.cpp | 2 +- src/gui/kernel/qwindowsysteminterface.cpp | 4 +- src/gui/opengl/qopengl.cpp | 2 +- src/network/access/qnetworkaccessmanager.cpp | 2 +- src/network/ssl/qsslsocket_mac.cpp | 2 +- src/network/ssl/qsslsocket_mac_shared.cpp | 8 +- src/platformsupport/clipboard/qmacmime.mm | 2 +- .../mac/qcoretextfontdatabase.mm | 2 +- .../mac/qfontengine_coretext_p.h | 2 +- src/testlib/qtestblacklist.cpp | 2 +- src/testlib/qtestcase.cpp | 2 +- src/testlib/qxctestlogger.mm | 2 +- src/widgets/dialogs/qfiledialog.cpp | 2 +- src/widgets/itemviews/qabstractitemview.cpp | 4 +- src/widgets/kernel/qapplication.cpp | 2 +- src/widgets/kernel/qgesturemanager.cpp | 6 +- src/widgets/kernel/qwidgetwindow.cpp | 4 +- src/widgets/widgets/qabstractscrollarea.cpp | 2 +- src/widgets/widgets/qcombobox.cpp | 6 +- src/widgets/widgets/qmainwindow.cpp | 10 +-- src/widgets/widgets/qmenu.cpp | 6 +- src/widgets/widgets/qmenu.h | 2 +- src/widgets/widgets/qmenu_p.h | 2 +- src/widgets/widgets/qtabbar.cpp | 4 +- src/widgets/widgets/qtoolbar.cpp | 12 +-- src/widgets/widgets/qtoolbar_p.h | 4 +- src/widgets/widgets/qtoolbarlayout.cpp | 4 +- .../gui/kernel/qclipboard/tst_qclipboard.cpp | 4 +- .../widgets/dialogs/qdialog/tst_qdialog.cpp | 2 +- .../widgets/kernel/qwidget/tst_qwidget.cpp | 78 +++++++++---------- .../qstylesheetstyle/tst_qstylesheetstyle.cpp | 2 +- .../widgets/widgets/qmenubar/tst_qmenubar.cpp | 2 +- .../qopenglwidget/tst_qopenglwidget.cpp | 2 +- 48 files changed, 117 insertions(+), 117 deletions(-) diff --git a/examples/network/torrent/mainwindow.cpp b/examples/network/torrent/mainwindow.cpp index 331fa129440..c343ee81b94 100644 --- a/examples/network/torrent/mainwindow.cpp +++ b/examples/network/torrent/mainwindow.cpp @@ -183,7 +183,7 @@ MainWindow::MainWindow(QWidget *parent) bottomBar->addWidget((uploadLimitLabel = new QLabel(tr("0 KB/s")))); uploadLimitLabel->setFixedSize(QSize(fm.horizontalAdvance(tr("99999 KB/s")), fm.lineSpacing())); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS setUnifiedTitleAndToolBarOnMac(true); #endif diff --git a/examples/widgets/desktop/systray/window.cpp b/examples/widgets/desktop/systray/window.cpp index e30166beac9..9cfe651669a 100644 --- a/examples/widgets/desktop/systray/window.cpp +++ b/examples/widgets/desktop/systray/window.cpp @@ -111,7 +111,7 @@ void Window::setVisible(bool visible) //! [2] void Window::closeEvent(QCloseEvent *event) { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS if (!event->spontaneous() || !isVisible()) { return; } diff --git a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp index 4ba180f312c..717c75b166b 100644 --- a/examples/widgets/mainwindows/mainwindow/mainwindow.cpp +++ b/examples/widgets/mainwindows/mainwindow/mainwindow.cpp @@ -120,7 +120,7 @@ void MainWindow::actionTriggered(QAction *action) void MainWindow::setupToolBar() { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS setUnifiedTitleAndToolBarOnMac(true); #endif @@ -178,7 +178,7 @@ void MainWindow::setupMenuBar() for (int i = 0; i < toolBars.count(); ++i) toolBarMenu->addMenu(toolBars.at(i)->toolbarMenu()); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS toolBarMenu->addSeparator(); action = toolBarMenu->addAction(tr("Unified")); diff --git a/examples/widgets/richtext/textedit/textedit.cpp b/examples/widgets/richtext/textedit/textedit.cpp index c9173bcb999..cf3eb47ad8f 100644 --- a/examples/widgets/richtext/textedit/textedit.cpp +++ b/examples/widgets/richtext/textedit/textedit.cpp @@ -96,7 +96,7 @@ const QString rsrcPath = ":/images/win"; TextEdit::TextEdit(QWidget *parent) : QMainWindow(parent) { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS setUnifiedTitleAndToolBarOnMac(true); #endif setWindowTitle(QCoreApplication::applicationName()); diff --git a/examples/widgets/tools/settingseditor/mainwindow.cpp b/examples/widgets/tools/settingseditor/mainwindow.cpp index ccca16ffcd7..225a396f91f 100644 --- a/examples/widgets/tools/settingseditor/mainwindow.cpp +++ b/examples/widgets/tools/settingseditor/mainwindow.cpp @@ -157,10 +157,10 @@ void MainWindow::createActions() QAction *openIniFileAct = fileMenu->addAction(tr("Open I&NI File..."), this, &MainWindow::openIniFile); openIniFileAct->setShortcut(tr("Ctrl+N")); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS QAction *openPropertyListAct = fileMenu->addAction(tr("Open Apple &Property List..."), this, &MainWindow::openPropertyList); openPropertyListAct->setShortcut(tr("Ctrl+P")); -#endif // Q_OS_OSX +#endif // Q_OS_MACOS #ifdef Q_OS_WIN QAction *openRegistryPathAct = fileMenu->addAction(tr("Open Windows &Registry Path..."), this, &MainWindow::openRegistryPath); diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 0f7ba8580ed..62c6e64abb7 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -2101,7 +2101,7 @@ QT_WARNING_DISABLE_DEPRECATED QSysInfo::MacVersion QSysInfo::macVersion() { const auto version = QOperatingSystemVersion::current(); -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) return QSysInfo::MacVersion(Q_MV_OSX(version.majorVersion(), version.minorVersion())); #elif defined(Q_OS_IOS) return QSysInfo::MacVersion(Q_MV_IOS(version.majorVersion(), version.minorVersion())); diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index eaf4e2d9afe..67cff7c68c2 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -69,7 +69,7 @@ # include #endif -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS #include #endif diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp index 86c8963cb60..96d9210c1c9 100644 --- a/src/corelib/io/qfilesystemwatcher.cpp +++ b/src/corelib/io/qfilesystemwatcher.cpp @@ -58,7 +58,7 @@ # include "qfilesystemwatcher_inotify_p.h" #elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD) || defined(QT_PLATFORM_UIKIT) # include "qfilesystemwatcher_kqueue_p.h" -#elif defined(Q_OS_OSX) +#elif defined(Q_OS_MACOS) # include "qfilesystemwatcher_fsevents_p.h" #endif @@ -79,7 +79,7 @@ QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine(QObject return QInotifyFileSystemWatcherEngine::create(parent); #elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD) || defined(QT_PLATFORM_UIKIT) return QKqueueFileSystemWatcherEngine::create(parent); -#elif defined(Q_OS_OSX) +#elif defined(Q_OS_MACOS) return QFseventsFileSystemWatcherEngine::create(parent); #else Q_UNUSED(parent); diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.mm b/src/corelib/io/qfilesystemwatcher_fsevents.mm index 6194bf7c713..e039559ea3f 100644 --- a/src/corelib/io/qfilesystemwatcher_fsevents.mm +++ b/src/corelib/io/qfilesystemwatcher_fsevents.mm @@ -199,7 +199,7 @@ void QFseventsFileSystemWatcherEngine::processEvent(ConstFSEventStreamRef stream const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId eventIds[]) { -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) Q_UNUSED(streamRef); bool needsRestart = false; diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp index ce2b7e8faa8..b5311404373 100644 --- a/src/corelib/io/qlockfile_unix.cpp +++ b/src/corelib/io/qlockfile_unix.cpp @@ -68,7 +68,7 @@ #include // kill #include // gethostname -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) # include #elif defined(Q_OS_LINUX) # include @@ -222,7 +222,7 @@ bool QLockFilePrivate::isProcessRunning(qint64 pid, const QString &appname) QString QLockFilePrivate::processNameByPid(qint64 pid) { -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) char name[1024]; proc_name(pid, name, sizeof(name) / sizeof(char)); return QFile::decodeName(name); diff --git a/src/corelib/kernel/qcore_mac.mm b/src/corelib/kernel/qcore_mac.mm index 0d334e73003..a8aa1dad1fc 100644 --- a/src/corelib/kernel/qcore_mac.mm +++ b/src/corelib/kernel/qcore_mac.mm @@ -458,7 +458,7 @@ QMacRootLevelAutoReleasePool::~QMacRootLevelAutoReleasePool() // ------------------------------------------------------------------------- -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS // Use this method to keep all the information in the TextSegment. As long as it is ordered // we are in OK shape, and we can influence that ourselves. @@ -598,7 +598,7 @@ Qt::Key qt_mac_cocoaKey2QtKey(QChar keyCode) return i->qtKey; } -#endif // Q_OS_OSX +#endif // Q_OS_MACOS void qt_apple_check_os_version() { diff --git a/src/corelib/kernel/qeventdispatcher_cf.mm b/src/corelib/kernel/qeventdispatcher_cf.mm index 177551467ce..b482269df2b 100644 --- a/src/corelib/kernel/qeventdispatcher_cf.mm +++ b/src/corelib/kernel/qeventdispatcher_cf.mm @@ -48,7 +48,7 @@ #include -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS # include #elif defined(Q_OS_WATCHOS) # include diff --git a/src/corelib/text/qcollator_p.h b/src/corelib/text/qcollator_p.h index fc2d434a8da..444ae06a991 100644 --- a/src/corelib/text/qcollator_p.h +++ b/src/corelib/text/qcollator_p.h @@ -57,7 +57,7 @@ #include #if QT_CONFIG(icu) #include -#elif defined(Q_OS_OSX) +#elif defined(Q_OS_MACOS) #include #elif defined(Q_OS_WIN) #include @@ -70,7 +70,7 @@ typedef UCollator *CollatorType; typedef QByteArray CollatorKeyType; const CollatorType NoCollator = nullptr; -#elif defined(Q_OS_OSX) +#elif defined(Q_OS_MACOS) typedef CollatorRef CollatorType; typedef QVector CollatorKeyType; const CollatorType NoCollator = 0; diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index b9e8db87895..13369dc8f6a 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2320,7 +2320,7 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE static bool menuKeyPressAccepted = false; #endif -#if !defined(Q_OS_OSX) +#if !defined(Q_OS_MACOS) // FIXME: Include OS X in this code path by passing the key event through // QPlatformInputContext::filterEvent(). if (e->keyType == QEvent::KeyPress && window) { diff --git a/src/gui/kernel/qkeysequence.cpp b/src/gui/kernel/qkeysequence.cpp index 3a3dd42cae3..a75b8ef9204 100644 --- a/src/gui/kernel/qkeysequence.cpp +++ b/src/gui/kernel/qkeysequence.cpp @@ -1288,7 +1288,7 @@ QString QKeySequencePrivate::encodeString(int key, QKeySequence::SequenceFormat QString p = keyName(key, format); -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) if (nativeText) s += p; else diff --git a/src/gui/kernel/qplatformdialoghelper.cpp b/src/gui/kernel/qplatformdialoghelper.cpp index 5face965754..33cd0042340 100644 --- a/src/gui/kernel/qplatformdialoghelper.cpp +++ b/src/gui/kernel/qplatformdialoghelper.cpp @@ -979,7 +979,7 @@ QPlatformDialogHelper::ButtonRole QPlatformDialogHelper::buttonRole(QPlatformDia const int *QPlatformDialogHelper::buttonLayout(Qt::Orientation orientation, ButtonLayout policy) { if (policy == UnknownLayout) { -#if defined (Q_OS_OSX) +#if defined (Q_OS_MACOS) policy = MacLayout; #elif defined (Q_OS_LINUX) || defined (Q_OS_UNIX) policy = KdeLayout; diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp index b20578940ca..aefb3776831 100644 --- a/src/gui/kernel/qwindowsysteminterface.cpp +++ b/src/gui/kernel/qwindowsysteminterface.cpp @@ -498,7 +498,7 @@ QT_DEFINE_QPA_EVENT_HANDLER(bool, handleKeyEvent, QWindow *window, QEvent::Type QT_DEFINE_QPA_EVENT_HANDLER(bool, handleKeyEvent, QWindow *window, ulong timestamp, QEvent::Type t, int k, Qt::KeyboardModifiers mods, const QString & text, bool autorep, ushort count) { -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) if (t == QEvent::KeyPress && QWindowSystemInterface::handleShortcutEvent(window, timestamp, k, mods, 0, 0, 0, text, autorep, count)) return true; #endif @@ -526,7 +526,7 @@ bool QWindowSystemInterface::handleExtendedKeyEvent(QWindow *window, ulong times const QString& text, bool autorep, ushort count, bool tryShortcutOverride) { -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) if (tryShortcutOverride && type == QEvent::KeyPress && QWindowSystemInterface::handleShortcutEvent(window, timestamp, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, count)) { return true; diff --git a/src/gui/opengl/qopengl.cpp b/src/gui/opengl/qopengl.cpp index adca5367970..3066b832827 100644 --- a/src/gui/opengl/qopengl.cpp +++ b/src/gui/opengl/qopengl.cpp @@ -295,7 +295,7 @@ QString OsTypeTerm::hostOs() return QStringLiteral("win"); #elif defined(Q_OS_LINUX) return QStringLiteral("linux"); -#elif defined(Q_OS_OSX) +#elif defined(Q_OS_MACOS) return QStringLiteral("macosx"); #elif defined(Q_OS_ANDROID) return QStringLiteral("android"); diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp index 9e0389e08de..6f6aa73f62e 100644 --- a/src/network/access/qnetworkaccessmanager.cpp +++ b/src/network/access/qnetworkaccessmanager.cpp @@ -1892,7 +1892,7 @@ void QNetworkAccessManagerPrivate::proxyAuthenticationRequired(const QUrl &url, } } -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) //now we try to get the username and password from keychain //if not successful signal will be emitted QString username; diff --git a/src/network/ssl/qsslsocket_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp index e0e065679dc..77e847e9722 100644 --- a/src/network/ssl/qsslsocket_mac.cpp +++ b/src/network/ssl/qsslsocket_mac.cpp @@ -66,7 +66,7 @@ #include -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS #include #endif diff --git a/src/network/ssl/qsslsocket_mac_shared.cpp b/src/network/ssl/qsslsocket_mac_shared.cpp index 4f0adf16f9b..0bc4647e8b5 100644 --- a/src/network/ssl/qsslsocket_mac_shared.cpp +++ b/src/network/ssl/qsslsocket_mac_shared.cpp @@ -57,14 +57,14 @@ #include -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS # include #endif QT_BEGIN_NAMESPACE -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS namespace { bool hasTrustedSslServerPolicy(SecPolicyRef policy, CFDictionaryRef props) { @@ -119,7 +119,7 @@ bool isCaCertificateTrusted(SecCertificateRef cfCert, int domain) } } // anon namespace -#endif // Q_OS_OSX +#endif // Q_OS_MACOS QList QSslSocketPrivate::systemCaCertificates() { @@ -127,7 +127,7 @@ QList QSslSocketPrivate::systemCaCertificates() QList systemCerts; // SecTrustSettingsCopyCertificates is not defined on iOS. -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS // iterate through all enum members, order: // kSecTrustSettingsDomainUser, kSecTrustSettingsDomainAdmin, kSecTrustSettingsDomainSystem for (int dom = kSecTrustSettingsDomainUser; dom <= int(kSecTrustSettingsDomainSystem); dom++) { diff --git a/src/platformsupport/clipboard/qmacmime.mm b/src/platformsupport/clipboard/qmacmime.mm index 76e9c8712c9..c97d961260f 100644 --- a/src/platformsupport/clipboard/qmacmime.mm +++ b/src/platformsupport/clipboard/qmacmime.mm @@ -42,7 +42,7 @@ #include #include -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) #import #else #include diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index 894919a1c8f..bf986aab779 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -41,7 +41,7 @@ #include -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) #import #import #elif defined(QT_PLATFORM_UIKIT) diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h index 51d839688d5..fe5be960b3d 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h @@ -55,7 +55,7 @@ #include #include -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS #include #else #include diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp index 9b7c2495d4d..f9ccde02809 100644 --- a/src/testlib/qtestblacklist.cpp +++ b/src/testlib/qtestblacklist.cpp @@ -102,7 +102,7 @@ static QSet keywords() #ifdef Q_OS_LINUX << "linux" #endif -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS << "osx" << "macos" #endif diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 20c370dc38c..f45999c7fab 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -231,7 +231,7 @@ static void stackTrace() if (system(cmd) == -1) fprintf(stderr, "calling gdb failed\n"); fprintf(stderr, "=== End of stack trace ===\n"); -#elif defined(Q_OS_OSX) +#elif defined(Q_OS_MACOS) char cmd[512]; qsnprintf(cmd, 512, "lldb -p %d 2>/dev/null <key() == Qt::Key_O && event->modifiers() & Qt::ControlModifier && currentIndex().isValid()) { emit activated(currentIndex()); break; diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index a2c2dccbcc0..80e4aa525e3 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -4293,7 +4293,7 @@ bool QApplicationPrivate::translateRawTouchEvent(QWidget *window, QWidget *targetWidget = static_cast(target.data()); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS // Single-touch events are normally not sent unless WA_TouchPadAcceptSingleTouchEvents is set. // In Qt 4 this check was in OS X-only code. That behavior is preserved here by the #ifdef. if (touchPoints.count() == 1 diff --git a/src/widgets/kernel/qgesturemanager.cpp b/src/widgets/kernel/qgesturemanager.cpp index 541519245e2..134cebca099 100644 --- a/src/widgets/kernel/qgesturemanager.cpp +++ b/src/widgets/kernel/qgesturemanager.cpp @@ -51,7 +51,7 @@ #include "qgesture.h" #include "qevent.h" -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS #include "qmacgesturerecognizer_p.h" #endif @@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcGestureManager, "qt.widgets.gestures") -#if !defined(Q_OS_OSX) +#if !defined(Q_OS_MACOS) static inline int panTouchPoints() { // Override by environment variable for testing. @@ -89,7 +89,7 @@ QGestureManager::QGestureManager(QObject *parent) { qRegisterMetaType(); -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) registerGestureRecognizer(new QMacSwipeGestureRecognizer); registerGestureRecognizer(new QMacPinchGestureRecognizer); registerGestureRecognizer(new QMacPanGestureRecognizer); diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index 48e407f9176..0fa3fb4c678 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -397,7 +397,7 @@ QPointer qt_last_mouse_receiver = nullptr; void QWidgetWindow::handleEnterLeaveEvent(QEvent *event) { -#if !defined(Q_OS_OSX) && !defined(Q_OS_IOS) // Cocoa tracks popups +#if !defined(Q_OS_MACOS) && !defined(Q_OS_IOS) // Cocoa tracks popups // Ignore all enter/leave events from QPA if we are not on the first-level context menu. // This prevents duplicated events on most platforms. Fake events will be delivered in // QWidgetWindow::handleMouseEvent(QMouseEvent *). Make an exception whether the widget @@ -544,7 +544,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) if (receiver != activePopupWidget) widgetPos = receiver->mapFromGlobal(event->globalPos()); -#if !defined(Q_OS_OSX) && !defined(Q_OS_IOS) // Cocoa tracks popups +#if !defined(Q_OS_MACOS) && !defined(Q_OS_IOS) // Cocoa tracks popups const bool reallyUnderMouse = activePopupWidget->rect().contains(mapped); const bool underMouse = activePopupWidget->underMouse(); if (underMouse != reallyUnderMouse) { diff --git a/src/widgets/widgets/qabstractscrollarea.cpp b/src/widgets/widgets/qabstractscrollarea.cpp index 257cffda62c..6bc88f129dd 100644 --- a/src/widgets/widgets/qabstractscrollarea.cpp +++ b/src/widgets/widgets/qabstractscrollarea.cpp @@ -308,7 +308,7 @@ void QAbstractScrollAreaPrivate::init() q->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); q->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); layoutChildren(); -#ifndef Q_OS_OSX +#ifndef Q_OS_MACOS # ifndef QT_NO_GESTURES viewport->grabGesture(Qt::PanGesture); # endif diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index 84ba6479752..b1f2d40d384 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -1082,7 +1082,7 @@ QComboBox::QComboBox(QComboBoxPrivate &dd, QWidget *parent) void QComboBoxPrivate::init() { Q_Q(QComboBox); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS // On OS X, only line edits and list views always get tab focus. It's only // when we enable full keyboard access that other controls can get tab focus. // When it's not editable, a combobox looks like a button, and it behaves as @@ -1239,7 +1239,7 @@ void QComboBoxPrivate::updateViewContainerPaletteAndOpacity() void QComboBoxPrivate::updateFocusPolicy() { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS Q_Q(QComboBox); // See comment in QComboBoxPrivate::init() @@ -2696,7 +2696,7 @@ bool QComboBoxPrivate::showNativePopup() const QRect targetRect = QRect(tlw->mapFromGlobal(q->mapToGlobal(offset)), QSize()); m_platformMenu->showPopup(tlw, QHighDpi::toNativePixels(targetRect, tlw), currentItem); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS // The Cocoa popup will swallow any mouse release event. // We need to fake one here to un-press the button. QMouseEvent mouseReleased(QEvent::MouseButtonRelease, q->pos(), Qt::LeftButton, diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index 4f94b81b19f..6b50f5e8abd 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -67,7 +67,7 @@ #include "qtoolbar_p.h" #endif #include "qwidgetanimator_p.h" -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS #include #endif @@ -79,7 +79,7 @@ class QMainWindowPrivate : public QWidgetPrivate public: inline QMainWindowPrivate() : layout(nullptr), explicitIconSize(false), toolButtonStyle(Qt::ToolButtonIconOnly) -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS , useUnifiedToolBar(false) #endif { } @@ -87,7 +87,7 @@ public: QSize iconSize; bool explicitIconSize; Qt::ToolButtonStyle toolButtonStyle; -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS bool useUnifiedToolBar; #endif void init(); @@ -1357,7 +1357,7 @@ bool QMainWindow::event(QEvent *event) */ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set) { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS Q_D(QMainWindow); if (isWindow()) { d->useUnifiedToolBar = set; @@ -1382,7 +1382,7 @@ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set) bool QMainWindow::unifiedTitleAndToolBarOnMac() const { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS return d_func()->useUnifiedToolBar; #endif return false; diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index 0233fa136d8..86978cb6814 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -48,7 +48,7 @@ #include "qlayout.h" #include "qpainter.h" #include -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS #include "qmacnativewidget_mac.h" #endif #include "qapplication.h" @@ -1491,7 +1491,7 @@ void QMenuPrivate::_q_platformMenuAboutToShow() emit q->aboutToShow(); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS if (platformMenu) { const auto actions = q->actions(); for (QAction *action : actions) { @@ -3547,7 +3547,7 @@ void QMenu::actionEvent(QActionEvent *e) d->currentAction = nullptr; if (QWidgetAction *wa = qobject_cast(e->action())) { if (QWidget *widget = d->widgetItems.value(wa)) { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS QWidget *p = widget->parentWidget(); if (p != this && qobject_cast(p)) { // This widget was reparented into a native Mac view diff --git a/src/widgets/widgets/qmenu.h b/src/widgets/widgets/qmenu.h index 84ab9e027a9..eec9708d43e 100644 --- a/src/widgets/widgets/qmenu.h +++ b/src/widgets/widgets/qmenu.h @@ -270,7 +270,7 @@ private: friend void qt_mac_menu_emit_hovered(QMenu *menu, QAction *action); }; -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS // ### Qt 4 compatibility; remove in Qt 6 inline QT_DEPRECATED void qt_mac_set_dock_menu(QMenu *menu) { menu->setAsDockMenu(); } #endif diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h index 02fe9f31a1d..3871d6763c9 100644 --- a/src/widgets/widgets/qmenu_p.h +++ b/src/widgets/widgets/qmenu_p.h @@ -335,7 +335,7 @@ public: void copyActionToPlatformItem(const QAction *action, QPlatformMenuItem *item); QPlatformMenuItem *insertActionInPlatformMenu(const QAction *action, QPlatformMenuItem *beforeItem); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS void moveWidgetToPlatformItem(QWidget *w, QPlatformMenuItem* item); #endif diff --git a/src/widgets/widgets/qtabbar.cpp b/src/widgets/widgets/qtabbar.cpp index df480629dac..53be9179452 100644 --- a/src/widgets/widgets/qtabbar.cpp +++ b/src/widgets/widgets/qtabbar.cpp @@ -60,7 +60,7 @@ #ifndef QT_NO_ACCESSIBILITY #include "qaccessible.h" #endif -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS #include #endif @@ -115,7 +115,7 @@ inline static bool verticalTabs(QTabBar::Shape shape) void QTabBarPrivate::updateMacBorderMetrics() { -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) Q_Q(QTabBar); // Extend the unified title and toolbar area to cover the tab bar iff // 1) the tab bar is in document mode diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp index b4e90c7d718..0912cd55d39 100644 --- a/src/widgets/widgets/qtoolbar.cpp +++ b/src/widgets/widgets/qtoolbar.cpp @@ -61,7 +61,7 @@ #include #include -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS #include #endif @@ -248,7 +248,7 @@ bool QToolBarPrivate::mousePressEvent(QMouseEvent *event) QStyleOptionToolBar opt; q->initStyleOption(&opt); if (q->style()->subElementRect(QStyle::SE_ToolBarHandle, &opt, q).contains(event->pos()) == false) { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS // When using the unified toolbar on OS X, the user can click and // drag between toolbar contents to move the window. Make this work by // implementing the standard mouse-dragging code and then call @@ -282,7 +282,7 @@ bool QToolBarPrivate::mouseReleaseEvent(QMouseEvent*) endDrag(); return true; } else { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS if (!macWindowDragging) return false; macWindowDragging = false; @@ -298,7 +298,7 @@ bool QToolBarPrivate::mouseMoveEvent(QMouseEvent *event) Q_Q(QToolBar); if (!state) { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS if (!macWindowDragging) return false; QWidget *w = q->window(); @@ -1083,7 +1083,7 @@ static bool waitForPopup(QToolBar *tb, QWidget *popup) return false; } -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS static void enableMacToolBar(QToolBar *toolbar, bool enable) { QPlatformNativeInterface *nativeInterface = QApplication::platformNativeInterface(); @@ -1122,7 +1122,7 @@ bool QToolBar::event(QEvent *event) Q_FALLTHROUGH(); case QEvent::Show: d->toggleViewAction->setChecked(event->type() == QEvent::Show); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS enableMacToolBar(this, event->type() == QEvent::Show); #endif emit visibilityChanged(event->type() == QEvent::Show); diff --git a/src/widgets/widgets/qtoolbar_p.h b/src/widgets/widgets/qtoolbar_p.h index 8cb58509033..79e693acbfe 100644 --- a/src/widgets/widgets/qtoolbar_p.h +++ b/src/widgets/widgets/qtoolbar_p.h @@ -74,7 +74,7 @@ public: allowedAreas(Qt::AllToolBarAreas), orientation(Qt::Horizontal), toolButtonStyle(Qt::ToolButtonIconOnly), layout(nullptr), state(nullptr) -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS , macWindowDragging(false) #endif { } @@ -106,7 +106,7 @@ public: }; DragState *state; -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS bool macWindowDragging; QPoint macWindowDragPressPosition; #endif diff --git a/src/widgets/widgets/qtoolbarlayout.cpp b/src/widgets/widgets/qtoolbarlayout.cpp index d77ba3c13e9..4ffa17ecd73 100644 --- a/src/widgets/widgets/qtoolbarlayout.cpp +++ b/src/widgets/widgets/qtoolbarlayout.cpp @@ -48,7 +48,7 @@ #include #include #include -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS #include #endif @@ -348,7 +348,7 @@ static bool defaultWidgetAction(QToolBarItem *item) void QToolBarLayout::updateMacBorderMetrics() { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS QToolBar *tb = qobject_cast(parentWidget()); if (!tb) return; diff --git a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp index bff9f7d0e02..e099b4dfc7d 100644 --- a/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp +++ b/tests/auto/gui/kernel/qclipboard/tst_qclipboard.cpp @@ -289,10 +289,10 @@ void tst_QClipboard::copyImage() image.fill(QColor(Qt::transparent)); image.setPixel(QPoint(1, 0), QColor(Qt::blue).rgba()); QGuiApplication::clipboard()->setImage(image); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS // The Pasteboard needs a moment to breathe (at least on older Macs). QTest::qWait(100); -#endif // Q_OS_OSX +#endif // Q_OS_MACOS // paster will perform hard-coded checks on the copied image. QByteArray errorMessage; QVERIFY2(runHelper(QStringLiteral("paster/paster"), diff --git a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp index 1af3bade0e5..10a3746e362 100644 --- a/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp +++ b/tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp @@ -607,7 +607,7 @@ void tst_QDialog::snapToDefaultButton() + QPoint(100, 100), QSize(200, 200)); const QPoint startingPos = dialogGeometry.bottomRight() + QPoint(100, 100); QCursor::setPos(startingPos); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS // On OS X we use CGEventPost to move the cursor, it needs at least // some time before the event handled and the position really set. QTest::qWait(100); diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 2483d7b5bb5..5ffbbdd400c 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -75,7 +75,7 @@ #include #include -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) #include "tst_qwidget_mac_helpers.h" // Abstract the ObjC stuff out so not everyone must run an ObjC++ compile. #endif @@ -110,7 +110,7 @@ static HWND winHandleOf(const QWidget *w) # define Q_CHECK_PAINTEVENTS #endif -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS #include bool macHasAccessToWindowsServer() { @@ -216,7 +216,7 @@ private slots: void restoreVersion1Geometry(); void widgetAt(); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS void setMask(); #endif void optimizedResizeMove(); @@ -250,7 +250,7 @@ private slots: void update(); void isOpaque(); -#ifndef Q_OS_OSX +#ifndef Q_OS_MACOS void scroll(); void scrollNativeChildren(); #endif @@ -381,7 +381,7 @@ private slots: void taskQTBUG_7532_tabOrderWithFocusProxy(); void movedAndResizedAttributes(); void childAt(); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS void taskQTBUG_11373(); #endif void taskQTBUG_17333_ResizeInfiniteRecursion(); @@ -2301,7 +2301,7 @@ void tst_QWidget::activation() void tst_QWidget::windowState() { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS QSKIP("QTBUG-52974"); #endif @@ -2514,7 +2514,7 @@ void tst_QWidget::showMaximized() void tst_QWidget::showFullScreen() { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS QSKIP("QTBUG-52974"); #endif @@ -2834,14 +2834,14 @@ void tst_QWidget::showMinimizedKeepsFocus() window.showNormal(); QApplication::setActiveWindow(&window); QVERIFY(QTest::qWaitForWindowActive(&window)); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS if (!macHasAccessToWindowsServer()) QEXPECT_FAIL("", "When not having WindowServer access, we lose focus.", Continue); #elif defined(Q_OS_WINRT) QEXPECT_FAIL("", "Winrt fails here - QTBUG-68297", Continue); #endif QTRY_COMPARE(window.focusWidget(), firstchild); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS if (!macHasAccessToWindowsServer()) QEXPECT_FAIL("", "When not having WindowServer access, we lose focus.", Continue); #elif defined(Q_OS_WINRT) @@ -2904,7 +2904,7 @@ void tst_QWidget::reparent() // Qt/Embedded does it differently. void tst_QWidget::icon() { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS QSKIP("QTBUG-52974"); #endif @@ -2970,7 +2970,7 @@ void tst_QWidget::hideWhenFocusWidgetIsChild() void tst_QWidget::normalGeometry() { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS QSKIP("QTBUG-52974"); #endif @@ -3230,7 +3230,7 @@ public: void tst_QWidget::lostUpdatesOnHide() { -#ifndef Q_OS_OSX +#ifndef Q_OS_MACOS UpdateWidget widget; widget.setAttribute(Qt::WA_DontShowOnScreen); widget.setWindowTitle(QLatin1String(QTest::currentTestFunction())); @@ -3271,7 +3271,7 @@ void tst_QWidget::raise() parentPtr->show(); QVERIFY(QTest::qWaitForWindowExposed(parentPtr.data())); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS if (child1->internalWinId()) { QSKIP("Cocoa has no Z-Order for views, we hack it, but it results in paint events."); } @@ -3412,7 +3412,7 @@ void tst_QWidget::lower() void tst_QWidget::stackUnder() { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS QSKIP("QTBUG-52974: Cocoa has no Z-Order for views, we hack it, but it results in paint events."); #endif @@ -3445,7 +3445,7 @@ void tst_QWidget::stackUnder() for (UpdateWidget *child : qAsConst(allChildren)) { int expectedPaintEvents = child == child4 ? 1 : 0; -#if defined(Q_OS_WIN) || defined(Q_OS_OSX) +#if defined(Q_OS_WIN) || defined(Q_OS_MACOS) if (expectedPaintEvents == 1 && child->numPaintEvents == 2) QEXPECT_FAIL(0, "Mac and Windows issues double repaints for Z-Order change", Continue); #endif @@ -3479,7 +3479,7 @@ void tst_QWidget::stackUnder() for (UpdateWidget *child : qAsConst(allChildren)) { int expectedZOrderChangeEvents = child == child1 ? 1 : 0; if (child == child3) { -#ifndef Q_OS_OSX +#ifndef Q_OS_MACOS QEXPECT_FAIL(0, "See QTBUG-493", Continue); #endif QCOMPARE(child->numPaintEvents, 0); @@ -3579,7 +3579,7 @@ void tst_QWidget::testContentsPropagation() void tst_QWidget::saveRestoreGeometry() { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS QSKIP("QTBUG-52974"); #endif @@ -3817,7 +3817,7 @@ void tst_QWidget::restoreVersion1Geometry() void tst_QWidget::widgetAt() { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS QSKIP("QTBUG-52974"); #endif @@ -4020,7 +4020,7 @@ void tst_QWidget::testDeletionInEventHandlers() delete w; } -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS class MaskedPainter : public QWidget { public: @@ -4887,7 +4887,7 @@ void tst_QWidget::update() QCOMPARE(sibling.numPaintEvents, 1); QCOMPARE(sibling.paintedRegion, sibling.visibleRegion()); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS if (child.internalWinId()) // child is native QEXPECT_FAIL(0, "Cocoa compositor paints child and sibling", Continue); #endif @@ -4904,7 +4904,7 @@ void tst_QWidget::update() } } -#ifndef Q_OS_OSX +#ifndef Q_OS_MACOS static inline bool isOpaque(QWidget *widget) { if (!widget) @@ -4915,7 +4915,7 @@ static inline bool isOpaque(QWidget *widget) void tst_QWidget::isOpaque() { -#ifndef Q_OS_OSX +#ifndef Q_OS_MACOS QWidget w; QVERIFY(::isOpaque(&w)); @@ -4987,7 +4987,7 @@ void tst_QWidget::isOpaque() #endif } -#ifndef Q_OS_OSX +#ifndef Q_OS_MACOS /* Test that scrolling of a widget invalidates the correct regions */ @@ -5431,7 +5431,7 @@ void tst_QWidget::windowMoveResize() widget.move(r.topLeft()); widget.resize(r.size()); QApplication::processEvents(); -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) if (r.width() == 0 && r.height() > 0) { widget.move(r.topLeft()); widget.resize(r.size()); @@ -5502,7 +5502,7 @@ void tst_QWidget::windowMoveResize() widget.move(r.topLeft()); widget.resize(r.size()); QApplication::processEvents(); -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) if (r.width() == 0 && r.height() > 0) { widget.move(r.topLeft()); widget.resize(r.size()); @@ -5689,7 +5689,7 @@ void tst_QWidget::moveChild() QTRY_COMPARE(pos, child.pos()); QTRY_COMPARE(parent.r, QRegion(oldGeometry) - child.geometry()); -#if !defined(Q_OS_OSX) +#if !defined(Q_OS_MACOS) // should be scrolled in backingstore QCOMPARE(child.r, QRegion()); #endif @@ -5739,7 +5739,7 @@ void tst_QWidget::showAndMoveChild() void tst_QWidget::subtractOpaqueSiblings() { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS QSKIP("QTBUG-52974: Cocoa only has rect granularity."); #endif @@ -5816,7 +5816,7 @@ public slots: void tst_QWidget::multipleToplevelFocusCheck() { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS QSKIP("QTBUG-52974"); #endif @@ -7584,7 +7584,7 @@ void tst_QWidget::render_systemClip() // rrrrrrrrrr // ... -#ifndef Q_OS_OSX +#ifndef Q_OS_MACOS for (int i = 0; i < image.height(); ++i) { for (int j = 0; j < image.width(); ++j) { if (i < 50 && j < i) @@ -8618,11 +8618,11 @@ void tst_QWidget::sendUpdateRequestImmediately() void tst_QWidget::doubleRepaint() { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS QSKIP("QTBUG-52974"); #endif -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) if (!macHasAccessToWindowsServer()) QSKIP("Not having window server access causes the wrong number of repaints to be issues"); #endif @@ -9330,7 +9330,7 @@ void tst_QWidget::setClearAndResizeMask() child.setMask(childMask); QTRY_COMPARE(child.mask(), childMask); // and ensure that the child widget doesn't get any update. -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS // Mac always issues a full update when calling setMask, and we cannot force it to not do so. if (child.internalWinId()) QCOMPARE(child.numPaintEvents, 1); @@ -9352,7 +9352,7 @@ void tst_QWidget::setClearAndResizeMask() // and ensure that that the child widget gets an update for the area outside the old mask. QTRY_COMPARE(child.numPaintEvents, 1); outsideOldMask = child.rect(); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS // Mac always issues a full update when calling setMask, and we cannot force it to not do so. if (!child.internalWinId()) #endif @@ -9366,7 +9366,7 @@ void tst_QWidget::setClearAndResizeMask() // Mask child widget with a mask that is bigger than the rect child.setMask(QRegion(0, 0, 1000, 1000)); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS // Mac always issues a full update when calling setMask, and we cannot force it to not do so. if (child.internalWinId()) QTRY_COMPARE(child.numPaintEvents, 1); @@ -9379,7 +9379,7 @@ void tst_QWidget::setClearAndResizeMask() // ...and the same applies when clearing the mask. child.clearMask(); QTest::qWait(100); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS // Mac always issues a full update when calling setMask, and we cannot force it to not do so. if (child.internalWinId()) QTRY_VERIFY(child.numPaintEvents > 0); @@ -9409,7 +9409,7 @@ void tst_QWidget::setClearAndResizeMask() QTimer::singleShot(100, &resizeChild, SLOT(shrinkMask())); QTest::qWait(200); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS // Mac always issues a full update when calling setMask, and we cannot force it to not do so. if (child.internalWinId()) QTRY_COMPARE(resizeChild.paintedRegion, resizeChild.mask()); @@ -9421,7 +9421,7 @@ void tst_QWidget::setClearAndResizeMask() const QRegion oldMask = resizeChild.mask(); QTimer::singleShot(0, &resizeChild, SLOT(enlargeMask())); QTest::qWait(100); -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS // Mac always issues a full update when calling setMask, and we cannot force it to not do so. if (child.internalWinId()) QTRY_COMPARE(resizeChild.paintedRegion, resizeChild.mask()); @@ -10265,7 +10265,7 @@ void tst_QWidget::childAt() QCOMPARE(parent.childAt(120, 120), grandChild); } -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS void tst_QWidget::taskQTBUG_11373() { @@ -11121,7 +11121,7 @@ public: // when mousing over it. void tst_QWidget::taskQTBUG_27643_enterEvents() { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS QSKIP("QTBUG-52974: this test can crash!"); #endif // Move the mouse cursor to a safe location so it won't interfere diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp index 0ae2e6626fd..82527849b09 100644 --- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp +++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp @@ -995,7 +995,7 @@ void tst_QStyleSheetStyle::focusColors() #ifndef QT_NO_CURSOR void tst_QStyleSheetStyle::hoverColors() { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS QSKIP("This test is fragile on Mac, most likely due to QTBUG-33959."); #endif if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) diff --git a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp index b2559301380..53f1e1fc5c4 100644 --- a/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp +++ b/tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp @@ -1525,7 +1525,7 @@ void tst_QMenuBar::cornerWidgets() QFETCH(Qt::Corner, corner); -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) QSKIP("Test interferes with native menu bars on this platform"); #endif diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp index 17a5fe2cd9e..7d70d49019a 100644 --- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp +++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp @@ -579,7 +579,7 @@ bool verifyColor(const QWidget *widget, const QRect &clipArea, const QColor &col void tst_QOpenGLWidget::stackWidgetOpaqueChildIsVisible() { -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS QSKIP("QScreen::grabWindow() doesn't work properly on OSX HighDPI screen: QTBUG-46803"); return; #endif