diff options
author | Mikkel Krautz <mikkel@krautz.dk> | 2013-06-29 02:36:17 +0400 |
---|---|---|
committer | Mikkel Krautz <mikkel@krautz.dk> | 2013-06-29 18:56:42 +0400 |
commit | be75138d8bd294b297f1a1eab09fa77d6c91cec8 (patch) | |
tree | f99f199247b6e0e87fc20fa3af2dc7f70c0ddc26 /plugins | |
parent | e0b884e663c9087d9e9f61de662ee81eb35a6426 (diff) |
mumble, plugins: allow 'manual' plugin dialogs to work OS X when using Qt 5.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/manual/manual.cpp | 20 | ||||
-rw-r--r-- | plugins/manual/manual.h | 3 |
2 files changed, 15 insertions, 8 deletions
diff --git a/plugins/manual/manual.cpp b/plugins/manual/manual.cpp index 6c5ca541c..0d807fbd5 100644 --- a/plugins/manual/manual.cpp +++ b/plugins/manual/manual.cpp @@ -32,7 +32,7 @@ #include <QtCore/QtCore> #include <QtGui/QtGui> -#if QT_VERSION >= 0x050000 +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) #include <QtWidgets/QMessageBox> #else #include <QMessageBox> @@ -247,17 +247,21 @@ static void unlock() { static void config(HWND h) { if (mDlg) { -#if defined(Q_OS_WIN) && QT_VERSION >= 0x050000 +#if defined(Q_OS_WIN) && QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) mDlg->setParent(QWidget::find(reinterpret_cast<WId>(h)), Qt::Dialog); -#else +#elif defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(5, 0, 0) mDlg->setParent(QWidget::find(h), Qt::Dialog); +#else + mDlg->setParent(reinterpret_cast<QWidget *>(h), Qt::Dialog); #endif mDlg->qpbUnhinge->setEnabled(true); } else { -#if defined(Q_OS_WIN) && QT_VERSION >= 0x050000 +#if defined(Q_OS_WIN) && QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) mDlg = new Manual(QWidget::find(reinterpret_cast<WId>(h))); -#else +#elif defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(5, 0, 0) mDlg = new Manual(QWidget::find(h)); +#else + mDlg = new Manual(reinterpret_cast<QWidget *>(h)); #endif } @@ -297,10 +301,12 @@ static std::wstring shortname(L"Manual placement"); static void about(HWND h) { QMessageBox::about( -#if defined(Q_OS_WIN) && QT_VERSION >= 0x050000 +#if defined(Q_OS_WIN) && QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) QWidget::find(reinterpret_cast<WId>(h)), -#else +#elif defined(Q_OS_WIN) && QT_VERSION < QT_VERSION_CHECK(5, 0, 0) QWidget::find(h), +#else + reinterpret_cast<QWidget *>(h), #endif QString::fromStdWString(description), QString::fromStdWString(longdesc()) diff --git a/plugins/manual/manual.h b/plugins/manual/manual.h index ac727d431..d67791be2 100644 --- a/plugins/manual/manual.h +++ b/plugins/manual/manual.h @@ -1,7 +1,8 @@ #ifndef MUMBLE_MANUAL_H_ #define MUMBLE_MANUAL_H_ -#if QT_VERSION >= 0x050000 +#include <QtCore/QtGlobal> +#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) # include <QtWidgets/QDialog> # include <QtWidgets/QGraphicsItem> # include <QtWidgets/QGraphicsScene> |