Merged in israelins85/libqxt/MACOS_QT5_FIXES (pull request #46)

MacOs: compilation faults
This commit is contained in:
Arvid Picciani 2014-02-14 19:26:54 +01:00
commit a6e35c34dd
7 changed files with 16 additions and 12 deletions

View File

@ -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

View File

@ -33,17 +33,17 @@
#include <QAbstractEventDispatcher>
#include <QtDebug>
#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<QPair<quint32, quint32>, 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)

View File

@ -42,7 +42,7 @@
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
#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);

View File

@ -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;

View File

@ -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

View File

@ -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);

View File

@ -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,