aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/doc.pri6
-rw-r--r--qtcreator.pri10
-rw-r--r--share/qtcreator/static.pro2
-rw-r--r--share/qtcreator/translations/translations.pro8
-rw-r--r--src/app/main.cpp11
-rw-r--r--src/libs/cplusplus/cplusplus-lib.pri2
-rw-r--r--src/libs/extensionsystem/pluginmanager.cpp4
-rw-r--r--src/libs/qmljs/qmljsinterpreter.cpp21
-rw-r--r--src/libs/qmljs/qmljsmodelmanagerinterface.cpp2
-rw-r--r--src/libs/qmljs/qmljsplugindumper.cpp6
-rw-r--r--src/libs/utils/algorithm.h14
-rw-r--r--src/libs/utils/consoleprocess_p.h6
-rw-r--r--src/libs/utils/detailsbutton.cpp23
-rw-r--r--src/libs/utils/fancylineedit.cpp10
-rw-r--r--src/libs/utils/stylehelper.cpp16
-rw-r--r--src/libs/utils/synchronousprocess.cpp9
-rw-r--r--src/libs/zeroconf/servicebrowser.cpp5
-rw-r--r--src/plugins/android/androidmanifesteditorwidget.cpp4
-rw-r--r--src/plugins/beautifier/abstractsettings.cpp4
-rw-r--r--src/plugins/beautifier/configurationeditor.cpp4
-rw-r--r--src/plugins/coreplugin/coreplugin.pro12
-rw-r--r--src/plugins/coreplugin/editormanager/openeditorsview.cpp2
-rw-r--r--src/plugins/coreplugin/editormanager/openeditorsview.h2
-rw-r--r--src/plugins/coreplugin/editormanager/openeditorswindow.cpp4
-rw-r--r--src/plugins/coreplugin/fileutils.cpp9
-rw-r--r--src/plugins/coreplugin/find/searchresulttreeitemdelegate.cpp4
-rw-r--r--src/plugins/coreplugin/progressmanager/progressmanager_win.cpp20
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp2
-rw-r--r--src/plugins/debugger/debuggerprotocol.cpp9
-rw-r--r--src/plugins/fakevim/fakevim_test.cpp6
-rw-r--r--src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp14
-rw-r--r--src/plugins/git/gerrit/gerritmodel.cpp186
-rw-r--r--src/plugins/git/gerrit/gerritparameters.cpp12
-rw-r--r--src/plugins/help/help.pro12
-rw-r--r--src/plugins/imageviewer/imageviewer.pro8
-rw-r--r--src/plugins/projectexplorer/customwizard/customwizardparameters.cpp2
-rw-r--r--src/plugins/projectexplorer/metatypedeclarations.h10
-rw-r--r--src/plugins/projectexplorer/miniprojecttargetselector.cpp19
-rw-r--r--src/plugins/projectexplorer/projectexplorer.cpp18
-rw-r--r--src/plugins/projectexplorer/projectexplorer.pro9
-rw-r--r--src/plugins/qmljstools/qmljsmodelmanager.cpp2
-rw-r--r--src/plugins/qtsupport/qtsupport.pro10
-rw-r--r--src/plugins/qtsupport/qtsupportplugin.cpp6
-rw-r--r--src/plugins/texteditor/texteditor.pro3
-rw-r--r--src/plugins/vcsbase/submiteditorwidget.cpp8
-rw-r--r--src/plugins/welcome/welcomeplugin.cpp6
-rw-r--r--src/shared/proparser/proitems.cpp4
-rw-r--r--src/shared/qtsingleapplication/qtsingleapplication.pri3
-rw-r--r--src/tools/iostool/iosdevicemanager.cpp4
-rw-r--r--src/tools/iostool/main.cpp12
-rw-r--r--src/tools/qtcdebugger/qtcdebugger.pro2
-rw-r--r--src/tools/sdktool/main.cpp2
-rw-r--r--src/tools/tools.pro8
-rw-r--r--tests/auto/auto.pro8
-rw-r--r--tests/auto/debugger/dumpers.pro3
-rw-r--r--tests/auto/debugger/dumpers.qbs1
-rw-r--r--tests/auto/debugger/temporarydir.h217
-rw-r--r--tests/auto/debugger/tst_dumpers.cpp6
-rw-r--r--tests/auto/ioutils/ioutils.pro2
-rw-r--r--tests/auto/valgrind/memcheck/parsertests.cpp14
-rw-r--r--tests/manual/debugger/gui/gui.pro2
-rw-r--r--tests/manual/ssh/sftpfsmodel/sftpfsmodel.pro3
-rw-r--r--tests/manual/utils/tcpportsgatherer/tcpportsgatherer.pro3
63 files changed, 68 insertions, 788 deletions
diff --git a/doc/doc.pri b/doc/doc.pri
index 5590341240..7fcb3bc7e1 100644
--- a/doc/doc.pri
+++ b/doc/doc.pri
@@ -1,5 +1,5 @@
-HELPGENERATOR = $$targetPath($$[QT_INSTALL_BINS]/qhelpgenerator) -platform minimal
-QDOC_BIN = $$targetPath($$[QT_INSTALL_BINS]/qdoc)
+HELPGENERATOR = $$shell_path($$[QT_INSTALL_BINS]/qhelpgenerator) -platform minimal
+QDOC_BIN = $$shell_path($$[QT_INSTALL_BINS]/qdoc)
QDOC_GLOBAL = QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS/src] QDOC_INDEX_DIR=$$[QT_INSTALL_DOCS]
COMPAT =
@@ -90,6 +90,6 @@ QMAKE_EXTRA_TARGETS += html_docs dev_html_docs html_docs_online dev_html_docs_on
OTHER_FILES = $$HELP_DEP_FILES $$DEV_HELP_DEP_FILES
fixnavi.commands = \
- cd $$targetPath($$PWD) && \
+ cd $$shell_path($$PWD) && \
perl fixnavi.pl -Dqcmanual -Dqtquick src
QMAKE_EXTRA_TARGETS += fixnavi
diff --git a/qtcreator.pri b/qtcreator.pri
index cf273e412b..56a9e64abe 100644
--- a/qtcreator.pri
+++ b/qtcreator.pri
@@ -8,14 +8,6 @@ BINARY_ARTIFACTS_BRANCH = master
# enable c++11
CONFIG += c++11
-defineReplace(cleanPath) {
- return($$clean_path($$1))
-}
-
-defineReplace(targetPath) {
- return($$shell_path($$1))
-}
-
defineReplace(qtLibraryName) {
unset(LIBRARY_NAME)
LIBRARY_NAME = $$1
@@ -78,7 +70,7 @@ IDE_SOURCE_TREE = $$PWD
isEmpty(IDE_BUILD_TREE) {
sub_dir = $$_PRO_FILE_PWD_
sub_dir ~= s,^$$re_escape($$PWD),,
- IDE_BUILD_TREE = $$cleanPath($$OUT_PWD)
+ IDE_BUILD_TREE = $$clean_path($$OUT_PWD)
IDE_BUILD_TREE ~= s,$$re_escape($$sub_dir)$,,
}
IDE_APP_PATH = $$IDE_BUILD_TREE/bin
diff --git a/share/qtcreator/static.pro b/share/qtcreator/static.pro
index 7e417cd9bc..6b30b7f121 100644
--- a/share/qtcreator/static.pro
+++ b/share/qtcreator/static.pro
@@ -88,7 +88,7 @@ defineReplace(stripSrcResourceDir) {
} else {
!contains(1, ^/.*):1 = $$OUT_PWD/$$1
}
- out = $$cleanPath($$1)
+ out = $$clean_path($$1)
out ~= s|^$$re_escape($$SRCRESOURCEDIR)||$$i_flag
return($$out)
}
diff --git a/share/qtcreator/translations/translations.pro b/share/qtcreator/translations/translations.pro
index fd55debde3..d1fef6a40a 100644
--- a/share/qtcreator/translations/translations.pro
+++ b/share/qtcreator/translations/translations.pro
@@ -10,10 +10,10 @@ defineReplace(prependAll) {
return($$result)
}
-XMLPATTERNS = $$targetPath($$[QT_INSTALL_BINS]/xmlpatterns)
-LUPDATE = $$targetPath($$[QT_INSTALL_BINS]/lupdate) -locations relative -no-ui-lines -no-sort
-LRELEASE = $$targetPath($$[QT_INSTALL_BINS]/lrelease)
-LCONVERT = $$targetPath($$[QT_INSTALL_BINS]/lconvert)
+XMLPATTERNS = $$shell_path($$[QT_INSTALL_BINS]/xmlpatterns)
+LUPDATE = $$shell_path($$[QT_INSTALL_BINS]/lupdate) -locations relative -no-ui-lines -no-sort
+LRELEASE = $$shell_path($$[QT_INSTALL_BINS]/lrelease)
+LCONVERT = $$shell_path($$[QT_INSTALL_BINS]/lconvert)
wd = $$replace(IDE_SOURCE_TREE, /, $$QMAKE_DIR_SEP)
diff --git a/src/app/main.cpp b/src/app/main.cpp
index eeb4e56a8b..06c925b4b1 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -309,9 +309,7 @@ int main(int argc, char **argv)
QtSystemExceptionHandler systemExceptionHandler;
#endif
-#if QT_VERSION >= 0x050100
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
-#endif
// Manually determine -settingspath command line option
// We can't use the regular way of the plugin manager, because that needs to parse plugin meta data
@@ -365,23 +363,14 @@ int main(int argc, char **argv)
QTranslator translator;
QTranslator qtTranslator;
QStringList uiLanguages;
-// uiLanguages crashes on Windows with 4.8.0 release builds
-#if (QT_VERSION >= 0x040801) || (QT_VERSION >= 0x040800 && !defined(Q_OS_WIN))
uiLanguages = QLocale::system().uiLanguages();
-#else
- uiLanguages << QLocale::system().name();
-#endif
QString overrideLanguage = settings->value(QLatin1String("General/OverrideLanguage")).toString();
if (!overrideLanguage.isEmpty())
uiLanguages.prepend(overrideLanguage);
const QString &creatorTrPath = QCoreApplication::applicationDirPath()
+ QLatin1String(SHARE_PATH "/translations");
foreach (QString locale, uiLanguages) {
-#if (QT_VERSION >= 0x050000)
locale = QLocale(locale).name();
-#else
- locale.replace(QLatin1Char('-'), QLatin1Char('_')); // work around QTBUG-25973
-#endif
if (translator.load(QLatin1String("qtcreator_") + locale, creatorTrPath)) {
const QString &qtTrPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
const QString &qtTrFile = QLatin1String("qt_") + locale;
diff --git a/src/libs/cplusplus/cplusplus-lib.pri b/src/libs/cplusplus/cplusplus-lib.pri
index 7d2a3c9aca..826d9dfa10 100644
--- a/src/libs/cplusplus/cplusplus-lib.pri
+++ b/src/libs/cplusplus/cplusplus-lib.pri
@@ -8,7 +8,7 @@ INCLUDEPATH *= $$IDE_SOURCE_TREE/src/libs/3rdparty
include(../3rdparty/cplusplus/cplusplus.pri)
-greaterThan(QT_MAJOR_VERSION, 4): QT += concurrent
+QT += concurrent
#DEFINES += DEBUG_INCLUDE_GUARD_TRACKING
diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp
index deac311ee3..01701f9516 100644
--- a/src/libs/extensionsystem/pluginmanager.cpp
+++ b/src/libs/extensionsystem/pluginmanager.cpp
@@ -714,11 +714,7 @@ void PluginManager::startTests()
const QMetaObject *metaObject = pluginSpec->plugin()->metaObject();
for (int i = metaObject->methodOffset(); i < metaObject->methodCount(); ++i) {
-#if QT_VERSION >= 0x050000
const QByteArray signature = metaObject->method(i).methodSignature();
-#else
- const QByteArray signature = metaObject->method(i).signature();
-#endif
if (signature.startsWith("test") && !signature.endsWith("_data()")) {
const QString method = QString::fromLatin1(signature);
const QString methodName = method.left(method.size() - 2);
diff --git a/src/libs/qmljs/qmljsinterpreter.cpp b/src/libs/qmljs/qmljsinterpreter.cpp
index c994be953c..febff509cc 100644
--- a/src/libs/qmljs/qmljsinterpreter.cpp
+++ b/src/libs/qmljs/qmljsinterpreter.cpp
@@ -248,13 +248,8 @@ CppComponentValue::CppComponentValue(FakeMetaObject::ConstPtr metaObject, const
CppComponentValue::~CppComponentValue()
{
-#if QT_VERSION >= 0x050000
delete m_metaSignatures.load();
delete m_signalScopes.load();
-#else
- delete m_metaSignatures;
- delete m_signalScopes;
-#endif
}
static QString generatedSlotName(const QString &base)
@@ -292,11 +287,7 @@ void CppComponentValue::processMembers(MemberProcessor *processor) const
QSet<QString> explicitSignals;
// make MetaFunction instances lazily when first needed
-#if QT_VERSION >= 0x050000
QList<const Value *> *signatures = m_metaSignatures.load();
-#else
- QList<const Value *> *signatures = m_metaSignatures;
-#endif
if (!signatures) {
signatures = new QList<const Value *>;
signatures->reserve(m_metaObject->methodCount());
@@ -304,11 +295,7 @@ void CppComponentValue::processMembers(MemberProcessor *processor) const
signatures->append(new Internal::MetaFunction(m_metaObject->method(index), valueOwner()));
if (!m_metaSignatures.testAndSetOrdered(0, signatures)) {
delete signatures;
-#if QT_VERSION >= 0x050000
signatures = m_metaSignatures.load();
-#else
- signatures = m_metaSignatures;
-#endif
}
}
@@ -536,11 +523,7 @@ const QmlEnumValue *CppComponentValue::getEnumValue(const QString &typeName, con
const ObjectValue *CppComponentValue::signalScope(const QString &signalName) const
{
-#if QT_VERSION >= 0x050000
QHash<QString, const ObjectValue *> *scopes = m_signalScopes.load();
-#else
- QHash<QString, const ObjectValue *> *scopes = m_signalScopes;
-#endif
if (!scopes) {
scopes = new QHash<QString, const ObjectValue *>;
// usually not all methods are signals
@@ -566,11 +549,7 @@ const ObjectValue *CppComponentValue::signalScope(const QString &signalName) con
}
if (!m_signalScopes.testAndSetOrdered(0, scopes)) {
delete scopes;
-#if QT_VERSION >= 0x050000
scopes = m_signalScopes.load();
-#else
- scopes = m_signalScopes;
-#endif
}
}
diff --git a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
index fb2c24c4a4..565c4d5a39 100644
--- a/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
+++ b/src/libs/qmljs/qmljsmodelmanagerinterface.cpp
@@ -120,10 +120,8 @@ ModelManagerInterface::ModelManagerInterface(QObject *parent)
m_defaultProjectInfo.qtImportsPath = QFileInfo(
QLibraryInfo::location(QLibraryInfo::ImportsPath)).canonicalFilePath();
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
m_defaultProjectInfo.qtQmlPath = QFileInfo(
QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath)).canonicalFilePath();
-#endif
m_defaultImportPaths << environmentImportPaths();
updateImportPaths();
diff --git a/src/libs/qmljs/qmljsplugindumper.cpp b/src/libs/qmljs/qmljsplugindumper.cpp
index 28e6661a67..d67322922f 100644
--- a/src/libs/qmljs/qmljsplugindumper.cpp
+++ b/src/libs/qmljs/qmljsplugindumper.cpp
@@ -262,11 +262,7 @@ static void printParseWarnings(const QString &libraryPath, const QString &warnin
static QString qmlPluginDumpErrorMessage(QProcess *process)
{
QString errorMessage;
-#if QT_VERSION >= 0x050000
const QString binary = QDir::toNativeSeparators(process->program());
-#else
- const QString binary = QLatin1String("qmlplugindump");
-#endif
switch (process->error()) {
case QProcess::FailedToStart:
errorMessage = PluginDumper::tr("\"%1\" failed to start: %2").arg(binary, process->errorString());
@@ -286,9 +282,7 @@ static QString qmlPluginDumpErrorMessage(QProcess *process)
errorMessage = PluginDumper::tr("\"%1\" returned exit code %2.").arg(binary).arg(process->exitCode());
break;
}
-#if QT_VERSION >= 0x050000
errorMessage += QLatin1Char('\n') + PluginDumper::tr("Arguments: %1").arg(process->arguments().join(QLatin1Char(' ')));
-#endif
if (process->error() != QProcess::FailedToStart) {
const QString stdErr = QString::fromLocal8Bit(process->readAllStandardError());
if (!stdErr.isEmpty()) {
diff --git a/src/libs/utils/algorithm.h b/src/libs/utils/algorithm.h
index 77d6458f4b..dc95f93377 100644
--- a/src/libs/utils/algorithm.h
+++ b/src/libs/utils/algorithm.h
@@ -30,21 +30,11 @@
#ifndef ALGORITHM_H
#define ALGORITHM_H
+#include <qcompilerdetection.h> // for Q_REQUIRED_RESULT
+
#include <algorithm>
#include <functional>
-#if QT_VERSION < 0x050000
- #ifndef Q_REQUIRED_RESULT
- # if defined(Q_CC_GNU)
- # define Q_REQUIRED_RESULT __attribute__ ((warn_unused_result))
- # else
- # define Q_REQUIRED_RESULT
- # endif
- #endif
-#else
- #include <qcompilerdetection.h> // for Q_REQUIRED_RESULT
-#endif
-
namespace Utils
{
//////////////////
diff --git a/src/libs/utils/consoleprocess_p.h b/src/libs/utils/consoleprocess_p.h
index 8a5bee324c..13d6d4ec83 100644
--- a/src/libs/utils/consoleprocess_p.h
+++ b/src/libs/utils/consoleprocess_p.h
@@ -43,11 +43,7 @@ class QTimer;
QT_END_NAMESPACE
#ifdef Q_OS_WIN
-# if QT_VERSION >= 0x050000
-# include <QWinEventNotifier>
-# else
-# include <private/qwineventnotifier_p.h>
-# endif
+# include <QWinEventNotifier>
# include <windows.h>
#endif
diff --git a/src/libs/utils/detailsbutton.cpp b/src/libs/utils/detailsbutton.cpp
index 3d33296d26..5dd1b36fd7 100644
--- a/src/libs/utils/detailsbutton.cpp
+++ b/src/libs/utils/detailsbutton.cpp
@@ -32,15 +32,12 @@
#include <utils/hostosinfo.h>
#include <QGraphicsOpacityEffect>
+#include <QGuiApplication>
#include <QPropertyAnimation>
#include <QPaintEvent>
#include <QPainter>
#include <QStyleOption>
-#if QT_VERSION >= 0x050100
-#include <QGuiApplication>
-#endif
-
using namespace Utils;
FadingWidget::FadingWidget(QWidget *parent) :
@@ -127,19 +124,12 @@ void DetailsButton::paintEvent(QPaintEvent *e)
if (!HostOsInfo::isMacHost() && !isDown() && m_fader > 0)
p.fillRect(rect().adjusted(1, 1, -2, -2), QColor(255, 255, 255, int(m_fader*180)));
- qreal checkedPixmapRatio = 1.0;
- qreal uncheckedPixmapRatio = 1.0;
-#if QT_VERSION >= 0x050100
- checkedPixmapRatio = m_checkedPixmap.devicePixelRatio();
- uncheckedPixmapRatio = m_uncheckedPixmap.devicePixelRatio();
-#endif
-
if (isChecked()) {
- if (m_checkedPixmap.isNull() || m_checkedPixmap.size() / checkedPixmapRatio != contentsRect().size())
+ if (m_checkedPixmap.isNull() || m_checkedPixmap.size() / m_checkedPixmap.devicePixelRatio() != contentsRect().size())
m_checkedPixmap = cacheRendering(contentsRect().size(), true);
p.drawPixmap(contentsRect(), m_checkedPixmap);
} else {
- if (m_uncheckedPixmap.isNull() || m_uncheckedPixmap.size() / uncheckedPixmapRatio != contentsRect().size())
+ if (m_uncheckedPixmap.isNull() || m_uncheckedPixmap.size() / m_uncheckedPixmap.devicePixelRatio() != contentsRect().size())
m_uncheckedPixmap = cacheRendering(contentsRect().size(), false);
p.drawPixmap(contentsRect(), m_uncheckedPixmap);
}
@@ -156,14 +146,9 @@ QPixmap DetailsButton::cacheRendering(const QSize &size, bool checked)
lg.setCoordinateMode(QGradient::ObjectBoundingMode);
lg.setFinalStop(0, 1);
- qreal pixelRatio = 1.0;
-#if QT_VERSION >= 0x050100
- pixelRatio = devicePixelRatio();
-#endif
+ const qreal pixelRatio = devicePixelRatio();
QPixmap pixmap(size * pixelRatio);
-#if QT_VERSION >= 0x050100
pixmap.setDevicePixelRatio(pixelRatio);
-#endif
pixmap.fill(Qt::transparent);
QPainter p(&pixmap);
p.setRenderHint(QPainter::Antialiasing, true);
diff --git a/src/libs/utils/fancylineedit.cpp b/src/libs/utils/fancylineedit.cpp
index 51415c903b..fd64b4b4cb 100644
--- a/src/libs/utils/fancylineedit.cpp
+++ b/src/libs/utils/fancylineedit.cpp
@@ -498,10 +498,7 @@ IconButton::IconButton(QWidget *parent)
void IconButton::paintEvent(QPaintEvent *)
{
- qreal pixmapRatio = 1.0;
-#if QT_VERSION >= 0x050100
- pixmapRatio = m_pixmap.devicePixelRatio();
-#endif
+ const qreal pixmapRatio = m_pixmap.devicePixelRatio();
QStylePainter painter(this);
QRect pixmapRect = QRect(0, 0, m_pixmap.width()/pixmapRatio, m_pixmap.height()/pixmapRatio);
pixmapRect.moveCenter(rect().center());
@@ -541,10 +538,7 @@ void IconButton::animateShow(bool visible)
QSize IconButton::sizeHint() const
{
- qreal pixmapRatio = 1.0;
-#if QT_VERSION >= 0x050100
- pixmapRatio = m_pixmap.devicePixelRatio();
-#endif
+ const qreal pixmapRatio = m_pixmap.devicePixelRatio();
return QSize(m_pixmap.width()/pixmapRatio, m_pixmap.height()/pixmapRatio);
}
diff --git a/src/libs/utils/stylehelper.cpp b/src/libs/utils/stylehelper.cpp
index 58c9405af2..ac4061a234 100644
--- a/src/libs/utils/stylehelper.cpp
+++ b/src/libs/utils/stylehelper.cpp
@@ -349,16 +349,6 @@ void StyleHelper::menuGradient(QPainter *painter, const QRect &spanRect, const Q
}
}
-static qreal pixmapDevicePixelRatio(const QPixmap &pixmap)
-{
-#if QT_VERSION > 0x050000
- return pixmap.devicePixelRatio();
-#else
- Q_UNUSED(pixmap);
- return 1.0;
-#endif
-}
-
// Draws a cached pixmap with shadow
void StyleHelper::drawIconWithShadow(const QIcon &icon, const QRect &rect,
QPainter *p, QIcon::Mode iconMode, int dipRadius, const QColor &color, const QPoint &dipOffset)
@@ -373,7 +363,7 @@ void StyleHelper::drawIconWithShadow(const QIcon &icon, const QRect &rect,
// different than 1. The shadow drawing caluculations are done in device
// pixels.
QPixmap px = icon.pixmap(rect.size());
- int devicePixelRatio = qCeil(pixmapDevicePixelRatio(px));
+ int devicePixelRatio = qCeil(px.devicePixelRatio());
int radius = dipRadius * devicePixelRatio;
QPoint offset = dipOffset * devicePixelRatio;
cache = QPixmap(px.size() + QSize(radius * 2, radius * 2));
@@ -428,14 +418,12 @@ void StyleHelper::drawIconWithShadow(const QIcon &icon, const QRect &rect,
// Draw the actual pixmap...
cachePainter.drawPixmap(QRect(QPoint(radius, radius) + offset, QSize(px.width(), px.height())), px);
-#if QT_VERSION > 0x050000
cache.setDevicePixelRatio(devicePixelRatio);
-#endif
QPixmapCache::insert(pixmapName, cache);
}
QRect targetRect = cache.rect();
- targetRect.setSize(targetRect.size() / pixmapDevicePixelRatio(cache));
+ targetRect.setSize(targetRect.size() / cache.devicePixelRatio());
targetRect.moveCenter(rect.center() - dipOffset);
p->drawPixmap(targetRect, cache);
}
diff --git a/src/libs/utils/synchronousprocess.cpp b/src/libs/utils/synchronousprocess.cpp
index 4b99d6290a..01e2ac4b79 100644
--- a/src/libs/utils/synchronousprocess.cpp
+++ b/src/libs/utils/synchronousprocess.cpp
@@ -614,14 +614,7 @@ bool SynchronousProcess::readDataFromProcess(QProcess &p, int timeOutMS,
}
// Prompt user, pretend we have data if says 'No'.
const bool hang = !hasData && !finished;
- if (hang && showTimeOutMessageBox) {
- QString binary;
-#if QT_VERSION >= 0x050000
- binary = p.program();
-#endif
- if (!askToKill(binary))
- hasData = true;
- }
+ hasData = hang && showTimeOutMessageBox && !askToKill(p.program());
} while (hasData && !finished);
if (syncDebug)
qDebug() << "<readDataFromProcess" << finished;
diff --git a/src/libs/zeroconf/servicebrowser.cpp b/src/libs/zeroconf/servicebrowser.cpp
index a2cb63b1f8..057407145c 100644
--- a/src/libs/zeroconf/servicebrowser.cpp
+++ b/src/libs/zeroconf/servicebrowser.cpp
@@ -1958,12 +1958,7 @@ ZConfLib::ConnectionRef MainConnection::mainRef()
MainConnection::Status MainConnection::status()
{
-#if QT_VERSION >= 0x050000
return static_cast<MainConnection::Status>(m_status.load());
-#else
- int val = m_status;
- return static_cast<MainConnection::Status>(val);
-#endif
}
QList<ErrorMessage> MainConnection::errors()
diff --git a/src/plugins/android/androidmanifesteditorwidget.cpp b/src/plugins/android/androidmanifesteditorwidget.cpp
index c65f5e7c28..11f90fdae0 100644
--- a/src/plugins/android/androidmanifesteditorwidget.cpp
+++ b/src/plugins/android/androidmanifesteditorwidget.cpp
@@ -855,11 +855,7 @@ int extractVersion(const QString &string)
int index = string.indexOf(QLatin1Char(':'));
if (index == -1)
return 0;
-#if QT_VERSION < 0x050100
- return string.mid(4, index - 4).toInt();
-#else
return string.midRef(4, index - 4).toInt();
-#endif
}
void AndroidManifestEditorWidget::syncToEditor()
diff --git a/src/plugins/beautifier/abstractsettings.cpp b/src/plugins/beautifier/abstractsettings.cpp
index bf164cef28..ffcc32f865 100644
--- a/src/plugins/beautifier/abstractsettings.cpp
+++ b/src/plugins/beautifier/abstractsettings.cpp
@@ -65,11 +65,7 @@ QStringList AbstractSettings::completerWords()
QStringList AbstractSettings::styles() const
{
QStringList list = m_styles.keys();
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
list.sort(Qt::CaseInsensitive);
-#else //QT_VERSION_CHECK(5, 0, 0)
- list.sort();
-#endif // QT_VERSION_CHECK(5, 0, 0)
return list;
}
diff --git a/src/plugins/beautifier/configurationeditor.cpp b/src/plugins/beautifier/configurationeditor.cpp
index 898de0a122..b79ff9cbf2 100644
--- a/src/plugins/beautifier/configurationeditor.cpp
+++ b/src/plugins/beautifier/configurationeditor.cpp
@@ -123,11 +123,7 @@ void ConfigurationEditor::setSettings(AbstractSettings *settings)
QStringList keywords = m_settings->options();
m_highlighter->setKeywords(keywords);
keywords << m_settings->completerWords();
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
keywords.sort(Qt::CaseInsensitive);
-#else //QT_VERSION_CHECK(5, 0, 0)
- keywords.sort();
-#endif //QT_VERSION_CHECK(5, 0, 0)
m_model->setStringList(keywords);
}
diff --git a/src/plugins/coreplugin/coreplugin.pro b/src/plugins/coreplugin/coreplugin.pro
index 64c7acf596..ee6cb507b9 100644
--- a/src/plugins/coreplugin/coreplugin.pro
+++ b/src/plugins/coreplugin/coreplugin.pro
@@ -1,14 +1,10 @@
DEFINES += CORE_LIBRARY
-QT += network \
+QT += help \
+ network \
+ printsupport \
script \
sql
-greaterThan(QT_MAJOR_VERSION, 4) {
- QT += help printsupport
-} else {
- CONFIG += help
-}
-
include(../../qtcreatorplugin.pri)
include(../../shared/scriptwrapper/scriptwrapper.pri)
win32-msvc*:QMAKE_CXXFLAGS += -wd4251 -wd4290 -wd4250
@@ -227,7 +223,7 @@ include(locator/locator.pri)
win32 {
SOURCES += progressmanager/progressmanager_win.cpp
- greaterThan(QT_MAJOR_VERSION, 4): QT += gui-private # Uses QPlatformNativeInterface.
+ QT += gui-private # Uses QPlatformNativeInterface.
LIBS += -lole32 -luser32
}
else:macx {
diff --git a/src/plugins/coreplugin/editormanager/openeditorsview.cpp b/src/plugins/coreplugin/editormanager/openeditorsview.cpp
index 7c77dcf37c..18d8d1d317 100644
--- a/src/plugins/coreplugin/editormanager/openeditorsview.cpp
+++ b/src/plugins/coreplugin/editormanager/openeditorsview.cpp
@@ -309,12 +309,10 @@ void ProxyModel::setSourceModel(QAbstractItemModel *sm)
}
}
-#if QT_VERSION >= 0x050000
QModelIndex ProxyModel::sibling(int row, int column, const QModelIndex &idx) const
{
return QAbstractItemModel::sibling(row, column, idx);
}
-#endif
void ProxyModel::sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
{
diff --git a/src/plugins/coreplugin/editormanager/openeditorsview.h b/src/plugins/coreplugin/editormanager/openeditorsview.h
index 01479ae93d..36e19261cf 100644
--- a/src/plugins/coreplugin/editormanager/openeditorsview.h
+++ b/src/plugins/coreplugin/editormanager/openeditorsview.h
@@ -57,10 +57,8 @@ public:
void setSourceModel(QAbstractItemModel *sourceModel);
-#if QT_VERSION >= 0x050000
// QAbstractProxyModel::sibling is broken in Qt 5
QModelIndex sibling(int row, int column, const QModelIndex &idx) const;
-#endif
private slots:
void sourceDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
diff --git a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp
index 8f33f6401f..62c38903ca 100644
--- a/src/plugins/coreplugin/editormanager/openeditorswindow.cpp
+++ b/src/plugins/coreplugin/editormanager/openeditorswindow.cpp
@@ -160,11 +160,7 @@ void OpenEditorsWindow::selectPreviousEditor()
QSize OpenEditorsTreeWidget::sizeHint() const
{
return QSize(sizeHintForColumn(0) + verticalScrollBar()->width() + frameWidth() * 2,
-#if QT_VERSION < 0x050200
- minimumHeight());
-#else
viewportSizeHint().height() + frameWidth() * 2);
-#endif
}
QSize OpenEditorsWindow::sizeHint() const
diff --git a/src/plugins/coreplugin/fileutils.cpp b/src/plugins/coreplugin/fileutils.cpp
index 7a90335aa3..c7355ad5cc 100644
--- a/src/plugins/coreplugin/fileutils.cpp
+++ b/src/plugins/coreplugin/fileutils.cpp
@@ -47,10 +47,6 @@
#include <QPushButton>
#include <QWidget>
-#if QT_VERSION < 0x050000
-#include <QAbstractFileEngine>
-#endif
-
using namespace Utils;
namespace Core {
@@ -187,11 +183,6 @@ void FileUtils::removeFile(const QString &filePath, bool deleteFromFS)
static inline bool fileSystemRenameFile(const QString &orgFilePath,
const QString &newFilePath)
{
-#if QT_VERSION < 0x050000
- QAbstractFileEngine *fileEngine = QAbstractFileEngine::create(orgFilePath); // Due to QTBUG-3570
- if (!fileEngine->caseSensitive() && orgFilePath.compare(newFilePath, Qt::CaseInsensitive) == 0)
- return fileEngine->rename(newFilePath);
-#endif
// QTBUG-3570 is also valid for Qt 5 but QAbstractFileEngine is now in a private header file and
// the symbol is not exported.
return QFile::rename(orgFilePath, newFilePath);
diff --git a/src/plugins/coreplugin/find/searchresulttreeitemdelegate.cpp b/src/plugins/coreplugin/find/searchresulttreeitemdelegate.cpp
index 949a298f62..f9df32d185 100644
--- a/src/plugins/coreplugin/find/searchresulttreeitemdelegate.cpp
+++ b/src/plugins/coreplugin/find/searchresulttreeitemdelegate.cpp
@@ -65,11 +65,7 @@ void SearchResultTreeItemDelegate::paint(QPainter *painter, const QStyleOptionVi
if (checkable) {
QVariant checkStateData = index.data(Qt::CheckStateRole);
checkState = static_cast<Qt::CheckState>(checkStateData.toInt());
-#if QT_VERSION >= 0x050000
checkRect = doCheck(opt, opt.rect, checkStateData);
-#else // Qt4
- checkRect = check(opt, opt.rect, checkStateData);
-#endif
}
// icon
diff --git a/src/plugins/coreplugin/progressmanager/progressmanager_win.cpp b/src/plugins/coreplugin/progressmanager/progressmanager_win.cpp
index b91b4542d1..d069e8345f 100644
--- a/src/plugins/coreplugin/progressmanager/progressmanager_win.cpp
+++ b/src/plugins/coreplugin/progressmanager/progressmanager_win.cpp
@@ -27,18 +27,16 @@
**
****************************************************************************/
+#include <QGuiApplication>
#include <QVariant>
#include <QMainWindow>
#include <QFont>
#include <QFontMetrics>
#include <QPixmap>
#include <QPainter>
-#if QT_VERSION >= 0x050000
-# include <QGuiApplication>
-# include <QWindow>
-# include <qpa/qplatformnativeinterface.h>
-#endif
+#include <QWindow>
#include <QLabel>
+#include <qpa/qplatformnativeinterface.h>
#include <coreplugin/icore.h>
#include <utils/stylehelper.h>
@@ -58,8 +56,6 @@ namespace {
ITaskbarList3* pITask = 0;
}
-#if QT_VERSION >= 0x050000
-
QT_BEGIN_NAMESPACE
Q_GUI_EXPORT HICON qt_pixmapToWinHICON(const QPixmap &p);
QT_END_NAMESPACE
@@ -80,12 +76,6 @@ static inline HWND hwndOfWidget(const QWidget *w)
result = QGuiApplication::platformNativeInterface()->nativeResourceForWindow("handle", window);
return static_cast<HWND>(result);
}
-#else
-static inline HWND hwndOfWidget(const QWidget *w)
-{
- return w->winId();
-}
-#endif
void Core::Internal::ProgressManagerPrivate::initInternal()
{
@@ -131,11 +121,7 @@ void Core::Internal::ProgressManagerPrivate::doSetApplicationLabel(const QString
font.setPixelSize(pix.height() * 0.5);
p.setFont(font);
p.drawText(pix.rect(), Qt::AlignCenter, text);
-#if QT_VERSION >= 0x050000
const HICON icon = qt_pixmapToWinHICON(pix);
-#else
- const HICON icon = pix.toWinHICON();
-#endif
pITask->SetOverlayIcon(winId, icon, (wchar_t*)text.utf16());
DestroyIcon(icon);
}
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 175bebe12e..12a6c31b60 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -2699,9 +2699,7 @@ QMessageBox *showMessageBox(int icon, const QString &title,
title, text, QMessageBox::StandardButtons(buttons),
ICore::mainWindow());
mb->setAttribute(Qt::WA_DeleteOnClose);
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0))
mb->setTextInteractionFlags(Qt::TextSelectableByMouse);
-#endif
mb->show();
return mb;
}
diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp
index 1897527e49..fa25363005 100644
--- a/src/plugins/debugger/debuggerprotocol.cpp
+++ b/src/plugins/debugger/debuggerprotocol.cpp
@@ -34,9 +34,7 @@
#include <QDebug>
#include <QHostAddress>
#include <QRegExp>
-#if QT_VERSION >= 0x050200
#include <QTimeZone>
-#endif
#include <ctype.h>
@@ -512,7 +510,6 @@ static QTime timeFromData(int ms)
return ms == -1 ? QTime() : QTime(0, 0, 0, 0).addMSecs(ms);
}
-#if QT_VERSION >= 0x050200
// Stolen and adapted from qdatetime.cpp
static void getDateTime(qint64 msecs, int status, QDate *date, QTime *time)
{
@@ -559,7 +556,6 @@ static void getDateTime(qint64 msecs, int status, QDate *date, QTime *time)
*date = (status & NullDate) ? QDate() : QDate::fromJulianDay(jd);
*time = (status & NullTime) ? QTime() : QTime::fromMSecsSinceStartOfDay(ds);
}
-#endif
QString decodeData(const QByteArray &ba, int encoding)
{
@@ -688,7 +684,6 @@ QString decodeData(const QByteArray &ba, int encoding)
return QString::fromUtf8(decodedBa);
}
case DateTimeInternal: { // 29, DateTimeInternal: msecs, spec, offset, tz, status
-#if QT_VERSION >= 0x050200
int p0 = ba.indexOf('/');
int p1 = ba.indexOf('/', p0 + 1);
int p2 = ba.indexOf('/', p1 + 1);
@@ -719,10 +714,6 @@ QString decodeData(const QByteArray &ba, int encoding)
dateTime = QDateTime(date, time, spec);
}
return dateTime.toString();
-#else
- // "Very plain".
- return QString::fromLatin1(ba);
-#endif
}
}
qDebug() << "ENCODING ERROR: " << encoding;
diff --git a/src/plugins/fakevim/fakevim_test.cpp b/src/plugins/fakevim/fakevim_test.cpp
index 0aad5370fb..039018f765 100644
--- a/src/plugins/fakevim/fakevim_test.cpp
+++ b/src/plugins/fakevim/fakevim_test.cpp
@@ -49,11 +49,7 @@
* Tests after this macro will be skipped and warning printed.
* Uncomment it to test a feature -- if tests succeeds it should be removed from the test.
*/
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-# define NOT_IMPLEMENTED QSKIP("Not fully implemented!", SkipSingle);
-#else
-# define NOT_IMPLEMENTED QSKIP("Not fully implemented!");
-#endif
+#define NOT_IMPLEMENTED QSKIP("Not fully implemented!");
// Text cursor representation in comparisons.
#define X "|"
diff --git a/src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp b/src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp
index c645837865..b5222b1039 100644
--- a/src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp
+++ b/src/plugins/genericprojectmanager/cppmodelmanagerhelper.cpp
@@ -63,21 +63,7 @@ void CppModelManagerHelper::waitForSourceFilesRefreshed(const QStringList &files
foreach (const QString &file, files) {
while (!m_refreshedSourceFiles.contains(file)) {
-#if QT_VERSION >= 0x050000
QVERIFY(spy.wait());
-#else // Qt 4.x
- class MyThread: public QThread
- {
- public:
- static void Zzzzz()
- {
- QThread::msleep(50);
- }
- };
-
- MyThread::Zzzzz();
- QCoreApplication::processEvents();
-#endif
}
QVERIFY(t.elapsed() <= timeOut);
}
diff --git a/src/plugins/git/gerrit/gerritmodel.cpp b/src/plugins/git/gerrit/gerritmodel.cpp
index e5f493f012..0b0eb97804 100644
--- a/src/plugins/git/gerrit/gerritmodel.cpp
+++ b/src/plugins/git/gerrit/gerritmodel.cpp
@@ -37,6 +37,10 @@
#include <vcsbase/vcsoutputwindow.h>
#include <utils/synchronousprocess.h>
+#include <QJsonArray>
+#include <QJsonDocument>
+#include <QJsonObject>
+#include <QJsonValue>
#include <QStringList>
#include <QProcess>
#include <QVariant>
@@ -47,15 +51,6 @@
#include <QScopedPointer>
#include <QTimer>
#include <QApplication>
-#if QT_VERSION >= 0x050000
-# include <QJsonDocument>
-# include <QJsonValue>
-# include <QJsonArray>
-# include <QJsonObject>
-#else
-# include <utils/json.h>
-# include <utils/qtcassert.h>
-#endif
enum { debug = 0 };
@@ -559,8 +554,6 @@ void GerritModel::clearData()
\endcode
*/
-#if QT_VERSION >= 0x050000
-// Qt 5 using the QJsonDocument classes.
static bool parseOutput(const QSharedPointer<GerritParameters> &parameters,
const QByteArray &output,
QList<GerritChangePtr> &result)
@@ -678,177 +671,6 @@ static bool parseOutput(const QSharedPointer<GerritParameters> &parameters,
}
return res;
}
-#else // QT_VERSION >= 0x050000
-// Qt 4.8 using the Json classes from utils.
-
-static inline int jsonIntMember(Utils::JsonObjectValue *object,
- const QString &key,
- int defaultValue = 0)
-{
- if (Utils::JsonValue *v = object->member(key)) {
- if (Utils::JsonIntValue *iv = v->toInt())
- return iv->value();
- if (Utils::JsonStringValue *sv = v->toString()) {
- bool ok;
- const int result = sv->value().toInt(&ok);
- if (ok)
- return result;
- }
- }
- return defaultValue;
-}
-
-static inline QString jsonStringMember(Utils::JsonObjectValue *object,
- const QString &key)
-{
- if (Utils::JsonValue *v = object->member(key))
- if (Utils::JsonStringValue *sv = v->toString())
- return sv->value();
- return QString();
-}
-
-static bool parseOutput(const QSharedPointer<GerritParameters> &parameters,
- const QByteArray &output,
- QList<GerritChangePtr> &result)
-{
- // The output consists of separate lines containing a document each
- const QList<QByteArray> lines = output.split('\n');
- const QString typeKey = QLatin1String("type");
- const QString idKey = QLatin1String("id");
- const QString dependsOnKey = QLatin1String("dependsOn");
- const QString neededByKey = QLatin1String("neededBy");
- const QString branchKey = QLatin1String("branch");
- const QString numberKey = QLatin1String("number");
- const QString ownerKey = QLatin1String("owner");
- const QString ownerNameKey = QLatin1String("name");
- const QString ownerEmailKey = QLatin1String("email");
- const QString statusKey = QLatin1String("status");
- const QString projectKey = QLatin1String("project");
- const QString titleKey = QLatin1String("subject");
- const QString urlKey = QLatin1String("url");
- const QString patchSetKey = QLatin1String("currentPatchSet");
- const QString refKey = QLatin1String("ref");
- const QString approvalsKey = QLatin1String("approvals");
- const QString approvalsValueKey = QLatin1String("value");
- const QString approvalsByKey = QLatin1String("by");
- const QString approvalsTypeKey = QLatin1String("type");
- const QString approvalsDescriptionKey = QLatin1String("description");
- const QString lastUpdatedKey = QLatin1String("lastUpdated");
- bool res = true;
- result.clear();
- result.reserve(lines.size());
-
- Utils::JsonMemoryPool pool;
-
- foreach (const QByteArray &line, lines) {
- if (line.isEmpty())
- continue;
- Utils::JsonValue *objectValue = Utils::JsonValue::create(QString::fromUtf8(line), &pool);
- if (!objectValue) {
- QString errorMessage = GerritModel::tr("Parse error: \"%1\"")
- .arg(QString::fromLocal8Bit(line));
- qWarning() << errorMessage;
- VcsBase::VcsOutputWindow::appendError(errorMessage);
- res = false;
- continue;
- }
- Utils::JsonObjectValue *object = objectValue->toObject();
- QTC_ASSERT(object, continue );
- GerritChangePtr change(new GerritChange);
- // Skip stats line: {"type":"stats","rowCount":9,"runTimeMilliseconds":13}
- if (jsonStringMember(object, typeKey) == QLatin1String("stats"))
- continue;
- // Read current patch set.
- if (Utils::JsonValue *patchSetValue = object->member(patchSetKey)) {
- Utils::JsonObjectValue *patchSet = patchSetValue->toObject();
- QTC_ASSERT(patchSet, continue );
- const int n = jsonIntMember(patchSet, numberKey);
- change->currentPatchSet.patchSetNumber = qMax(1, n);
- change->currentPatchSet.ref = jsonStringMember(patchSet, refKey);
- if (Utils::JsonValue *approvalsV = patchSet->member(approvalsKey)) {
- Utils::JsonArrayValue *approvals = approvalsV->toArray();
- QTC_ASSERT(approvals, continue );
- foreach (Utils::JsonValue *c, approvals->elements()) {
- Utils::JsonObjectValue *oc = c->toObject();
- QTC_ASSERT(oc, break );
- const int value = jsonIntMember(oc, approvalsValueKey);
- QString by;
- QString byMail;
- if (Utils::JsonValue *byV = oc->member(approvalsByKey)) {
- Utils::JsonObjectValue *byO = byV->toObject();
- QTC_ASSERT(byO, break );
- by = jsonStringMember(byO, ownerNameKey);
- byMail = jsonStringMember(byO, ownerEmailKey);
- }
- GerritApproval a;
- a.reviewer = by;
- a.email = byMail;
- a.approval = value;
- a.type = jsonStringMember(oc, approvalsTypeKey);
- a.description = jsonStringMember(oc, approvalsDescriptionKey);
- change->currentPatchSet.approvals.push_back(a);
- }
- qStableSort(change->currentPatchSet.approvals.begin(),
- change->currentPatchSet.approvals.end(),
- gerritApprovalLessThan);
- }
- } // patch set
- // Remaining
-
- change->number = jsonIntMember(object, numberKey);
- change->url = jsonStringMember(object, urlKey);
- if (change->url.isEmpty()) // No "canonicalWebUrl" is in gerrit.config.
- change->url = defaultUrl(parameters, change->number);
- change->id = jsonStringMember(object, idKey);
- change->title = jsonStringMember(object, titleKey);
- if (Utils::JsonValue *ownerV = object->member(ownerKey)) {
- Utils::JsonObjectValue *ownerO = ownerV->toObject();
- QTC_ASSERT(ownerO, continue );
- change->owner = jsonStringMember(ownerO, ownerNameKey);
- change->email = jsonStringMember(ownerO, ownerEmailKey);
- }
- change->project = jsonStringMember(object, projectKey);
- change->branch = jsonStringMember(object, branchKey);
- change->status = jsonStringMember(object, statusKey);
-
- if (const int timeT = jsonIntMember(object, lastUpdatedKey))
- change->lastUpdated = QDateTime::fromTime_t(timeT);
- if (change->isValid()) {
- result.push_back(change);
- } else {
- QString errorMessage = GerritModel::tr("Parse error in line \"%1\"")
- .arg(QString::fromLocal8Bit(line));
- VcsBase::VcsOutputWindow::appendError(errorMessage);
- qWarning("%s: Parse error in line '%s'.", Q_FUNC_INFO, line.constData());
- res = false;
- }
- // Read out dependencies
- if (Utils::JsonValue *dependsOnValue = object->member(dependsOnKey)) {
- if (Utils::JsonArrayValue *dependsOnArray = dependsOnValue->toArray()) {
- if (dependsOnArray->size()) {
- if (Utils::JsonObjectValue *dependsOnObject = dependsOnArray->elements().first()->toObject())
- change->dependsOnId = jsonStringMember(dependsOnObject, idKey);
- }
- }
- }
- // Read out needed by
- if (Utils::JsonValue *neededByValue = object->member(neededByKey)) {
- if (Utils::JsonArrayValue *neededByArray = neededByValue->toArray()) {
- if (neededByArray->size()) {
- if (Utils::JsonObjectValue *neededByObject = neededByArray->elements().first()->toObject())
- change->neededById = jsonStringMember(neededByObject, idKey);
- }
- }
- }
- }
- if (debug) {
- qDebug() << __FUNCTION__;
- foreach (const GerritChangePtr &p, result)
- qDebug() << *p;
- }
- return res;
-}
-#endif // QT_VERSION < 0x050000
QList<QStandardItem *> GerritModel::changeToRow(const GerritChangePtr &c) const
{
diff --git a/src/plugins/git/gerrit/gerritparameters.cpp b/src/plugins/git/gerrit/gerritparameters.cpp
index 07caf83712..8d1535c5fc 100644
--- a/src/plugins/git/gerrit/gerritparameters.cpp
+++ b/src/plugins/git/gerrit/gerritparameters.cpp
@@ -30,16 +30,13 @@
#include "gerritparameters.h"
#include "gerritplugin.h"
-#if QT_VERSION >= 0x050000
-# include <QStandardPaths>
-#else
-# include <utils/environment.h>
-#endif
#include <utils/hostosinfo.h>
#include <utils/pathchooser.h>
+
#include <QDebug>
#include <QFileInfo>
#include <QSettings>
+#include <QStandardPaths>
namespace Gerrit {
namespace Internal {
@@ -64,12 +61,7 @@ static inline QString detectSsh()
const QByteArray gitSsh = qgetenv("GIT_SSH");
if (!gitSsh.isEmpty())
return QString::fromLocal8Bit(gitSsh);
-#if QT_VERSION >= 0x050000
QString ssh = QStandardPaths::findExecutable(QLatin1String(defaultSshC));
-#else
- const Utils::Environment env = Utils::Environment::systemEnvironment();
- QString ssh = env.searchInPath(QLatin1String(defaultSshC));
-#endif
if (!ssh.isEmpty())
return ssh;
if (Utils::HostOsInfo::isWindowsHost()) { // Windows: Use ssh.exe from git if it cannot be found.
diff --git a/src/plugins/help/help.pro b/src/plugins/help/help.pro
index 3997008cc3..9f806278bb 100644
--- a/src/plugins/help/help.pro
+++ b/src/plugins/help/help.pro
@@ -1,12 +1,6 @@
-QT += network
-greaterThan(QT_MAJOR_VERSION, 4) {
- QT += printsupport help
- !isEmpty(QT.webkitwidgets.name): QT += webkitwidgets webkit
- else: DEFINES += QT_NO_WEBKIT
-} else {
- CONFIG += help
- contains(QT_CONFIG, webkit): QT += webkit
-}
+QT += help network printsupport
+!isEmpty(QT.webkitwidgets.name): QT += webkitwidgets webkit
+else: DEFINES += QT_NO_WEBKIT
INCLUDEPATH += $$PWD
diff --git a/src/plugins/imageviewer/imageviewer.pro b/src/plugins/imageviewer/imageviewer.pro
index 0ef9d61a9b..6855222ba2 100644
--- a/src/plugins/imageviewer/imageviewer.pro
+++ b/src/plugins/imageviewer/imageviewer.pro
@@ -20,12 +20,8 @@ SOURCES += \
RESOURCES += \
imageviewer.qrc
-greaterThan(QT_MAJOR_VERSION, 4) {
- !isEmpty(QT.svg.name): QT += svg
- else: DEFINES += QT_NO_SVG
-} else {
- contains(QT_CONFIG, svg): QT += svg
-}
+!isEmpty(QT.svg.name): QT += svg
+else: DEFINES += QT_NO_SVG
FORMS += \
imageviewertoolbar.ui
diff --git a/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp b/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp
index e389d0b5ef..20948c0106 100644
--- a/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp
+++ b/src/plugins/projectexplorer/customwizard/customwizardparameters.cpp
@@ -928,12 +928,10 @@ void CustomWizardContext::reset()
currentDate.toString(Qt::ISODate));
baseReplacements.insert(QLatin1String("CurrentTime:ISO"),
currentTime.toString(Qt::ISODate));
-#if QT_VERSION >= 0x050200
baseReplacements.insert(QLatin1String("CurrentDate:RFC"),
currentDate.toString(Qt::RFC2822Date));
baseReplacements.insert(QLatin1String("CurrentTime:RFC"),
currentTime.toString(Qt::RFC2822Date));
-#endif
baseReplacements.insert(QLatin1String("CurrentDate:Locale"),
currentDate.toString(Qt::DefaultLocaleShortDate));
baseReplacements.insert(QLatin1String("CurrentTime:Locale"),
diff --git a/src/plugins/projectexplorer/metatypedeclarations.h b/src/plugins/projectexplorer/metatypedeclarations.h
index 7ce6686e7b..665002aeb5 100644
--- a/src/plugins/projectexplorer/metatypedeclarations.h
+++ b/src/plugins/projectexplorer/metatypedeclarations.h
@@ -38,12 +38,10 @@ class SessionManager;
class Project;
}
-#if QT_VERSION >= 0x050000
-// Required for Q_DECLARE_METATYPE of forward-declared types in Qt 5.
- Q_DECLARE_OPAQUE_POINTER(ProjectExplorer::Project*)
- Q_DECLARE_OPAQUE_POINTER(ProjectExplorer::IProjectManager*)
- Q_DECLARE_OPAQUE_POINTER(ProjectExplorer::SessionManager*)
-#endif // QT_VERSION >= 0x050000
+// Required for Q_DECLARE_METATYPE of forward-declared types.
+Q_DECLARE_OPAQUE_POINTER(ProjectExplorer::Project*)
+Q_DECLARE_OPAQUE_POINTER(ProjectExplorer::IProjectManager*)
+Q_DECLARE_OPAQUE_POINTER(ProjectExplorer::SessionManager*)
Q_DECLARE_METATYPE(QList<ProjectExplorer::Project*>)
Q_DECLARE_METATYPE(ProjectExplorer::SessionManager*)
diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp
index 2f37a953f8..846318fd89 100644
--- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp
+++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp
@@ -50,6 +50,7 @@
#include <projectexplorer/projectmodels.h>
#include <projectexplorer/runconfiguration.h>
+#include <QGuiApplication>
#include <QTimer>
#include <QLayout>
#include <QLabel>
@@ -60,38 +61,24 @@
#include <QAction>
#include <QItemDelegate>
-#if QT_VERSION >= 0x050100
-#include <QGuiApplication>
-#endif
static QIcon createCenteredIcon(const QIcon &icon, const QIcon &overlay)
{
QPixmap targetPixmap;
- qreal appDevicePixelRatio = 1.0;
-#if QT_VERSION >= 0x050100
- appDevicePixelRatio = qApp->devicePixelRatio();
-#endif
+ const qreal appDevicePixelRatio = qApp->devicePixelRatio();
int deviceSpaceIconSize = Core::Constants::TARGET_ICON_SIZE * appDevicePixelRatio;
targetPixmap = QPixmap(deviceSpaceIconSize, deviceSpaceIconSize);
-#if QT_VERSION >= 0x050100
targetPixmap.setDevicePixelRatio(appDevicePixelRatio);
-#endif
targetPixmap.fill(Qt::transparent);
QPainter painter(&targetPixmap); // painter in user space
QPixmap pixmap = icon.pixmap(Core::Constants::TARGET_ICON_SIZE); // already takes app devicePixelRatio into account
- qreal pixmapDevicePixelRatio = 1.0;
-#if QT_VERSION >= 0x050100
- pixmapDevicePixelRatio = pixmap.devicePixelRatio();
-#endif
+ qreal pixmapDevicePixelRatio = pixmap.devicePixelRatio();
painter.drawPixmap((Core::Constants::TARGET_ICON_SIZE - pixmap.width() / pixmapDevicePixelRatio) / 2,
(Core::Constants::TARGET_ICON_SIZE - pixmap.height() / pixmapDevicePixelRatio) / 2, pixmap);
if (!overlay.isNull()) {
pixmap = overlay.pixmap(Core::Constants::TARGET_ICON_SIZE); // already takes app devicePixelRatio into account
- pixmapDevicePixelRatio = 1.0;
-#if QT_VERSION >= 0x050100
pixmapDevicePixelRatio = pixmap.devicePixelRatio();
-#endif
painter.drawPixmap((Core::Constants::TARGET_ICON_SIZE - pixmap.width() / pixmapDevicePixelRatio) / 2,
(Core::Constants::TARGET_ICON_SIZE - pixmap.height() / pixmapDevicePixelRatio) / 2, pixmap);
}
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index 81f70f8dd6..73aa428a90 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -93,11 +93,7 @@
# include "wincetoolchain.h"
#endif
-#define HAS_WELCOME_PAGE (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0))
-
-#if HAS_WELCOME_PAGE
#include "projectwelcomepage.h"
-#endif
#include <extensionsystem/pluginspec.h>
#include <extensionsystem/pluginmanager.h>
@@ -259,9 +255,7 @@ struct ProjectExplorerPluginPrivate {
Internal::ProjectExplorerSettings m_projectExplorerSettings;
-#if HAS_WELCOME_PAGE
Internal::ProjectWelcomePage *m_welcomePage;
-#endif
IMode *m_projectsMode;
TaskHub *m_taskHub;
@@ -317,10 +311,8 @@ ProjectExplorerPlugin::ProjectExplorerPlugin()
ProjectExplorerPlugin::~ProjectExplorerPlugin()
{
-#if HAS_WELCOME_PAGE
removeObject(d->m_welcomePage);
delete d->m_welcomePage;
-#endif
removeObject(this);
// Force sequence of deletion:
delete d->m_kitManager; // remove all the profile informations
@@ -407,11 +399,9 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
connect(ICore::instance(), SIGNAL(newItemsDialogRequested()), this, SLOT(loadCustomWizards()));
-#if HAS_WELCOME_PAGE
d->m_welcomePage = new ProjectWelcomePage;
connect(d->m_welcomePage, SIGNAL(manageSessions()), this, SLOT(showSessionManager()));
addObject(d->m_welcomePage);
-#endif
connect(DocumentManager::instance(), SIGNAL(currentFileChanged(QString)),
this, SLOT(setCurrentFile(QString)));
@@ -1267,9 +1257,7 @@ void ProjectExplorerPlugin::closeAllProjects()
SessionManager::closeAllProjects();
updateActions();
-#if HAS_WELCOME_PAGE
ModeManager::activateMode(Core::Constants::MODE_WELCOME);
-#endif
}
void ProjectExplorerPlugin::extensionsInitialized()
@@ -1377,11 +1365,9 @@ void ProjectExplorerPlugin::showSessionManager()
updateActions();
-#if HAS_WELCOME_PAGE
IMode *welcomeMode = ModeManager::mode(Core::Constants::MODE_WELCOME);
if (ModeManager::currentMode() == welcomeMode)
updateWelcomePage();
-#endif
}
void ProjectExplorerPlugin::setStartupProject(Project *project)
@@ -1605,9 +1591,7 @@ void ProjectExplorerPlugin::setCurrentNode(Node *node)
void ProjectExplorerPlugin::updateWelcomePage()
{
-#if HAS_WELCOME_PAGE
d->m_welcomePage->reloadWelcomeScreenData();
-#endif
}
void ProjectExplorerPlugin::currentModeChanged(IMode *mode, IMode *oldMode)
@@ -1729,10 +1713,8 @@ void ProjectExplorerPlugin::restoreSession()
connect(ModeManager::instance(),
SIGNAL(currentModeChanged(Core::IMode*,Core::IMode*)),
SLOT(currentModeChanged(Core::IMode*,Core::IMode*)));
-#if HAS_WELCOME_PAGE
connect(d->m_welcomePage, SIGNAL(requestSession(QString)), this, SLOT(loadSession(QString)));
connect(d->m_welcomePage, SIGNAL(requestProject(QString)), this, SLOT(openProjectWelcomePage(QString)));
-#endif
d->m_arguments = arguments;
QTimer::singleShot(0, this, SLOT(restoreSession2()));
updateActions();
diff --git a/src/plugins/projectexplorer/projectexplorer.pro b/src/plugins/projectexplorer/projectexplorer.pro
index 8bea487d30..5fae1cab7d 100644
--- a/src/plugins/projectexplorer/projectexplorer.pro
+++ b/src/plugins/projectexplorer/projectexplorer.pro
@@ -1,4 +1,4 @@
-QT += xml script
+QT += quick script xml
include(../../qtcreatorplugin.pri)
include(customwizard/customwizard.pri)
@@ -151,6 +151,7 @@ HEADERS += projectexplorer.h \
xcodebuildparser.h \
propertiespanel.h \
panelswidget.h \
+ projectwelcomepage.h \
projectpanelfactory.h
SOURCES += projectexplorer.cpp \
@@ -289,6 +290,7 @@ SOURCES += projectexplorer.cpp \
xcodebuildparser.cpp \
propertiespanel.cpp \
panelswidget.cpp \
+ projectwelcomepage.cpp \
projectpanelfactory.cpp
FORMS += processstep.ui \
@@ -332,11 +334,6 @@ equals(TEST, 1) {
outputparser_test.h
}
-greaterThan(QT_MAJOR_VERSION, 4) {
- QT += quick
- HEADERS += projectwelcomepage.h
- SOURCES += projectwelcomepage.cpp
-}
macx:LIBS += -framework Carbon
RESOURCES += projectexplorer.qrc
diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp
index c32c78668d..c4d21bef97 100644
--- a/src/plugins/qmljstools/qmljsmodelmanager.cpp
+++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp
@@ -116,9 +116,7 @@ ModelManagerInterface::ProjectInfo QmlJSTools::Internal::ModelManager::defaultPr
projectInfo.qtImportsPath = QFileInfo(qtVersion->qmakeProperty("QT_INSTALL_IMPORTS")).canonicalFilePath();
projectInfo.qtVersionString = qtVersion->qtVersionString();
} else {
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
projectInfo.qtQmlPath = QFileInfo(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath)).canonicalFilePath();
-#endif
projectInfo.qtImportsPath = QFileInfo(QLibraryInfo::location(QLibraryInfo::ImportsPath)).canonicalFilePath();
projectInfo.qtVersionString = QLatin1String(qVersion());
}
diff --git a/src/plugins/qtsupport/qtsupport.pro b/src/plugins/qtsupport/qtsupport.pro
index f1e794c4ff..c5106bdc2c 100644
--- a/src/plugins/qtsupport/qtsupport.pro
+++ b/src/plugins/qtsupport/qtsupport.pro
@@ -1,5 +1,5 @@
DEFINES += QTSUPPORT_LIBRARY
-QT += network
+QT += network quick
include(../../qtcreatorplugin.pri)
@@ -9,6 +9,7 @@ include(../../shared/proparser/proparser.pri)
HEADERS += \
codegensettings.h \
codegensettingspage.h \
+ gettingstartedwelcomepage.h \
qtsupportplugin.h \
qtsupport_global.h \
qtkitconfigwidget.h \
@@ -39,6 +40,7 @@ HEADERS += \
SOURCES += \
codegensettings.cpp \
codegensettingspage.cpp \
+ gettingstartedwelcomepage.cpp \
qtsupportplugin.cpp \
qtkitconfigwidget.cpp \
qtkitinformation.cpp \
@@ -64,12 +66,6 @@ SOURCES += \
winceqtversionfactory.cpp \
winceqtversion.cpp
-greaterThan(QT_MAJOR_VERSION, 4) {
- QT += quick
- HEADERS += gettingstartedwelcomepage.h
- SOURCES += gettingstartedwelcomepage.cpp
-}
-
FORMS += \
codegensettingspagewidget.ui \
showbuildlog.ui \
diff --git a/src/plugins/qtsupport/qtsupportplugin.cpp b/src/plugins/qtsupport/qtsupportplugin.cpp
index 419ac2d9ee..a7973d4931 100644
--- a/src/plugins/qtsupport/qtsupportplugin.cpp
+++ b/src/plugins/qtsupport/qtsupportplugin.cpp
@@ -32,6 +32,7 @@
#include "codegensettingspage.h"
#include "customexecutablerunconfiguration.h"
#include "desktopqtversionfactory.h"
+#include "gettingstartedwelcomepage.h"
#include "qtkitinformation.h"
#include "qtoptionspage.h"
#include "qtversionmanager.h"
@@ -48,9 +49,6 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/target.h>
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0))
-#include "gettingstartedwelcomepage.h"
-#endif
#include <QtPlugin>
@@ -81,7 +79,6 @@ bool QtSupportPlugin::initialize(const QStringList &arguments, QString *errorMes
addAutoReleasedObject(new CodeGenSettingsPage);
addAutoReleasedObject(new QtOptionsPage);
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 1, 0))
ExamplesWelcomePage *welcomePage;
welcomePage = new ExamplesWelcomePage;
addAutoReleasedObject(welcomePage);
@@ -89,7 +86,6 @@ bool QtSupportPlugin::initialize(const QStringList &arguments, QString *errorMes
welcomePage = new ExamplesWelcomePage;
addAutoReleasedObject(welcomePage);
-#endif
addAutoReleasedObject(new CustomExecutableRunConfigurationFactory);
ProjectExplorer::KitManager::registerKitInformation(new QtKitInformation);
diff --git a/src/plugins/texteditor/texteditor.pro b/src/plugins/texteditor/texteditor.pro
index 51d37f673d..40fc8d6308 100644
--- a/src/plugins/texteditor/texteditor.pro
+++ b/src/plugins/texteditor/texteditor.pro
@@ -1,8 +1,7 @@
DEFINES += TEXTEDITOR_LIBRARY
-QT += xml network
+QT += network printsupport xml
CONFIG += exceptions
CONFIG += include_source_dir # For the highlighter autotest.
-greaterThan(QT_MAJOR_VERSION, 4): QT += printsupport
include(../../qtcreatorplugin.pri)
SOURCES += texteditorplugin.cpp \
textfilewizard.cpp \
diff --git a/src/plugins/vcsbase/submiteditorwidget.cpp b/src/plugins/vcsbase/submiteditorwidget.cpp
index dab9ed638c..5bb294ad57 100644
--- a/src/plugins/vcsbase/submiteditorwidget.cpp
+++ b/src/plugins/vcsbase/submiteditorwidget.cpp
@@ -555,14 +555,6 @@ void SubmitEditorWidget::hideDescription()
void SubmitEditorWidget::descriptionTextChanged()
{
-#if QT_VERSION < 0x050000 // Fix Qt-Bug, see QTCREATORBUG-5633 && QTCREATORBUG-6082
- static QString lastText;
- const QString text = d->m_ui.description->toPlainText();
- if (lastText != text)
- lastText = text;
- else
- return;
-#endif
updateSubmitAction();
}
diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp
index 3c254da518..678ebede31 100644
--- a/src/plugins/welcome/welcomeplugin.cpp
+++ b/src/plugins/welcome/welcomeplugin.cpp
@@ -98,9 +98,7 @@ signals:
private slots:
void welcomePluginAdded(QObject*);
-#if QT_VERSION >= 0x050300
void sceneGraphError(QQuickWindow::SceneGraphError, const QString &message);
-#endif
private:
void facilitateQml(QQmlEngine *engine);
@@ -137,10 +135,8 @@ WelcomeMode::WelcomeMode() :
m_welcomePage->setObjectName(QLatin1String("WelcomePage"));
-#if QT_VERSION >= 0x050300
connect(m_welcomePage, SIGNAL(sceneGraphError(QQuickWindow::SceneGraphError,QString)),
this, SLOT(sceneGraphError(QQuickWindow::SceneGraphError,QString)));
-#endif // Qt 5.3
Utils::StyledBar* styledBar = new Utils::StyledBar(m_modeWidget);
styledBar->setObjectName(QLatin1String("WelcomePageStyledBar"));
@@ -168,7 +164,6 @@ WelcomeMode::~WelcomeMode()
delete m_modeWidget;
}
-#if QT_VERSION >= 0x050300
void WelcomeMode::sceneGraphError(QQuickWindow::SceneGraphError, const QString &message)
{
QMessageBox *messageBox =
@@ -179,7 +174,6 @@ void WelcomeMode::sceneGraphError(QQuickWindow::SceneGraphError, const QString &
messageBox->setAttribute(Qt::WA_DeleteOnClose);
messageBox->show();
}
-#endif // Qt 5.3
void WelcomeMode::facilitateQml(QQmlEngine * /*engine*/)
{
diff --git a/src/shared/proparser/proitems.cpp b/src/shared/proparser/proitems.cpp
index 050924ed6e..d3e7ebc7d8 100644
--- a/src/shared/proparser/proitems.cpp
+++ b/src/shared/proparser/proitems.cpp
@@ -196,11 +196,7 @@ ProString &ProString::prepend(const ProString &other)
ProString &ProString::append(const QLatin1String other)
{
const char *latin1 = other.latin1();
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
int size = other.size();
-#else
- int size = strlen(latin1);
-#endif
if (size) {
QChar *ptr = prepareExtend(size, 0, m_length);
for (int i = 0; i < size; i++)
diff --git a/src/shared/qtsingleapplication/qtsingleapplication.pri b/src/shared/qtsingleapplication/qtsingleapplication.pri
index c807763dce..75e68caac2 100644
--- a/src/shared/qtsingleapplication/qtsingleapplication.pri
+++ b/src/shared/qtsingleapplication/qtsingleapplication.pri
@@ -3,8 +3,7 @@ DEPENDPATH += $$PWD
HEADERS += $$PWD/qtsingleapplication.h $$PWD/qtlocalpeer.h
SOURCES += $$PWD/qtsingleapplication.cpp $$PWD/qtlocalpeer.cpp
-QT *= network
-greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+QT *= network widgets
gotqtlockedfile = $$find(HEADERS, .*qtlockedfile.h)
isEmpty(gotqtlockedfile):include(../qtlockedfile/qtlockedfile.pri)
diff --git a/src/tools/iostool/iosdevicemanager.cpp b/src/tools/iostool/iosdevicemanager.cpp
index e8225c8670..f26d2f7e62 100644
--- a/src/tools/iostool/iosdevicemanager.cpp
+++ b/src/tools/iostool/iosdevicemanager.cpp
@@ -40,11 +40,7 @@
#include <mach/error.h>
/* // annoying to import, do without
-#if QT_VERSION < 0x050000
-#include <private/qcore_mac_p.h>
-#else
#include <QtCore/private/qcore_mac_p.h>
-#endif
*/
/* standard calling convention under Win32 is __stdcall */
/* Note: When compiling Intel EFI (Extensible Firmware Interface) under MS Visual Studio, the */
diff --git a/src/tools/iostool/main.cpp b/src/tools/iostool/main.cpp
index cae61aa333..7889702aef 100644
--- a/src/tools/iostool/main.cpp
+++ b/src/tools/iostool/main.cpp
@@ -29,11 +29,7 @@
#include "iosdevicemanager.h"
#include <qglobal.h>
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-#include <QApplication>
-#else
#include <QGuiApplication>
-#endif
#include <QTextStream>
#include <QDebug>
#include <QXmlStreamWriter>
@@ -504,11 +500,7 @@ IosTool::IosTool(QObject *parent):
gdbServer(0),
qmlServer(0)
{
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- outFile.open(stdout, QIODevice::WriteOnly, QFile::DontCloseHandle);
-#else
outFile.open(stdout, QIODevice::WriteOnly, QFileDevice::DontCloseHandle);
-#endif
out.setAutoFormatting(true);
out.setCodec("UTF-8");
}
@@ -886,11 +878,7 @@ int main(int argc, char *argv[])
qtArgc = 1;
}
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- QApplication a(qtArgc, &qtArg);
-#else
QGuiApplication a(qtArgc, &qtArg);
-#endif
IosTool tool;
tool.run(args);
int res = a.exec();
diff --git a/src/tools/qtcdebugger/qtcdebugger.pro b/src/tools/qtcdebugger/qtcdebugger.pro
index 9c3220aba0..82d230c2e2 100644
--- a/src/tools/qtcdebugger/qtcdebugger.pro
+++ b/src/tools/qtcdebugger/qtcdebugger.pro
@@ -1,5 +1,5 @@
include(../../shared/registryaccess/registryaccess.pri)
-greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+QT += widgets
TARGET = qtcdebugger
TEMPLATE = app
SOURCES += main.cpp
diff --git a/src/tools/sdktool/main.cpp b/src/tools/sdktool/main.cpp
index 5f6e62682d..93cba8ed10 100644
--- a/src/tools/sdktool/main.cpp
+++ b/src/tools/sdktool/main.cpp
@@ -159,14 +159,12 @@ int parseArguments(const QStringList &args, Settings *s, const QList<Operation *
int main(int argc, char *argv[])
{
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
// Since 5.3, Qt by default aborts if the effective user id is different than the
// real user id. However, in IFW on Mac we use setuid to 'elevate'
// permissions if needed. This is considered safe because the user has to provide
// the credentials manually - an attack would require at least access to the
// user's environment.
QCoreApplication::setSetuidAllowed(true);
-#endif
QCoreApplication a(argc, argv);
diff --git a/src/tools/tools.pro b/src/tools/tools.pro
index c6597d47a0..218f3c7e9e 100644
--- a/src/tools/tools.pro
+++ b/src/tools/tools.pro
@@ -6,6 +6,7 @@ SUBDIRS = qtpromaker \
sdktool \
valgrindfake \
3rdparty \
+ qml2puppet \
buildoutputparser
win32 {
@@ -29,10 +30,3 @@ QT_BREAKPAD_ROOT_PATH = $$(QT_BREAKPAD_ROOT_PATH)
}
}
}
-
-greaterThan(QT_MAJOR_VERSION, 4) {
- !greaterThan(QT_MINOR_VERSION, 0):!greaterThan(QT_PATCH_VERSION, 0) {
- } else {
- SUBDIRS += qml2puppet
- }
-}
diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro
index fee08fa49f..aefb5d9f4a 100644
--- a/tests/auto/auto.pro
+++ b/tests/auto/auto.pro
@@ -19,12 +19,6 @@ SUBDIRS += \
filesearch \
valgrind
-lessThan(QT_MAJOR_VERSION, 5) {
- contains(QT_CONFIG, declarative) {
- SUBDIRS += qml
- }
-} else {
- qtHaveModule(declarative) {
+qtHaveModule(declarative) {
SUBDIRS += qml qmlprofiler
- }
}
diff --git a/tests/auto/debugger/dumpers.pro b/tests/auto/debugger/dumpers.pro
index 80e02f4a37..be0244690e 100644
--- a/tests/auto/debugger/dumpers.pro
+++ b/tests/auto/debugger/dumpers.pro
@@ -32,8 +32,7 @@ HEADERS += \
$$DEBUGGERDIR/debuggerprotocol.h \
$$DEBUGGERDIR/simplifytype.h \
$$DEBUGGERDIR/watchdata.h \
- $$DEBUGGERDIR/watchutils.h \
- temporarydir.h
+ $$DEBUGGERDIR/watchutils.h
!isEmpty(vcproj) {
DEFINES += DUMPERDIR=\"$$DUMPERDIR\"
diff --git a/tests/auto/debugger/dumpers.qbs b/tests/auto/debugger/dumpers.qbs
index 24190b8761..eff2a1c528 100644
--- a/tests/auto/debugger/dumpers.qbs
+++ b/tests/auto/debugger/dumpers.qbs
@@ -20,7 +20,6 @@ QtcAutotest {
Group {
name: "Test sources"
files: [
- "temporarydir.h",
"tst_dumpers.cpp"
]
}
diff --git a/tests/auto/debugger/temporarydir.h b/tests/auto/debugger/temporarydir.h
deleted file mode 100644
index b00c662bed..0000000000
--- a/tests/auto/debugger/temporarydir.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of Qt Creator.
-**
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-****************************************************************************/
-
-// this file has been adapted from TemporaryDir implementation of Qt5
-
-#ifndef TEMPORARYDIR_H_INCLUDED
-#define TEMPORARYDIR_H_INCLUDED
-
-#include <QtGlobal>
-
-#if QT_VERSION >= 0x050000
- #include <QTemporaryDir>
-#else // QT_VERSION < 0x050000
-
-#include <QDir>
-#include <stdlib.h> // mkdtemp
-
-#ifdef Q_OS_MAC
- #include <unistd.h>
-#endif
-
-QT_BEGIN_NAMESPACE
-
-//************* TemporaryDirPrivate
-class TemporaryDirPrivate
-{
-public:
- TemporaryDirPrivate();
- ~TemporaryDirPrivate();
-
- void create(const QString &templateName);
-
- QString path;
- bool autoRemove;
- bool success;
-};
-
-TemporaryDirPrivate::TemporaryDirPrivate()
- : autoRemove(true),
- success(false)
-{
-}
-
-TemporaryDirPrivate::~TemporaryDirPrivate()
-{
-}
-
-static QString defaultTemplateName()
-{
- QString baseName;
- baseName = QLatin1String("qt_temp");
- return QDir::tempPath() + QLatin1Char('/') + baseName + QLatin1String("-XXXXXX");
-}
-
-#ifdef Q_OS_WIN
-static char *mkdtemp(char *templateName)
-{
- static const char letters[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
- const size_t length = strlen(templateName);
- char *XXXXXX = templateName + length - 6;
- if ((length < 6u) || strncmp(XXXXXX, "XXXXXX", 6))
- return 0;
- for (int i = 0; i < 256; ++i) {
- int v = qrand();
- /* Fill in the random bits. */
- XXXXXX[0] = letters[v % 62];
- v /= 62;
- XXXXXX[1] = letters[v % 62];
- v /= 62;
- XXXXXX[2] = letters[v % 62];
- v /= 62;
- XXXXXX[3] = letters[v % 62];
- v /= 62;
- XXXXXX[4] = letters[v % 62];
- v /= 62;
- XXXXXX[5] = letters[v % 62];
- QString templateNameStr = QFile::decodeName(templateName);
-
- QFileInfo fileInfo(templateNameStr);
- if (fileInfo.absoluteDir().mkdir(fileInfo.fileName())) {
- if (!QFile::setPermissions(fileInfo.absoluteFilePath(), QFile::ReadOwner |
- QFile::WriteOwner |
- QFile::ExeOwner)) {
- continue;
- }
- return templateName;
- }
- }
- return 0;
-}
-#endif
-
-void TemporaryDirPrivate::create(const QString &templateName)
-{
- QByteArray buffer = QFile::encodeName(templateName);
- if (!buffer.endsWith("XXXXXX"))
- buffer += "XXXXXX";
- if (mkdtemp(buffer.data())) { // modifies buffer
- success = true;
- path = QFile::decodeName(buffer.constData());
- }
-}
-
-//************* TemporaryDir
-static bool removeRecursively(QDir directory)
-{
- if (!directory.exists())
- return true;
- bool success = true;
- QFileInfoList filesAndDirs = directory.entryInfoList(QDir::AllEntries | QDir::Hidden
- | QDir::System | QDir::NoDotAndDotDot);
- foreach (QFileInfo fdInfo, filesAndDirs) {
- if (fdInfo.isDir())
- success &= removeRecursively(QDir(fdInfo.absoluteFilePath()));
- else
- success &= directory.remove(fdInfo.fileName());
- }
- if (success) {
- QDir parent(directory.absolutePath());
- success = parent.cdUp();
- if (success)
- success = parent.rmdir(directory.dirName());
- }
- return success;
-}
-
-class TemporaryDir
-{
-public:
- TemporaryDir();
- explicit TemporaryDir(const QString &templateName);
- ~TemporaryDir();
-
- bool autoRemove() {return d_ptr->autoRemove;}
- void setAutoRemove(bool b);
- bool remove();
- QString path() const;
-
-private:
- QScopedPointer<TemporaryDirPrivate> d_ptr;
-
- Q_DISABLE_COPY(TemporaryDir)
-};
-
-TemporaryDir::TemporaryDir()
- : d_ptr(new TemporaryDirPrivate)
-{
- d_ptr->create(defaultTemplateName());
-}
-
-TemporaryDir::TemporaryDir(const QString &templateName)
- : d_ptr(new TemporaryDirPrivate)
-{
- if (templateName.isEmpty())
- d_ptr->create(defaultTemplateName());
- else
- d_ptr->create(templateName);
-}
-
-TemporaryDir::~TemporaryDir()
-{
- if (d_ptr->autoRemove)
- remove();
-}
-
-QString TemporaryDir::path() const
-{
- return d_ptr->path;
-}
-
-void TemporaryDir::setAutoRemove(bool b)
-{
- d_ptr->autoRemove = b;
-}
-
-bool TemporaryDir::remove()
-{
- if (!d_ptr->success)
- return false;
- Q_ASSERT(!path().isEmpty());
- Q_ASSERT(path() != QLatin1String("."));
- return removeRecursively(QDir(path()));
-}
-
-QT_END_NAMESPACE
-
-typedef TemporaryDir QTemporaryDir;
-
-#endif // QT_VERSION < 0x050000
-
-#endif // TEMPORARYDIR_H_INCLUDED
diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp
index bd8355f8d1..27f2464f0d 100644
--- a/tests/auto/debugger/tst_dumpers.cpp
+++ b/tests/auto/debugger/tst_dumpers.cpp
@@ -39,16 +39,10 @@
#include <utils/synchronousprocess.h>
#endif // Q_CC_MSVC
-#include "temporarydir.h"
-
#include <QtTest>
#include <math.h>
-#if QT_VERSION >= 0x050000
#define MSKIP_SINGLE(x) do { disarm(); QSKIP(x); } while (0)
-#else
-#define MSKIP_SINGLE(x) do { disarm(); QSKIP(x, SkipSingle); } while (0)
-#endif
using namespace Debugger;
using namespace Internal;
diff --git a/tests/auto/ioutils/ioutils.pro b/tests/auto/ioutils/ioutils.pro
index 1e2f7d1af2..a4b2b5787f 100644
--- a/tests/auto/ioutils/ioutils.pro
+++ b/tests/auto/ioutils/ioutils.pro
@@ -1,7 +1,5 @@
include(../qttest.pri)
-# for shellQuote(). hopefully without side effects ...
-isEqual(QT_MAJOR_VERSION, 4):DEFINES += QT_BOOTSTRAPPED
INCLUDEPATH += $$IDE_SOURCE_TREE/src/shared
SOURCES += tst_ioutils.cpp \
$$IDE_SOURCE_TREE/src/shared/proparser/ioutils.cpp
diff --git a/tests/auto/valgrind/memcheck/parsertests.cpp b/tests/auto/valgrind/memcheck/parsertests.cpp
index 2bd2085e2c..418bfc88ac 100644
--- a/tests/auto/valgrind/memcheck/parsertests.cpp
+++ b/tests/auto/valgrind/memcheck/parsertests.cpp
@@ -51,12 +51,6 @@
#include <iostream>
#include <QProcess>
-#if QT_VERSION >= 0x050000
-#define MSKIP_SINGLE(x) QSKIP(x)
-#else
-#define MSKIP_SINGLE(x) QSKIP(x, SkipSingle)
-#endif
-
using namespace Valgrind;
using namespace Valgrind::XmlProtocol;
@@ -155,7 +149,7 @@ void ParserTests::cleanup()
void ParserTests::testHelgrindSample1()
{
- MSKIP_SINGLE("testfile does not exist");
+ QSKIP("testfile does not exist");
initTest(QLatin1String("helgrind-output-sample1.xml"));
@@ -327,7 +321,7 @@ void ParserTests::testMemcheckSample1()
void ParserTests::testMemcheckSample2()
{
- MSKIP_SINGLE("testfile does not exist");
+ QSKIP("testfile does not exist");
initTest(QLatin1String("memcheck-output-sample2.xml"));
@@ -353,7 +347,7 @@ void ParserTests::testMemcheckSample2()
void ParserTests::testMemcheckSample3()
{
- MSKIP_SINGLE("testfile does not exist");
+ QSKIP("testfile does not exist");
initTest(QLatin1String("memcheck-output-sample3.xml"));
@@ -405,7 +399,7 @@ void ParserTests::testMemcheckSample3()
void ParserTests::testMemcheckCharm()
{
- MSKIP_SINGLE("testfile does not exist");
+ QSKIP("testfile does not exist");
// a somewhat larger file, to make sure buffering and partial I/O works ok
initTest(QLatin1String("memcheck-output-untitled.xml"));
diff --git a/tests/manual/debugger/gui/gui.pro b/tests/manual/debugger/gui/gui.pro
index 3bab60a05a..887e9cec77 100644
--- a/tests/manual/debugger/gui/gui.pro
+++ b/tests/manual/debugger/gui/gui.pro
@@ -1,6 +1,6 @@
TARGET = gui
CONFIG+=console
-greaterThan(QT_MAJOR_VERSION, 4):QT *= widgets
+QT *= widgets
TEMPLATE = app
SOURCES += \
diff --git a/tests/manual/ssh/sftpfsmodel/sftpfsmodel.pro b/tests/manual/ssh/sftpfsmodel/sftpfsmodel.pro
index 8fda709c52..e768e8ea69 100644
--- a/tests/manual/ssh/sftpfsmodel/sftpfsmodel.pro
+++ b/tests/manual/ssh/sftpfsmodel/sftpfsmodel.pro
@@ -1,8 +1,7 @@
include(../ssh.pri)
include(../../../../src/shared/modeltest/modeltest.pri)
-QT += gui
-greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+QT += widgets
TARGET=sftpfsmodel
SOURCES+=main.cpp window.cpp
diff --git a/tests/manual/utils/tcpportsgatherer/tcpportsgatherer.pro b/tests/manual/utils/tcpportsgatherer/tcpportsgatherer.pro
index acae9bec6a..23298e08c8 100644
--- a/tests/manual/utils/tcpportsgatherer/tcpportsgatherer.pro
+++ b/tests/manual/utils/tcpportsgatherer/tcpportsgatherer.pro
@@ -1,8 +1,7 @@
TEMPLATE = app
TARGET = tcpportsgatherer
-QT = core gui network
-greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+QT = core widgets network
CONFIG += console
CONFIG -= app_bundle