diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-03-15 15:49:14 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-04-03 14:15:22 +0000 |
commit | 5f3c5c3159bc24162413e5eaded296673e3537fc (patch) | |
tree | 79527b7935834e99670da90191d536dbe8aecb5b | |
parent | 795ce9035864be122e70297a426c5249beaa9056 (diff) |
Bump required Qt version
... and remove the workarounds that are no longer needed.
Change-Id: Ie0ae19279633784f8cea3bdbe4a9eeaa308689aa
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | doc/qbs.qdoc | 2 | ||||
-rw-r--r-- | qbs-resources/imports/QbsProduct.qbs | 2 | ||||
-rw-r--r-- | qbs.pro | 4 | ||||
-rw-r--r-- | src/lib/corelib/tools/buildgraphlocker.cpp | 12 | ||||
-rw-r--r-- | src/lib/corelib/tools/filetime.cpp | 11 | ||||
-rw-r--r-- | src/lib/corelib/tools/qttools.h | 49 |
6 files changed, 6 insertions, 74 deletions
diff --git a/doc/qbs.qdoc b/doc/qbs.qdoc index c494b36d2..1dbe87110 100644 --- a/doc/qbs.qdoc +++ b/doc/qbs.qdoc @@ -453,7 +453,7 @@ To build \QBS from the source, you need: \list - \li Qt 5.6.2, or later + \li Qt 5.9, or later \li Windows: MinGW with GCC 4.9 or Microsoft Visual Studio 2015, or later \li Linux: GCC 4.9, or later, or Clang 3.9.0, or later diff --git a/qbs-resources/imports/QbsProduct.qbs b/qbs-resources/imports/QbsProduct.qbs index 7425e1ea3..1685a9d4e 100644 --- a/qbs-resources/imports/QbsProduct.qbs +++ b/qbs-resources/imports/QbsProduct.qbs @@ -4,7 +4,7 @@ Product { Depends { name: "qbsbuildconfig" } Depends { name: "qbsversion" } Depends { name: "Qt.core"; versionAtLeast: minimumQtVersion } - property string minimumQtVersion: "5.6.0" + property string minimumQtVersion: "5.9.0" property bool install: true property string targetInstallDir cpp.defines: { @@ -23,9 +23,9 @@ defineTest(minQtVersion) { return(false) } -!minQtVersion(5, 6, 0) { +!minQtVersion(5, 9, 0) { message("Cannot build qbs with Qt version $${QT_VERSION}.") - error("Use at least Qt 5.6.0.") + error("Use at least Qt 5.9.0.") } TEMPLATE = subdirs diff --git a/src/lib/corelib/tools/buildgraphlocker.cpp b/src/lib/corelib/tools/buildgraphlocker.cpp index 5fa21f49c..c166c6e2d 100644 --- a/src/lib/corelib/tools/buildgraphlocker.cpp +++ b/src/lib/corelib/tools/buildgraphlocker.cpp @@ -44,7 +44,6 @@ #include "processutils.h" #include "progressobserver.h" #include "stringconstants.h" -#include "version.h" #include <logging/translator.h> @@ -93,15 +92,6 @@ void DirectoryManager::removeEmptyCreatedDirectories() } } -static bool hasQtBug53392() -{ - if (!HostOsInfo::isWindowsHost()) - return false; - const Version qtVersion = Version::fromString(QLatin1String(qVersion())); - // The fix is included in 5.6.2 and 5.7.1, but not in 5.7.0. - return qtVersion == Version(5, 7, 0) || qtVersion < Version(5, 6, 2); -} - static void tryCreateBuildDirectory(const QString &buildDir, const QString &buildGraphFilePath) { if (!QDir::root().mkpath(buildDir)) { @@ -139,7 +129,7 @@ BuildGraphLocker::BuildGraphLocker(const QString &buildGraphFilePath, const Logg QString hostName; QString appName; if (m_lockFile.getLockInfo(&pid, &hostName, &appName)) { - if ((!hasQtBug53392()) || appNamesAreEqual(appName, processNameByPid(pid))) { + if (appNamesAreEqual(appName, processNameByPid(pid))) { throw ErrorInfo(Tr::tr("Cannot lock build graph file '%1': " "Already locked by '%2' (PID %3).") .arg(buildGraphFilePath, appName).arg(pid)); diff --git a/src/lib/corelib/tools/filetime.cpp b/src/lib/corelib/tools/filetime.cpp index e6bceca9b..3f7148594 100644 --- a/src/lib/corelib/tools/filetime.cpp +++ b/src/lib/corelib/tools/filetime.cpp @@ -166,15 +166,6 @@ double FileTime::asDouble() const #endif } -static Qt::DateFormat stringFormat() -{ -#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)) - return Qt::ISODateWithMs; -#else - return Qt::ISODate; -#endif -} - QString FileTime::toString() const { #ifdef Q_OS_WIN @@ -193,7 +184,7 @@ QString FileTime::toString() const #else dt.setTime_t(m_fileTime); #endif - return dt.toString(stringFormat()); + return dt.toString(Qt::ISODateWithMs); #endif } diff --git a/src/lib/corelib/tools/qttools.h b/src/lib/corelib/tools/qttools.h index 94d1ccb0d..50b2829d1 100644 --- a/src/lib/corelib/tools/qttools.h +++ b/src/lib/corelib/tools/qttools.h @@ -53,55 +53,6 @@ template<> struct hash<QString> { QT_BEGIN_NAMESPACE uint qHash(const QStringList &list); - -#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) -template <typename T1, typename T2> inline uint qHash(const std::pair<T1, T2> &key, uint seed = 0) - Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(key.first, seed)) && noexcept(qHash(key.second, seed))) -{ - QtPrivate::QHashCombine hash; - seed = hash(seed, key.first); - seed = hash(seed, key.second); - return seed; -} - -namespace QtPrivate { -template <typename T> struct QAddConst { typedef const T Type; }; -} - -// this adds const to non-const objects (like std::as_const) -template <typename T> -Q_DECL_CONSTEXPR typename QtPrivate::QAddConst<T>::Type &qAsConst(T &t) Q_DECL_NOTHROW { return t; } -// prevent rvalue arguments: -template <typename T> -void qAsConst(const T &&) Q_DECL_EQ_DELETE; -#endif // Qt Version < 5.7.0 QT_END_NAMESPACE -#ifndef Q_FALLTHROUGH -#ifndef QT_HAS_CPP_ATTRIBUTE -#ifdef __has_cpp_attribute -# define QT_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x) -#else -# define QT_HAS_CPP_ATTRIBUTE(x) 0 -#endif -#endif -#if defined(__cplusplus) -#if QT_HAS_CPP_ATTRIBUTE(fallthrough) -# define Q_FALLTHROUGH() [[fallthrough]] -#elif QT_HAS_CPP_ATTRIBUTE(clang::fallthrough) -# define Q_FALLTHROUGH() [[clang::fallthrough]] -#elif QT_HAS_CPP_ATTRIBUTE(gnu::fallthrough) -# define Q_FALLTHROUGH() [[gnu::fallthrough]] -#endif -#endif -#ifndef Q_FALLTHROUGH -# if (defined(Q_CC_GNU) && Q_CC_GNU >= 700) && !defined(Q_CC_INTEL) -# define Q_FALLTHROUGH() __attribute__((fallthrough)) -# else -# define Q_FALLTHROUGH() (void)0 -#endif -#endif -#endif - - #endif // QBSQTTOOLS_H |