macOS: Remove all use of deprecated Q_OS_OSX define

Change-Id: I49c285604694c93d37c9d1c7cd6d3b1509858319
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Tor Arne Vestbø 2020-04-03 12:45:36 +02:00
parent 7e7c649884
commit ab4c22d47d
48 changed files with 117 additions and 117 deletions

View File

@ -183,7 +183,7 @@ MainWindow::MainWindow(QWidget *parent)
bottomBar->addWidget((uploadLimitLabel = new QLabel(tr("0 KB/s")))); bottomBar->addWidget((uploadLimitLabel = new QLabel(tr("0 KB/s"))));
uploadLimitLabel->setFixedSize(QSize(fm.horizontalAdvance(tr("99999 KB/s")), fm.lineSpacing())); uploadLimitLabel->setFixedSize(QSize(fm.horizontalAdvance(tr("99999 KB/s")), fm.lineSpacing()));
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
setUnifiedTitleAndToolBarOnMac(true); setUnifiedTitleAndToolBarOnMac(true);
#endif #endif

View File

@ -111,7 +111,7 @@ void Window::setVisible(bool visible)
//! [2] //! [2]
void Window::closeEvent(QCloseEvent *event) void Window::closeEvent(QCloseEvent *event)
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
if (!event->spontaneous() || !isVisible()) { if (!event->spontaneous() || !isVisible()) {
return; return;
} }

View File

@ -120,7 +120,7 @@ void MainWindow::actionTriggered(QAction *action)
void MainWindow::setupToolBar() void MainWindow::setupToolBar()
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
setUnifiedTitleAndToolBarOnMac(true); setUnifiedTitleAndToolBarOnMac(true);
#endif #endif
@ -178,7 +178,7 @@ void MainWindow::setupMenuBar()
for (int i = 0; i < toolBars.count(); ++i) for (int i = 0; i < toolBars.count(); ++i)
toolBarMenu->addMenu(toolBars.at(i)->toolbarMenu()); toolBarMenu->addMenu(toolBars.at(i)->toolbarMenu());
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
toolBarMenu->addSeparator(); toolBarMenu->addSeparator();
action = toolBarMenu->addAction(tr("Unified")); action = toolBarMenu->addAction(tr("Unified"));

View File

@ -96,7 +96,7 @@ const QString rsrcPath = ":/images/win";
TextEdit::TextEdit(QWidget *parent) TextEdit::TextEdit(QWidget *parent)
: QMainWindow(parent) : QMainWindow(parent)
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
setUnifiedTitleAndToolBarOnMac(true); setUnifiedTitleAndToolBarOnMac(true);
#endif #endif
setWindowTitle(QCoreApplication::applicationName()); setWindowTitle(QCoreApplication::applicationName());

View File

@ -157,10 +157,10 @@ void MainWindow::createActions()
QAction *openIniFileAct = fileMenu->addAction(tr("Open I&NI File..."), this, &MainWindow::openIniFile); QAction *openIniFileAct = fileMenu->addAction(tr("Open I&NI File..."), this, &MainWindow::openIniFile);
openIniFileAct->setShortcut(tr("Ctrl+N")); 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); QAction *openPropertyListAct = fileMenu->addAction(tr("Open Apple &Property List..."), this, &MainWindow::openPropertyList);
openPropertyListAct->setShortcut(tr("Ctrl+P")); openPropertyListAct->setShortcut(tr("Ctrl+P"));
#endif // Q_OS_OSX #endif // Q_OS_MACOS
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
QAction *openRegistryPathAct = fileMenu->addAction(tr("Open Windows &Registry Path..."), this, &MainWindow::openRegistryPath); QAction *openRegistryPathAct = fileMenu->addAction(tr("Open Windows &Registry Path..."), this, &MainWindow::openRegistryPath);

View File

@ -2101,7 +2101,7 @@ QT_WARNING_DISABLE_DEPRECATED
QSysInfo::MacVersion QSysInfo::macVersion() QSysInfo::MacVersion QSysInfo::macVersion()
{ {
const auto version = QOperatingSystemVersion::current(); 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())); return QSysInfo::MacVersion(Q_MV_OSX(version.majorVersion(), version.minorVersion()));
#elif defined(Q_OS_IOS) #elif defined(Q_OS_IOS)
return QSysInfo::MacVersion(Q_MV_IOS(version.majorVersion(), version.minorVersion())); return QSysInfo::MacVersion(Q_MV_IOS(version.majorVersion(), version.minorVersion()));

View File

@ -69,7 +69,7 @@
# include <CoreFoundation/CFBundle.h> # include <CoreFoundation/CFBundle.h>
#endif #endif
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
#include <CoreServices/CoreServices.h> #include <CoreServices/CoreServices.h>
#endif #endif

View File

@ -58,7 +58,7 @@
# include "qfilesystemwatcher_inotify_p.h" # include "qfilesystemwatcher_inotify_p.h"
#elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD) || defined(QT_PLATFORM_UIKIT) #elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD) || defined(QT_PLATFORM_UIKIT)
# include "qfilesystemwatcher_kqueue_p.h" # include "qfilesystemwatcher_kqueue_p.h"
#elif defined(Q_OS_OSX) #elif defined(Q_OS_MACOS)
# include "qfilesystemwatcher_fsevents_p.h" # include "qfilesystemwatcher_fsevents_p.h"
#endif #endif
@ -79,7 +79,7 @@ QFileSystemWatcherEngine *QFileSystemWatcherPrivate::createNativeEngine(QObject
return QInotifyFileSystemWatcherEngine::create(parent); return QInotifyFileSystemWatcherEngine::create(parent);
#elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD) || defined(QT_PLATFORM_UIKIT) #elif defined(Q_OS_FREEBSD) || defined(Q_OS_NETBSD) || defined(Q_OS_OPENBSD) || defined(QT_PLATFORM_UIKIT)
return QKqueueFileSystemWatcherEngine::create(parent); return QKqueueFileSystemWatcherEngine::create(parent);
#elif defined(Q_OS_OSX) #elif defined(Q_OS_MACOS)
return QFseventsFileSystemWatcherEngine::create(parent); return QFseventsFileSystemWatcherEngine::create(parent);
#else #else
Q_UNUSED(parent); Q_UNUSED(parent);

View File

@ -199,7 +199,7 @@ void QFseventsFileSystemWatcherEngine::processEvent(ConstFSEventStreamRef stream
const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventFlags eventFlags[],
const FSEventStreamEventId eventIds[]) const FSEventStreamEventId eventIds[])
{ {
#if defined(Q_OS_OSX) #if defined(Q_OS_MACOS)
Q_UNUSED(streamRef); Q_UNUSED(streamRef);
bool needsRestart = false; bool needsRestart = false;

View File

@ -68,7 +68,7 @@
#include <signal.h> // kill #include <signal.h> // kill
#include <unistd.h> // gethostname #include <unistd.h> // gethostname
#if defined(Q_OS_OSX) #if defined(Q_OS_MACOS)
# include <libproc.h> # include <libproc.h>
#elif defined(Q_OS_LINUX) #elif defined(Q_OS_LINUX)
# include <unistd.h> # include <unistd.h>
@ -222,7 +222,7 @@ bool QLockFilePrivate::isProcessRunning(qint64 pid, const QString &appname)
QString QLockFilePrivate::processNameByPid(qint64 pid) QString QLockFilePrivate::processNameByPid(qint64 pid)
{ {
#if defined(Q_OS_OSX) #if defined(Q_OS_MACOS)
char name[1024]; char name[1024];
proc_name(pid, name, sizeof(name) / sizeof(char)); proc_name(pid, name, sizeof(name) / sizeof(char));
return QFile::decodeName(name); return QFile::decodeName(name);

View File

@ -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 // 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. // 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; return i->qtKey;
} }
#endif // Q_OS_OSX #endif // Q_OS_MACOS
void qt_apple_check_os_version() void qt_apple_check_os_version()
{ {

View File

@ -48,7 +48,7 @@
#include <limits> #include <limits>
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
# include <AppKit/NSApplication.h> # include <AppKit/NSApplication.h>
#elif defined(Q_OS_WATCHOS) #elif defined(Q_OS_WATCHOS)
# include <WatchKit/WatchKit.h> # include <WatchKit/WatchKit.h>

View File

@ -57,7 +57,7 @@
#include <QVector> #include <QVector>
#if QT_CONFIG(icu) #if QT_CONFIG(icu)
#include <unicode/ucol.h> #include <unicode/ucol.h>
#elif defined(Q_OS_OSX) #elif defined(Q_OS_MACOS)
#include <CoreServices/CoreServices.h> #include <CoreServices/CoreServices.h>
#elif defined(Q_OS_WIN) #elif defined(Q_OS_WIN)
#include <qt_windows.h> #include <qt_windows.h>
@ -70,7 +70,7 @@ typedef UCollator *CollatorType;
typedef QByteArray CollatorKeyType; typedef QByteArray CollatorKeyType;
const CollatorType NoCollator = nullptr; const CollatorType NoCollator = nullptr;
#elif defined(Q_OS_OSX) #elif defined(Q_OS_MACOS)
typedef CollatorRef CollatorType; typedef CollatorRef CollatorType;
typedef QVector<UCCollationValue> CollatorKeyType; typedef QVector<UCCollationValue> CollatorKeyType;
const CollatorType NoCollator = 0; const CollatorType NoCollator = 0;

View File

@ -2320,7 +2320,7 @@ void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyE
static bool menuKeyPressAccepted = false; static bool menuKeyPressAccepted = false;
#endif #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 // FIXME: Include OS X in this code path by passing the key event through
// QPlatformInputContext::filterEvent(). // QPlatformInputContext::filterEvent().
if (e->keyType == QEvent::KeyPress && window) { if (e->keyType == QEvent::KeyPress && window) {

View File

@ -1288,7 +1288,7 @@ QString QKeySequencePrivate::encodeString(int key, QKeySequence::SequenceFormat
QString p = keyName(key, format); QString p = keyName(key, format);
#if defined(Q_OS_OSX) #if defined(Q_OS_MACOS)
if (nativeText) if (nativeText)
s += p; s += p;
else else

View File

@ -979,7 +979,7 @@ QPlatformDialogHelper::ButtonRole QPlatformDialogHelper::buttonRole(QPlatformDia
const int *QPlatformDialogHelper::buttonLayout(Qt::Orientation orientation, ButtonLayout policy) const int *QPlatformDialogHelper::buttonLayout(Qt::Orientation orientation, ButtonLayout policy)
{ {
if (policy == UnknownLayout) { if (policy == UnknownLayout) {
#if defined (Q_OS_OSX) #if defined (Q_OS_MACOS)
policy = MacLayout; policy = MacLayout;
#elif defined (Q_OS_LINUX) || defined (Q_OS_UNIX) #elif defined (Q_OS_LINUX) || defined (Q_OS_UNIX)
policy = KdeLayout; policy = KdeLayout;

View File

@ -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) 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)) if (t == QEvent::KeyPress && QWindowSystemInterface::handleShortcutEvent(window, timestamp, k, mods, 0, 0, 0, text, autorep, count))
return true; return true;
#endif #endif
@ -526,7 +526,7 @@ bool QWindowSystemInterface::handleExtendedKeyEvent(QWindow *window, ulong times
const QString& text, bool autorep, const QString& text, bool autorep,
ushort count, bool tryShortcutOverride) ushort count, bool tryShortcutOverride)
{ {
#if defined(Q_OS_OSX) #if defined(Q_OS_MACOS)
if (tryShortcutOverride && type == QEvent::KeyPress && QWindowSystemInterface::handleShortcutEvent(window, if (tryShortcutOverride && type == QEvent::KeyPress && QWindowSystemInterface::handleShortcutEvent(window,
timestamp, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, count)) { timestamp, key, modifiers, nativeScanCode, nativeVirtualKey, nativeModifiers, text, autorep, count)) {
return true; return true;

View File

@ -295,7 +295,7 @@ QString OsTypeTerm::hostOs()
return QStringLiteral("win"); return QStringLiteral("win");
#elif defined(Q_OS_LINUX) #elif defined(Q_OS_LINUX)
return QStringLiteral("linux"); return QStringLiteral("linux");
#elif defined(Q_OS_OSX) #elif defined(Q_OS_MACOS)
return QStringLiteral("macosx"); return QStringLiteral("macosx");
#elif defined(Q_OS_ANDROID) #elif defined(Q_OS_ANDROID)
return QStringLiteral("android"); return QStringLiteral("android");

View File

@ -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 //now we try to get the username and password from keychain
//if not successful signal will be emitted //if not successful signal will be emitted
QString username; QString username;

View File

@ -66,7 +66,7 @@
#include <QtCore/private/qcore_mac_p.h> #include <QtCore/private/qcore_mac_p.h>
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
#include <CoreServices/CoreServices.h> #include <CoreServices/CoreServices.h>
#endif #endif

View File

@ -57,14 +57,14 @@
#include <QtCore/qdebug.h> #include <QtCore/qdebug.h>
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
# include <Security/Security.h> # include <Security/Security.h>
#endif #endif
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
namespace { namespace {
bool hasTrustedSslServerPolicy(SecPolicyRef policy, CFDictionaryRef props) { bool hasTrustedSslServerPolicy(SecPolicyRef policy, CFDictionaryRef props) {
@ -119,7 +119,7 @@ bool isCaCertificateTrusted(SecCertificateRef cfCert, int domain)
} }
} // anon namespace } // anon namespace
#endif // Q_OS_OSX #endif // Q_OS_MACOS
QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates() QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
{ {
@ -127,7 +127,7 @@ QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
QList<QSslCertificate> systemCerts; QList<QSslCertificate> systemCerts;
// SecTrustSettingsCopyCertificates is not defined on iOS. // SecTrustSettingsCopyCertificates is not defined on iOS.
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
// iterate through all enum members, order: // iterate through all enum members, order:
// kSecTrustSettingsDomainUser, kSecTrustSettingsDomainAdmin, kSecTrustSettingsDomainSystem // kSecTrustSettingsDomainUser, kSecTrustSettingsDomainAdmin, kSecTrustSettingsDomainSystem
for (int dom = kSecTrustSettingsDomainUser; dom <= int(kSecTrustSettingsDomainSystem); dom++) { for (int dom = kSecTrustSettingsDomainUser; dom <= int(kSecTrustSettingsDomainSystem); dom++) {

View File

@ -42,7 +42,7 @@
#include <QtCore/qsystemdetection.h> #include <QtCore/qsystemdetection.h>
#include <QtGui/qimage.h> #include <QtGui/qimage.h>
#if defined(Q_OS_OSX) #if defined(Q_OS_MACOS)
#import <AppKit/AppKit.h> #import <AppKit/AppKit.h>
#else #else
#include <MobileCoreServices/MobileCoreServices.h> #include <MobileCoreServices/MobileCoreServices.h>

View File

@ -41,7 +41,7 @@
#include <sys/param.h> #include <sys/param.h>
#if defined(Q_OS_OSX) #if defined(Q_OS_MACOS)
#import <AppKit/AppKit.h> #import <AppKit/AppKit.h>
#import <IOKit/graphics/IOGraphicsLib.h> #import <IOKit/graphics/IOGraphicsLib.h>
#elif defined(QT_PLATFORM_UIKIT) #elif defined(QT_PLATFORM_UIKIT)

View File

@ -55,7 +55,7 @@
#include <private/qcore_mac_p.h> #include <private/qcore_mac_p.h>
#include <QtCore/qloggingcategory.h> #include <QtCore/qloggingcategory.h>
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
#include <ApplicationServices/ApplicationServices.h> #include <ApplicationServices/ApplicationServices.h>
#else #else
#include <CoreText/CoreText.h> #include <CoreText/CoreText.h>

View File

@ -102,7 +102,7 @@ static QSet<QByteArray> keywords()
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
<< "linux" << "linux"
#endif #endif
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
<< "osx" << "osx"
<< "macos" << "macos"
#endif #endif

View File

@ -231,7 +231,7 @@ static void stackTrace()
if (system(cmd) == -1) if (system(cmd) == -1)
fprintf(stderr, "calling gdb failed\n"); fprintf(stderr, "calling gdb failed\n");
fprintf(stderr, "=== End of stack trace ===\n"); fprintf(stderr, "=== End of stack trace ===\n");
#elif defined(Q_OS_OSX) #elif defined(Q_OS_MACOS)
char cmd[512]; char cmd[512];
qsnprintf(cmd, 512, "lldb -p %d 2>/dev/null <<EOF\n" qsnprintf(cmd, 512, "lldb -p %d 2>/dev/null <<EOF\n"
"bt all\n" "bt all\n"

View File

@ -189,7 +189,7 @@ private:
// Prevent XCTestProbe from re-launching runTests on application startup // Prevent XCTestProbe from re-launching runTests on application startup
[[NSNotificationCenter defaultCenter] removeObserver:[XCTestProbe class] [[NSNotificationCenter defaultCenter] removeObserver:[XCTestProbe class]
name:[NSString stringWithFormat:@"%@DidFinishLaunchingNotification", name:[NSString stringWithFormat:@"%@DidFinishLaunchingNotification",
#if defined(Q_OS_OSX) #if defined(Q_OS_MACOS)
@"NSApplication" @"NSApplication"
#else #else
@"UIApplication" @"UIApplication"

View File

@ -1041,7 +1041,7 @@ static inline bool isCaseSensitiveFileSystem(const QString &path)
// Return case insensitive unconditionally, even if someone has a case sensitive // Return case insensitive unconditionally, even if someone has a case sensitive
// file system mounted, wrongly capitalized drive letters will cause mismatches. // file system mounted, wrongly capitalized drive letters will cause mismatches.
return false; return false;
#elif defined(Q_OS_OSX) #elif defined(Q_OS_MACOS)
return pathconf(QFile::encodeName(path).constData(), _PC_CASE_SENSITIVE); return pathconf(QFile::encodeName(path).constData(), _PC_CASE_SENSITIVE);
#else #else
return true; return true;

View File

@ -2461,7 +2461,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
} }
#endif #endif
break; break;
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
case Qt::Key_Enter: case Qt::Key_Enter:
case Qt::Key_Return: case Qt::Key_Return:
// Propagate the enter if you couldn't edit the item and there are no // Propagate the enter if you couldn't edit the item and there are no
@ -2493,7 +2493,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
break; break;
} }
#endif #endif
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
if (event->key() == Qt::Key_O && event->modifiers() & Qt::ControlModifier && currentIndex().isValid()) { if (event->key() == Qt::Key_O && event->modifiers() & Qt::ControlModifier && currentIndex().isValid()) {
emit activated(currentIndex()); emit activated(currentIndex());
break; break;

View File

@ -4293,7 +4293,7 @@ bool QApplicationPrivate::translateRawTouchEvent(QWidget *window,
QWidget *targetWidget = static_cast<QWidget *>(target.data()); 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. // 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. // In Qt 4 this check was in OS X-only code. That behavior is preserved here by the #ifdef.
if (touchPoints.count() == 1 if (touchPoints.count() == 1

View File

@ -51,7 +51,7 @@
#include "qgesture.h" #include "qgesture.h"
#include "qevent.h" #include "qevent.h"
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
#include "qmacgesturerecognizer_p.h" #include "qmacgesturerecognizer_p.h"
#endif #endif
@ -64,7 +64,7 @@ QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(lcGestureManager, "qt.widgets.gestures") Q_LOGGING_CATEGORY(lcGestureManager, "qt.widgets.gestures")
#if !defined(Q_OS_OSX) #if !defined(Q_OS_MACOS)
static inline int panTouchPoints() static inline int panTouchPoints()
{ {
// Override by environment variable for testing. // Override by environment variable for testing.
@ -89,7 +89,7 @@ QGestureManager::QGestureManager(QObject *parent)
{ {
qRegisterMetaType<Qt::GestureState>(); qRegisterMetaType<Qt::GestureState>();
#if defined(Q_OS_OSX) #if defined(Q_OS_MACOS)
registerGestureRecognizer(new QMacSwipeGestureRecognizer); registerGestureRecognizer(new QMacSwipeGestureRecognizer);
registerGestureRecognizer(new QMacPinchGestureRecognizer); registerGestureRecognizer(new QMacPinchGestureRecognizer);
registerGestureRecognizer(new QMacPanGestureRecognizer); registerGestureRecognizer(new QMacPanGestureRecognizer);

View File

@ -397,7 +397,7 @@ QPointer<QWidget> qt_last_mouse_receiver = nullptr;
void QWidgetWindow::handleEnterLeaveEvent(QEvent *event) 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. // 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 // This prevents duplicated events on most platforms. Fake events will be delivered in
// QWidgetWindow::handleMouseEvent(QMouseEvent *). Make an exception whether the widget // QWidgetWindow::handleMouseEvent(QMouseEvent *). Make an exception whether the widget
@ -544,7 +544,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
if (receiver != activePopupWidget) if (receiver != activePopupWidget)
widgetPos = receiver->mapFromGlobal(event->globalPos()); 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 reallyUnderMouse = activePopupWidget->rect().contains(mapped);
const bool underMouse = activePopupWidget->underMouse(); const bool underMouse = activePopupWidget->underMouse();
if (underMouse != reallyUnderMouse) { if (underMouse != reallyUnderMouse) {

View File

@ -308,7 +308,7 @@ void QAbstractScrollAreaPrivate::init()
q->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); q->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
q->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); q->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
layoutChildren(); layoutChildren();
#ifndef Q_OS_OSX #ifndef Q_OS_MACOS
# ifndef QT_NO_GESTURES # ifndef QT_NO_GESTURES
viewport->grabGesture(Qt::PanGesture); viewport->grabGesture(Qt::PanGesture);
# endif # endif

View File

@ -1082,7 +1082,7 @@ QComboBox::QComboBox(QComboBoxPrivate &dd, QWidget *parent)
void QComboBoxPrivate::init() void QComboBoxPrivate::init()
{ {
Q_Q(QComboBox); 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 // 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 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 // 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() void QComboBoxPrivate::updateFocusPolicy()
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
Q_Q(QComboBox); Q_Q(QComboBox);
// See comment in QComboBoxPrivate::init() // See comment in QComboBoxPrivate::init()
@ -2696,7 +2696,7 @@ bool QComboBoxPrivate::showNativePopup()
const QRect targetRect = QRect(tlw->mapFromGlobal(q->mapToGlobal(offset)), QSize()); const QRect targetRect = QRect(tlw->mapFromGlobal(q->mapToGlobal(offset)), QSize());
m_platformMenu->showPopup(tlw, QHighDpi::toNativePixels(targetRect, tlw), currentItem); 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. // The Cocoa popup will swallow any mouse release event.
// We need to fake one here to un-press the button. // We need to fake one here to un-press the button.
QMouseEvent mouseReleased(QEvent::MouseButtonRelease, q->pos(), Qt::LeftButton, QMouseEvent mouseReleased(QEvent::MouseButtonRelease, q->pos(), Qt::LeftButton,

View File

@ -67,7 +67,7 @@
#include "qtoolbar_p.h" #include "qtoolbar_p.h"
#endif #endif
#include "qwidgetanimator_p.h" #include "qwidgetanimator_p.h"
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
#include <qpa/qplatformnativeinterface.h> #include <qpa/qplatformnativeinterface.h>
#endif #endif
@ -79,7 +79,7 @@ class QMainWindowPrivate : public QWidgetPrivate
public: public:
inline QMainWindowPrivate() inline QMainWindowPrivate()
: layout(nullptr), explicitIconSize(false), toolButtonStyle(Qt::ToolButtonIconOnly) : layout(nullptr), explicitIconSize(false), toolButtonStyle(Qt::ToolButtonIconOnly)
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
, useUnifiedToolBar(false) , useUnifiedToolBar(false)
#endif #endif
{ } { }
@ -87,7 +87,7 @@ public:
QSize iconSize; QSize iconSize;
bool explicitIconSize; bool explicitIconSize;
Qt::ToolButtonStyle toolButtonStyle; Qt::ToolButtonStyle toolButtonStyle;
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
bool useUnifiedToolBar; bool useUnifiedToolBar;
#endif #endif
void init(); void init();
@ -1357,7 +1357,7 @@ bool QMainWindow::event(QEvent *event)
*/ */
void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set) void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set)
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
Q_D(QMainWindow); Q_D(QMainWindow);
if (isWindow()) { if (isWindow()) {
d->useUnifiedToolBar = set; d->useUnifiedToolBar = set;
@ -1382,7 +1382,7 @@ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set)
bool QMainWindow::unifiedTitleAndToolBarOnMac() const bool QMainWindow::unifiedTitleAndToolBarOnMac() const
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
return d_func()->useUnifiedToolBar; return d_func()->useUnifiedToolBar;
#endif #endif
return false; return false;

View File

@ -48,7 +48,7 @@
#include "qlayout.h" #include "qlayout.h"
#include "qpainter.h" #include "qpainter.h"
#include <qpa/qplatformtheme.h> #include <qpa/qplatformtheme.h>
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
#include "qmacnativewidget_mac.h" #include "qmacnativewidget_mac.h"
#endif #endif
#include "qapplication.h" #include "qapplication.h"
@ -1491,7 +1491,7 @@ void QMenuPrivate::_q_platformMenuAboutToShow()
emit q->aboutToShow(); emit q->aboutToShow();
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
if (platformMenu) { if (platformMenu) {
const auto actions = q->actions(); const auto actions = q->actions();
for (QAction *action : actions) { for (QAction *action : actions) {
@ -3547,7 +3547,7 @@ void QMenu::actionEvent(QActionEvent *e)
d->currentAction = nullptr; d->currentAction = nullptr;
if (QWidgetAction *wa = qobject_cast<QWidgetAction *>(e->action())) { if (QWidgetAction *wa = qobject_cast<QWidgetAction *>(e->action())) {
if (QWidget *widget = d->widgetItems.value(wa)) { if (QWidget *widget = d->widgetItems.value(wa)) {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
QWidget *p = widget->parentWidget(); QWidget *p = widget->parentWidget();
if (p != this && qobject_cast<QMacNativeWidget *>(p)) { if (p != this && qobject_cast<QMacNativeWidget *>(p)) {
// This widget was reparented into a native Mac view // This widget was reparented into a native Mac view

View File

@ -270,7 +270,7 @@ private:
friend void qt_mac_menu_emit_hovered(QMenu *menu, QAction *action); 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 // ### Qt 4 compatibility; remove in Qt 6
inline QT_DEPRECATED void qt_mac_set_dock_menu(QMenu *menu) { menu->setAsDockMenu(); } inline QT_DEPRECATED void qt_mac_set_dock_menu(QMenu *menu) { menu->setAsDockMenu(); }
#endif #endif

View File

@ -335,7 +335,7 @@ public:
void copyActionToPlatformItem(const QAction *action, QPlatformMenuItem *item); void copyActionToPlatformItem(const QAction *action, QPlatformMenuItem *item);
QPlatformMenuItem *insertActionInPlatformMenu(const QAction *action, QPlatformMenuItem *beforeItem); QPlatformMenuItem *insertActionInPlatformMenu(const QAction *action, QPlatformMenuItem *beforeItem);
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
void moveWidgetToPlatformItem(QWidget *w, QPlatformMenuItem* item); void moveWidgetToPlatformItem(QWidget *w, QPlatformMenuItem* item);
#endif #endif

View File

@ -60,7 +60,7 @@
#ifndef QT_NO_ACCESSIBILITY #ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h" #include "qaccessible.h"
#endif #endif
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
#include <qpa/qplatformnativeinterface.h> #include <qpa/qplatformnativeinterface.h>
#endif #endif
@ -115,7 +115,7 @@ inline static bool verticalTabs(QTabBar::Shape shape)
void QTabBarPrivate::updateMacBorderMetrics() void QTabBarPrivate::updateMacBorderMetrics()
{ {
#if defined(Q_OS_OSX) #if defined(Q_OS_MACOS)
Q_Q(QTabBar); Q_Q(QTabBar);
// Extend the unified title and toolbar area to cover the tab bar iff // Extend the unified title and toolbar area to cover the tab bar iff
// 1) the tab bar is in document mode // 1) the tab bar is in document mode

View File

@ -61,7 +61,7 @@
#include <private/qwidgetaction_p.h> #include <private/qwidgetaction_p.h>
#include <private/qmainwindowlayout_p.h> #include <private/qmainwindowlayout_p.h>
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
#include <qpa/qplatformnativeinterface.h> #include <qpa/qplatformnativeinterface.h>
#endif #endif
@ -248,7 +248,7 @@ bool QToolBarPrivate::mousePressEvent(QMouseEvent *event)
QStyleOptionToolBar opt; QStyleOptionToolBar opt;
q->initStyleOption(&opt); q->initStyleOption(&opt);
if (q->style()->subElementRect(QStyle::SE_ToolBarHandle, &opt, q).contains(event->pos()) == false) { 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 // 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 // drag between toolbar contents to move the window. Make this work by
// implementing the standard mouse-dragging code and then call // implementing the standard mouse-dragging code and then call
@ -282,7 +282,7 @@ bool QToolBarPrivate::mouseReleaseEvent(QMouseEvent*)
endDrag(); endDrag();
return true; return true;
} else { } else {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
if (!macWindowDragging) if (!macWindowDragging)
return false; return false;
macWindowDragging = false; macWindowDragging = false;
@ -298,7 +298,7 @@ bool QToolBarPrivate::mouseMoveEvent(QMouseEvent *event)
Q_Q(QToolBar); Q_Q(QToolBar);
if (!state) { if (!state) {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
if (!macWindowDragging) if (!macWindowDragging)
return false; return false;
QWidget *w = q->window(); QWidget *w = q->window();
@ -1083,7 +1083,7 @@ static bool waitForPopup(QToolBar *tb, QWidget *popup)
return false; return false;
} }
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
static void enableMacToolBar(QToolBar *toolbar, bool enable) static void enableMacToolBar(QToolBar *toolbar, bool enable)
{ {
QPlatformNativeInterface *nativeInterface = QApplication::platformNativeInterface(); QPlatformNativeInterface *nativeInterface = QApplication::platformNativeInterface();
@ -1122,7 +1122,7 @@ bool QToolBar::event(QEvent *event)
Q_FALLTHROUGH(); Q_FALLTHROUGH();
case QEvent::Show: case QEvent::Show:
d->toggleViewAction->setChecked(event->type() == QEvent::Show); d->toggleViewAction->setChecked(event->type() == QEvent::Show);
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
enableMacToolBar(this, event->type() == QEvent::Show); enableMacToolBar(this, event->type() == QEvent::Show);
#endif #endif
emit visibilityChanged(event->type() == QEvent::Show); emit visibilityChanged(event->type() == QEvent::Show);

View File

@ -74,7 +74,7 @@ public:
allowedAreas(Qt::AllToolBarAreas), orientation(Qt::Horizontal), allowedAreas(Qt::AllToolBarAreas), orientation(Qt::Horizontal),
toolButtonStyle(Qt::ToolButtonIconOnly), toolButtonStyle(Qt::ToolButtonIconOnly),
layout(nullptr), state(nullptr) layout(nullptr), state(nullptr)
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
, macWindowDragging(false) , macWindowDragging(false)
#endif #endif
{ } { }
@ -106,7 +106,7 @@ public:
}; };
DragState *state; DragState *state;
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
bool macWindowDragging; bool macWindowDragging;
QPoint macWindowDragPressPosition; QPoint macWindowDragPressPosition;
#endif #endif

View File

@ -48,7 +48,7 @@
#include <qmenu.h> #include <qmenu.h>
#include <qdebug.h> #include <qdebug.h>
#include <qmath.h> #include <qmath.h>
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
#include <qpa/qplatformnativeinterface.h> #include <qpa/qplatformnativeinterface.h>
#endif #endif
@ -348,7 +348,7 @@ static bool defaultWidgetAction(QToolBarItem *item)
void QToolBarLayout::updateMacBorderMetrics() void QToolBarLayout::updateMacBorderMetrics()
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
QToolBar *tb = qobject_cast<QToolBar*>(parentWidget()); QToolBar *tb = qobject_cast<QToolBar*>(parentWidget());
if (!tb) if (!tb)
return; return;

View File

@ -289,10 +289,10 @@ void tst_QClipboard::copyImage()
image.fill(QColor(Qt::transparent)); image.fill(QColor(Qt::transparent));
image.setPixel(QPoint(1, 0), QColor(Qt::blue).rgba()); image.setPixel(QPoint(1, 0), QColor(Qt::blue).rgba());
QGuiApplication::clipboard()->setImage(image); QGuiApplication::clipboard()->setImage(image);
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
// The Pasteboard needs a moment to breathe (at least on older Macs). // The Pasteboard needs a moment to breathe (at least on older Macs).
QTest::qWait(100); QTest::qWait(100);
#endif // Q_OS_OSX #endif // Q_OS_MACOS
// paster will perform hard-coded checks on the copied image. // paster will perform hard-coded checks on the copied image.
QByteArray errorMessage; QByteArray errorMessage;
QVERIFY2(runHelper(QStringLiteral("paster/paster"), QVERIFY2(runHelper(QStringLiteral("paster/paster"),

View File

@ -607,7 +607,7 @@ void tst_QDialog::snapToDefaultButton()
+ QPoint(100, 100), QSize(200, 200)); + QPoint(100, 100), QSize(200, 200));
const QPoint startingPos = dialogGeometry.bottomRight() + QPoint(100, 100); const QPoint startingPos = dialogGeometry.bottomRight() + QPoint(100, 100);
QCursor::setPos(startingPos); 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 // 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. // some time before the event handled and the position really set.
QTest::qWait(100); QTest::qWait(100);

View File

@ -75,7 +75,7 @@
#include <qtimer.h> #include <qtimer.h>
#include <QtWidgets/QDoubleSpinBox> #include <QtWidgets/QDoubleSpinBox>
#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. #include "tst_qwidget_mac_helpers.h" // Abstract the ObjC stuff out so not everyone must run an ObjC++ compile.
#endif #endif
@ -110,7 +110,7 @@ static HWND winHandleOf(const QWidget *w)
# define Q_CHECK_PAINTEVENTS # define Q_CHECK_PAINTEVENTS
#endif #endif
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
#include <Security/AuthSession.h> #include <Security/AuthSession.h>
bool macHasAccessToWindowsServer() bool macHasAccessToWindowsServer()
{ {
@ -216,7 +216,7 @@ private slots:
void restoreVersion1Geometry(); void restoreVersion1Geometry();
void widgetAt(); void widgetAt();
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
void setMask(); void setMask();
#endif #endif
void optimizedResizeMove(); void optimizedResizeMove();
@ -250,7 +250,7 @@ private slots:
void update(); void update();
void isOpaque(); void isOpaque();
#ifndef Q_OS_OSX #ifndef Q_OS_MACOS
void scroll(); void scroll();
void scrollNativeChildren(); void scrollNativeChildren();
#endif #endif
@ -381,7 +381,7 @@ private slots:
void taskQTBUG_7532_tabOrderWithFocusProxy(); void taskQTBUG_7532_tabOrderWithFocusProxy();
void movedAndResizedAttributes(); void movedAndResizedAttributes();
void childAt(); void childAt();
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
void taskQTBUG_11373(); void taskQTBUG_11373();
#endif #endif
void taskQTBUG_17333_ResizeInfiniteRecursion(); void taskQTBUG_17333_ResizeInfiniteRecursion();
@ -2301,7 +2301,7 @@ void tst_QWidget::activation()
void tst_QWidget::windowState() void tst_QWidget::windowState()
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
QSKIP("QTBUG-52974"); QSKIP("QTBUG-52974");
#endif #endif
@ -2514,7 +2514,7 @@ void tst_QWidget::showMaximized()
void tst_QWidget::showFullScreen() void tst_QWidget::showFullScreen()
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
QSKIP("QTBUG-52974"); QSKIP("QTBUG-52974");
#endif #endif
@ -2834,14 +2834,14 @@ void tst_QWidget::showMinimizedKeepsFocus()
window.showNormal(); window.showNormal();
QApplication::setActiveWindow(&window); QApplication::setActiveWindow(&window);
QVERIFY(QTest::qWaitForWindowActive(&window)); QVERIFY(QTest::qWaitForWindowActive(&window));
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
if (!macHasAccessToWindowsServer()) if (!macHasAccessToWindowsServer())
QEXPECT_FAIL("", "When not having WindowServer access, we lose focus.", Continue); QEXPECT_FAIL("", "When not having WindowServer access, we lose focus.", Continue);
#elif defined(Q_OS_WINRT) #elif defined(Q_OS_WINRT)
QEXPECT_FAIL("", "Winrt fails here - QTBUG-68297", Continue); QEXPECT_FAIL("", "Winrt fails here - QTBUG-68297", Continue);
#endif #endif
QTRY_COMPARE(window.focusWidget(), firstchild); QTRY_COMPARE(window.focusWidget(), firstchild);
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
if (!macHasAccessToWindowsServer()) if (!macHasAccessToWindowsServer())
QEXPECT_FAIL("", "When not having WindowServer access, we lose focus.", Continue); QEXPECT_FAIL("", "When not having WindowServer access, we lose focus.", Continue);
#elif defined(Q_OS_WINRT) #elif defined(Q_OS_WINRT)
@ -2904,7 +2904,7 @@ void tst_QWidget::reparent()
// Qt/Embedded does it differently. // Qt/Embedded does it differently.
void tst_QWidget::icon() void tst_QWidget::icon()
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
QSKIP("QTBUG-52974"); QSKIP("QTBUG-52974");
#endif #endif
@ -2970,7 +2970,7 @@ void tst_QWidget::hideWhenFocusWidgetIsChild()
void tst_QWidget::normalGeometry() void tst_QWidget::normalGeometry()
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
QSKIP("QTBUG-52974"); QSKIP("QTBUG-52974");
#endif #endif
@ -3230,7 +3230,7 @@ public:
void tst_QWidget::lostUpdatesOnHide() void tst_QWidget::lostUpdatesOnHide()
{ {
#ifndef Q_OS_OSX #ifndef Q_OS_MACOS
UpdateWidget widget; UpdateWidget widget;
widget.setAttribute(Qt::WA_DontShowOnScreen); widget.setAttribute(Qt::WA_DontShowOnScreen);
widget.setWindowTitle(QLatin1String(QTest::currentTestFunction())); widget.setWindowTitle(QLatin1String(QTest::currentTestFunction()));
@ -3271,7 +3271,7 @@ void tst_QWidget::raise()
parentPtr->show(); parentPtr->show();
QVERIFY(QTest::qWaitForWindowExposed(parentPtr.data())); QVERIFY(QTest::qWaitForWindowExposed(parentPtr.data()));
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
if (child1->internalWinId()) { if (child1->internalWinId()) {
QSKIP("Cocoa has no Z-Order for views, we hack it, but it results in paint events."); 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() 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."); QSKIP("QTBUG-52974: Cocoa has no Z-Order for views, we hack it, but it results in paint events.");
#endif #endif
@ -3445,7 +3445,7 @@ void tst_QWidget::stackUnder()
for (UpdateWidget *child : qAsConst(allChildren)) { for (UpdateWidget *child : qAsConst(allChildren)) {
int expectedPaintEvents = child == child4 ? 1 : 0; 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) if (expectedPaintEvents == 1 && child->numPaintEvents == 2)
QEXPECT_FAIL(0, "Mac and Windows issues double repaints for Z-Order change", Continue); QEXPECT_FAIL(0, "Mac and Windows issues double repaints for Z-Order change", Continue);
#endif #endif
@ -3479,7 +3479,7 @@ void tst_QWidget::stackUnder()
for (UpdateWidget *child : qAsConst(allChildren)) { for (UpdateWidget *child : qAsConst(allChildren)) {
int expectedZOrderChangeEvents = child == child1 ? 1 : 0; int expectedZOrderChangeEvents = child == child1 ? 1 : 0;
if (child == child3) { if (child == child3) {
#ifndef Q_OS_OSX #ifndef Q_OS_MACOS
QEXPECT_FAIL(0, "See QTBUG-493", Continue); QEXPECT_FAIL(0, "See QTBUG-493", Continue);
#endif #endif
QCOMPARE(child->numPaintEvents, 0); QCOMPARE(child->numPaintEvents, 0);
@ -3579,7 +3579,7 @@ void tst_QWidget::testContentsPropagation()
void tst_QWidget::saveRestoreGeometry() void tst_QWidget::saveRestoreGeometry()
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
QSKIP("QTBUG-52974"); QSKIP("QTBUG-52974");
#endif #endif
@ -3817,7 +3817,7 @@ void tst_QWidget::restoreVersion1Geometry()
void tst_QWidget::widgetAt() void tst_QWidget::widgetAt()
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
QSKIP("QTBUG-52974"); QSKIP("QTBUG-52974");
#endif #endif
@ -4020,7 +4020,7 @@ void tst_QWidget::testDeletionInEventHandlers()
delete w; delete w;
} }
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
class MaskedPainter : public QWidget class MaskedPainter : public QWidget
{ {
public: public:
@ -4887,7 +4887,7 @@ void tst_QWidget::update()
QCOMPARE(sibling.numPaintEvents, 1); QCOMPARE(sibling.numPaintEvents, 1);
QCOMPARE(sibling.paintedRegion, sibling.visibleRegion()); QCOMPARE(sibling.paintedRegion, sibling.visibleRegion());
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
if (child.internalWinId()) // child is native if (child.internalWinId()) // child is native
QEXPECT_FAIL(0, "Cocoa compositor paints child and sibling", Continue); QEXPECT_FAIL(0, "Cocoa compositor paints child and sibling", Continue);
#endif #endif
@ -4904,7 +4904,7 @@ void tst_QWidget::update()
} }
} }
#ifndef Q_OS_OSX #ifndef Q_OS_MACOS
static inline bool isOpaque(QWidget *widget) static inline bool isOpaque(QWidget *widget)
{ {
if (!widget) if (!widget)
@ -4915,7 +4915,7 @@ static inline bool isOpaque(QWidget *widget)
void tst_QWidget::isOpaque() void tst_QWidget::isOpaque()
{ {
#ifndef Q_OS_OSX #ifndef Q_OS_MACOS
QWidget w; QWidget w;
QVERIFY(::isOpaque(&w)); QVERIFY(::isOpaque(&w));
@ -4987,7 +4987,7 @@ void tst_QWidget::isOpaque()
#endif #endif
} }
#ifndef Q_OS_OSX #ifndef Q_OS_MACOS
/* /*
Test that scrolling of a widget invalidates the correct regions Test that scrolling of a widget invalidates the correct regions
*/ */
@ -5431,7 +5431,7 @@ void tst_QWidget::windowMoveResize()
widget.move(r.topLeft()); widget.move(r.topLeft());
widget.resize(r.size()); widget.resize(r.size());
QApplication::processEvents(); QApplication::processEvents();
#if defined(Q_OS_OSX) #if defined(Q_OS_MACOS)
if (r.width() == 0 && r.height() > 0) { if (r.width() == 0 && r.height() > 0) {
widget.move(r.topLeft()); widget.move(r.topLeft());
widget.resize(r.size()); widget.resize(r.size());
@ -5502,7 +5502,7 @@ void tst_QWidget::windowMoveResize()
widget.move(r.topLeft()); widget.move(r.topLeft());
widget.resize(r.size()); widget.resize(r.size());
QApplication::processEvents(); QApplication::processEvents();
#if defined(Q_OS_OSX) #if defined(Q_OS_MACOS)
if (r.width() == 0 && r.height() > 0) { if (r.width() == 0 && r.height() > 0) {
widget.move(r.topLeft()); widget.move(r.topLeft());
widget.resize(r.size()); widget.resize(r.size());
@ -5689,7 +5689,7 @@ void tst_QWidget::moveChild()
QTRY_COMPARE(pos, child.pos()); QTRY_COMPARE(pos, child.pos());
QTRY_COMPARE(parent.r, QRegion(oldGeometry) - child.geometry()); QTRY_COMPARE(parent.r, QRegion(oldGeometry) - child.geometry());
#if !defined(Q_OS_OSX) #if !defined(Q_OS_MACOS)
// should be scrolled in backingstore // should be scrolled in backingstore
QCOMPARE(child.r, QRegion()); QCOMPARE(child.r, QRegion());
#endif #endif
@ -5739,7 +5739,7 @@ void tst_QWidget::showAndMoveChild()
void tst_QWidget::subtractOpaqueSiblings() void tst_QWidget::subtractOpaqueSiblings()
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
QSKIP("QTBUG-52974: Cocoa only has rect granularity."); QSKIP("QTBUG-52974: Cocoa only has rect granularity.");
#endif #endif
@ -5816,7 +5816,7 @@ public slots:
void tst_QWidget::multipleToplevelFocusCheck() void tst_QWidget::multipleToplevelFocusCheck()
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
QSKIP("QTBUG-52974"); QSKIP("QTBUG-52974");
#endif #endif
@ -7584,7 +7584,7 @@ void tst_QWidget::render_systemClip()
// rrrrrrrrrr // rrrrrrrrrr
// ... // ...
#ifndef Q_OS_OSX #ifndef Q_OS_MACOS
for (int i = 0; i < image.height(); ++i) { for (int i = 0; i < image.height(); ++i) {
for (int j = 0; j < image.width(); ++j) { for (int j = 0; j < image.width(); ++j) {
if (i < 50 && j < i) if (i < 50 && j < i)
@ -8618,11 +8618,11 @@ void tst_QWidget::sendUpdateRequestImmediately()
void tst_QWidget::doubleRepaint() void tst_QWidget::doubleRepaint()
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
QSKIP("QTBUG-52974"); QSKIP("QTBUG-52974");
#endif #endif
#if defined(Q_OS_OSX) #if defined(Q_OS_MACOS)
if (!macHasAccessToWindowsServer()) if (!macHasAccessToWindowsServer())
QSKIP("Not having window server access causes the wrong number of repaints to be issues"); QSKIP("Not having window server access causes the wrong number of repaints to be issues");
#endif #endif
@ -9330,7 +9330,7 @@ void tst_QWidget::setClearAndResizeMask()
child.setMask(childMask); child.setMask(childMask);
QTRY_COMPARE(child.mask(), childMask); QTRY_COMPARE(child.mask(), childMask);
// and ensure that the child widget doesn't get any update. // 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. // Mac always issues a full update when calling setMask, and we cannot force it to not do so.
if (child.internalWinId()) if (child.internalWinId())
QCOMPARE(child.numPaintEvents, 1); 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. // and ensure that that the child widget gets an update for the area outside the old mask.
QTRY_COMPARE(child.numPaintEvents, 1); QTRY_COMPARE(child.numPaintEvents, 1);
outsideOldMask = child.rect(); 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. // Mac always issues a full update when calling setMask, and we cannot force it to not do so.
if (!child.internalWinId()) if (!child.internalWinId())
#endif #endif
@ -9366,7 +9366,7 @@ void tst_QWidget::setClearAndResizeMask()
// Mask child widget with a mask that is bigger than the rect // Mask child widget with a mask that is bigger than the rect
child.setMask(QRegion(0, 0, 1000, 1000)); 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. // Mac always issues a full update when calling setMask, and we cannot force it to not do so.
if (child.internalWinId()) if (child.internalWinId())
QTRY_COMPARE(child.numPaintEvents, 1); QTRY_COMPARE(child.numPaintEvents, 1);
@ -9379,7 +9379,7 @@ void tst_QWidget::setClearAndResizeMask()
// ...and the same applies when clearing the mask. // ...and the same applies when clearing the mask.
child.clearMask(); child.clearMask();
QTest::qWait(100); 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. // Mac always issues a full update when calling setMask, and we cannot force it to not do so.
if (child.internalWinId()) if (child.internalWinId())
QTRY_VERIFY(child.numPaintEvents > 0); QTRY_VERIFY(child.numPaintEvents > 0);
@ -9409,7 +9409,7 @@ void tst_QWidget::setClearAndResizeMask()
QTimer::singleShot(100, &resizeChild, SLOT(shrinkMask())); QTimer::singleShot(100, &resizeChild, SLOT(shrinkMask()));
QTest::qWait(200); 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. // Mac always issues a full update when calling setMask, and we cannot force it to not do so.
if (child.internalWinId()) if (child.internalWinId())
QTRY_COMPARE(resizeChild.paintedRegion, resizeChild.mask()); QTRY_COMPARE(resizeChild.paintedRegion, resizeChild.mask());
@ -9421,7 +9421,7 @@ void tst_QWidget::setClearAndResizeMask()
const QRegion oldMask = resizeChild.mask(); const QRegion oldMask = resizeChild.mask();
QTimer::singleShot(0, &resizeChild, SLOT(enlargeMask())); QTimer::singleShot(0, &resizeChild, SLOT(enlargeMask()));
QTest::qWait(100); 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. // Mac always issues a full update when calling setMask, and we cannot force it to not do so.
if (child.internalWinId()) if (child.internalWinId())
QTRY_COMPARE(resizeChild.paintedRegion, resizeChild.mask()); QTRY_COMPARE(resizeChild.paintedRegion, resizeChild.mask());
@ -10265,7 +10265,7 @@ void tst_QWidget::childAt()
QCOMPARE(parent.childAt(120, 120), grandChild); QCOMPARE(parent.childAt(120, 120), grandChild);
} }
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
void tst_QWidget::taskQTBUG_11373() void tst_QWidget::taskQTBUG_11373()
{ {
@ -11121,7 +11121,7 @@ public:
// when mousing over it. // when mousing over it.
void tst_QWidget::taskQTBUG_27643_enterEvents() void tst_QWidget::taskQTBUG_27643_enterEvents()
{ {
#ifdef Q_OS_OSX #ifdef Q_OS_MACOS
QSKIP("QTBUG-52974: this test can crash!"); QSKIP("QTBUG-52974: this test can crash!");
#endif #endif
// Move the mouse cursor to a safe location so it won't interfere // Move the mouse cursor to a safe location so it won't interfere

View File

@ -995,7 +995,7 @@ void tst_QStyleSheetStyle::focusColors()
#ifndef QT_NO_CURSOR #ifndef QT_NO_CURSOR
void tst_QStyleSheetStyle::hoverColors() 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."); QSKIP("This test is fragile on Mac, most likely due to QTBUG-33959.");
#endif #endif
if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive)) if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive))

View File

@ -1525,7 +1525,7 @@ void tst_QMenuBar::cornerWidgets()
QFETCH(Qt::Corner, corner); QFETCH(Qt::Corner, corner);
#if defined(Q_OS_OSX) #if defined(Q_OS_MACOS)
QSKIP("Test interferes with native menu bars on this platform"); QSKIP("Test interferes with native menu bars on this platform");
#endif #endif

View File

@ -579,7 +579,7 @@ bool verifyColor(const QWidget *widget, const QRect &clipArea, const QColor &col
void tst_QOpenGLWidget::stackWidgetOpaqueChildIsVisible() 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"); QSKIP("QScreen::grabWindow() doesn't work properly on OSX HighDPI screen: QTBUG-46803");
return; return;
#endif #endif