diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2016-08-03 22:54:19 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2016-08-12 13:29:58 +0000 |
commit | a6c17fc5371451b792a709ca142d28b16d3e610f (patch) | |
tree | 442c8957f3e9b8b9bf816f0c8bcee2dd48c61fb0 /src | |
parent | 991498845ad3cc32dbbcc1396656c0c9262581ac (diff) |
Remove all QT_VERSION_CHECK
We only support Qt 5.6 now.
Change-Id: If94864400545b057623e3af0743c55ea1e84e33b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/app/main.cpp | 8 | ||||
-rw-r--r-- | src/libs/utils/algorithm.h | 9 | ||||
-rw-r--r-- | src/libs/utils/qtcprocess.cpp | 12 | ||||
-rw-r--r-- | src/plugins/help/help.pro | 2 | ||||
-rw-r--r-- | src/plugins/imageviewer/imageviewerfactory.cpp | 5 | ||||
-rw-r--r-- | src/plugins/projectexplorer/windebuginterface.cpp | 4 | ||||
-rw-r--r-- | src/plugins/welcome/welcome.pro | 7 | ||||
-rw-r--r-- | src/plugins/welcome/welcome.qbs | 3 | ||||
-rw-r--r-- | src/plugins/welcome/welcomeplugin.cpp | 32 | ||||
-rw-r--r-- | src/tools/3rdparty/iossim_1_8_2/main.mm | 9 |
10 files changed, 9 insertions, 82 deletions
diff --git a/src/app/main.cpp b/src/app/main.cpp index 13c178ec1ae..126604b960d 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -159,13 +159,6 @@ static const char *setHighDpiEnvironmentVariable() { const char* envVarName = 0; static const char ENV_VAR_QT_DEVICE_PIXEL_RATIO[] = "QT_DEVICE_PIXEL_RATIO"; -#if (QT_VERSION < QT_VERSION_CHECK(5, 6, 0)) - if (Utils::HostOsInfo().isWindowsHost() - && !qEnvironmentVariableIsSet(ENV_VAR_QT_DEVICE_PIXEL_RATIO)) { - envVarName = ENV_VAR_QT_DEVICE_PIXEL_RATIO; - qputenv(envVarName, "auto"); - } -#else if (Utils::HostOsInfo().isWindowsHost() && !qEnvironmentVariableIsSet(ENV_VAR_QT_DEVICE_PIXEL_RATIO) // legacy in 5.6, but still functional && !qEnvironmentVariableIsSet("QT_AUTO_SCREEN_SCALE_FACTOR") @@ -173,7 +166,6 @@ static const char *setHighDpiEnvironmentVariable() && !qEnvironmentVariableIsSet("QT_SCREEN_SCALE_FACTORS")) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); } -#endif // < Qt 5.6 return envVarName; } diff --git a/src/libs/utils/algorithm.h b/src/libs/utils/algorithm.h index 8dc611088a3..10b6daef94f 100644 --- a/src/libs/utils/algorithm.h +++ b/src/libs/utils/algorithm.h @@ -412,18 +412,9 @@ inline void sort(Container &c, R (S::*function)() const) template <typename Container, typename Op> inline void reverseForeach(const Container &c, const Op &operation) { -#if QT_VERSION < QT_VERSION_CHECK(5, 6, 0) - auto rend = c.begin(); - auto it = c.end(); - while (it != rend) { - --it; - operation(*it); - } -#else auto rend = c.rend(); for (auto it = c.rbegin(); it != rend; ++it) operation(*it); -#endif } } diff --git a/src/libs/utils/qtcprocess.cpp b/src/libs/utils/qtcprocess.cpp index f43728adfe1..1f302a02d39 100644 --- a/src/libs/utils/qtcprocess.cpp +++ b/src/libs/utils/qtcprocess.cpp @@ -699,18 +699,6 @@ void QtcProcess::start() qWarning("QtcProcess::start: Empty environment set when running '%s'.", qPrintable(m_command)); env = m_environment; -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - // QTBUG-49694 - // If the process environment has no libraryPath, - // Qt will copy creator's libraryPath into the process environment. - // That's brain dead, and we work around it - if (osType != OsTypeWindows) { // a.k.a "Unixoid" - const QString libraryPath = - QLatin1String(osType == OsTypeMac ? "DYLD_LIBRARY_PATH" : "LD_LIBRARY_PATH"); - if (env.constFind(libraryPath) == env.constEnd()) - env.set(libraryPath, QString()); - } -#endif QProcess::setEnvironment(env.toStringList()); } else { env = Environment::systemEnvironment(); diff --git a/src/plugins/help/help.pro b/src/plugins/help/help.pro index a6079647982..135186fd9b0 100644 --- a/src/plugins/help/help.pro +++ b/src/plugins/help/help.pro @@ -63,7 +63,7 @@ FORMS += docsettingspage.ui \ generalsettingspage.ui \ remotehelpfilter.ui -!isEmpty(QT.webenginewidgets.name):minQtVersion(5, 6, 0) { +!isEmpty(QT.webenginewidgets.name) { QT += webenginewidgets HEADERS += webenginehelpviewer.h SOURCES += webenginehelpviewer.cpp diff --git a/src/plugins/imageviewer/imageviewerfactory.cpp b/src/plugins/imageviewer/imageviewerfactory.cpp index d3419369679..c04733555f7 100644 --- a/src/plugins/imageviewer/imageviewerfactory.cpp +++ b/src/plugins/imageviewer/imageviewerfactory.cpp @@ -45,11 +45,6 @@ ImageViewerFactory::ImageViewerFactory(QObject *parent) : const QList<QByteArray> supportedMimeTypes = QImageReader::supportedMimeTypes(); foreach (const QByteArray &format, supportedMimeTypes) addMimeType(format.constData()); - -#if (QT_VERSION < QT_VERSION_CHECK(5, 5, 0)) && !QT_NO_SVGRENDERER - // Workaround for https://codereview.qt-project.org/108693 - addMimeType("image/svg+xml"); -#endif } Core::IEditor *ImageViewerFactory::createEditor() diff --git a/src/plugins/projectexplorer/windebuginterface.cpp b/src/plugins/projectexplorer/windebuginterface.cpp index c03a07f00bb..a4d0bac9fa5 100644 --- a/src/plugins/projectexplorer/windebuginterface.cpp +++ b/src/plugins/projectexplorer/windebuginterface.cpp @@ -27,10 +27,6 @@ #ifdef Q_OS_WIN -# if (QT_VERSION < QT_VERSION_CHECK(5, 4, 1)) -# define NOMINMAX -# endif - #include <windows.h> #include <QApplication> #include <QTime> diff --git a/src/plugins/welcome/welcome.pro b/src/plugins/welcome/welcome.pro index 50ad9f9fdee..9fec1225511 100644 --- a/src/plugins/welcome/welcome.pro +++ b/src/plugins/welcome/welcome.pro @@ -1,15 +1,10 @@ -QT += quick +QT += quick quickwidgets QML_IMPORT_PATH=../../../share/qtcreator/welcomescreen include(../../qtcreatorplugin.pri) -!isEmpty(USE_QUICK_WIDGET)|minQtVersion(5, 5, 0) { - QT += quickwidgets - DEFINES += USE_QUICK_WIDGET -} - HEADERS += welcomeplugin.h SOURCES += welcomeplugin.cpp diff --git a/src/plugins/welcome/welcome.qbs b/src/plugins/welcome/welcome.qbs index b43b2414da4..2a29e749aeb 100644 --- a/src/plugins/welcome/welcome.qbs +++ b/src/plugins/welcome/welcome.qbs @@ -3,8 +3,7 @@ import qbs 1.0 QtcPlugin { name: "Welcome" - Depends { name: "Qt"; submodules: ["widgets", "network"] } - Depends { name: "Qt.quick"; condition: product.condition; } + Depends { name: "Qt"; submodules: ["widgets", "network", "quick", "quickwidgets"] } Depends { name: "Utils" } Depends { name: "Core" } diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index 76d50f4689c..ac3d3a01fa5 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -53,13 +53,7 @@ #include <QQmlPropertyMap> #include <QQuickImageProvider> -#ifdef USE_QUICK_WIDGET - #include <QtQuickWidgets/QQuickWidget> - typedef QQuickWidget QuickContainer; -#else - #include <QtQuick/QQuickView> - typedef QQuickView QuickContainer; -#endif +#include <QtQuickWidgets/QQuickWidget> #include <QtQml/QQmlContext> #include <QtQml/QQmlEngine> @@ -168,7 +162,7 @@ private: void addKeyboardShortcuts(); QWidget *m_modeWidget; - QuickContainer *m_welcomePage; + QQuickWidget *m_welcomePage; QMap<Id, IWelcomePage *> m_idPageMap; QList<IWelcomePage *> m_pluginList; int m_activePlugin; @@ -202,28 +196,21 @@ WelcomeMode::WelcomeMode() layout->setMargin(0); layout->setSpacing(0); - m_welcomePage = new QuickContainer(); + m_welcomePage = new QQuickWidget; applyTheme(); // initialize background color and theme properties - m_welcomePage->setResizeMode(QuickContainer::SizeRootObjectToView); + m_welcomePage->setResizeMode(QQuickWidget::SizeRootObjectToView); m_welcomePage->setObjectName(QLatin1String("WelcomePage")); - connect(m_welcomePage, &QuickContainer::sceneGraphError, + connect(m_welcomePage, &QQuickWidget::sceneGraphError, this, &WelcomeMode::sceneGraphError); StyledBar *styledBar = new StyledBar(m_modeWidget); styledBar->setObjectName(QLatin1String("WelcomePageStyledBar")); layout->addWidget(styledBar); -#ifdef USE_QUICK_WIDGET m_welcomePage->setParent(m_modeWidget); layout->addWidget(m_welcomePage); -#else - QWidget *container = QWidget::createWindowContainer(m_welcomePage, m_modeWidget); - container->setProperty("nativeAncestors", true); - m_modeWidget->setLayout(layout); - layout->addWidget(container); -#endif // USE_QUICK_WIDGET addKeyboardShortcuts(); @@ -307,15 +294,8 @@ void WelcomeMode::facilitateQml(QQmlEngine *engine) QQmlContext *ctx = engine->rootContext(); ctx->setContextProperty(QLatin1String("welcomeMode"), this); - ctx->setContextProperty(QLatin1String("creatorTheme"), &m_themeProperties); - -#if defined(USE_QUICK_WIDGET) && (QT_VERSION < QT_VERSION_CHECK(5, 5, 0)) - bool useNativeText = !HostOsInfo::isMacHost(); -#else - bool useNativeText = true; -#endif - ctx->setContextProperty(QLatin1String("useNativeText"), useNativeText); + ctx->setContextProperty(QLatin1String("useNativeText"), true); } void WelcomeMode::initPlugins() diff --git a/src/tools/3rdparty/iossim_1_8_2/main.mm b/src/tools/3rdparty/iossim_1_8_2/main.mm index fb83dc3e199..701068ead58 100644 --- a/src/tools/3rdparty/iossim_1_8_2/main.mm +++ b/src/tools/3rdparty/iossim_1_8_2/main.mm @@ -8,11 +8,7 @@ #import <AppKit/AppKit.h> #import "iphonesimulator.h" #include <QLibrary> -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) -#include <QApplication> -#else #include <QGuiApplication> -#endif #include <QString> #include <QStringList> @@ -29,12 +25,7 @@ int main (int argc, char *argv[]) { char *qtarg = 0; if (argc) qtarg = argv[0]; -#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) - QApplication a(qtargc, &qtarg); -#else QGuiApplication a(qtargc, &qtarg); -#endif - //NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |