forked from qt-creator/qt-creator
Remove all QT_VERSION_CHECK
We only support Qt 5.6 now. Change-Id: If94864400545b057623e3af0743c55ea1e84e33b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
991498845a
commit
a6c17fc537
@@ -159,13 +159,6 @@ static const char *setHighDpiEnvironmentVariable()
|
|||||||
{
|
{
|
||||||
const char* envVarName = 0;
|
const char* envVarName = 0;
|
||||||
static const char ENV_VAR_QT_DEVICE_PIXEL_RATIO[] = "QT_DEVICE_PIXEL_RATIO";
|
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()
|
if (Utils::HostOsInfo().isWindowsHost()
|
||||||
&& !qEnvironmentVariableIsSet(ENV_VAR_QT_DEVICE_PIXEL_RATIO) // legacy in 5.6, but still functional
|
&& !qEnvironmentVariableIsSet(ENV_VAR_QT_DEVICE_PIXEL_RATIO) // legacy in 5.6, but still functional
|
||||||
&& !qEnvironmentVariableIsSet("QT_AUTO_SCREEN_SCALE_FACTOR")
|
&& !qEnvironmentVariableIsSet("QT_AUTO_SCREEN_SCALE_FACTOR")
|
||||||
@@ -173,7 +166,6 @@ static const char *setHighDpiEnvironmentVariable()
|
|||||||
&& !qEnvironmentVariableIsSet("QT_SCREEN_SCALE_FACTORS")) {
|
&& !qEnvironmentVariableIsSet("QT_SCREEN_SCALE_FACTORS")) {
|
||||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
}
|
}
|
||||||
#endif // < Qt 5.6
|
|
||||||
return envVarName;
|
return envVarName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -412,18 +412,9 @@ inline void sort(Container &c, R (S::*function)() const)
|
|||||||
template <typename Container, typename Op>
|
template <typename Container, typename Op>
|
||||||
inline void reverseForeach(const Container &c, const Op &operation)
|
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();
|
auto rend = c.rend();
|
||||||
for (auto it = c.rbegin(); it != rend; ++it)
|
for (auto it = c.rbegin(); it != rend; ++it)
|
||||||
operation(*it);
|
operation(*it);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -699,18 +699,6 @@ void QtcProcess::start()
|
|||||||
qWarning("QtcProcess::start: Empty environment set when running '%s'.", qPrintable(m_command));
|
qWarning("QtcProcess::start: Empty environment set when running '%s'.", qPrintable(m_command));
|
||||||
env = m_environment;
|
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());
|
QProcess::setEnvironment(env.toStringList());
|
||||||
} else {
|
} else {
|
||||||
env = Environment::systemEnvironment();
|
env = Environment::systemEnvironment();
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ FORMS += docsettingspage.ui \
|
|||||||
generalsettingspage.ui \
|
generalsettingspage.ui \
|
||||||
remotehelpfilter.ui
|
remotehelpfilter.ui
|
||||||
|
|
||||||
!isEmpty(QT.webenginewidgets.name):minQtVersion(5, 6, 0) {
|
!isEmpty(QT.webenginewidgets.name) {
|
||||||
QT += webenginewidgets
|
QT += webenginewidgets
|
||||||
HEADERS += webenginehelpviewer.h
|
HEADERS += webenginehelpviewer.h
|
||||||
SOURCES += webenginehelpviewer.cpp
|
SOURCES += webenginehelpviewer.cpp
|
||||||
|
|||||||
@@ -45,11 +45,6 @@ ImageViewerFactory::ImageViewerFactory(QObject *parent) :
|
|||||||
const QList<QByteArray> supportedMimeTypes = QImageReader::supportedMimeTypes();
|
const QList<QByteArray> supportedMimeTypes = QImageReader::supportedMimeTypes();
|
||||||
foreach (const QByteArray &format, supportedMimeTypes)
|
foreach (const QByteArray &format, supportedMimeTypes)
|
||||||
addMimeType(format.constData());
|
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()
|
Core::IEditor *ImageViewerFactory::createEditor()
|
||||||
|
|||||||
@@ -27,10 +27,6 @@
|
|||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
|
||||||
# if (QT_VERSION < QT_VERSION_CHECK(5, 4, 1))
|
|
||||||
# define NOMINMAX
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QTime>
|
#include <QTime>
|
||||||
|
|||||||
@@ -1,15 +1,10 @@
|
|||||||
|
|
||||||
QT += quick
|
QT += quick quickwidgets
|
||||||
|
|
||||||
QML_IMPORT_PATH=../../../share/qtcreator/welcomescreen
|
QML_IMPORT_PATH=../../../share/qtcreator/welcomescreen
|
||||||
|
|
||||||
include(../../qtcreatorplugin.pri)
|
include(../../qtcreatorplugin.pri)
|
||||||
|
|
||||||
!isEmpty(USE_QUICK_WIDGET)|minQtVersion(5, 5, 0) {
|
|
||||||
QT += quickwidgets
|
|
||||||
DEFINES += USE_QUICK_WIDGET
|
|
||||||
}
|
|
||||||
|
|
||||||
HEADERS += welcomeplugin.h
|
HEADERS += welcomeplugin.h
|
||||||
|
|
||||||
SOURCES += welcomeplugin.cpp
|
SOURCES += welcomeplugin.cpp
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ import qbs 1.0
|
|||||||
QtcPlugin {
|
QtcPlugin {
|
||||||
name: "Welcome"
|
name: "Welcome"
|
||||||
|
|
||||||
Depends { name: "Qt"; submodules: ["widgets", "network"] }
|
Depends { name: "Qt"; submodules: ["widgets", "network", "quick", "quickwidgets"] }
|
||||||
Depends { name: "Qt.quick"; condition: product.condition; }
|
|
||||||
Depends { name: "Utils" }
|
Depends { name: "Utils" }
|
||||||
|
|
||||||
Depends { name: "Core" }
|
Depends { name: "Core" }
|
||||||
|
|||||||
@@ -53,13 +53,7 @@
|
|||||||
#include <QQmlPropertyMap>
|
#include <QQmlPropertyMap>
|
||||||
#include <QQuickImageProvider>
|
#include <QQuickImageProvider>
|
||||||
|
|
||||||
#ifdef USE_QUICK_WIDGET
|
#include <QtQuickWidgets/QQuickWidget>
|
||||||
#include <QtQuickWidgets/QQuickWidget>
|
|
||||||
typedef QQuickWidget QuickContainer;
|
|
||||||
#else
|
|
||||||
#include <QtQuick/QQuickView>
|
|
||||||
typedef QQuickView QuickContainer;
|
|
||||||
#endif
|
|
||||||
#include <QtQml/QQmlContext>
|
#include <QtQml/QQmlContext>
|
||||||
#include <QtQml/QQmlEngine>
|
#include <QtQml/QQmlEngine>
|
||||||
|
|
||||||
@@ -168,7 +162,7 @@ private:
|
|||||||
void addKeyboardShortcuts();
|
void addKeyboardShortcuts();
|
||||||
|
|
||||||
QWidget *m_modeWidget;
|
QWidget *m_modeWidget;
|
||||||
QuickContainer *m_welcomePage;
|
QQuickWidget *m_welcomePage;
|
||||||
QMap<Id, IWelcomePage *> m_idPageMap;
|
QMap<Id, IWelcomePage *> m_idPageMap;
|
||||||
QList<IWelcomePage *> m_pluginList;
|
QList<IWelcomePage *> m_pluginList;
|
||||||
int m_activePlugin;
|
int m_activePlugin;
|
||||||
@@ -202,28 +196,21 @@ WelcomeMode::WelcomeMode()
|
|||||||
layout->setMargin(0);
|
layout->setMargin(0);
|
||||||
layout->setSpacing(0);
|
layout->setSpacing(0);
|
||||||
|
|
||||||
m_welcomePage = new QuickContainer();
|
m_welcomePage = new QQuickWidget;
|
||||||
applyTheme(); // initialize background color and theme properties
|
applyTheme(); // initialize background color and theme properties
|
||||||
m_welcomePage->setResizeMode(QuickContainer::SizeRootObjectToView);
|
m_welcomePage->setResizeMode(QQuickWidget::SizeRootObjectToView);
|
||||||
|
|
||||||
m_welcomePage->setObjectName(QLatin1String("WelcomePage"));
|
m_welcomePage->setObjectName(QLatin1String("WelcomePage"));
|
||||||
|
|
||||||
connect(m_welcomePage, &QuickContainer::sceneGraphError,
|
connect(m_welcomePage, &QQuickWidget::sceneGraphError,
|
||||||
this, &WelcomeMode::sceneGraphError);
|
this, &WelcomeMode::sceneGraphError);
|
||||||
|
|
||||||
StyledBar *styledBar = new StyledBar(m_modeWidget);
|
StyledBar *styledBar = new StyledBar(m_modeWidget);
|
||||||
styledBar->setObjectName(QLatin1String("WelcomePageStyledBar"));
|
styledBar->setObjectName(QLatin1String("WelcomePageStyledBar"));
|
||||||
layout->addWidget(styledBar);
|
layout->addWidget(styledBar);
|
||||||
|
|
||||||
#ifdef USE_QUICK_WIDGET
|
|
||||||
m_welcomePage->setParent(m_modeWidget);
|
m_welcomePage->setParent(m_modeWidget);
|
||||||
layout->addWidget(m_welcomePage);
|
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();
|
addKeyboardShortcuts();
|
||||||
|
|
||||||
@@ -307,15 +294,8 @@ void WelcomeMode::facilitateQml(QQmlEngine *engine)
|
|||||||
|
|
||||||
QQmlContext *ctx = engine->rootContext();
|
QQmlContext *ctx = engine->rootContext();
|
||||||
ctx->setContextProperty(QLatin1String("welcomeMode"), this);
|
ctx->setContextProperty(QLatin1String("welcomeMode"), this);
|
||||||
|
|
||||||
ctx->setContextProperty(QLatin1String("creatorTheme"), &m_themeProperties);
|
ctx->setContextProperty(QLatin1String("creatorTheme"), &m_themeProperties);
|
||||||
|
ctx->setContextProperty(QLatin1String("useNativeText"), true);
|
||||||
#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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WelcomeMode::initPlugins()
|
void WelcomeMode::initPlugins()
|
||||||
|
|||||||
9
src/tools/3rdparty/iossim_1_8_2/main.mm
vendored
9
src/tools/3rdparty/iossim_1_8_2/main.mm
vendored
@@ -8,11 +8,7 @@
|
|||||||
#import <AppKit/AppKit.h>
|
#import <AppKit/AppKit.h>
|
||||||
#import "iphonesimulator.h"
|
#import "iphonesimulator.h"
|
||||||
#include <QLibrary>
|
#include <QLibrary>
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
|
||||||
#include <QApplication>
|
|
||||||
#else
|
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#endif
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
@@ -29,12 +25,7 @@ int main (int argc, char *argv[]) {
|
|||||||
char *qtarg = 0;
|
char *qtarg = 0;
|
||||||
if (argc)
|
if (argc)
|
||||||
qtarg = argv[0];
|
qtarg = argv[0];
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
|
||||||
QApplication a(qtargc, &qtarg);
|
|
||||||
#else
|
|
||||||
QGuiApplication a(qtargc, &qtarg);
|
QGuiApplication a(qtargc, &qtarg);
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
//NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
//NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||||
|
|
||||||
|
|||||||
@@ -3,21 +3,17 @@ TEMPLATE = subdirs
|
|||||||
|
|
||||||
SUBDIRS = \
|
SUBDIRS = \
|
||||||
timelineabstractrenderer \
|
timelineabstractrenderer \
|
||||||
|
timelineitemsrenderpass \
|
||||||
timelinemodel \
|
timelinemodel \
|
||||||
timelinemodelaggregator \
|
timelinemodelaggregator \
|
||||||
timelinenotesmodel \
|
timelinenotesmodel \
|
||||||
|
timelinenotesrenderpass \
|
||||||
timelineoverviewrenderer \
|
timelineoverviewrenderer \
|
||||||
timelinerenderer \
|
timelinerenderer \
|
||||||
timelinerenderpass \
|
timelinerenderpass \
|
||||||
timelinerenderstate \
|
timelinerenderstate \
|
||||||
|
timelineselectionrenderpass \
|
||||||
timelinezoomcontrol
|
timelinezoomcontrol
|
||||||
|
|
||||||
minQtVersion(5,4,0) {
|
|
||||||
SUBDIRS += \
|
|
||||||
timelineitemsrenderpass \
|
|
||||||
timelinenotesrenderpass \
|
|
||||||
timelineselectionrenderpass
|
|
||||||
}
|
|
||||||
|
|
||||||
OTHER_FILES += \
|
OTHER_FILES += \
|
||||||
timelineautotest.qbs
|
timelineautotest.qbs
|
||||||
|
|||||||
Reference in New Issue
Block a user