# include "../../plugins/codecs/kr/qeuckrcodec.h"
# include "../../plugins/codecs/tw/qbig5codec.h"
# endif // QT_NO_ICONV
-# if defined(Q_WS_X11) && !defined(QT_BOOTSTRAPPED)
+# if defined(Q_OS_UNIX) && !defined(QT_BOOTSTRAPPED)
# include "qfontlaocodec_p.h"
# include "../../plugins/codecs/jp/qfontjpcodec.h"
# endif
localeMapper = QSymbianTextCodec::init();
#endif
-# if defined(Q_WS_X11) && !defined(QT_BOOTSTRAPPED)
+# if defined(Q_OS_UNIX) && !defined(QT_BOOTSTRAPPED)
// no font codecs when bootstrapping
(void)new QFontLaoCodec;
# if defined(QT_NO_ICONV)
(void)new QFontBig5hkscsCodec;
(void)new QFontBig5Codec;
# endif // QT_NO_ICONV && !QT_BOOTSTRAPPED
-# endif // Q_WS_X11
+# endif // Q_OS_UNIX
#if !defined(Q_OS_SYMBIAN) && !defined(Q_OS_INTEGRITY)
include(statemachine/statemachine.pri)
include(xml/xml.pri)
-!qpa:mac|darwin:LIBS_PRIVATE += -framework ApplicationServices
-qpa {
+mac|darwin {
contains(QT_CONFIG, coreservices) {
+ LIBS_PRIVATE += -framework ApplicationServices
LIBS_PRIVATE += -framework CoreServices
}
-} else:mac|darwin {
- LIBS_PRIVATE += -framework CoreFoundation
+ LIBS_PRIVATE += -framework CoreFoundation
}
mac:lib_bundle:DEFINES += QT_NO_DEBUG_PLUGIN_CHECK
win32:DEFINES-=QT_NO_CAST_TO_ASCII
\endlist
Some constants are defined only on certain platforms. You can use
- the preprocessor symbols Q_WS_WIN and Q_WS_MAC to test that
+ the preprocessor symbols Q_OS_WIN and Q_OS_MAC to test that
the application is compiled under Windows or Mac.
\sa QLibraryInfo
*/
/*!
- \macro Q_WS_MAC
- \relates <QtGlobal>
-
- Defined on Mac OS X.
-
- \sa Q_WS_WIN, Q_WS_X11, Q_WS_QWS, Q_WS_QPA, Q_WS_S60
-*/
-
-/*!
- \macro Q_WS_WIN
- \relates <QtGlobal>
-
- Defined on Windows.
-
- \sa Q_WS_MAC, Q_WS_X11, Q_WS_QWS, Q_WS_QPA, Q_WS_S60
-*/
-
-/*!
- \macro Q_WS_X11
- \relates <QtGlobal>
-
- Defined on X11.
-
- \sa Q_WS_MAC, Q_WS_WIN, Q_WS_QWS, Q_WS_QPA, Q_WS_S60
-*/
-
-/*!
- \macro Q_WS_QWS
- \relates <QtGlobal>
-
- Defined on Qt for Embedded Linux.
-
- \sa Q_WS_MAC, Q_WS_WIN, Q_WS_X11, Q_WS_QPA, Q_WS_S60
-*/
-
-/*!
- \macro Q_WS_QPA
- \relates <QtGlobal>
-
- Defined on Qt for Embedded Linux, Lite version.
-
- \sa Q_WS_MAC, Q_WS_WIN, Q_WS_X11, Q_WS_QWS, Q_WS_S60
-*/
-
-/*!
\macro Q_OS_DARWIN
\relates <QtGlobal>
*/
/*!
- \macro Q_OS_MSDOS
- \relates <QtGlobal>
-
- Defined on MS-DOS and Windows.
-*/
-
-/*!
- \macro Q_OS_OS2
- \relates <QtGlobal>
-
- Defined on OS/2.
-*/
-
-/*!
- \macro Q_OS_OS2EMX
- \relates <QtGlobal>
-
- Defined on XFree86 on OS/2 (not PM).
-*/
-
-/*!
\macro Q_OS_WIN32
\relates <QtGlobal>
*/
/*!
- \macro Q_WS_S60
- \relates <QtGlobal>
-
- Defined on S60 with the Avkon UI framework.
-
- \sa Q_WS_MAC, Q_WS_WIN, Q_WS_X11, Q_WS_QWS
- */
-
-/*!
\macro QT_DISABLE_DEPRECATED_BEFORE
\relates <QtGlobal>
const int QSysInfo::ByteOrder = ((*((unsigned char *) &qt_one) == 0) ? BigEndian : LittleEndian);
#endif
-#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
QT_BEGIN_INCLUDE_NAMESPACE
#include "private/qcore_mac_p.h"
return FSPathMakeRef(reinterpret_cast<const UInt8 *>(file.toUtf8().constData()), fsref, 0);
}
-// Don't use this function, it won't work in 10.5 (Leopard) and up
-Q_CORE_EXPORT OSErr qt_mac_create_fsspec(const QString &file, FSSpec *spec)
-{
- FSRef fsref;
- OSErr ret = qt_mac_create_fsref(file, &fsref);
- if (ret == noErr)
- ret = FSGetCatalogInfo(&fsref, kFSCatInfoNone, 0, 0, spec, 0);
- return ret;
-}
-
Q_CORE_EXPORT void qt_mac_to_pascal_string(QString s, Str255 str, TextEncoding encoding=0, int len=-1)
{
- if(len == -1)
- len = s.length();
-#if 0
- UnicodeMapping mapping;
- mapping.unicodeEncoding = CreateTextEncoding(kTextEncodingUnicodeDefault,
- kTextEncodingDefaultVariant,
- kUnicode16BitFormat);
- mapping.otherEncoding = (encoding ? encoding : );
- mapping.mappingVersion = kUnicodeUseLatestMapping;
-
- UnicodeToTextInfo info;
- OSStatus err = CreateUnicodeToTextInfo(&mapping, &info);
- if(err != noErr) {
- qDebug("Qt: internal: Unable to create pascal string '%s'::%d [%ld]",
- s.left(len).latin1(), (int)encoding, err);
- return;
- }
- const int unilen = len * 2;
- const UniChar *unibuf = (UniChar *)s.unicode();
- ConvertFromUnicodeToPString(info, unilen, unibuf, str);
- DisposeUnicodeToTextInfo(&info);
-#else
Q_UNUSED(encoding);
+ Q_UNUSED(len);
CFStringGetPascalString(QCFString(s), str, 256, CFStringGetSystemEncoding());
-#endif
}
Q_CORE_EXPORT QString qt_mac_from_pascal_string(const Str255 pstr) {
return QCFString(CFStringCreateWithPascalString(0, pstr, CFStringGetSystemEncoding()));
}
-#endif //!defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC)
+#endif // defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
-#if !defined(QWS) && defined(Q_OS_MAC)
+#if defined(Q_OS_MAC)
static QSysInfo::MacVersion macVersion()
{
}
const QSysInfo::MacVersion QSysInfo::MacintoshVersion = macVersion();
-#elif defined(Q_OS_WIN32) || defined(Q_OS_CYGWIN) || defined(Q_OS_WINCE)
+#elif defined(Q_OS_WIN) || defined(Q_OS_CYGWIN) || defined(Q_OS_WINCE)
QT_BEGIN_INCLUDE_NAMESPACE
#include "qt_windows.h"
# define QT_NO_GETIFADDRS
#elif defined(__CYGWIN__)
# define Q_OS_CYGWIN
-#elif defined(MSDOS) || defined(_MSDOS)
-# define Q_OS_MSDOS
-#elif defined(__OS2__)
-# if defined(__EMX__)
-# define Q_OS_OS2EMX
-# else
-# define Q_OS_OS2
-# endif
#elif !defined(SAG_COM) && (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))
# define Q_OS_WIN32
# define Q_OS_WIN64
# endif
#endif
-#if defined(Q_OS_MSDOS) || defined(Q_OS_OS2) || defined(Q_OS_WIN)
+#if defined(Q_OS_WIN)
# undef Q_OS_UNIX
#elif !defined(Q_OS_UNIX)
# define Q_OS_UNIX
# endif
#endif
-/*
- The window system, must be one of: (Q_WS_x)
-
- MACX - Mac OS X
- MAC9 - Mac OS 9
- QWS - Qt for Embedded Linux
- WIN32 - Windows
- X11 - X Window System
- S60 - Symbian S60
- PM - unsupported
- WIN16 - unsupported
-*/
-
-#if defined (Q_WS_QPA)
-
-#elif defined(Q_OS_MSDOS)
-# define Q_WS_WIN16
-# error "Qt requires Win32 and does not work with Windows 3.x"
-#elif defined(_WIN32_X11_)
-# define Q_WS_X11
-#elif defined(Q_OS_WIN32)
-# define Q_WS_WIN32
-# if defined(Q_OS_WIN64)
-# define Q_WS_WIN64
-# endif
-#elif defined(Q_OS_WINCE)
-# define Q_WS_WIN32
-# define Q_WS_WINCE
-# if defined(Q_OS_WINCE_WM)
-# define Q_WS_WINCE_WM
-# endif
-#elif defined(Q_OS_OS2)
-# define Q_WS_PM
-# error "Qt does not work with OS/2 Presentation Manager or Workplace Shell"
-#elif defined(Q_OS_UNIX)
-# if defined(Q_OS_SYMBIAN)
-# if !defined(QT_NO_S60)
-# define Q_WS_S60
-# endif
-# elif !defined(Q_WS_QWS) && !defined(Q_WS_QPA)
-# define Q_WS_X11
-# endif
-#endif
-
-#if defined(Q_WS_WIN16) || defined(Q_WS_WIN32) || defined(Q_WS_WINCE)
-# define Q_WS_WIN
-#endif
-
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class QDataStream;
-#if defined(Q_WS_MAC)
-# ifndef QMAC_QMENUBAR_NO_EVENT
-# define QMAC_QMENUBAR_NO_EVENT
-# endif
-#endif
-
-#if !defined(Q_WS_QWS) && !defined(QT_NO_COP)
+#if !defined(QT_NO_COP)
# define QT_NO_COP
#endif
# endif
#endif
-#if !(defined(Q_WS_WIN) && !defined(Q_WS_WINCE)) \
- && !(defined(Q_WS_X11) && !defined(QT_NO_FREETYPE)) \
- && !(defined(Q_WS_QPA))
-# define QT_NO_RAWFONT
-#endif
-
namespace QtPrivate {
//like std::enable_if
template <bool B, typename T = void> struct QEnableIf;
};
Q_DECLARE_FLAGS(MatchFlags, MatchFlag)
-#if defined(Q_WS_MAC)
- typedef void * HANDLE;
-#elif defined(Q_WS_WIN)
- typedef void *HANDLE;
-#elif defined(Q_WS_X11)
- typedef unsigned long HANDLE;
-#elif defined(Q_WS_QWS) || defined(Q_WS_QPA)
- typedef void * HANDLE;
-#elif defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_SYMBIAN)
typedef unsigned long int HANDLE; // equivalent to TUint32
+#else
+ typedef void * HANDLE;
#endif
typedef WindowFlags WFlags;
#define CLEARTYPE_QUALITY 5
#endif
-#ifdef Q_WS_WINCE
+#ifdef Q_OS_WINCE
#ifndef LR_DEFAULTSIZE
#define LR_DEFAULTSIZE 0
#endif
*/
QString QDir::toNativeSeparators(const QString &pathName)
{
-#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
int i = pathName.indexOf(QLatin1Char('/'));
if (i != -1) {
QString n(pathName);
*/
QString QDir::fromNativeSeparators(const QString &pathName)
{
-#if defined(Q_FS_FAT) || defined(Q_OS_OS2EMX) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
int i = pathName.indexOf(QLatin1Char('\\'));
if (i != -1) {
QString n(pathName);
*/
QChar QDir::separator()
{
-#if defined (Q_FS_FAT) || defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
+#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
return QLatin1Char('\\');
-#elif defined(Q_OS_UNIX)
- return QLatin1Char('/');
-#elif defined (Q_OS_MAC)
- return QLatin1Char(':');
#else
return QLatin1Char('/');
#endif
// Attributes
entryFlags |= QFileSystemMetaData::ExistsAttribute;
size_ = statBuffer.st_size;
-#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC) \
+#if defined (Q_OS_MAC) && !defined(QT_NO_CORESERVICES) \
&& MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
if (statBuffer.st_flags & UF_HIDDEN) {
entryFlags |= QFileSystemMetaData::HiddenAttribute;
static QString resolveGroupName(uint groupId);
#endif
-#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
static QString bundleName(const QFileSystemEntry &entry);
#else
static QString bundleName(const QFileSystemEntry &entry) { Q_UNUSED(entry) return QString(); }
QT_BEGIN_NAMESPACE
-#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
static inline bool _q_isMacHidden(const char *nativePath)
{
OSErr err;
ret.chop(1);
return QFileSystemEntry(ret);
}
-#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
{
FSRef fref;
if (FSPathMakeRef((const UInt8 *)QFile::encodeName(QDir::cleanPath(link.filePath())).data(), &fref, 0) == noErr) {
return QString();
}
-#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
//static
QString QFileSystemEngine::bundleName(const QFileSystemEntry &entry)
{
bool QFileSystemEngine::fillMetaData(const QFileSystemEntry &entry, QFileSystemMetaData &data,
QFileSystemMetaData::MetaDataFlags what)
{
-#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
if (what & QFileSystemMetaData::BundleType) {
if (!data.hasFlags(QFileSystemMetaData::DirectoryType))
what |= QFileSystemMetaData::DirectoryType;
}
-#endif
-
-#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC) \
- && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
+# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
if (what & QFileSystemMetaData::HiddenAttribute) {
// Mac OS >= 10.5: st_flags & UF_HIDDEN
what |= QFileSystemMetaData::PosixStatFlags;
}
-#endif
+# endif // MAC_OS_X_VERSION_MAX_ALLOWED...
+#endif // defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
if (what & QFileSystemMetaData::PosixStatFlags)
what |= QFileSystemMetaData::PosixStatFlags;
| QFileSystemMetaData::ExistsAttribute;
}
-#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
if (what & QFileSystemMetaData::AliasType)
{
if (entryExists) {
data.knownFlagsMask |= QFileSystemMetaData::HiddenAttribute;
}
-#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
if (what & QFileSystemMetaData::BundleType) {
if (entryExists && data.isDirectory()) {
QCFType<CFStringRef> path = CFStringCreateWithBytes(0,
{
#if defined(Q_OS_WINCE)
QString ret = QLatin1String("/");
-#elif defined(Q_FS_FAT)
+#else
QString ret = QString::fromLatin1(qgetenv("SystemDrive").constData());
if (ret.isEmpty())
ret = QLatin1String("c:");
ret.append(QLatin1Char('/'));
-#elif defined(Q_OS_OS2EMX)
- char dir[4];
- _abspath(dir, QLatin1String("/"), _MAX_PATH);
- QString ret(dir);
#endif
return ret;
}
#endif
FileType = 0x00020000,
DirectoryType = 0x00040000,
-#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
BundleType = 0x00080000,
AliasType = 0x08000000,
#else
Q_DECLARE_OPERATORS_FOR_FLAGS(QFileSystemMetaData::MetaDataFlags)
-#if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
inline bool QFileSystemMetaData::isBundle() const { return (entryFlags & BundleType); }
inline bool QFileSystemMetaData::isAlias() const { return (entryFlags & AliasType); }
#else
#if !defined(Q_OS_WINCE)
#if defined(Q_OS_WIN32)
quint32 driveBits = (quint32) GetLogicalDrives() & 0x3ffffff;
-#elif defined(Q_OS_OS2EMX)
- quint32 driveBits, cur;
- if (DosQueryCurrentDisk(&cur, &driveBits) != NO_ERROR)
- exit(1);
- driveBits &= 0x3ffffff;
#endif
char driveName[] = "A:/";
if (env == 0) {
userPath = homePath;
userPath += QLatin1Char('/');
-#if defined(Q_WS_QWS) || defined(Q_WS_QPA)
- userPath += QLatin1String("Settings");
-#else
userPath += QLatin1String(".config");
-#endif
} else if (*env == '/') {
userPath = QFile::decodeName(env);
} else {
QT_BEGIN_NAMESPACE
-#if defined(Q_WS_QWS) || defined(Q_WS_QPA)
#define QT_QSETTINGS_ALWAYS_CASE_SENSITIVE_AND_FORGET_ORIGINAL_KEY_ORDER
-#endif
// used in testing framework
#define QSETTINGS_P_H_VERSION 3
kernel/qfunctions_wince.h
}
-mac:!embedded:!qpa{
+mac {
SOURCES += \
kernel/qcoreapplication_mac.cpp
}
#endif
-#if defined(Q_OS_WIN) || defined(Q_WS_MAC)
+#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
extern QString qAppFileName();
#endif
#if defined(Q_OS_WIN)
d->cachedApplicationFilePath = QFileInfo(qAppFileName()).filePath();
return d->cachedApplicationFilePath;
-#elif defined(Q_WS_MAC)
+#elif defined(Q_OS_MAC)
QString qAppFileName_str = qAppFileName();
if(!qAppFileName_str.isEmpty()) {
QFileInfo fi(qAppFileName_str);
"Cannot move to target thread (%p)\n",
currentData->thread, d->threadData->thread, targetData->thread);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
qWarning("On Mac OS X, you might be loading two sets of Qt binaries into the same process. "
"Check that all plugins are compiled against the right Qt binaries. Export "
"DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.");
return 0;
}
-#ifdef Q_WS_X11
+#if defined(Q_OS_UNIX) && !defined (Q_OS_MAC)
QLibraryPrivate *QFactoryLoader::library(const QString &key) const
{
Q_D(const QFactoryLoader);
QStringList keys() const;
QObject *instance(const QString &key) const;
-#ifdef Q_WS_X11
+#if defined(Q_OS_UNIX) && !defined (Q_OS_MAC)
QLibraryPrivate *library(const QString &key) const;
#endif
{
int cores = -1;
-#if defined(Q_OS_MAC) && !defined(Q_WS_QPA)
+#if defined(Q_OS_MAC) && !defined(QT_NO_CORESERVICES)
// Mac OS X
cores = MPProcessorsScheduled();
#elif defined(Q_OS_HPUX)
# define QDTPDEBUGN if (false) qDebug
#endif
-#if defined(Q_WS_MAC)
+#if defined(Q_OS_MAC)
#include <private/qcore_mac_p.h>
#endif
friend Q_CORE_EXPORT_INLINE bool operator!=(const QRect &, const QRect &);
private:
-#if defined(Q_WS_X11)
- friend void qt_setCoords(QRect *r, int xp1, int yp1, int xp2, int yp2);
-#endif
// ### Qt 5; remove the ifdef and just have the same order on all platforms.
#if defined(Q_OS_MAC)
int y1;
return toLatin1();
}
-#if !defined(Q_WS_MAC) && defined(Q_OS_UNIX)
+#if !defined(Q_OS_MAC) && defined(Q_OS_UNIX)
static QByteArray toLocal8Bit_helper(const QChar *data, int length)
{
#ifndef QT_NO_TEXTCODEC