diff options
author | Tor Arne Vestbø <torarnv@gmail.com> | 2020-04-03 12:45:36 +0200 |
---|---|---|
committer | Tor Arne Vestbø <torarnv@gmail.com> | 2020-04-03 13:44:37 +0200 |
commit | ab4c22d47d196d5eb28fc16cd7262c77bcb6875f (patch) | |
tree | 29022a8bdd5849cd6d0e9755063c449110b8686d /src | |
parent | 7e7c6498841cb4e5a5b4454424a374b70bb111d9 (diff) |
macOS: Remove all use of deprecated Q_OS_OSX define
Change-Id: I49c285604694c93d37c9d1c7cd6d3b1509858319
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src')
37 files changed, 65 insertions, 65 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 0f7ba8580e..62c6e64abb 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 eaf4e2d9af..67cff7c68c 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -69,7 +69,7 @@ # include <CoreFoundation/CFBundle.h> #endif -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS #include <CoreServices/CoreServices.h> #endif diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp index 86c8963cb6..96d9210c1c 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 6194bf7c71..e039559ea3 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 ce2b7e8faa..b531140437 100644 --- a/src/corelib/io/qlockfile_unix.cpp +++ b/src/corelib/io/qlockfile_unix.cpp @@ -68,7 +68,7 @@ #include <signal.h> // kill #include <unistd.h> // gethostname -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) # include <libproc.h> #elif defined(Q_OS_LINUX) # include <unistd.h> @@ -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 0d334e7300..a8aa1dad1f 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 177551467c..b482269df2 100644 --- a/src/corelib/kernel/qeventdispatcher_cf.mm +++ b/src/corelib/kernel/qeventdispatcher_cf.mm @@ -48,7 +48,7 @@ #include <limits> -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS # include <AppKit/NSApplication.h> #elif defined(Q_OS_WATCHOS) # include <WatchKit/WatchKit.h> diff --git a/src/corelib/text/qcollator_p.h b/src/corelib/text/qcollator_p.h index fc2d434a8d..444ae06a99 100644 --- a/src/corelib/text/qcollator_p.h +++ b/src/corelib/text/qcollator_p.h @@ -57,7 +57,7 @@ #include <QVector> #if QT_CONFIG(icu) #include <unicode/ucol.h> -#elif defined(Q_OS_OSX) +#elif defined(Q_OS_MACOS) #include <CoreServices/CoreServices.h> #elif defined(Q_OS_WIN) #include <qt_windows.h> @@ -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<UCCollationValue> CollatorKeyType; const CollatorType NoCollator = 0; diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index b9e8db8789..13369dc8f6 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 3a3dd42cae..a75b8ef920 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 5face96575..33cd004234 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 b20578940c..aefb377683 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 adca536797..3066b83282 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 9e0389e08d..6f6aa73f62 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 e0e065679d..77e847e972 100644 --- a/src/network/ssl/qsslsocket_mac.cpp +++ b/src/network/ssl/qsslsocket_mac.cpp @@ -66,7 +66,7 @@ #include <QtCore/private/qcore_mac_p.h> -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS #include <CoreServices/CoreServices.h> #endif diff --git a/src/network/ssl/qsslsocket_mac_shared.cpp b/src/network/ssl/qsslsocket_mac_shared.cpp index 4f0adf16f9..0bc4647e8b 100644 --- a/src/network/ssl/qsslsocket_mac_shared.cpp +++ b/src/network/ssl/qsslsocket_mac_shared.cpp @@ -57,14 +57,14 @@ #include <QtCore/qdebug.h> -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS # include <Security/Security.h> #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<QSslCertificate> QSslSocketPrivate::systemCaCertificates() { @@ -127,7 +127,7 @@ QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates() QList<QSslCertificate> 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 76e9c8712c..c97d961260 100644 --- a/src/platformsupport/clipboard/qmacmime.mm +++ b/src/platformsupport/clipboard/qmacmime.mm @@ -42,7 +42,7 @@ #include <QtCore/qsystemdetection.h> #include <QtGui/qimage.h> -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) #import <AppKit/AppKit.h> #else #include <MobileCoreServices/MobileCoreServices.h> diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index 894919a1c8..bf986aab77 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -41,7 +41,7 @@ #include <sys/param.h> -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) #import <AppKit/AppKit.h> #import <IOKit/graphics/IOGraphicsLib.h> #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 51d839688d..fe5be960b3 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h @@ -55,7 +55,7 @@ #include <private/qcore_mac_p.h> #include <QtCore/qloggingcategory.h> -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS #include <ApplicationServices/ApplicationServices.h> #else #include <CoreText/CoreText.h> diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp index 9b7c2495d4..f9ccde0280 100644 --- a/src/testlib/qtestblacklist.cpp +++ b/src/testlib/qtestblacklist.cpp @@ -102,7 +102,7 @@ static QSet<QByteArray> 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 20c370dc38..f45999c7fa 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 <<EOF\n" "bt all\n" diff --git a/src/testlib/qxctestlogger.mm b/src/testlib/qxctestlogger.mm index 9fa9da2fdd..d9e56cf542 100644 --- a/src/testlib/qxctestlogger.mm +++ b/src/testlib/qxctestlogger.mm @@ -189,7 +189,7 @@ private: // Prevent XCTestProbe from re-launching runTests on application startup [[NSNotificationCenter defaultCenter] removeObserver:[XCTestProbe class] name:[NSString stringWithFormat:@"%@DidFinishLaunchingNotification", - #if defined(Q_OS_OSX) + #if defined(Q_OS_MACOS) @"NSApplication" #else @"UIApplication" diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 34c2c4ecb5..bace311924 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -1041,7 +1041,7 @@ static inline bool isCaseSensitiveFileSystem(const QString &path) // Return case insensitive unconditionally, even if someone has a case sensitive // file system mounted, wrongly capitalized drive letters will cause mismatches. return false; -#elif defined(Q_OS_OSX) +#elif defined(Q_OS_MACOS) return pathconf(QFile::encodeName(path).constData(), _PC_CASE_SENSITIVE); #else return true; diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index f8784f9428..3b2aebff15 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -2461,7 +2461,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event) } #endif break; -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS case Qt::Key_Enter: case Qt::Key_Return: // Propagate the enter if you couldn't edit the item and there are no @@ -2493,7 +2493,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event) break; } #endif -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS if (event->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 a2c2dccbcc..80e4aa525e 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<QWidget *>(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 541519245e..134cebca09 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<Qt::GestureState>(); -#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 48e407f917..0fa3fb4c67 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -397,7 +397,7 @@ QPointer<QWidget> 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 257cffda62..6bc88f129d 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 84ba647975..b1f2d40d38 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 4f94b81b19..6b50f5e8ab 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 <qpa/qplatformnativeinterface.h> #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 0233fa136d..86978cb681 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -48,7 +48,7 @@ #include "qlayout.h" #include "qpainter.h" #include <qpa/qplatformtheme.h> -#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<QWidgetAction *>(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<QMacNativeWidget *>(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 84ab9e027a..eec9708d43 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 02fe9f31a1..3871d6763c 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 df480629da..53be917945 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 <qpa/qplatformnativeinterface.h> #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 b4e90c7d71..0912cd55d3 100644 --- a/src/widgets/widgets/qtoolbar.cpp +++ b/src/widgets/widgets/qtoolbar.cpp @@ -61,7 +61,7 @@ #include <private/qwidgetaction_p.h> #include <private/qmainwindowlayout_p.h> -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS #include <qpa/qplatformnativeinterface.h> #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 8cb5850903..79e693acbf 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 d77ba3c13e..4ffa17ecd7 100644 --- a/src/widgets/widgets/qtoolbarlayout.cpp +++ b/src/widgets/widgets/qtoolbarlayout.cpp @@ -48,7 +48,7 @@ #include <qmenu.h> #include <qdebug.h> #include <qmath.h> -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS #include <qpa/qplatformnativeinterface.h> #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<QToolBar*>(parentWidget()); if (!tb) return; |