diff options
-rw-r--r-- | cmake/QtCMakePackageVersionFile.cmake.in | 10 | ||||
-rw-r--r-- | mkspecs/features/unix/ccache.prf | 14 | ||||
-rw-r--r-- | src/corelib/global/qtenvironmentvariables.cpp | 2 | ||||
-rw-r--r-- | src/corelib/text/qlocale.cpp | 4 | ||||
-rw-r--r-- | src/corelib/text/qlocale_win.cpp | 7 | ||||
-rw-r--r-- | src/corelib/text/qtextboundaryfinder.cpp | 4 | ||||
-rw-r--r-- | src/tools/androiddeployqt/main.cpp | 2 | ||||
-rw-r--r-- | src/tools/windeployqt/main.cpp | 22 | ||||
-rw-r--r-- | src/tools/windeployqt/qmlutils.cpp | 5 | ||||
-rw-r--r-- | src/tools/windeployqt/qmlutils.h | 2 | ||||
-rw-r--r-- | src/tools/windeployqt/utils.cpp | 4 | ||||
-rw-r--r-- | src/tools/windeployqt/utils.h | 2 | ||||
-rw-r--r-- | tests/auto/corelib/kernel/qjniarray/tst_qjniarray.cpp | 4 | ||||
-rw-r--r-- | tests/auto/corelib/kernel/qjnienvironment/tst_qjnienvironment.cpp | 4 | ||||
-rw-r--r-- | tests/auto/corelib/kernel/qjniobject/tst_qjniobject.cpp | 4 | ||||
-rw-r--r-- | tests/auto/corelib/kernel/qjnitypes/tst_qjnitypes.cpp | 4 | ||||
-rw-r--r-- | tests/auto/corelib/kernel/qobject/tst_qobject.cpp | 8 |
17 files changed, 76 insertions, 26 deletions
diff --git a/cmake/QtCMakePackageVersionFile.cmake.in b/cmake/QtCMakePackageVersionFile.cmake.in index d4c30b33ac8..0e236901561 100644 --- a/cmake/QtCMakePackageVersionFile.cmake.in +++ b/cmake/QtCMakePackageVersionFile.cmake.in @@ -6,15 +6,15 @@ include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]") set(__qt_disable_package_version_check FALSE) -# Allow to opt out of the version check. -if(QT_NO_PACKAGE_VERSION_CHECK) - set(__qt_disable_package_version_check TRUE) -endif() - # Extra CMake code begin @extra_code@ # Extra CMake code end +# Allow to opt out of the version check. +if(DEFINED QT_NO_PACKAGE_VERSION_CHECK) + set(__qt_disable_package_version_check ${QT_NO_PACKAGE_VERSION_CHECK}) +endif() + if((NOT PACKAGE_VERSION_COMPATIBLE) OR PACKAGE_VERSION_UNSUITABLE) set(__qt_package_version_incompatible TRUE) else() diff --git a/mkspecs/features/unix/ccache.prf b/mkspecs/features/unix/ccache.prf index d5739d3eaba..ff6173171ab 100644 --- a/mkspecs/features/unix/ccache.prf +++ b/mkspecs/features/unix/ccache.prf @@ -2,18 +2,22 @@ macx-xcode: return() darwin: load(sdk) -ccache_prefix = ccache +launcher_prefix = ccache -precompile_header { +!isEmpty(QMAKE_CACHE_LAUNCHER_PREFIX) { + launcher_prefix = $$QMAKE_CACHE_LAUNCHER_PREFIX +} + +precompile_header:contains(launcher_prefix, ccache) { CCACHE_SLOPPINESS += pch_defines time_macros - ccache_prefix = \ + launcher_prefix = \ CCACHE_SLOPPINESS=\"$$join(CCACHE_SLOPPINESS, ',')\$${CCACHE_SLOPPINESS+,\$$CCACHE_SLOPPINESS}\" \ # Make sure we build sources directly, not from their preprocessed version, # otherwise precompiled headers will not be used during cache misses. CCACHE_CPP2=true \ - $$ccache_prefix + $$launcher_prefix } for(tool, $$list(QMAKE_CC QMAKE_CXX QMAKE_LINK QMAKE_LINK_SHLIB QMAKE_LINK_C)): \ - $$tool = $$ccache_prefix $$eval($$tool) + $$tool = $$launcher_prefix $$eval($$tool) diff --git a/src/corelib/global/qtenvironmentvariables.cpp b/src/corelib/global/qtenvironmentvariables.cpp index cc0169a1f8c..a823238b40e 100644 --- a/src/corelib/global/qtenvironmentvariables.cpp +++ b/src/corelib/global/qtenvironmentvariables.cpp @@ -430,7 +430,7 @@ QString qTzName(int dstIndex) if (ok) memcpy(name, src, size + 1); } -#endif // Q_OS_WIN +#endif // _UCRT return ok ? QString::fromLocal8Bit(name, qsizetype(size)) : QString(); } diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp index 717eac25c0e..0ef0256e443 100644 --- a/src/corelib/text/qlocale.cpp +++ b/src/corelib/text/qlocale.cpp @@ -4430,8 +4430,8 @@ char NumericTokenizer::nextToken() // Must match qlocale_tools.h's unicodeForDigit() if (m_guide.zeroLen == 1) { if (!ch.isSurrogate()) { - const uint gap = asBmpDigit(ch.unicode()); - if (gap < 10u) { + const int gap = asBmpDigit(ch.unicode()); + if (gap >= 0 && gap < 10) { ++m_index; return '0' + gap; } diff --git a/src/corelib/text/qlocale_win.cpp b/src/corelib/text/qlocale_win.cpp index 2ee34455d03..f7db925ba63 100644 --- a/src/corelib/text/qlocale_win.cpp +++ b/src/corelib/text/qlocale_win.cpp @@ -1010,6 +1010,7 @@ static constexpr WindowsToISOListElt windows_to_iso_list[] = { { 0x0412, "ko" }, { 0x0413, "nl" }, { 0x0414, "no" }, + { 0x0414, "nb" }, // alternative spelling; lower_bound will find the first one { 0x0415, "pl" }, { 0x0416, "pt_BR" }, { 0x0418, "ro" }, @@ -1045,6 +1046,7 @@ static constexpr WindowsToISOListElt windows_to_iso_list[] = { { 0x0812, "ko" }, { 0x0813, "nl_BE" }, { 0x0814, "no" }, + { 0x0814, "nn" }, // alternative spelling; lower_bound will find the first one { 0x0816, "pt" }, { 0x081a, "sr" }, { 0x081d, "sv_FI" }, @@ -1129,11 +1131,6 @@ LCID qt_inIsoNametoLCID(const char *name) return LOCALE_USER_DEFAULT; if (std::strlen(name) >= sizeof(WindowsToISOListElt::iso_name)) return LOCALE_USER_DEFAULT; // cannot possibly match (too long) - // handle norwegian manually, the list above will fail - if (!strncmp(name, "nb", 2)) - return 0x0414; - if (!strncmp(name, "nn", 2)) - return 0x0814; // normalize separators: char n[sizeof(WindowsToISOListElt::iso_name)]; diff --git a/src/corelib/text/qtextboundaryfinder.cpp b/src/corelib/text/qtextboundaryfinder.cpp index 019ae3577b1..6c247ffa6e0 100644 --- a/src/corelib/text/qtextboundaryfinder.cpp +++ b/src/corelib/text/qtextboundaryfinder.cpp @@ -104,6 +104,7 @@ static void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharA */ QTextBoundaryFinder::QTextBoundaryFinder() : freeBuffer(true) + , unused{0} { } @@ -116,6 +117,7 @@ QTextBoundaryFinder::QTextBoundaryFinder(const QTextBoundaryFinder &other) , sv(other.sv) , pos(other.pos) , freeBuffer(true) + , unused{0} { if (other.attributes) { Q_ASSERT(sv.size() > 0); @@ -176,6 +178,7 @@ QTextBoundaryFinder::QTextBoundaryFinder(BoundaryType type, const QString &strin , s(string) , sv(s) , freeBuffer(true) + , unused{0} { if (sv.size() > 0) { attributes = (QCharAttributes *) malloc((sv.size() + 1) * sizeof(QCharAttributes)); @@ -209,6 +212,7 @@ QTextBoundaryFinder::QTextBoundaryFinder(BoundaryType type, QStringView string, : t(type) , sv(string) , freeBuffer(true) + , unused{0} { if (!sv.isEmpty()) { if (buffer && bufferSize / int(sizeof(QCharAttributes)) >= sv.size() + 1) { diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 0201c2c8646..03c04b5aa26 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -3707,7 +3707,7 @@ int generateJavaQmlComponents(const Options &options) }; const static QHash<QString, QString> qmlToJavaType = { - { "qreal"_L1, "Double"_L1 }, { "double"_L1, "Double"_L1 }, { "int"_L1, "Integer"_L1 }, + { "real"_L1, "Double"_L1 }, { "double"_L1, "Double"_L1 }, { "int"_L1, "Integer"_L1 }, { "float"_L1, "Float"_L1 }, { "bool"_L1, "Boolean"_L1 }, { "string"_L1, "String"_L1 }, { "void"_L1, "Void"_L1 } }; diff --git a/src/tools/windeployqt/main.cpp b/src/tools/windeployqt/main.cpp index fc8f5d5e922..b0ee3356e2d 100644 --- a/src/tools/windeployqt/main.cpp +++ b/src/tools/windeployqt/main.cpp @@ -194,6 +194,7 @@ struct Options { unsigned updateFileFlags = 0; QStringList qmlDirectories; // Project's QML files. QStringList qmlImportPaths; // Custom QML module locations. + int qmlImportTimeout = 30000; QString directory; QString qtpathsBinary; QString translationsDirectory; // Translations target directory @@ -444,6 +445,12 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse QStringLiteral("directory")); parser->addOption(qmlImportOption); + QCommandLineOption qmlImportTimeoutOption(QStringLiteral("qmlimporttimeout"), + QStringLiteral("Set timeout (in ms for) execution of " + "qmlimportscanner."), + QStringLiteral("timeout")); + parser->addOption(qmlImportTimeoutOption); + QCommandLineOption noQuickImportOption(QStringLiteral("no-quick-import"), QStringLiteral("Skip deployment of Qt Quick imports.")); parser->addOption(noQuickImportOption); @@ -693,6 +700,18 @@ static inline int parseArguments(const QStringList &arguments, QCommandLineParse if (parser->isSet(qmlImportOption)) options->qmlImportPaths = parser->values(qmlImportOption); + if (parser->isSet(qmlImportTimeoutOption)) { + const QString timeoutString = parser->value(qmlImportTimeoutOption); + bool ok; + int timeout = timeoutString.toInt(&ok); + if (!ok) { + *errorMessage = u'"' + timeoutString + QStringLiteral("\" is not an acceptable timeout " + "value."); + return CommandLineParseError; + } + options->qmlImportTimeout = timeout; + } + const QString &file = posArgs.front(); const QFileInfo fi(QDir::cleanPath(file)); if (!fi.exists()) { @@ -1624,7 +1643,8 @@ static DeployResult deploy(const Options &options, const QMap<QString, QString> const QmlImportScanResult scanResult = runQmlImportScanner(qmlDirectory, qmlImportPaths, result.directlyUsedQtLibraries.test(QtWidgetsModuleId), - options.platform, debugMatchMode, errorMessage); + options.platform, debugMatchMode, errorMessage, + options.qmlImportTimeout); if (!scanResult.ok) return result; qmlScanResult.append(scanResult); diff --git a/src/tools/windeployqt/qmlutils.cpp b/src/tools/windeployqt/qmlutils.cpp index a7e63e74705..0f7c13653a7 100644 --- a/src/tools/windeployqt/qmlutils.cpp +++ b/src/tools/windeployqt/qmlutils.cpp @@ -75,7 +75,7 @@ static void findFileRecursion(const QDir &directory, Platform platform, QmlImportScanResult runQmlImportScanner(const QString &directory, const QStringList &qmlImportPaths, bool usesWidgets, int platform, DebugMatchMode debugMatchMode, - QString *errorMessage) + QString *errorMessage, int timeout) { Q_UNUSED(usesWidgets); QmlImportScanResult result; @@ -87,7 +87,8 @@ QmlImportScanResult runQmlImportScanner(const QString &directory, const QStringL QByteArray stdOut; QByteArray stdErr; const QString binary = QStringLiteral("qmlimportscanner"); - if (!runProcess(binary, arguments, QDir::currentPath(), &exitCode, &stdOut, &stdErr, errorMessage)) + if (!runProcess(binary, arguments, QDir::currentPath(), &exitCode, &stdOut, &stdErr, + errorMessage, timeout)) return result; if (exitCode) { *errorMessage = binary + QStringLiteral(" returned ") + QString::number(exitCode) diff --git a/src/tools/windeployqt/qmlutils.h b/src/tools/windeployqt/qmlutils.h index bff1fb3a9bf..81a31fbe9c3 100644 --- a/src/tools/windeployqt/qmlutils.h +++ b/src/tools/windeployqt/qmlutils.h @@ -33,7 +33,7 @@ bool operator==(const QmlImportScanResult::Module &m1, const QmlImportScanResult QmlImportScanResult runQmlImportScanner(const QString &directory, const QStringList &qmlImportPaths, bool usesWidgets, int platform, DebugMatchMode debugMatchMode, - QString *errorMessage); + QString *errorMessage, int timeout = 30000); QT_END_NAMESPACE diff --git a/src/tools/windeployqt/utils.cpp b/src/tools/windeployqt/utils.cpp index ea32346c65f..aa67e144f8c 100644 --- a/src/tools/windeployqt/utils.cpp +++ b/src/tools/windeployqt/utils.cpp @@ -137,7 +137,7 @@ static inline void appendToCommandLine(const QString &argument, QString *command bool runProcess(const QString &binary, const QStringList &args, const QString &workingDirectory, unsigned long *exitCode, QByteArray *stdOut, QByteArray *stdErr, - QString *errorMessage) + QString *errorMessage, int timeout) { if (exitCode) *exitCode = 0; @@ -157,7 +157,7 @@ bool runProcess(const QString &binary, const QStringList &args, } process.start(); - if (!process.waitForStarted() || !process.waitForFinished()) { + if (!process.waitForStarted() || !process.waitForFinished(timeout)) { if (errorMessage) *errorMessage = process.errorString(); return false; diff --git a/src/tools/windeployqt/utils.h b/src/tools/windeployqt/utils.h index fb3ba0b40b1..57100417a26 100644 --- a/src/tools/windeployqt/utils.h +++ b/src/tools/windeployqt/utils.h @@ -164,7 +164,7 @@ bool updateFile(const QString &sourceFileName, const QStringList &nameFilters, bool runProcess(const QString &binary, const QStringList &args, const QString &workingDirectory = QString(), unsigned long *exitCode = 0, QByteArray *stdOut = 0, QByteArray *stdErr = 0, - QString *errorMessage = 0); + QString *errorMessage = 0, int timeout = 30000); bool readPeExecutable(const QString &peExecutableFileName, QString *errorMessage, QStringList *dependentLibraries = 0, unsigned *wordSize = 0, diff --git a/tests/auto/corelib/kernel/qjniarray/tst_qjniarray.cpp b/tests/auto/corelib/kernel/qjniarray/tst_qjniarray.cpp index b6a6d4d2cdf..6e8ff4ec53b 100644 --- a/tests/auto/corelib/kernel/qjniarray/tst_qjniarray.cpp +++ b/tests/auto/corelib/kernel/qjniarray/tst_qjniarray.cpp @@ -6,6 +6,8 @@ #include <QtCore/qjnitypes.h> #include <QtCore/qjniarray.h> +QT_BEGIN_NAMESPACE + using namespace Qt::StringLiterals; class tst_QJniArray : public QObject @@ -494,6 +496,8 @@ void tst_QJniArray::mutate() } } +QT_END_NAMESPACE + QTEST_MAIN(tst_QJniArray) #include "tst_qjniarray.moc" diff --git a/tests/auto/corelib/kernel/qjnienvironment/tst_qjnienvironment.cpp b/tests/auto/corelib/kernel/qjnienvironment/tst_qjnienvironment.cpp index 53b39ff2e16..b93e79cda5e 100644 --- a/tests/auto/corelib/kernel/qjnienvironment/tst_qjnienvironment.cpp +++ b/tests/auto/corelib/kernel/qjnienvironment/tst_qjnienvironment.cpp @@ -7,6 +7,8 @@ #include <QtCore/QJniObject> #include <QtTest/QTest> +QT_BEGIN_NAMESPACE + static const char javaTestClass[] = "org/qtproject/qt/android/testdatapackage/QtJniEnvironmentTestClass"; static const char javaTestClassNoCtor[] = @@ -374,6 +376,8 @@ void tst_QJniEnvironment::findStaticField() QVERIFY(!env.checkAndClearExceptions()); } +QT_END_NAMESPACE + QTEST_MAIN(tst_QJniEnvironment) #include "tst_qjnienvironment.moc" diff --git a/tests/auto/corelib/kernel/qjniobject/tst_qjniobject.cpp b/tests/auto/corelib/kernel/qjniobject/tst_qjniobject.cpp index 62ffae0daa5..180406368db 100644 --- a/tests/auto/corelib/kernel/qjniobject/tst_qjniobject.cpp +++ b/tests/auto/corelib/kernel/qjniobject/tst_qjniobject.cpp @@ -8,6 +8,8 @@ #include <QtCore/QJniObject> #include <QTest> +QT_BEGIN_NAMESPACE + using namespace Qt::StringLiterals; static constexpr const char testClassName[] = "org/qtproject/qt/android/testdatapackage/QtJniObjectTestClass"; @@ -2275,6 +2277,8 @@ void tst_QJniObject::callStaticOverloadResolution() QCOMPARE(result, value); } +QT_END_NAMESPACE + QTEST_MAIN(tst_QJniObject) #include "tst_qjniobject.moc" diff --git a/tests/auto/corelib/kernel/qjnitypes/tst_qjnitypes.cpp b/tests/auto/corelib/kernel/qjnitypes/tst_qjnitypes.cpp index 4bd84513b3b..b24f9cb3bb8 100644 --- a/tests/auto/corelib/kernel/qjnitypes/tst_qjnitypes.cpp +++ b/tests/auto/corelib/kernel/qjnitypes/tst_qjnitypes.cpp @@ -6,6 +6,8 @@ #include <QtCore/qjnitypes.h> #include <QtCore/qjniarray.h> +QT_BEGIN_NAMESPACE + using namespace Qt::StringLiterals; class tst_QJniTypes : public QObject @@ -280,6 +282,8 @@ void tst_QJniTypes::stringTypeCantBeArgument() == Overload::OnlyMethod); } +QT_END_NAMESPACE + QTEST_MAIN(tst_QJniTypes) #include "tst_qjnitypes.moc" diff --git a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp index 034da6f15a2..d4de066a48b 100644 --- a/tests/auto/corelib/kernel/qobject/tst_qobject.cpp +++ b/tests/auto/corelib/kernel/qobject/tst_qobject.cpp @@ -7800,9 +7800,17 @@ void tst_QObject::nullReceiver() { QObject o; QObject *nullObj = nullptr; // Passing nullptr directly doesn't compile with gcc 4.8 + auto ignoreMsg = [] { + QTest::ignoreMessage(QtWarningMsg, "QObject::connect(QObject, Unknown): invalid nullptr parameter"); + }; + ignoreMsg(); QVERIFY(!connect(&o, &QObject::destroyed, nullObj, &QObject::deleteLater)); + ignoreMsg(); QVERIFY(!connect(&o, &QObject::destroyed, nullObj, [] {})); + ignoreMsg(); QVERIFY(!connect(&o, &QObject::destroyed, nullObj, Functor_noexcept())); + QTest::ignoreMessage(QtWarningMsg, + "QObject::connect: Cannot connect QObject::destroyed() to (nullptr)::deleteLater()"); QVERIFY(!connect(&o, SIGNAL(destroyed()), nullObj, SLOT(deleteLater()))); } |