diff options
author | Christian Kandeler <christian.kandeler@digia.com> | 2014-08-29 13:18:41 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2014-09-08 10:33:25 +0200 |
commit | 847f10e9ccc8c3541782a790e04c85c6b4c701da (patch) | |
tree | e59ebac8dfb77c88d8e5540855836ca79a9a7a91 /src | |
parent | 6f58e5b798e368e6254cc837e489bd8fd8f066e9 (diff) |
Remove Qt version checks.
Qt 5.3 is the minimum requirement these days. Remove all fallback code
from sources and project files.
Change-Id: If6188a471197acadda4d6baee71804ba1a8026c6
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Diffstat (limited to 'src')
49 files changed, 50 insertions, 521 deletions
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> ¶meters, const QByteArray &output, QList<GerritChangePtr> &result) @@ -678,177 +671,6 @@ static bool parseOutput(const QSharedPointer<GerritParameters> ¶meters, } 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> ¶meters, - 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 - } -} |