MacOs: compilation faults

- replacing Q_WS_MAC => Q_OS_MAC
  - incomplete migration to Qt5
This commit is contained in:
Israel Lins Albuquerque 2014-02-12 16:18:51 -03:00
parent 7a4998fe23
commit 51ee678a81
7 changed files with 16 additions and 12 deletions

View File

@ -30,6 +30,7 @@
*****************************************************************************/ *****************************************************************************/
#include "qxtapplication_p.h" #include "qxtapplication_p.h"
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
#include "qxtnativeeventfilter.h" #include "qxtnativeeventfilter.h"
/*! /*!
@ -44,3 +45,4 @@ bool QxtApplication::macEventFilter(EventHandlerCallRef caller, EventRef event)
} }
return QApplication::macEventFilter(caller, event); return QApplication::macEventFilter(caller, event);
} }
#endif

View File

@ -33,17 +33,17 @@
#include <QAbstractEventDispatcher> #include <QAbstractEventDispatcher>
#include <QtDebug> #include <QtDebug>
#ifndef Q_WS_MAC #ifndef Q_OS_MAC
int QxtGlobalShortcutPrivate::ref = 0; int QxtGlobalShortcutPrivate::ref = 0;
# if QT_VERSION < QT_VERSION_CHECK(5,0,0) # if QT_VERSION < QT_VERSION_CHECK(5,0,0)
QAbstractEventDispatcher::EventFilter QxtGlobalShortcutPrivate::prevEventFilter = 0; QAbstractEventDispatcher::EventFilter QxtGlobalShortcutPrivate::prevEventFilter = 0;
# endif # endif
#endif // Q_WS_MAC #endif // Q_OS_MAC
QHash<QPair<quint32, quint32>, QxtGlobalShortcut*> QxtGlobalShortcutPrivate::shortcuts; QHash<QPair<quint32, quint32>, QxtGlobalShortcut*> QxtGlobalShortcutPrivate::shortcuts;
QxtGlobalShortcutPrivate::QxtGlobalShortcutPrivate() : enabled(true), key(Qt::Key(0)), mods(Qt::NoModifier) QxtGlobalShortcutPrivate::QxtGlobalShortcutPrivate() : enabled(true), key(Qt::Key(0)), mods(Qt::NoModifier)
{ {
#ifndef Q_WS_MAC #ifndef Q_OS_MAC
if (ref == 0) { if (ref == 0) {
# if QT_VERSION < QT_VERSION_CHECK(5,0,0) # if QT_VERSION < QT_VERSION_CHECK(5,0,0)
prevEventFilter = QAbstractEventDispatcher::instance()->setEventFilter(eventFilter); prevEventFilter = QAbstractEventDispatcher::instance()->setEventFilter(eventFilter);
@ -52,12 +52,12 @@ QxtGlobalShortcutPrivate::QxtGlobalShortcutPrivate() : enabled(true), key(Qt::Ke
#endif #endif
} }
++ref; ++ref;
#endif // Q_WS_MAC #endif // Q_OS_MAC
} }
QxtGlobalShortcutPrivate::~QxtGlobalShortcutPrivate() QxtGlobalShortcutPrivate::~QxtGlobalShortcutPrivate()
{ {
#ifndef Q_WS_MAC #ifndef Q_OS_MAC
--ref; --ref;
if (ref == 0) { if (ref == 0) {
QAbstractEventDispatcher *ed = QAbstractEventDispatcher::instance(); QAbstractEventDispatcher *ed = QAbstractEventDispatcher::instance();
@ -69,7 +69,7 @@ QxtGlobalShortcutPrivate::~QxtGlobalShortcutPrivate()
# endif # endif
} }
} }
#endif // Q_WS_MAC #endif // Q_OS_MAC
} }
bool QxtGlobalShortcutPrivate::setShortcut(const QKeySequence& shortcut) bool QxtGlobalShortcutPrivate::setShortcut(const QKeySequence& shortcut)

View File

@ -42,7 +42,7 @@
class QxtGlobalShortcutPrivate : public QxtPrivate<QxtGlobalShortcut> class QxtGlobalShortcutPrivate : public QxtPrivate<QxtGlobalShortcut>
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #if QT_VERSION >= QT_VERSION_CHECK(5,0,0) && !defined(Q_OS_MAC)
,public QAbstractNativeEventFilter ,public QAbstractNativeEventFilter
#endif #endif
{ {
@ -59,7 +59,7 @@ public:
bool unsetShortcut(); bool unsetShortcut();
static bool error; static bool error;
#ifndef Q_WS_MAC #ifndef Q_OS_MAC
static int ref; static int ref;
#if QT_VERSION < QT_VERSION_CHECK(5,0,0) #if QT_VERSION < QT_VERSION_CHECK(5,0,0)
static QAbstractEventDispatcher::EventFilter prevEventFilter; static QAbstractEventDispatcher::EventFilter prevEventFilter;
@ -67,7 +67,7 @@ public:
#else #else
virtual bool nativeEventFilter(const QByteArray & eventType, void * message, long * result); virtual bool nativeEventFilter(const QByteArray & eventType, void * message, long * result);
#endif // QT_VERSION < QT_VERSION_CHECK(5,0,0) #endif // QT_VERSION < QT_VERSION_CHECK(5,0,0)
#endif // Q_WS_MAC #endif // Q_OS_MAC
static void activateShortcut(quint32 nativeKey, quint32 nativeMods); static void activateShortcut(quint32 nativeKey, quint32 nativeMods);

View File

@ -53,7 +53,7 @@ void QxtItemDelegatePrivate::paintButton(QPainter* painter, const QStyleOptionVi
// draw the button // draw the button
QStyleOptionButton buttonOption; QStyleOptionButton buttonOption;
buttonOption.state = option.state; buttonOption.state = option.state;
#ifdef Q_WS_MAC #ifdef Q_OS_MAC
buttonOption.state |= QStyle::State_Raised; buttonOption.state |= QStyle::State_Raised;
#endif #endif
buttonOption.state &= ~QStyle::State_HasFocus; buttonOption.state &= ~QStyle::State_HasFocus;

View File

@ -33,6 +33,7 @@
#include "qxtapplication.h" #include "qxtapplication.h"
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
class QxtNativeEventFilter class QxtNativeEventFilter
{ {
public: public:
@ -60,5 +61,6 @@ public:
} }
#endif // Q_OS_MAC #endif // Q_OS_MAC
}; };
#endif
#endif // QXTNATIVEEVENTFILTER_H #endif // QXTNATIVEEVENTFILTER_H

View File

@ -187,7 +187,7 @@ void QxtToolTipPrivate::hideLater()
QPoint QxtToolTipPrivate::calculatePos(int scr, const QPoint& eventPos) const QPoint QxtToolTipPrivate::calculatePos(int scr, const QPoint& eventPos) const
{ {
#ifdef Q_WS_MAC #ifdef Q_OS_MAC
QRect screen = QApplication::desktop()->availableGeometry(scr); QRect screen = QApplication::desktop()->availableGeometry(scr);
#else #else
QRect screen = QApplication::desktop()->screenGeometry(scr); QRect screen = QApplication::desktop()->screenGeometry(scr);

View File

@ -25,7 +25,7 @@ void QxtMDNS::doLookup(QString n, QObject * r, const char * m)
&ref, &ref,
0, 0,
0, 0,
name.toAscii().constData(), name.toLatin1().constData(),
kDNSServiceType_SRV, kDNSServiceType_SRV,
kDNSServiceClass_IN, kDNSServiceClass_IN,
QxtMDNS::DNSServiceQueryRecordCallback, QxtMDNS::DNSServiceQueryRecordCallback,