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>
This commit is contained in:
parent
7dd71e8125
commit
5652d33f97
@ -4,4 +4,4 @@ CONFIG += warning_clean
|
||||
QT_SOURCE_TREE = $$PWD
|
||||
QT_BUILD_TREE = $$shadowed($$PWD)
|
||||
|
||||
MODULE_VERSION = 5.14.0
|
||||
MODULE_VERSION = 6.0.0
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -63,6 +63,7 @@ QT_REQUIRE_CONFIG(mimetype);
|
||||
#include <QtCore/qmutex.h>
|
||||
#include <QtCore/qvector.h>
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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()) {
|
||||
|
@ -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++) {
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -115,7 +115,7 @@ static DWORD createSymbolicLink(const QString &symLinkName, const QString &targe
|
||||
reinterpret_cast<const wchar_t*>(nativeTarget.utf16()), flags) == FALSE) {
|
||||
result = GetLastError();
|
||||
QTextStream(errorMessage) << "CreateSymbolicLink(" << nativeSymLinkName << ", "
|
||||
<< nativeTarget << ", 0x" << hex << flags << dec << ") failed with error " << result
|
||||
<< nativeTarget << ", 0x" << Qt::hex << flags << Qt::dec << ") failed with error " << result
|
||||
<< ": " << qt_error_string(int(result));
|
||||
}
|
||||
return result;
|
||||
|
@ -1,65 +1,51 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="/">
|
||||
<file>extras/test</file>
|
||||
<file>extras/test2</file>
|
||||
<file>extras/+custom1/test</file>
|
||||
<file>extras/+custom1/test3</file>
|
||||
<file>extras/+custom2/test</file>
|
||||
<file>extras/+custom3/test</file>
|
||||
<file>extras/+custom3/+custom2/test</file>
|
||||
<file>extras/+custom3/+custom4/test</file>
|
||||
<file>extras/+custom3/+custom5/test</file>
|
||||
<file>extras/+custom5/+custom3/test</file>
|
||||
|
||||
<!-- platforms/test: deepest possible selection -->
|
||||
<file>platforms/test</file>
|
||||
<file>platforms/+unix/+android/test</file>
|
||||
<file>platforms/+unix/+darwin/+mac/+ios/test</file>
|
||||
<file>platforms/+unix/+darwin/+mac/+osx/+macos/test</file>
|
||||
<file>platforms/+unix/+darwin/+mac/+osx/test</file>
|
||||
<file>platforms/+unix/+darwin/+mac/test</file>
|
||||
<file>platforms/+unix/+darwin/test</file>
|
||||
<file>platforms/+unix/+haiku/test</file>
|
||||
<file>platforms/+unix/+linux/test</file>
|
||||
<file>platforms/+unix/+qnx/test</file>
|
||||
<file>platforms/+unix/test</file>
|
||||
<file>platforms/+windows/+wince/test</file>
|
||||
<file>platforms/+windows/+winnt/test</file>
|
||||
<file>platforms/+windows/+winrt/test</file>
|
||||
<file>platforms/+windows/test</file>
|
||||
<file>platforms/+android/test</file>
|
||||
<file>platforms/+ios/test</file>
|
||||
<file>platforms/+macos/test</file>
|
||||
<file>platforms/+osx/test</file>
|
||||
<file>platforms/+darwin/test</file>
|
||||
<file>platforms/+mac/test</file>
|
||||
<file>platforms/+haiku/test</file>
|
||||
<file>platforms/+linux/test</file>
|
||||
<file>platforms/+qnx/test</file>
|
||||
<file>platforms/+wince/test</file>
|
||||
<file>platforms/+winrt/test</file>
|
||||
|
||||
<!-- platforms/test2: shallow selection for the deepest selector -->
|
||||
<file>platforms/test2</file>
|
||||
<file>platforms/+android/test2</file>
|
||||
<file>platforms/+ios/test2</file>
|
||||
<file>platforms/+macos/test2</file>
|
||||
<file>platforms/+haiku/test2</file>
|
||||
<file>platforms/+linux/test2</file>
|
||||
<file>platforms/+qnx/test2</file>
|
||||
<file>platforms/+wince/test2</file>
|
||||
<file>platforms/+winnt/test2</file>
|
||||
<file>platforms/+winrt/test2</file>
|
||||
|
||||
<!-- platforms/test3: selection for the family only -->
|
||||
<file>platforms/test3</file>
|
||||
<file>platforms/+windows/test3</file>
|
||||
<file>platforms/+unix/test3</file>
|
||||
|
||||
<!-- platforms/test4 and 5: special cases for macOS -->
|
||||
<file>platforms/test4</file>
|
||||
<file>platforms/+osx/test4</file>
|
||||
<file>platforms/test5</file>
|
||||
<file>platforms/+mac/test5</file>
|
||||
</qresource>
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>extras/test</file>
|
||||
<file>extras/test2</file>
|
||||
<file>extras/+custom1/test</file>
|
||||
<file>extras/+custom1/test3</file>
|
||||
<file>extras/+custom2/test</file>
|
||||
<file>extras/+custom3/test</file>
|
||||
<file>extras/+custom3/+custom2/test</file>
|
||||
<file>extras/+custom3/+custom4/test</file>
|
||||
<file>extras/+custom3/+custom5/test</file>
|
||||
<file>extras/+custom5/+custom3/test</file>
|
||||
<file>platforms/test</file>
|
||||
<file>platforms/+unix/+android/test</file>
|
||||
<file>platforms/+unix/+darwin/test</file>
|
||||
<file>platforms/+unix/+haiku/test</file>
|
||||
<file>platforms/+unix/+linux/test</file>
|
||||
<file>platforms/+unix/+qnx/test</file>
|
||||
<file>platforms/+unix/test</file>
|
||||
<file>platforms/+windows/+wince/test</file>
|
||||
<file>platforms/+windows/+winnt/test</file>
|
||||
<file>platforms/+windows/+winrt/test</file>
|
||||
<file>platforms/+windows/test</file>
|
||||
<file>platforms/+android/test</file>
|
||||
<file>platforms/+ios/test</file>
|
||||
<file>platforms/+macos/test</file>
|
||||
<file>platforms/+darwin/test</file>
|
||||
<file>platforms/+haiku/test</file>
|
||||
<file>platforms/+linux/test</file>
|
||||
<file>platforms/+qnx/test</file>
|
||||
<file>platforms/+wince/test</file>
|
||||
<file>platforms/+winrt/test</file>
|
||||
<file>platforms/test2</file>
|
||||
<file>platforms/+android/test2</file>
|
||||
<file>platforms/+ios/test2</file>
|
||||
<file>platforms/+macos/test2</file>
|
||||
<file>platforms/+haiku/test2</file>
|
||||
<file>platforms/+linux/test2</file>
|
||||
<file>platforms/+qnx/test2</file>
|
||||
<file>platforms/+wince/test2</file>
|
||||
<file>platforms/+winnt/test2</file>
|
||||
<file>platforms/+winrt/test2</file>
|
||||
<file>platforms/test3</file>
|
||||
<file>platforms/+windows/test3</file>
|
||||
<file>platforms/+unix/test3</file>
|
||||
<file>platforms/test4</file>
|
||||
<file>platforms/test5</file>
|
||||
<file>platforms/+unix/+darwin/+macos/test</file>
|
||||
<file>platforms/+unix/+darwin/+ios/test</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -126,14 +126,6 @@ void tst_QFileSelector::basicTest_data()
|
||||
QTest::newRow("platform3") << QString(":/platforms/test3") << QStringList()
|
||||
<< expectedPlatform3File;
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
// special case for compatibility code
|
||||
QTest::newRow("osx-compat") << QString(":/platforms/test4") << QStringList()
|
||||
<< ":/platforms/+osx/test4";
|
||||
QTest::newRow("mac-compat") << QString(":/platforms/test5") << QStringList()
|
||||
<< ":/platforms/+mac/test5";
|
||||
#endif
|
||||
|
||||
QString resourceTestPath(":/extras/test");
|
||||
QString custom1("custom1");
|
||||
QTest::newRow("custom1-noselector") << resourceTestPath << QStringList()
|
||||
|
@ -54,7 +54,7 @@ QVector<double> mixedvector_fill_and_return_helper()
|
||||
std::vector<double> v(N);
|
||||
for (int i = 0; i != N; ++i)
|
||||
v[i] = i;
|
||||
return QVector<double>::fromStdVector(v);
|
||||
return QVector<double>(v.begin(), v.end());
|
||||
}
|
||||
|
||||
|
||||
|
@ -105,7 +105,7 @@ void qfile_vs_qnetworkaccessmanager::qnamFileRead()
|
||||
}
|
||||
|
||||
qint64 elapsed = t.elapsed();
|
||||
qDebug() << endl << "Finished!";
|
||||
qDebug() << Qt::endl << "Finished!";
|
||||
qDebug() << "Bytes:" << size;
|
||||
qDebug() << "Speed:" << (qreal(size*iterations) / 1024.0) / (qreal(elapsed) / 1000.0) << "KB/sec";
|
||||
}
|
||||
@ -138,7 +138,7 @@ void qfile_vs_qnetworkaccessmanager::qnamImmediateFileRead()
|
||||
}
|
||||
|
||||
qint64 elapsed = t.elapsed();
|
||||
qDebug() << endl << "Finished!";
|
||||
qDebug() << Qt::endl << "Finished!";
|
||||
qDebug() << "Bytes:" << size;
|
||||
qDebug() << "Speed:" << (qreal(size*iterations) / 1024.0) / (qreal(elapsed) / 1000.0) << "KB/sec";
|
||||
}
|
||||
@ -167,7 +167,7 @@ void qfile_vs_qnetworkaccessmanager::qfileFileRead()
|
||||
}
|
||||
|
||||
qint64 elapsed = t.elapsed();
|
||||
qDebug() << endl << "Finished!";
|
||||
qDebug() << Qt::endl << "Finished!";
|
||||
qDebug() << "Bytes:" << size;
|
||||
qDebug() << "Speed:" << (qreal(size*iterations) / 1024.0) / (qreal(elapsed) / 1000.0) << "KB/sec";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user