diff options
author | Lars Knoll <lars.knoll@qt.io> | 2019-04-30 11:54:31 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-05-14 12:14:08 +0000 |
commit | 5652d33f973a03b93c9b5ce9e49db8cf0430b675 (patch) | |
tree | ea7115458ef6539db3394c00625a57f85bb99a08 /src | |
parent | 7dd71e812542c561a00dd792d314843a81c5687c (diff) |
Bump version to Qt 6
Needed to disable QT_NO_UNSHARABLE_CONTAINERS, as this
triggers asserts.
QMetaType also has some Qt 6 specific code disabled to
get things to compile.
Fix various details in autotests to accommodate for
the changes with Qt 6.
Add a workaround for black lists on macos, where
QSysInfo::productType() now returns 'macos' and not
'osx' anymore.
Change-Id: Ie26afb12a2aac36521472715934a7e34639ea4d0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qglobal.h | 3 | ||||
-rw-r--r-- | src/corelib/global/qlogging.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qfileselector.cpp | 7 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemwatcher_win.cpp | 2 | ||||
-rw-r--r-- | src/corelib/itemmodels/qabstractitemmodel.cpp | 4 | ||||
-rw-r--r-- | src/corelib/itemmodels/qabstractproxymodel.h | 6 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 6 | ||||
-rw-r--r-- | src/corelib/kernel/qmetatype.h | 2 | ||||
-rw-r--r-- | src/corelib/mimetypes/qmimedatabase_p.h | 1 | ||||
-rw-r--r-- | src/corelib/plugin/qlibrary.cpp | 4 | ||||
-rw-r--r-- | src/gui/image/qimage_p.h | 2 | ||||
-rw-r--r-- | src/gui/itemmodels/qstandarditemmodel.h | 7 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket_winrt.cpp | 6 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaintegration.mm | 2 | ||||
-rw-r--r-- | src/testlib/qtestblacklist.cpp | 10 |
15 files changed, 40 insertions, 24 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 0a0c434a07..499558d7e6 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -87,7 +87,8 @@ #define QT_REQUIRE_CONFIG(feature) Q_STATIC_ASSERT_X(QT_FEATURE_##feature == 1, "Required feature " #feature " for file " __FILE__ " not available.") #if QT_VERSION >= QT_VERSION_CHECK(6,0,0) -# define QT_NO_UNSHARABLE_CONTAINERS +// ### Qt6: FIXME and get rid of unsharable containers +//# define QT_NO_UNSHARABLE_CONTAINERS # define QT6_VIRTUAL virtual # define QT6_NOT_VIRTUAL #else diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 4941ca45aa..23cb5ba61e 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -1318,7 +1318,7 @@ static QStringList backtraceFramesForLogMessage(int frameCount) QString function = m.captured(2); // skip the trace from QtCore that are because of the qDebug itself - if (!numberPrinted && library.contains(QLatin1String("Qt5Core")) + if (!numberPrinted && library.contains(QLatin1String("Qt6Core")) && (function.isEmpty() || function.contains(QLatin1String("Message"), Qt::CaseInsensitive) || function.contains(QLatin1String("QDebug")))) { continue; diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp index ce06c8e00b..7f65b0f8f7 100644 --- a/src/corelib/io/qfileselector.cpp +++ b/src/corelib/io/qfileselector.cpp @@ -331,7 +331,6 @@ void QFileSelectorPrivate::updateSelectors() QStringList QFileSelectorPrivate::platformSelectors() { // similar, but not identical to QSysInfo::osType - // ### Qt6: remove macOS fallbacks to "mac" and the future compatibility QStringList ret; #if defined(Q_OS_WIN) ret << QStringLiteral("windows"); @@ -344,16 +343,10 @@ QStringList QFileSelectorPrivate::platformSelectors() # if !defined(Q_OS_ANDROID) && !defined(Q_OS_QNX) // we don't want "linux" for Android or two instances of "qnx" for QNX ret << QSysInfo::kernelType(); -# ifdef Q_OS_MAC - ret << QStringLiteral("mac"); // compatibility, since kernelType() is "darwin" -# endif # endif QString productName = QSysInfo::productType(); if (productName != QLatin1String("unknown")) ret << productName; // "opensuse", "fedora", "osx", "ios", "android" -# if defined(Q_OS_MACOS) - ret << QStringLiteral("macos"); // future compatibility -# endif #endif return ret; } diff --git a/src/corelib/io/qfilesystemwatcher_win.cpp b/src/corelib/io/qfilesystemwatcher_win.cpp index eb626fd541..e1949e9697 100644 --- a/src/corelib/io/qfilesystemwatcher_win.cpp +++ b/src/corelib/io/qfilesystemwatcher_win.cpp @@ -79,7 +79,7 @@ static Qt::HANDLE createChangeNotification(const QString &path, uint flags) nativePath.append(QLatin1Char('\\')); const HANDLE result = FindFirstChangeNotification(reinterpret_cast<const wchar_t *>(nativePath.utf16()), FALSE, flags); - DEBUG() << __FUNCTION__ << nativePath << Qt::hex <<showbase << flags << "returns" << result; + DEBUG() << __FUNCTION__ << nativePath << Qt::hex << Qt::showbase << flags << "returns" << result; return result; } diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp index d171b313e6..ad857612b6 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.cpp +++ b/src/corelib/itemmodels/qabstractitemmodel.cpp @@ -3268,7 +3268,11 @@ void QAbstractItemModel::endResetModel() { Q_D(QAbstractItemModel); d->invalidatePersistentIndexes(); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + resetInternalData(); +#else QMetaObject::invokeMethod(this, "resetInternalData"); +#endif emit modelReset(QPrivateSignal()); } diff --git a/src/corelib/itemmodels/qabstractproxymodel.h b/src/corelib/itemmodels/qabstractproxymodel.h index c9a73b6a31..f6f6e45c1a 100644 --- a/src/corelib/itemmodels/qabstractproxymodel.h +++ b/src/corelib/itemmodels/qabstractproxymodel.h @@ -103,7 +103,11 @@ Q_SIGNALS: void sourceModelChanged(QPrivateSignal); protected Q_SLOTS: - void resetInternalData(); + void resetInternalData() +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + override +#endif + ; protected: QAbstractProxyModel(QAbstractProxyModelPrivate &, QObject *parent); diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 7a6faf2e2b..fc8b9227d4 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -152,10 +152,10 @@ private: extern QString qAppFileName(); #endif -#if QT_VERSION >= 0x060000 -# error "Bump QCoreApplicatoinPrivate::app_compile_version to 0x060000" +#if QT_VERSION >= 0x070000 +# error "Bump QCoreApplicatoinPrivate::app_compile_version to 0x070000" #endif -int QCoreApplicationPrivate::app_compile_version = 0x050000; //we don't know exactly, but it's at least 5.0.0 +int QCoreApplicationPrivate::app_compile_version = 0x060000; //we don't know exactly, but it's at least 6.0.0 bool QCoreApplicationPrivate::setuidAllowed = false; diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 79ee5eec11..7f512b6cb1 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -493,7 +493,7 @@ public: typedef void (*Deleter)(void *); typedef void *(*Creator)(const void *); -#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) +#if 1 || QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // ### Qt6: fix this typedef void (*Destructor)(void *); typedef void *(*Constructor)(void *, const void *); // TODO Qt6: remove me #endif diff --git a/src/corelib/mimetypes/qmimedatabase_p.h b/src/corelib/mimetypes/qmimedatabase_p.h index d9cf446d44..831390de1f 100644 --- a/src/corelib/mimetypes/qmimedatabase_p.h +++ b/src/corelib/mimetypes/qmimedatabase_p.h @@ -63,6 +63,7 @@ QT_REQUIRE_CONFIG(mimetype); #include <QtCore/qmutex.h> #include <QtCore/qvector.h> +#include <vector> #include <memory> QT_BEGIN_NAMESPACE diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 0e32776c71..c059851fce 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -692,7 +692,7 @@ static bool qt_get_metadata(QLibraryPrivate *priv, QString *errMsg) }; #else auto getMetaData = [](QFunctionPointer fptr) { - auto f = reinterpret_cast<QPair<const char *, size_t> (*)()>(fptr); + auto f = reinterpret_cast<QPluginMetaData (*)()>(fptr); return f(); }; #endif @@ -702,7 +702,7 @@ static bool qt_get_metadata(QLibraryPrivate *priv, QString *errMsg) return false; auto metaData = getMetaData(pfn); - QJsonDocument doc = qJsonFromRawLibraryMetaData(metaData.first, metaData.second, errMsg); + QJsonDocument doc = qJsonFromRawLibraryMetaData(reinterpret_cast<const char *>(metaData.data), metaData.size, errMsg); if (doc.isNull()) return false; priv->metaData = doc.object(); diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h index 9da6acd0a7..1cd0e8e0aa 100644 --- a/src/gui/image/qimage_p.h +++ b/src/gui/image/qimage_p.h @@ -140,7 +140,7 @@ QImageData::calculateImageParameters(qsizetype width, qsizetype height, qsizetyp qsizetype dummy; if (mul_overflow(height, qsizetype(sizeof(uchar *)), &dummy)) return invalid; // why is this here? -#if QT_VERSION < QT_VERSION_CHECK(6,0,0) +#if 1 || QT_VERSION < QT_VERSION_CHECK(6,0,0) // ### can only fix this if QImage dimensions are not int anymore // Disallow images where width * depth calculations might overflow if (width > (INT_MAX - 31) / depth) return invalid; diff --git a/src/gui/itemmodels/qstandarditemmodel.h b/src/gui/itemmodels/qstandarditemmodel.h index a9ee25da75..435b66591c 100644 --- a/src/gui/itemmodels/qstandarditemmodel.h +++ b/src/gui/itemmodels/qstandarditemmodel.h @@ -344,8 +344,11 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; - // Qt 6: add override keyword - bool clearItemData(const QModelIndex &index); + bool clearItemData(const QModelIndex &index) +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + override +#endif + ; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; diff --git a/src/network/ssl/qsslsocket_winrt.cpp b/src/network/ssl/qsslsocket_winrt.cpp index d54ac2ad73..0bbe6fe57d 100644 --- a/src/network/ssl/qsslsocket_winrt.cpp +++ b/src/network/ssl/qsslsocket_winrt.cpp @@ -274,7 +274,7 @@ void QSslSocketBackendPrivate::startClientEncryption() } // Sync custom certificates - const QSet<QSslCertificate> caCertificates = configuration.caCertificates.toSet(); + const QSet<QSslCertificate> caCertificates(configuration.caCertificates.constBegin(), configuration.caCertificates.constEnd()); const QSet<QSslCertificate> newCertificates = caCertificates - previousCaCertificates; const QSet<QSslCertificate> oldCertificates = previousCaCertificates - caCertificates; g->syncCaCertificates(newCertificates, oldCertificates); @@ -397,7 +397,7 @@ void QSslSocketBackendPrivate::continueHandshake() hr = control2->get_IgnorableServerCertificateErrors(&ignoreList); Q_ASSERT_SUCCEEDED(hr); - QSet<QSslError> ignoreErrors = ignoreErrorsList.toSet(); + QSet<QSslError> ignoreErrors(ignoreErrorsList.constBegin(), ignoreErrorsList.constEnd()); for (int i = ChainValidationResult_Untrusted; i < ChainValidationResult_OtherErrors + 1; ++i) { // Populate the native ignore list - break to add, continue to skip switch (i) { @@ -600,7 +600,7 @@ HRESULT QSslSocketBackendPrivate::onSslUpgrade(IAsyncAction *action, AsyncStatus } } - sslErrors = errors.toList(); + sslErrors = QList<QSslError>(errors.constBegin(), errors.constEnd()); // Peer validation if (!configuration.peerCertificate.isNull()) { diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index fb3d05d3e4..eb18e573ea 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -272,7 +272,7 @@ void QCocoaIntegration::updateScreens() [screens addObject:[NSScreen mainScreen]]; if ([screens count] == 0) return; - QSet<QCocoaScreen*> remainingScreens = QSet<QCocoaScreen*>::fromList(mScreens); + QSet<QCocoaScreen*> remainingScreens = QSet<QCocoaScreen*>(mScreens.constBegin(), mScreens.constEnd()); QList<QPlatformScreen *> siblings; uint screenCount = [screens count]; for (uint i = 0; i < screenCount; i++) { diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp index 886f1f75b9..72bb5688ef 100644 --- a/src/testlib/qtestblacklist.cpp +++ b/src/testlib/qtestblacklist.cpp @@ -186,10 +186,20 @@ static QSet<QByteArray> activeConditions() if (!distributionName.isEmpty()) { if (result.find(distributionName) == result.end()) result.insert(distributionName); + // backwards compatibility with Qt 5 + if (distributionName == "macos") { + if (result.find(distributionName) == result.end()) + result.insert("osx"); + } if (!distributionRelease.isEmpty()) { QByteArray versioned = distributionName + "-" + distributionRelease; if (result.find(versioned) == result.end()) result.insert(versioned); + if (distributionName == "macos") { + QByteArray versioned = "osx-" + distributionRelease; + if (result.find(versioned) == result.end()) + result.insert(versioned); + } } } |