Commit a6c17fc5 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Remove all QT_VERSION_CHECK

We only support Qt 5.6 now.

Change-Id: If94864400545b057623e3af0743c55ea1e84e33b
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent 99149884
......@@ -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;
}
......
......@@ -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
}
}
......@@ -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();
......
......@@ -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
......
......@@ -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()
......
......@@ -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>
......
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
......
......@@ -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" }
......
......@@ -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()
......
......@@ -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];
......
......@@ -3,21 +3,17 @@ TEMPLATE = subdirs
SUBDIRS = \
timelineabstractrenderer \
timelineitemsrenderpass \
timelinemodel \
timelinemodelaggregator \
timelinenotesmodel \
timelinenotesrenderpass \
timelineoverviewrenderer \
timelinerenderer \
timelinerenderpass \
timelinerenderstate \
timelineselectionrenderpass \
timelinezoomcontrol
minQtVersion(5,4,0) {
SUBDIRS += \
timelineitemsrenderpass \
timelinenotesrenderpass \
timelineselectionrenderpass
}
OTHER_FILES += \
timelineautotest.qbs
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment