Utilize the new Q_OS_MACX define.

All occurrences of `#if defined(Q_OS_MAC) && !defined(Q_OS_IOS)` have
been replaced with `#if defined(Q_OS_MACX)`.

Change-Id: I5055d9bd1845136beb8ed1c79a8f0f2c0897751a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Jake Petroules 2013-05-08 08:25:15 -04:00 committed by The Qt Project
parent bf10f2be19
commit f7eea69a2a
15 changed files with 43 additions and 43 deletions

View File

@ -72,7 +72,7 @@
# include <envLib.h> # include <envLib.h>
#endif #endif
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
#include <CoreServices/CoreServices.h> #include <CoreServices/CoreServices.h>
#endif #endif
@ -1660,7 +1660,7 @@ static const unsigned int qt_one = 1;
const int QSysInfo::ByteOrder = ((*((unsigned char *) &qt_one) == 0) ? BigEndian : LittleEndian); const int QSysInfo::ByteOrder = ((*((unsigned char *) &qt_one) == 0) ? BigEndian : LittleEndian);
#endif #endif
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
QT_BEGIN_INCLUDE_NAMESPACE QT_BEGIN_INCLUDE_NAMESPACE
#include "private/qcore_mac_p.h" #include "private/qcore_mac_p.h"
@ -1682,7 +1682,7 @@ Q_CORE_EXPORT void qt_mac_to_pascal_string(QString s, Str255 str, TextEncoding e
Q_CORE_EXPORT QString qt_mac_from_pascal_string(const Str255 pstr) { Q_CORE_EXPORT QString qt_mac_from_pascal_string(const Str255 pstr) {
return QCFString(CFStringCreateWithPascalString(0, pstr, CFStringGetSystemEncoding())); return QCFString(CFStringCreateWithPascalString(0, pstr, CFStringGetSystemEncoding()));
} }
#endif // defined(Q_OS_MAC) && !defined(Q_OS_IOS) #endif // defined(Q_OS_MACX)
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)

View File

@ -272,7 +272,7 @@ void QFileSystemMetaData::fillFromStatBuf(const QT_STATBUF &statBuffer)
// Attributes // Attributes
entryFlags |= QFileSystemMetaData::ExistsAttribute; entryFlags |= QFileSystemMetaData::ExistsAttribute;
size_ = statBuffer.st_size; size_ = statBuffer.st_size;
#if defined (Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
if (statBuffer.st_flags & UF_HIDDEN) { if (statBuffer.st_flags & UF_HIDDEN) {
entryFlags |= QFileSystemMetaData::HiddenAttribute; entryFlags |= QFileSystemMetaData::HiddenAttribute;
knownFlagsMask |= QFileSystemMetaData::HiddenAttribute; knownFlagsMask |= QFileSystemMetaData::HiddenAttribute;

View File

@ -84,7 +84,7 @@ public:
static QString resolveGroupName(uint groupId); static QString resolveGroupName(uint groupId);
#endif #endif
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
static QString bundleName(const QFileSystemEntry &entry); static QString bundleName(const QFileSystemEntry &entry);
#else #else
static QString bundleName(const QFileSystemEntry &entry) { Q_UNUSED(entry) return QString(); } static QString bundleName(const QFileSystemEntry &entry) { Q_UNUSED(entry) return QString(); }

View File

@ -59,7 +59,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
static inline bool _q_isMacHidden(const char *nativePath) static inline bool _q_isMacHidden(const char *nativePath)
{ {
OSErr err; OSErr err;
@ -143,7 +143,7 @@ QFileSystemEntry QFileSystemEngine::getLinkTarget(const QFileSystemEntry &link,
ret.chop(1); ret.chop(1);
return QFileSystemEntry(ret); return QFileSystemEntry(ret);
} }
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
{ {
FSRef fref; FSRef fref;
if (FSPathMakeRef((const UInt8 *)QFile::encodeName(QDir::cleanPath(link.filePath())).data(), &fref, 0) == noErr) { if (FSPathMakeRef((const UInt8 *)QFile::encodeName(QDir::cleanPath(link.filePath())).data(), &fref, 0) == noErr) {
@ -175,7 +175,7 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry,
return QFileSystemEntry(slowCanonicalized(absoluteName(entry).filePath())); return QFileSystemEntry(slowCanonicalized(absoluteName(entry).filePath()));
#else #else
char *ret = 0; char *ret = 0;
# if defined(Q_OS_MAC) && !defined(Q_OS_IOS) # if defined(Q_OS_MACX)
// When using -mmacosx-version-min=10.4, we get the legacy realpath implementation, // When using -mmacosx-version-min=10.4, we get the legacy realpath implementation,
// which does not work properly with the realpath(X,0) form. See QTBUG-28282. // which does not work properly with the realpath(X,0) form. See QTBUG-28282.
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) { if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) {
@ -335,7 +335,7 @@ QString QFileSystemEngine::resolveGroupName(uint groupId)
return QString(); return QString();
} }
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
//static //static
QString QFileSystemEngine::bundleName(const QFileSystemEntry &entry) QString QFileSystemEngine::bundleName(const QFileSystemEntry &entry)
{ {
@ -355,7 +355,7 @@ QString QFileSystemEngine::bundleName(const QFileSystemEntry &entry)
bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data, bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data,
QFileSystemMetaData::MetaDataFlags what) QFileSystemMetaData::MetaDataFlags what)
{ {
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
if (what & QFileSystemMetaData::BundleType) { if (what & QFileSystemMetaData::BundleType) {
if (!data.hasFlags(QFileSystemMetaData::DirectoryType)) if (!data.hasFlags(QFileSystemMetaData::DirectoryType))
what |= QFileSystemMetaData::DirectoryType; what |= QFileSystemMetaData::DirectoryType;
@ -364,7 +364,7 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
// Mac OS >= 10.5: st_flags & UF_HIDDEN // Mac OS >= 10.5: st_flags & UF_HIDDEN
what |= QFileSystemMetaData::PosixStatFlags; what |= QFileSystemMetaData::PosixStatFlags;
} }
#endif // defined(Q_OS_MAC) && !defined(Q_OS_IOS) #endif // defined(Q_OS_MACX)
if (what & QFileSystemMetaData::PosixStatFlags) if (what & QFileSystemMetaData::PosixStatFlags)
what |= QFileSystemMetaData::PosixStatFlags; what |= QFileSystemMetaData::PosixStatFlags;
@ -425,7 +425,7 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
| QFileSystemMetaData::ExistsAttribute; | QFileSystemMetaData::ExistsAttribute;
} }
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
if (what & QFileSystemMetaData::AliasType) if (what & QFileSystemMetaData::AliasType)
{ {
if (entryExists) { if (entryExists) {
@ -471,7 +471,7 @@ bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemM
data.knownFlagsMask |= QFileSystemMetaData::HiddenAttribute; data.knownFlagsMask |= QFileSystemMetaData::HiddenAttribute;
} }
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
if (what & QFileSystemMetaData::BundleType) { if (what & QFileSystemMetaData::BundleType) {
if (entryExists && data.isDirectory()) { if (entryExists && data.isDirectory()) {
QCFType<CFStringRef> path = CFStringCreateWithBytes(0, QCFType<CFStringRef> path = CFStringCreateWithBytes(0,

View File

@ -100,7 +100,7 @@ public:
LinkType = 0x00010000, LinkType = 0x00010000,
FileType = 0x00020000, FileType = 0x00020000,
DirectoryType = 0x00040000, DirectoryType = 0x00040000,
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
BundleType = 0x00080000, BundleType = 0x00080000,
AliasType = 0x08000000, AliasType = 0x08000000,
#else #else
@ -248,7 +248,7 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QFileSystemMetaData::MetaDataFlags) Q_DECLARE_OPERATORS_FOR_FLAGS(QFileSystemMetaData::MetaDataFlags)
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
inline bool QFileSystemMetaData::isBundle() const { return (entryFlags & BundleType); } inline bool QFileSystemMetaData::isBundle() const { return (entryFlags & BundleType); }
inline bool QFileSystemMetaData::isAlias() const { return (entryFlags & AliasType); } inline bool QFileSystemMetaData::isAlias() const { return (entryFlags & AliasType); }
#else #else

View File

@ -2340,7 +2340,7 @@ bool QProcess::startDetached(const QString &program)
} }
QT_BEGIN_INCLUDE_NAMESPACE QT_BEGIN_INCLUDE_NAMESPACE
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
# include <crt_externs.h> # include <crt_externs.h>
# define environ (*_NSGetEnviron()) # define environ (*_NSGetEnviron())
#elif defined(Q_OS_WINCE) || defined(Q_OS_IOS) #elif defined(Q_OS_WINCE) || defined(Q_OS_IOS)

View File

@ -472,7 +472,7 @@ bool QProcessPrivate::createChannel(Channel &channel)
} }
QT_BEGIN_INCLUDE_NAMESPACE QT_BEGIN_INCLUDE_NAMESPACE
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
# include <crt_externs.h> # include <crt_externs.h>
# define environ (*_NSGetEnviron()) # define environ (*_NSGetEnviron())
#else #else

View File

@ -55,14 +55,14 @@
#endif #endif
#include "qvariant.h" #include "qvariant.h"
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
#include <QtCore/private/qcore_mac_p.h> #include <QtCore/private/qcore_mac_p.h>
#include <Carbon/Carbon.h> #include <Carbon/Carbon.h>
#endif #endif
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
static bool qt_sequence_no_mnemonics = true; static bool qt_sequence_no_mnemonics = true;
struct MacSpecialKey { struct MacSpecialKey {
int key; int key;
@ -975,7 +975,7 @@ QKeySequence::QKeySequence(const QKeySequence& keysequence)
d->ref.ref(); d->ref.ref();
} }
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
static inline int maybeSwapShortcut(int shortcut) static inline int maybeSwapShortcut(int shortcut)
{ {
if (qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta)) { if (qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta)) {
@ -1007,7 +1007,7 @@ QList<QKeySequence> QKeySequence::keyBindings(StandardKey key)
QKeyBinding keyBinding = QKeySequencePrivate::keyBindings[i]; QKeyBinding keyBinding = QKeySequencePrivate::keyBindings[i];
if (keyBinding.standardKey == key && (keyBinding.platform & platform)) { if (keyBinding.standardKey == key && (keyBinding.platform & platform)) {
uint shortcut = uint shortcut =
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
maybeSwapShortcut(QKeySequencePrivate::keyBindings[i].shortcut); maybeSwapShortcut(QKeySequencePrivate::keyBindings[i].shortcut);
#else #else
QKeySequencePrivate::keyBindings[i].shortcut; QKeySequencePrivate::keyBindings[i].shortcut;
@ -1209,7 +1209,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
if (nativeText) { if (nativeText) {
gmodifs = globalModifs(); gmodifs = globalModifs();
if (gmodifs->isEmpty()) { if (gmodifs->isEmpty()) {
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
const bool dontSwap = qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta); const bool dontSwap = qApp->testAttribute(Qt::AA_MacDontSwapCtrlAndMeta);
if (dontSwap) if (dontSwap)
*gmodifs << QModifKeyName(Qt::META, QChar(kCommandUnicode)); *gmodifs << QModifKeyName(Qt::META, QChar(kCommandUnicode));
@ -1252,7 +1252,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
modifs += *gmodifs; // Test non-translated ones last modifs += *gmodifs; // Test non-translated ones last
QString sl = accel; QString sl = accel;
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
for (int i = 0; i < modifs.size(); ++i) { for (int i = 0; i < modifs.size(); ++i) {
const QModifKeyName &mkf = modifs.at(i); const QModifKeyName &mkf = modifs.at(i);
if (sl.contains(mkf.name)) { if (sl.contains(mkf.name)) {
@ -1304,7 +1304,7 @@ int QKeySequencePrivate::decodeString(const QString &str, QKeySequence::Sequence
int fnum = 0; int fnum = 0;
if (accel.length() == 1) { if (accel.length() == 1) {
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
int qtKey = qtkeyForMacSymbol(accel[0]); int qtKey = qtkeyForMacSymbol(accel[0]);
if (qtKey != -1) { if (qtKey != -1) {
ret |= qtKey; ret |= qtKey;
@ -1383,7 +1383,7 @@ QString QKeySequencePrivate::encodeString(int key, QKeySequence::SequenceFormat
if (key == -1 || key == Qt::Key_unknown) if (key == -1 || key == Qt::Key_unknown)
return s; return s;
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
if (nativeText) { if (nativeText) {
// On Mac OS X the order (by default) is Meta, Alt, Shift, Control. // On Mac OS X the order (by default) is Meta, Alt, Shift, Control.
// If the AA_MacDontSwapCtrlAndMeta is enabled, then the order // If the AA_MacDontSwapCtrlAndMeta is enabled, then the order
@ -1441,7 +1441,7 @@ QString QKeySequencePrivate::encodeString(int key, QKeySequence::SequenceFormat
: QString::fromLatin1("F%1").arg(key - Qt::Key_F1 + 1); : QString::fromLatin1("F%1").arg(key - Qt::Key_F1 + 1);
} else if (key) { } else if (key) {
int i=0; int i=0;
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
if (nativeText) { if (nativeText) {
QChar ch = qt_macSymbolForQtKey(key); QChar ch = qt_macSymbolForQtKey(key);
if (!ch.isNull()) if (!ch.isNull())
@ -1451,7 +1451,7 @@ QString QKeySequencePrivate::encodeString(int key, QKeySequence::SequenceFormat
} else } else
#endif #endif
{ {
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
NonSymbol: NonSymbol:
#endif #endif
while (keyname[i].name) { while (keyname[i].name) {
@ -1477,7 +1477,7 @@ NonSymbol:
} }
} }
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
if (nativeText) if (nativeText)
s += p; s += p;
else else

View File

@ -82,7 +82,7 @@ Q_GLOBAL_STATIC(QNetworkAccessFtpBackendFactory, ftpBackend)
Q_GLOBAL_STATIC(QNetworkAccessDebugPipeBackendFactory, debugpipeBackend) Q_GLOBAL_STATIC(QNetworkAccessDebugPipeBackendFactory, debugpipeBackend)
#endif #endif
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
#include <CoreServices/CoreServices.h> #include <CoreServices/CoreServices.h>
#include <SystemConfiguration/SystemConfiguration.h> #include <SystemConfiguration/SystemConfiguration.h>
@ -1246,7 +1246,7 @@ void QNetworkAccessManagerPrivate::authenticationRequired(QAuthenticator *authen
} }
#ifndef QT_NO_NETWORKPROXY #ifndef QT_NO_NETWORKPROXY
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
//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

@ -78,7 +78,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
#define kSecTrustSettingsDomainSystem 2 // so we do not need to include the header file #define kSecTrustSettingsDomainSystem 2 // so we do not need to include the header file
PtrSecCertificateGetData QSslSocketPrivate::ptrSecCertificateGetData = 0; PtrSecCertificateGetData QSslSocketPrivate::ptrSecCertificateGetData = 0;
PtrSecTrustSettingsCopyCertificates QSslSocketPrivate::ptrSecTrustSettingsCopyCertificates = 0; PtrSecTrustSettingsCopyCertificates QSslSocketPrivate::ptrSecTrustSettingsCopyCertificates = 0;
@ -489,7 +489,7 @@ void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
#ifndef QT_NO_LIBRARY #ifndef QT_NO_LIBRARY
//load symbols needed to receive certificates from system store //load symbols needed to receive certificates from system store
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
QLibrary securityLib("/System/Library/Frameworks/Security.framework/Versions/Current/Security"); QLibrary securityLib("/System/Library/Frameworks/Security.framework/Versions/Current/Security");
if (securityLib.load()) { if (securityLib.load()) {
ptrSecCertificateGetData = (PtrSecCertificateGetData) securityLib.resolve("SecCertificateGetData"); ptrSecCertificateGetData = (PtrSecCertificateGetData) securityLib.resolve("SecCertificateGetData");
@ -623,7 +623,7 @@ QList<QSslCertificate> QSslSocketPrivate::systemCaCertificates()
timer.start(); timer.start();
#endif #endif
QList<QSslCertificate> systemCerts; QList<QSslCertificate> systemCerts;
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
CFArrayRef cfCerts; CFArrayRef cfCerts;
OSStatus status = 1; OSStatus status = 1;

View File

@ -78,7 +78,7 @@
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
typedef OSStatus (*PtrSecCertificateGetData)(SecCertificateRef, CSSM_DATA_PTR); typedef OSStatus (*PtrSecCertificateGetData)(SecCertificateRef, CSSM_DATA_PTR);
typedef OSStatus (*PtrSecTrustSettingsCopyCertificates)(int, CFArrayRef*); typedef OSStatus (*PtrSecTrustSettingsCopyCertificates)(int, CFArrayRef*);
typedef OSStatus (*PtrSecTrustCopyAnchorCertificates)(CFArrayRef*); typedef OSStatus (*PtrSecTrustCopyAnchorCertificates)(CFArrayRef*);
@ -145,7 +145,7 @@ public:
static void addDefaultCaCertificate(const QSslCertificate &cert); static void addDefaultCaCertificate(const QSslCertificate &cert);
static void addDefaultCaCertificates(const QList<QSslCertificate> &certs); static void addDefaultCaCertificates(const QList<QSslCertificate> &certs);
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
static PtrSecCertificateGetData ptrSecCertificateGetData; static PtrSecCertificateGetData ptrSecCertificateGetData;
static PtrSecTrustSettingsCopyCertificates ptrSecTrustSettingsCopyCertificates; static PtrSecTrustSettingsCopyCertificates ptrSecTrustSettingsCopyCertificates;
static PtrSecTrustCopyAnchorCertificates ptrSecTrustCopyAnchorCertificates; static PtrSecTrustCopyAnchorCertificates ptrSecTrustCopyAnchorCertificates;

View File

@ -84,7 +84,7 @@
#include <time.h> #include <time.h>
#endif #endif
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
#include <IOKit/pwr_mgt/IOPMLib.h> #include <IOKit/pwr_mgt/IOPMLib.h>
#endif #endif
@ -2130,7 +2130,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
int callgrindChildExitCode = 0; int callgrindChildExitCode = 0;
#endif #endif
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
bool macNeedsActivate = qApp && (qstrcmp(qApp->metaObject()->className(), "QApplication") == 0); bool macNeedsActivate = qApp && (qstrcmp(qApp->metaObject()->className(), "QApplication") == 0);
IOPMAssertionID powerID; IOPMAssertionID powerID;
#endif #endif
@ -2145,7 +2145,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
SetErrorMode(SetErrorMode(0) | SEM_NOGPFAULTERRORBOX); SetErrorMode(SetErrorMode(0) | SEM_NOGPFAULTERRORBOX);
#endif #endif
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
if (macNeedsActivate) { if (macNeedsActivate) {
CFStringRef reasonForActivity= CFSTR("No Display Sleep"); CFStringRef reasonForActivity= CFSTR("No Display Sleep");
IOReturn ok = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, reasonForActivity, &powerID); IOReturn ok = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, reasonForActivity, &powerID);
@ -2198,7 +2198,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
} }
QTestLog::stopLogging(); QTestLog::stopLogging();
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
if (macNeedsActivate) { if (macNeedsActivate) {
IOPMAssertionRelease(powerID); IOPMAssertionRelease(powerID);
} }
@ -2215,7 +2215,7 @@ int QTest::qExec(QObject *testObject, int argc, char **argv)
QSignalDumper::endDump(); QSignalDumper::endDump();
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
if (macNeedsActivate) { if (macNeedsActivate) {
IOPMAssertionRelease(powerID); IOPMAssertionRelease(powerID);
} }

View File

@ -59,7 +59,7 @@ QPanGestureRecognizer::QPanGestureRecognizer()
QGesture *QPanGestureRecognizer::create(QObject *target) QGesture *QPanGestureRecognizer::create(QObject *target)
{ {
if (target && target->isWidgetType()) { if (target && target->isWidgetType()) {
#if ((defined(Q_OS_MAC) && !defined(Q_OS_IOS)) || defined(Q_OS_WIN)) && !defined(QT_NO_NATIVE_GESTURES) #if (defined(Q_OS_MACX) || defined(Q_OS_WIN)) && !defined(QT_NO_NATIVE_GESTURES)
// for scroll areas on Windows and Mac OS X we want to use native gestures instead // for scroll areas on Windows and Mac OS X we want to use native gestures instead
if (!qobject_cast<QAbstractScrollArea *>(target->parent())) if (!qobject_cast<QAbstractScrollArea *>(target->parent()))
static_cast<QWidget *>(target)->setAttribute(Qt::WA_AcceptTouchEvents); static_cast<QWidget *>(target)->setAttribute(Qt::WA_AcceptTouchEvents);

View File

@ -88,7 +88,7 @@ public:
// On mac we want a standard blue color used when the system palette is used // On mac we want a standard blue color used when the system palette is used
bool isMacSystemPalette(const QPalette &pal) const { bool isMacSystemPalette(const QPalette &pal) const {
Q_UNUSED(pal); Q_UNUSED(pal);
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
const QPalette *themePalette = QGuiApplicationPrivate::platformTheme()->palette(); const QPalette *themePalette = QGuiApplicationPrivate::platformTheme()->palette();
if (themePalette && themePalette->color(QPalette::Normal, QPalette::Highlight) == if (themePalette && themePalette->color(QPalette::Normal, QPalette::Highlight) ==
pal.color(QPalette::Normal, QPalette::Highlight) && pal.color(QPalette::Normal, QPalette::Highlight) &&

View File

@ -206,7 +206,7 @@ void QStyleOption::init(const QWidget *widget)
if (!(state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget)) if (!(state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget))
state &= ~QStyle::State_Enabled; state &= ~QStyle::State_Enabled;
#endif #endif
#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) #if defined(Q_OS_MACX)
switch (QMacStyle::widgetSizePolicy(widget)) { switch (QMacStyle::widgetSizePolicy(widget)) {
case QMacStyle::SizeSmall: case QMacStyle::SizeSmall:
state |= QStyle::State_Small; state |= QStyle::State_Small;