From 51ee678a8139821b2ff11a83a8f28ba29870550f Mon Sep 17 00:00:00 2001 From: Israel Lins Albuquerque Date: Wed, 12 Feb 2014 16:18:51 -0300 Subject: [PATCH] MacOs: compilation faults - replacing Q_WS_MAC => Q_OS_MAC - incomplete migration to Qt5 --- src/widgets/mac/qxtapplication_mac.cpp | 2 ++ src/widgets/qxtglobalshortcut.cpp | 12 ++++++------ src/widgets/qxtglobalshortcut_p.h | 6 +++--- src/widgets/qxtitemdelegate.cpp | 2 +- src/widgets/qxtnativeeventfilter.h | 2 ++ src/widgets/qxttooltip.cpp | 2 +- src/zeroconf/bonjour/qxtmdns_bonjour.cpp | 2 +- 7 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/widgets/mac/qxtapplication_mac.cpp b/src/widgets/mac/qxtapplication_mac.cpp index 1769168a..a0a35f76 100644 --- a/src/widgets/mac/qxtapplication_mac.cpp +++ b/src/widgets/mac/qxtapplication_mac.cpp @@ -30,6 +30,7 @@ *****************************************************************************/ #include "qxtapplication_p.h" +#if QT_VERSION < QT_VERSION_CHECK(5,0,0) #include "qxtnativeeventfilter.h" /*! @@ -44,3 +45,4 @@ bool QxtApplication::macEventFilter(EventHandlerCallRef caller, EventRef event) } return QApplication::macEventFilter(caller, event); } +#endif diff --git a/src/widgets/qxtglobalshortcut.cpp b/src/widgets/qxtglobalshortcut.cpp index 72548d6f..44b9f917 100644 --- a/src/widgets/qxtglobalshortcut.cpp +++ b/src/widgets/qxtglobalshortcut.cpp @@ -33,17 +33,17 @@ #include #include -#ifndef Q_WS_MAC +#ifndef Q_OS_MAC int QxtGlobalShortcutPrivate::ref = 0; # if QT_VERSION < QT_VERSION_CHECK(5,0,0) QAbstractEventDispatcher::EventFilter QxtGlobalShortcutPrivate::prevEventFilter = 0; # endif -#endif // Q_WS_MAC +#endif // Q_OS_MAC QHash, QxtGlobalShortcut*> QxtGlobalShortcutPrivate::shortcuts; QxtGlobalShortcutPrivate::QxtGlobalShortcutPrivate() : enabled(true), key(Qt::Key(0)), mods(Qt::NoModifier) { -#ifndef Q_WS_MAC +#ifndef Q_OS_MAC if (ref == 0) { # if QT_VERSION < QT_VERSION_CHECK(5,0,0) prevEventFilter = QAbstractEventDispatcher::instance()->setEventFilter(eventFilter); @@ -52,12 +52,12 @@ QxtGlobalShortcutPrivate::QxtGlobalShortcutPrivate() : enabled(true), key(Qt::Ke #endif } ++ref; -#endif // Q_WS_MAC +#endif // Q_OS_MAC } QxtGlobalShortcutPrivate::~QxtGlobalShortcutPrivate() { -#ifndef Q_WS_MAC +#ifndef Q_OS_MAC --ref; if (ref == 0) { QAbstractEventDispatcher *ed = QAbstractEventDispatcher::instance(); @@ -69,7 +69,7 @@ QxtGlobalShortcutPrivate::~QxtGlobalShortcutPrivate() # endif } } -#endif // Q_WS_MAC +#endif // Q_OS_MAC } bool QxtGlobalShortcutPrivate::setShortcut(const QKeySequence& shortcut) diff --git a/src/widgets/qxtglobalshortcut_p.h b/src/widgets/qxtglobalshortcut_p.h index 1a788852..112988d2 100644 --- a/src/widgets/qxtglobalshortcut_p.h +++ b/src/widgets/qxtglobalshortcut_p.h @@ -42,7 +42,7 @@ class QxtGlobalShortcutPrivate : public QxtPrivate -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) && !defined(Q_OS_MAC) ,public QAbstractNativeEventFilter #endif { @@ -59,7 +59,7 @@ public: bool unsetShortcut(); static bool error; -#ifndef Q_WS_MAC +#ifndef Q_OS_MAC static int ref; #if QT_VERSION < QT_VERSION_CHECK(5,0,0) static QAbstractEventDispatcher::EventFilter prevEventFilter; @@ -67,7 +67,7 @@ public: #else virtual bool nativeEventFilter(const QByteArray & eventType, void * message, long * result); #endif // QT_VERSION < QT_VERSION_CHECK(5,0,0) -#endif // Q_WS_MAC +#endif // Q_OS_MAC static void activateShortcut(quint32 nativeKey, quint32 nativeMods); diff --git a/src/widgets/qxtitemdelegate.cpp b/src/widgets/qxtitemdelegate.cpp index 5c1fcc50..b87120a2 100644 --- a/src/widgets/qxtitemdelegate.cpp +++ b/src/widgets/qxtitemdelegate.cpp @@ -53,7 +53,7 @@ void QxtItemDelegatePrivate::paintButton(QPainter* painter, const QStyleOptionVi // draw the button QStyleOptionButton buttonOption; buttonOption.state = option.state; -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC buttonOption.state |= QStyle::State_Raised; #endif buttonOption.state &= ~QStyle::State_HasFocus; diff --git a/src/widgets/qxtnativeeventfilter.h b/src/widgets/qxtnativeeventfilter.h index 809c25e4..5a7cea86 100644 --- a/src/widgets/qxtnativeeventfilter.h +++ b/src/widgets/qxtnativeeventfilter.h @@ -33,6 +33,7 @@ #include "qxtapplication.h" +#if QT_VERSION < QT_VERSION_CHECK(5,0,0) class QxtNativeEventFilter { public: @@ -60,5 +61,6 @@ public: } #endif // Q_OS_MAC }; +#endif #endif // QXTNATIVEEVENTFILTER_H diff --git a/src/widgets/qxttooltip.cpp b/src/widgets/qxttooltip.cpp index 39306207..15027211 100644 --- a/src/widgets/qxttooltip.cpp +++ b/src/widgets/qxttooltip.cpp @@ -187,7 +187,7 @@ void QxtToolTipPrivate::hideLater() QPoint QxtToolTipPrivate::calculatePos(int scr, const QPoint& eventPos) const { -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC QRect screen = QApplication::desktop()->availableGeometry(scr); #else QRect screen = QApplication::desktop()->screenGeometry(scr); diff --git a/src/zeroconf/bonjour/qxtmdns_bonjour.cpp b/src/zeroconf/bonjour/qxtmdns_bonjour.cpp index 7e9c94be..1d362de2 100644 --- a/src/zeroconf/bonjour/qxtmdns_bonjour.cpp +++ b/src/zeroconf/bonjour/qxtmdns_bonjour.cpp @@ -25,7 +25,7 @@ void QxtMDNS::doLookup(QString n, QObject * r, const char * m) &ref, 0, 0, - name.toAscii().constData(), + name.toLatin1().constData(), kDNSServiceType_SRV, kDNSServiceClass_IN, QxtMDNS::DNSServiceQueryRecordCallback,