From 98354cd1e7f3c6b89f7112bda0791cf8ba191372 Mon Sep 17 00:00:00 2001 From: Tannin Date: Sun, 16 Mar 2014 20:04:57 +0100 Subject: some fixes towards qt5 compatibility --- src/mainwindow.cpp | 4 ++++ src/moapplication.cpp | 8 ++++++++ src/organizer.pro | 35 ++++++++++++++++++++++++++++++++++- src/pluginlist.h | 2 +- src/settings.cpp | 4 ++++ src/shared/leaktrace.cpp | 1 + 6 files changed, 52 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4c66ccce..1c57f549 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -103,7 +103,11 @@ along with Mod Organizer. If not, see . #include #include #include +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) +#include +#else #include +#endif #include #include #include diff --git a/src/moapplication.cpp b/src/moapplication.cpp index f09b2fd9..12ff713b 100644 --- a/src/moapplication.cpp +++ b/src/moapplication.cpp @@ -23,8 +23,10 @@ along with Mod Organizer. If not, see . #include #include #include +#if QT_VERSION < QT_VERSION_CHECK(5,0,0) #include #include +#endif #include #include #include @@ -123,12 +125,18 @@ bool MOApplication::notify(QObject *receiver, QEvent *event) void MOApplication::updateStyle(const QString &fileName) { +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) + if (fileName == "Fusion") { + setStyle(QStyleFactory::create("fusion")); + setStyleSheet(""); +#else if (fileName == "Plastique") { setStyle(new ProxyStyle(new QPlastiqueStyle)); setStyleSheet(""); } else if (fileName == "Cleanlooks") { setStyle(new ProxyStyle(new QCleanlooksStyle)); setStyleSheet(""); +#endif } else { setStyle(new ProxyStyle(QStyleFactory::create(m_DefaultStyle))); if (QFile::exists(fileName)) { diff --git a/src/organizer.pro b/src/organizer.pro index 9a9d0da3..4fceb2be 100644 --- a/src/organizer.pro +++ b/src/organizer.pro @@ -4,8 +4,9 @@ # #------------------------------------------------- + contains(QT_VERSION, "^5.*") { - QT += core gui widgets network declarative script xml sql xmlpatterns + QT += core gui widgets network xml sql xmlpatterns qml quick script } else { QT += core gui network xml declarative script sql xmlpatterns opengl } @@ -311,6 +312,38 @@ OTHER_FILES += \ tutorials/tutorials_installdialog.qml +load(moc) + +# for each Boost header you include... +QMAKE_MOC += \ + -DBOOST_MPL_IF_HPP_INCLUDED \ + -DBOOST_TT_TYPE_WITH_ALIGNMENT_INCLUDED \ + -DBOOST_MPL_VOID_HPP_INCLUDED \ + -DBOOST_MPL_NOT_HPP_INCLUDED \ + -DBOOST_MPL_IDENTITY_HPP_INCLUDED \ + -DBOOST_VARIANT_VARIANT_FWD_HPP \ + -DBOOST_MPL_NEXT_PRIOR_HPP_INCLUDED \ + -DBOOST_MPL_O1_SIZE_HPP_INCLUDED \ + -DBOOST_MPL_DEREF_HPP_INCLUDED \ + -DBOOST_MPL_PAIR_HPP_INCLUDED \ + -DBOOST_MPL_ITER_FOLD_HPP_INCLUDED \ + -DBOOST_MPL_PROTECT_HPP_INCLUDED \ + -DBOOST_MPL_EVAL_IF_HPP_INCLUDED \ + -DBOOST_MPL_SEQUENCE_TAG_HPP_INCLUDED \ + -DBOOST_MPL_EMPTY_HPP_INCLUDED \ + -DBOOST_MPL_ALWAYS_HPP_INCLUDED \ + -DBOOST_MPL_TRANSFORM_HPP_INCLUDED \ + -DBOOST_MPL_CLEAR_HPP_INCLUDED \ + -DBOOST_MPL_BEGIN_END_HPP_INCLUDED \ + -DBOOST_MPL_FOLD_HPP_INCLUDED \ + -DBOOST_MPL_FRONT_HPP_INCLUDED \ + -DBOOST_MPL_IS_SEQUENCE_HPP_INCLUDED \ + -DBOOST_MPL_ITERATOR_RANGE_HPP_INCLUDED \ + -DBOOST_MPL_MAX_ELEMENT_HPP_INCLUDED \ + -DBOOST_MPL_PUSH_FRONT_HPP_INCLUDED \ + -DBOOST_RESULT_OF_HPP \ + -DBOOST_MPL_ITER_FOLD_IF_HPP_INCLUDED + # leak detection with vld #INCLUDEPATH += "E:/Visual Leak Detector/include" #LIBS += -L"E:/Visual Leak Detector/lib/Win32" diff --git a/src/pluginlist.h b/src/pluginlist.h index e45746f2..3d7f0926 100644 --- a/src/pluginlist.h +++ b/src/pluginlist.h @@ -29,7 +29,7 @@ along with Mod Organizer. If not, see . #include #include #include -#include +#include "pdll.h" #include diff --git a/src/settings.cpp b/src/settings.cpp index dd3891d4..d9a7e799 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -436,8 +436,12 @@ void Settings::addLanguages(QComboBox *languageBox) void Settings::addStyles(QComboBox *styleBox) { styleBox->addItem("None", ""); +#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) + styleBox->addItem("Fusion", "Fusion"); +#else styleBox->addItem("Plastique", "Plastique"); styleBox->addItem("Cleanlooks", "Cleanlooks"); +#endif QDirIterator langIter(QCoreApplication::applicationDirPath() + "/" + ToQString(AppConfig::stylesheetsPath()), QStringList("*.qss"), QDir::Files); while (langIter.hasNext()) { diff --git a/src/shared/leaktrace.cpp b/src/shared/leaktrace.cpp index c3721557..68e57609 100644 --- a/src/shared/leaktrace.cpp +++ b/src/shared/leaktrace.cpp @@ -5,6 +5,7 @@ #include #include #include +#include static const int FRAMES_TO_SKIP = 3; // StackData::StackData(), __TraceData::regTrace(), TraceAlloc() -- cgit v1.3.1