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/corelib | |
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/corelib')
-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 |
10 files changed, 20 insertions, 17 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(); |