diff options
26 files changed, 488 insertions, 101 deletions
diff --git a/dist/changes-5.12.5 b/dist/changes-5.12.5 new file mode 100644 index 0000000000..c22839db78 --- /dev/null +++ b/dist/changes-5.12.5 @@ -0,0 +1,109 @@ +Qt 5.12.5 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.12.0 through 5.12.4. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.12 series is binary compatible with the 5.11.x series. +Applications compiled for 5.11 will continue to run with 5.12. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* QtCore * +**************************************************************************** + + - QBitArray: + * Fixed two bugs that caused QBitArrays created using fromBits() not to + compare equal to the equivalent QBitArray created using other methods + if the size was zero or not a multiple of 4. If the size modulus 8 was + 5, 6, or 7, the data was actually incorrect. + + - QCborStreamReader: + * Fixed a bug that caused the QIODevice that the data was being read + from not to show the entire CBOR message as consumed. This allows the + user to consume data that may follow the CBOR payload. + + - QCryptographicHash: + * Fixed a bug that caused the SHA-3 and Keccak algorithms to crash if + passed 256 MB of data or more. + + - QObject: + * Fixed a resource leak caused by a race condition if multiple QObjects + were created at the same time, for the first time in an application, + from multiple threads (implies threads not started with QThread). + + - QStorageInfo: + * Fixed a bug that caused QStorageInfo to be unable to report all + filesystems if the options to mounted filesystems were too long (over + 900 characters, roughly), such as those found in Docker overlay + mounts. + + - QTimeZone: + * The IANA timezone database backend now properly follows symlinks even + when they point to variable locations like /run or /var (useful when + /etc is mounted read-only). + +**************************************************************************** +* QtGui * +**************************************************************************** + + - QImage: + * Improve loading time when loading png files that have the same size as + the target. + + - QPixmapCache: + * [QTBUG-76694][QTBUG-72523] Ignore unsafe access from non-main threads + + - Text: + * [QTBUG-76219] Fixed a bug which could cause the font cache to grow + larger than it was supposed to. + * [QTBUG-55096][QTBUG-74761] Fixed bug where regular text rendered with + a color font would always display in black. + * [QTBUG-69546] Fixed a crash bug in + QTextDocument::clearUndoRedoStacks(QTextDocument::UndoStack). + +**************************************************************************** +* QtNetwork * +**************************************************************************** + + - QHostInfo: + * Functors used in the lookupHost overloads are now called correctly in + the thread of the context object. When used without context object, + the thread that initiates the lookup will run the functor, and is + required to run an event loop. + + - Windows: + * Correctly emit errors when trying to reach unreachable hosts or + services + +**************************************************************************** +* QtWidgets * +**************************************************************************** + + - QGraphicsView: + * Ignore disabled items when setting the mouse cursor. + + - QSplashScreen: + * On macOS, lower the splash screen when a modal dialog is shown to make + sure the user sees the dialog. + + - QSystemTrayIcon: + * On macOS, show the icon passed into showMessage in the notification + popup + +**************************************************************************** +* Android * +**************************************************************************** + + - [QTBUG-76293] Fix NDK r20 linking. + - [QTBUG-76036] Fixed an issue where menus would not work on 64 bit + builds. diff --git a/dist/changes-5.13.1 b/dist/changes-5.13.1 new file mode 100644 index 0000000000..2021b959aa --- /dev/null +++ b/dist/changes-5.13.1 @@ -0,0 +1,141 @@ +Qt 5.13.1 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.13.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.13 series is binary compatible with the 5.12.x series. +Applications compiled for 5.12 will continue to run with 5.13. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + +**************************************************************************** +* Important Behavior Changes * +**************************************************************************** + + - [QTBUG-76521] RCC's default compression algorithm was changed back to + Zlib, as it was in all previous releases until 5.13.0. The default will + remain Zlib for all Qt 5.x releases but will change in Qt 6.0. To + activate Zstd compression for your resources, either pass the + --compress-algo=zstd option to the rcc tool or add the XML attribute + compression-algorithm="zstd" to the <file> tags in the .qrc file. + +**************************************************************************** +* Android * +**************************************************************************** + + - [QTBUG-76293] Fix NDK r20 linking. + +**************************************************************************** +* QtCore * +**************************************************************************** + + - Global: + * [QTBUG-72073] Added the QT_NO_FLOAT16_OPERATORS macro in order to work + around a Microsoft <= VS2017 compiler bug that is exposed when using + std::bitset along with any Qt header that includes <qfloat16.h>. + + - QCborStreamReader: + * Fixed a bug that caused the QIODevice that the data was being read + from not to show the entire CBOR message as consumed. This allows the + user to consume data that may follow the CBOR payload. + + - QDeadlineTimer: + * [QTBUG-69750] Fixed integer overflows leading to immediate timeouts. + + - QStorageInfo: + * Fixed a bug that caused QStorageInfo to be unable to report all + filesystems if the options to mounted filesystems were too long (over + 900 characters, roughly), such as those found in Docker overlay + mounts. + + - QTextBoundaryFinder: + * Sentence breaking now no longer breaks between uppercase letters and + comma. This is a deviation from the Unicode specification, but + produces less surprising behavior. + + - QTimeZone: + * The IANA timezone database backend now properly follows symlinks even + when they point to variable locations like /run or /var (useful when + /etc is mounted read-only). + + - QVector: + * Fixed a regression that caused fill() not to detach, corrupting shared + copies. + +**************************************************************************** +* QtNetwork * +**************************************************************************** + + - Windows: + * Correctly emit errors when trying to reach unreachable hosts or + services + + - QNetworkAccessManager: + * Fixed QNetworkAccessManager::sendCustomRequest for Qt For WebAssembly. + +**************************************************************************** +* QtGui * +**************************************************************************** + + - [QTBUG-73231] QWindow::mapToGlobal()/mapFromGlobal() now handle windows + spanning screens correctly. + + - QImage: + * Improve loading time when loading png files that have the same size as + the target. + + - QPixmapCache: + * [QTBUG-76694][QTBUG-72523] Ignore unsafe access from non-main threads + + - Text: + * [QTBUG-76219] Fixed a bug which could cause the font cache to grow + larger than it was supposed to. + * [QTBUG-55096][QTBUG-74761] Fixed bug where regular text rendered with + a color font would always display in black. + +**************************************************************************** +* QtWidgets * +**************************************************************************** + + - QSystemTrayIcon: + * On macOS, show the icon passed into showMessage in the notification + popup + + - QDateTimeEdit: + * Use the information provided by the locale to determine the AM/PM + strings, unless they are already translated. + + - QGraphicsView: + * Ignore disabled items when setting the mouse cursor. + + - QMenu: + * Shortcuts are again shown by default in context menus, except on + macOS. They can be forced off by setting + AA_DontShowShortcutsInContextMenus to true. + + - QSplashScreen: + * On macOS, lower the splash screen when a modal dialog is shown to make + sure the user sees the dialog. + +**************************************************************************** +* Third-Party Code * +**************************************************************************** + + - Updated bundled SQLite to version 3.28.0 + - Updated QLocale's data to CLDR v35.1 + +**************************************************************************** +* qmake * +**************************************************************************** + + - [QTBUG-75653] The CONFIG value c++latest was added to select the latest + C++ standard the currently used toolchain supports. diff --git a/doc/doc.pro b/doc/doc.pro index 41ceb7ceae..802bd12222 100644 --- a/doc/doc.pro +++ b/doc/doc.pro @@ -1,6 +1,8 @@ TEMPLATE = aux -global_docs.files = $$PWD/global +global_docs.files = \ + $$PWD/global \ + $$PWD/config global_docs.path = $$[QT_INSTALL_DOCS] INSTALLS += global_docs !prefix_build:!equals(OUT_PWD, $$PWD): \ diff --git a/doc/global/externalsites/qtcreator.qdoc b/doc/global/externalsites/qtcreator.qdoc index 98a5c9f12b..e283b32360 100644 --- a/doc/global/externalsites/qtcreator.qdoc +++ b/doc/global/externalsites/qtcreator.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. @@ -62,6 +62,18 @@ \title Qt Creator: User Interface */ /*! + \externalpage http://doc.qt.io/qtcreator/creator-modes.html + \title Qt Creator: Selecting Modes +*/ +/*! + \externalpage http://doc.qt.io/qtcreator/creator-sidebar-views.html + \title Qt Creator: Browsing Project Contents +*/ +/*! + \externalpage http://doc.qt.io/qtcreator/creator-output-panes.html + \title Qt Creator: Viewing Output +*/ +/*! \externalpage http://doc.qt.io/qtcreator/creator-cli.html \title Qt Creator: Using Command Line Options */ @@ -125,7 +137,7 @@ \externalpage http://doc.qt.io/qtcreator/quick-signals.html \title Qt Creator: Connecting Objects to Signals */ -* /*! +/*! \externalpage http://doc.qt.io/qtcreator/quick-dynamic-properties.html \title Qt Creator: Specifying Dynamic Properties */ @@ -154,6 +166,10 @@ \title Qt Creator: Using QML Modules with Plugins */ /*! + \externalpage http://doc.qt.io/qtcreator/quick-converting-ui-projects.html + \title Qt Creator: Converting UI Projects to Applications +*/ +/*! \externalpage http://doc.qt.io/qtcreator/creator-visual-editor.html \title Qt Creator: Developing Qt Quick Applications */ @@ -554,6 +570,10 @@ \title Qt Creator: Analyzing CPU Usage */ /*! + \externalpage http://doc.qt.io/qtcreator/creator-cppcheck.html + \title Qt Creator: Analyzing Code with Cppcheck +*/ +/*! \externalpage http://doc.qt.io/qtcreator/creator-autotest.html \title Qt Creator: Running Autotests */ @@ -581,3 +601,27 @@ \externalpage http://doc.qt.io/qtcreator/creator-scxml.html \title Qt Creator: Editing State Charts */ +/*! + \externalpage http://doc.qt.io/qtcreator/studio-timeline.html + \title Qt Creator: Creating Animations +*/ +/*! + \externalpage http://doc.qt.io/qtcreator/creator-language-servers.html + \title Qt Creator: Using Language Servers +*/ +/*! + \externalpage http://doc.qt.io/qtcreator/qtcreator-toc.html + \title Qt Creator: All Topics +*/ +/*! + \externalpage http://doc.qt.io/qtcreator/creator-live-preview.html + \title Qt Creator: Previewing +*/ +/*! + \externalpage http://doc.qt.io/qtcreator/creator-live-preview-desktop.html + \title Qt Creator: Previewing on Desktop +*/ +/*! + \externalpage http://doc.qt.io/qtcreator/creator-live-preview-devices.html + \title Qt Creator: Previewing on Devices +*/ diff --git a/mkspecs/common/macx.conf b/mkspecs/common/macx.conf index 889027ada5..67552dcc6c 100644 --- a/mkspecs/common/macx.conf +++ b/mkspecs/common/macx.conf @@ -8,7 +8,7 @@ QMAKE_MAC_SDK = macosx QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12 QMAKE_APPLE_DEVICE_ARCHS = x86_64 QT_MAC_SDK_VERSION_MIN = 10.13 -QT_MAC_SDK_VERSION_MAX = 10.14 +QT_MAC_SDK_VERSION_MAX = 10.15 device.sdk = macosx device.target = device diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in index 4d3dc1bd35..364c23e750 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -53,7 +53,11 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura set(_lib_deps) set(_link_flags) - get_filename_component(_qt5_install_libs \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/lib\" ABSOLUTE) +!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE) + set(_qt5_install_libs \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}\") +!!ELSE + set(_qt5_install_libs \"$${CMAKE_LIB_DIR}\") +!!ENDIF if(EXISTS \"${prl_file_location}\") file(STRINGS \"${prl_file_location}\" _prl_strings REGEX \"QMAKE_PRL_LIBS_FOR_CMAKE[ \\t]*=\") diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 28cf02344d..24e69444c9 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -509,6 +509,56 @@ static QList<QVariantMap> provisioningTeams() return flatTeams; } +bool ProjectBuilderMakefileGenerator::replaceLibrarySuffix(const QString &lib_file, + const ProString &opt, + QString &name, QString &library) +{ + /* This isn't real nice, but it is real useful. This looks in a prl + for what the library will ultimately be called so we can stick it + in the ProjectFile. If the prl format ever changes (not likely) then + this will not really work. However, more concerning is that it will + encode the version number in the Project file which might be a bad + things in days to come? --Sam + */ + if (lib_file.isEmpty()) + return false; + + QMakeMetaInfo libinfo; + if (!libinfo.readLib(lib_file) || libinfo.isEmpty("QMAKE_PRL_TARGET")) + return false; + + const QString libDir = fileInfo(lib_file).absolutePath(); + library = libDir + Option::dir_sep + libinfo.first("QMAKE_PRL_TARGET"); + + debug_msg(1, "pbuilder: Found library (%s) via PRL %s (%s)", + opt.toLatin1().constData(), lib_file.toLatin1().constData(), library.toLatin1().constData()); + + if (project->isActiveConfig("xcode_dynamic_library_suffix")) { + QString suffixSetting = project->first("QMAKE_XCODE_LIBRARY_SUFFIX_SETTING").toQString(); + if (!suffixSetting.isEmpty()) { + QString librarySuffix = project->first("QMAKE_XCODE_LIBRARY_SUFFIX").toQString(); + suffixSetting = "$(" + suffixSetting + ")"; + if (!librarySuffix.isEmpty()) { + int pos = library.lastIndexOf(librarySuffix + '.'); + if (pos == -1) { + warn_msg(WarnLogic, "Failed to find expected suffix '%s' for library '%s'.", + qPrintable(librarySuffix), qPrintable(library)); + } else { + library.replace(pos, librarySuffix.length(), suffixSetting); + if (name.endsWith(librarySuffix)) + name.chop(librarySuffix.length()); + } + } else { + int pos = library.lastIndexOf(name); + if (pos != -1) + library.insert(pos + name.length(), suffixSetting); + } + } + } + + return true; +} + bool ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) { @@ -820,6 +870,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) } if(!project->isActiveConfig("staticlib")) { //DUMP LIBRARIES + const ProStringList defaultLibDirs = project->values("QMAKE_DEFAULT_LIBDIRS"); ProStringList &libdirs = project->values("QMAKE_PBX_LIBPATHS"), &frameworkdirs = project->values("QMAKE_FRAMEWORKPATH"); static const char * const libs[] = { "LIBS", "LIBS_PRIVATE", @@ -827,6 +878,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) for (int i = 0; libs[i]; i++) { tmp = project->values(libs[i]); for(int x = 0; x < tmp.count();) { + bool libSuffixReplaced = false; bool remove = false; QString library, name; ProString opt = tmp[x]; @@ -839,49 +891,12 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) QString lib("lib" + name); for (ProStringList::Iterator lit = libdirs.begin(); lit != libdirs.end(); ++lit) { if(project->isActiveConfig("link_prl")) { - /* This isn't real nice, but it is real useful. This looks in a prl - for what the library will ultimately be called so we can stick it - in the ProjectFile. If the prl format ever changes (not likely) then - this will not really work. However, more concerning is that it will - encode the version number in the Project file which might be a bad - things in days to come? --Sam - */ - QString lib_file = QMakeMetaInfo::checkLib(Option::normalizePath( - (*lit) + Option::dir_sep + lib + Option::prl_ext)); - if (!lib_file.isEmpty()) { - QMakeMetaInfo libinfo; - if(libinfo.readLib(lib_file)) { - if(!libinfo.isEmpty("QMAKE_PRL_TARGET")) { - library = (*lit) + Option::dir_sep + libinfo.first("QMAKE_PRL_TARGET"); - debug_msg(1, "pbuilder: Found library (%s) via PRL %s (%s)", - opt.toLatin1().constData(), lib_file.toLatin1().constData(), library.toLatin1().constData()); - remove = true; - - if (project->isActiveConfig("xcode_dynamic_library_suffix")) { - QString suffixSetting = project->first("QMAKE_XCODE_LIBRARY_SUFFIX_SETTING").toQString(); - if (!suffixSetting.isEmpty()) { - QString librarySuffix = project->first("QMAKE_XCODE_LIBRARY_SUFFIX").toQString(); - suffixSetting = "$(" + suffixSetting + ")"; - if (!librarySuffix.isEmpty()) { - int pos = library.lastIndexOf(librarySuffix + '.'); - if (pos == -1) { - warn_msg(WarnLogic, "Failed to find expected suffix '%s' for library '%s'.", - qPrintable(librarySuffix), qPrintable(library)); - } else { - library.replace(pos, librarySuffix.length(), suffixSetting); - if (name.endsWith(librarySuffix)) - name.chop(librarySuffix.length()); - } - } else { - int pos = library.lastIndexOf(name); - if (pos != -1) - library.insert(pos + name.length(), suffixSetting); - } - } - } - } - } - } + const QString prlFilePath = QMakeMetaInfo::checkLib( + Option::normalizePath((*lit) + Option::dir_sep + lib + + Option::prl_ext)); + if (replaceLibrarySuffix(prlFilePath, opt, name, library)) + remove = true; + libSuffixReplaced = true; } if(!remove) { QString extns[] = { ".dylib", ".so", ".a", QString() }; @@ -931,6 +946,16 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) } } if(!library.isEmpty()) { + if (!libSuffixReplaced) { + const QFileInfo fi = fileInfo(library); + const QString prlFilePath = QMakeMetaInfo::checkLib( + Option::normalizePath(fi.absolutePath() + '/' + fi.completeBaseName() + + Option::prl_ext)); + if (!prlFilePath.isEmpty()) { + name = fi.completeBaseName().mid(3); + replaceLibrarySuffix(prlFilePath, opt, name, library); + } + } const int slsh = library.lastIndexOf(Option::dir_sep); if(name.isEmpty()) { if(slsh != -1) @@ -938,8 +963,10 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) } if(slsh != -1) { const QString path = QFileInfo(library.left(slsh)).absoluteFilePath(); - if(!path.isEmpty() && !libdirs.contains(path)) + if (!path.isEmpty() && !libdirs.contains(path) + && !defaultLibDirs.contains(path)) { libdirs += path; + } } library = fileFixify(library, FileFixifyFromOutdir | FileFixifyAbsolute); QString key = keyFor(library); diff --git a/qmake/generators/mac/pbuilder_pbx.h b/qmake/generators/mac/pbuilder_pbx.h index ac0d63606d..1b90a3bbeb 100644 --- a/qmake/generators/mac/pbuilder_pbx.h +++ b/qmake/generators/mac/pbuilder_pbx.h @@ -41,6 +41,8 @@ class ProjectBuilderMakefileGenerator : public UnixMakefileGenerator bool writeSubDirs(QTextStream &); bool writeMakeParts(QTextStream &); bool writeMakefile(QTextStream &) override; + bool replaceLibrarySuffix(const QString &lib_file, const ProString &opt, QString &name, + QString &library); QString pbxbuild(); QHash<QString, QString> keys; diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 8b4f2bf58f..ccb601d4b8 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -1199,8 +1199,10 @@ void UnixMakefileGenerator::init2() project->values("QMAKE_FRAMEWORK_VERSION").append(project->first("VER_MAJ")); if (project->first("TEMPLATE") == "aux") { - project->values("PRL_TARGET") = - project->values("TARGET").first().prepend(project->first("QMAKE_PREFIX_STATICLIB")); + project->values("PRL_TARGET") = { + project->first("QMAKE_PREFIX_STATICLIB") + + project->first("TARGET") + }; } else if (!project->values("QMAKE_APP_FLAG").isEmpty()) { if(!project->isEmpty("QMAKE_BUNDLE")) { ProString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION"); diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index cebab1daef..17f2246082 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -1803,8 +1803,8 @@ static void qt_message_print(QtMsgType msgType, const QMessageLogContext &contex #ifndef QT_BOOTSTRAPPED Q_TRACE(qt_message_print, msgType, context.category, context.function, context.file, context.line, message); - // qDebug, qWarning, ... macros do not check whether category is enabled - if (isDefaultCategory(context.category)) { + // qDebug, qWarning, ... macros do not check whether category is enabledgc + if (msgType != QtFatalMsg && isDefaultCategory(context.category)) { if (QLoggingCategory *defaultCategory = QLoggingCategory::defaultCategory()) { if (!defaultCategory->isEnabled(msgType)) return; diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp index 711eb8f4d5..e5b2399566 100644 --- a/src/corelib/global/qrandom.cpp +++ b/src/corelib/global/qrandom.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 Intel Corporation. +** Copyright (C) 2019 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -103,17 +103,22 @@ static QT_FUNCTION_TARGET(RDRND) qsizetype qt_random_cpu(void *buffer, qsizetype { unsigned *ptr = reinterpret_cast<unsigned *>(buffer); unsigned *end = ptr + count; + int retries = 10; while (ptr + sizeof(qregisteruint)/sizeof(*ptr) <= end) { - if (_rdrandXX_step(reinterpret_cast<qregisteruint *>(ptr)) == 0) + if (_rdrandXX_step(reinterpret_cast<qregisteruint *>(ptr))) + ptr += sizeof(qregisteruint)/sizeof(*ptr); + else if (--retries == 0) goto out; - ptr += sizeof(qregisteruint)/sizeof(*ptr); } - if (sizeof(*ptr) != sizeof(qregisteruint) && ptr != end) { - if (_rdrand32_step(ptr)) - goto out; - ++ptr; + while (sizeof(*ptr) != sizeof(qregisteruint) && ptr != end) { + bool ok = _rdrand32_step(ptr); + if (!ok && --retries) + continue; + if (ok) + ++ptr; + break; } out: diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 1ace28c93f..98a198df43 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -74,7 +74,7 @@ QT_BEGIN_NAMESPACE # define QLIBRARY_AS_DEBUG true #endif -#if defined(Q_OS_UNIX) || defined(Q_CC_MINGW) +#if defined(Q_OS_UNIX) // We don't use separate debug and release libs on UNIX, so we want // to allow loading plugins, regardless of how they were built. # define QT_NO_DEBUG_PLUGIN_CHECK diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp index 1d0c93f26f..27c82bc09f 100644 --- a/src/gui/image/qiconloader.cpp +++ b/src/gui/image/qiconloader.cpp @@ -281,7 +281,7 @@ static quint32 icon_name_hash(const char *p) QVector<const char *> QIconCacheGtkReader::lookup(const QStringRef &name) { QVector<const char *> ret; - if (!isValid()) + if (!isValid() || name.isEmpty()) return ret; QByteArray nameUtf8 = name.toUtf8(); diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index cb7a0b8ac9..fa9d5d5f4d 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2762,7 +2762,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To QWindow *window = e->window.data(); typedef QPair<Qt::TouchPointStates, QList<QTouchEvent::TouchPoint> > StatesAndTouchPoints; QHash<QWindow *, StatesAndTouchPoints> windowsNeedingEvents; - bool stationaryTouchPointChangedVelocity = false; + bool stationaryTouchPointChangedProperty = false; for (int i = 0; i < e->points.count(); ++i) { QTouchEvent::TouchPoint touchPoint = e->points.at(i); @@ -2842,7 +2842,11 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To if (touchPoint.state() == Qt::TouchPointStationary) { if (touchInfo.touchPoint.velocity() != touchPoint.velocity()) { touchInfo.touchPoint.setVelocity(touchPoint.velocity()); - stationaryTouchPointChangedVelocity = true; + stationaryTouchPointChangedProperty = true; + } + if (!qFuzzyCompare(touchInfo.touchPoint.pressure(), touchPoint.pressure())) { + touchInfo.touchPoint.setPressure(touchPoint.pressure()); + stationaryTouchPointChangedProperty = true; } } else { touchInfo.touchPoint = touchPoint; @@ -2883,7 +2887,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To break; case Qt::TouchPointStationary: // don't send the event if nothing changed - if (!stationaryTouchPointChangedVelocity) + if (!stationaryTouchPointChangedProperty) continue; Q_FALLTHROUGH(); default: diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index c267ade0c2..b37353bf2c 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -399,6 +399,7 @@ struct QBidiAlgorithm { analysis[i].bidiDirection = (level & 1) ? QChar::DirR : QChar::DirL; runHasContent = true; lastRunWithContent = -1; + ++isolatePairPosition; } int runBeforeIsolate = runs.size(); ushort newLevel = isRtl ? ((stack.top().level + 1) | 1) : ((stack.top().level + 2) & ~1); @@ -440,21 +441,19 @@ struct QBidiAlgorithm { doEmbed(true, true, false); break; case QChar::DirLRI: - Q_ASSERT(isolatePairs.at(isolatePairPosition).start == i); doEmbed(false, false, true); - ++isolatePairPosition; break; case QChar::DirRLI: - Q_ASSERT(isolatePairs.at(isolatePairPosition).start == i); doEmbed(true, false, true); - ++isolatePairPosition; break; case QChar::DirFSI: { - const auto &pair = isolatePairs.at(isolatePairPosition); - Q_ASSERT(pair.start == i); - bool isRtl = QStringView(text + pair.start + 1, pair.end - pair.start - 1).isRightToLeft(); + bool isRtl = false; + if (isolatePairPosition < isolatePairs.size()) { + const auto &pair = isolatePairs.at(isolatePairPosition); + Q_ASSERT(pair.start == i); + isRtl = QStringView(text + pair.start + 1, pair.end - pair.start - 1).isRightToLeft(); + } doEmbed(isRtl, false, true); - ++isolatePairPosition; break; } diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index 6ff2c47eb4..c5bc3f509f 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -854,8 +854,11 @@ void QHttpNetworkConnectionChannel::_q_disconnected() QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); } state = QHttpNetworkConnectionChannel::IdleState; - - requeueCurrentlyPipelinedRequests(); + if (alreadyPipelinedRequests.length()) { + // If nothing was in a pipeline, no need in calling + // _q_startNextRequest (which it does): + requeueCurrentlyPipelinedRequests(); + } pendingEncrypt = false; } diff --git a/src/network/ssl/qsslsocket_schannel.cpp b/src/network/ssl/qsslsocket_schannel.cpp index 1db26ee9a1..978571e61d 100644 --- a/src/network/ssl/qsslsocket_schannel.cpp +++ b/src/network/ssl/qsslsocket_schannel.cpp @@ -1360,6 +1360,18 @@ void QSslSocketBackendPrivate::transmit() #endif schannelState = SchannelState::Renegotiate; renegotiating = true; + + if (dataBuffer[3].BufferType == SECBUFFER_EXTRA) { + // https://docs.microsoft.com/en-us/windows/desktop/secauthn/extra-buffers-returned-by-schannel + // dataBuffer[3].cbBuffer indicates the amount of bytes _NOT_ processed, + // the rest need to be stored. +#ifdef QSSLSOCKET_DEBUG + qCDebug(lcSsl) << "We've got excess data, moving it to the intermediate buffer:" + << dataBuffer[3].cbBuffer << "bytes"; +#endif + intermediateBuffer = ciphertext.right(int(dataBuffer[3].cbBuffer)); + } + // We need to call 'continueHandshake' or else there's no guarantee it ever gets called continueHandshake(); break; diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp index 737d85d5c3..a6e5c9b5ab 100644 --- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp +++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp @@ -535,7 +535,7 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data) m_currentData.state = Qt::TouchPointReleased; if (m_typeB) m_contacts[m_currentSlot].maj = m_currentData.maj; - } else if (data->code == ABS_PRESSURE) { + } else if (data->code == ABS_PRESSURE || data->code == ABS_MT_PRESSURE) { m_currentData.pressure = qBound(hw_pressure_min, data->value, hw_pressure_max); if (m_typeB || m_singleTouch) m_contacts[m_currentSlot].pressure = m_currentData.pressure; diff --git a/src/plugins/platforms/windows/qwindowsscreen.cpp b/src/plugins/platforms/windows/qwindowsscreen.cpp index 8cd09a34eb..df63adf558 100644 --- a/src/plugins/platforms/windows/qwindowsscreen.cpp +++ b/src/plugins/platforms/windows/qwindowsscreen.cpp @@ -42,6 +42,7 @@ #include "qwindowswindow.h" #include "qwindowsintegration.h" #include "qwindowscursor.h" +#include "qwindowstheme.h" #include <QtCore/qt_windows.h> @@ -543,10 +544,13 @@ bool QWindowsScreenManager::handleScreenChanges() // Look for changed monitors, add new ones const WindowsScreenDataList newDataList = monitorData(); const bool lockScreen = newDataList.size() == 1 && (newDataList.front().flags & QWindowsScreenData::LockScreen); + bool primaryScreenChanged = false; for (const QWindowsScreenData &newData : newDataList) { const int existingIndex = indexOfMonitor(m_screens, newData.name); if (existingIndex != -1) { m_screens.at(existingIndex)->handleChanges(newData); + if (existingIndex == 0) + primaryScreenChanged = true; } else { auto *newScreen = new QWindowsScreen(newData); m_screens.push_back(newScreen); @@ -563,6 +567,8 @@ bool QWindowsScreenManager::handleScreenChanges() removeScreen(i); } // for existing screens } // not lock screen + if (primaryScreenChanged) + QWindowsTheme::instance()->refreshFonts(); return true; } diff --git a/src/plugins/platforms/windows/qwindowstheme.h b/src/plugins/platforms/windows/qwindowstheme.h index 4e24308445..07120230ce 100644 --- a/src/plugins/platforms/windows/qwindowstheme.h +++ b/src/plugins/platforms/windows/qwindowstheme.h @@ -85,6 +85,8 @@ public: static bool useNativeMenus(); + void refreshFonts(); + static const char *name; private: @@ -92,7 +94,6 @@ private: void clearPalettes(); void refreshPalettes(); void clearFonts(); - void refreshFonts(); void refreshIconPixmapSizes(); static QWindowsTheme *m_instance; diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp index 39b08dbc1e..eec65c8625 100644 --- a/src/widgets/kernel/qshortcut.cpp +++ b/src/widgets/kernel/qshortcut.cpp @@ -659,24 +659,22 @@ int QShortcut::id() const bool QShortcut::event(QEvent *e) { Q_D(QShortcut); - bool handled = false; if (d->sc_enabled && e->type() == QEvent::Shortcut) { auto se = static_cast<QShortcutEvent *>(e); if (se->shortcutId() == d->sc_id && se->key() == d->sc_sequence){ #if QT_CONFIG(whatsthis) if (QWhatsThis::inWhatsThisMode()) { QWhatsThis::showText(QCursor::pos(), d->sc_whatsthis); - handled = true; } else #endif if (se->isAmbiguous()) emit activatedAmbiguously(); else emit activated(); - handled = true; + return true; } } - return handled; + return QObject::event(e); } #endif // QT_NO_SHORTCUT diff --git a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp index aee2f970fe..a474acd790 100644 --- a/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp +++ b/tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp @@ -139,6 +139,7 @@ private slots: void superscriptCrash_qtbug53911(); void showLineAndParagraphSeparatorsCrash(); void koreanWordWrap(); + void tooManyDirectionalCharctersCrash_qtbug77819(); private: QFont testFont; @@ -2330,5 +2331,21 @@ void tst_QTextLayout::koreanWordWrap() QCOMPARE(layout.lineAt(1).textLength(), 4); } +void tst_QTextLayout::tooManyDirectionalCharctersCrash_qtbug77819() +{ + QString data; + data += QString::fromUtf8("\xe2\x81\xa8"); // U+2068 FSI character + data += QString::fromUtf8("\xe2\x81\xa7"); // U+2067 RLI character + + // duplicating the text + for (int i = 0; i < 10; i++) + data += data; + + // Nothing to test. It must not crash in beginLayout(). + QTextLayout tl(data); + tl.beginLayout(); + tl.endLayout(); +} + QTEST_MAIN(tst_QTextLayout) #include "tst_qtextlayout.moc" diff --git a/tests/auto/network/access/http2/tst_http2.cpp b/tests/auto/network/access/http2/tst_http2.cpp index e24a06bc34..c264956d7b 100644 --- a/tests/auto/network/access/http2/tst_http2.cpp +++ b/tests/auto/network/access/http2/tst_http2.cpp @@ -477,6 +477,9 @@ void tst_Http2::goaway_data() // - server waits for some time (enough for ur to init several streams on a // client side); then suddenly it replies with GOAWAY, never processing any // request. + if (clearTextHTTP2) + QSKIP("This test requires TLS with ALPN to work"); + QTest::addColumn<int>("responseTimeoutMS"); QTest::newRow("ImmediateGOAWAY") << 0; QTest::newRow("DelayedGOAWAY") << 1000; diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp index 032580e0f6..fbf906b55d 100644 --- a/tests/auto/other/lancelot/paintcommands.cpp +++ b/tests/auto/other/lancelot/paintcommands.cpp @@ -1010,7 +1010,10 @@ void PaintCommands::command_drawPixmap(QRegularExpressionMatch re) qPrintable(re.captured(1)), pm.width(), pm.height(), pm.depth(), tx, ty, tw, th, sx, sy, sw, sh); - m_painter->drawPixmap(QRectF(tx, ty, tw, th), pm, QRectF(sx, sy, sw, sh)); + if (!re.capturedLength(4)) // at most two coordinates specified + m_painter->drawPixmap(QPointF(tx, ty), pm); + else + m_painter->drawPixmap(QRectF(tx, ty, tw, th), pm, QRectF(sx, sy, sw, sh)); } /***************************************************************************************************/ @@ -1057,7 +1060,10 @@ void PaintCommands::command_drawImage(QRegularExpressionMatch re) printf(" -(lance) drawImage('%s' dim=(%d, %d), (%f, %f, %f, %f), (%f, %f, %f, %f)\n", qPrintable(re.captured(1)), im.width(), im.height(), tx, ty, tw, th, sx, sy, sw, sh); - m_painter->drawImage(QRectF(tx, ty, tw, th), im, QRectF(sx, sy, sw, sh), Qt::OrderedDither | Qt::OrderedAlphaDither); + if (!re.capturedLength(4)) // at most two coordinates specified + m_painter->drawImage(QPointF(tx, ty), im); + else + m_painter->drawImage(QRectF(tx, ty, tw, th), im, QRectF(sx, sy, sw, sh)); } /***************************************************************************************************/ diff --git a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp index 8c262ff3a5..84120c70e9 100644 --- a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp +++ b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp @@ -115,6 +115,7 @@ private slots: void context(); void duplicatedShortcutOverride(); void shortcutToFocusProxy(); + void deleteLater(); protected: static Qt::KeyboardModifiers toButtons( int key ); @@ -1263,5 +1264,14 @@ void tst_QShortcut::shortcutToFocusProxy() QCOMPARE(le.text(), QString()); } +void tst_QShortcut::deleteLater() +{ + QWidget w; + QPointer<QShortcut> sc(new QShortcut(QKeySequence(Qt::Key_1), &w)); + sc->deleteLater(); + QTRY_VERIFY(!sc); +} + + QTEST_MAIN(tst_QShortcut) #include "tst_qshortcut.moc" diff --git a/tests/baselineserver/shared/qbaselinetest.cpp b/tests/baselineserver/shared/qbaselinetest.cpp index 11fb208f20..3587cd01ea 100644 --- a/tests/baselineserver/shared/qbaselinetest.cpp +++ b/tests/baselineserver/shared/qbaselinetest.cpp @@ -28,10 +28,8 @@ #include "qbaselinetest.h" #include "baselineprotocol.h" -#if QT_CONFIG(process) -# include <QtCore/QProcess> -#endif #include <QtCore/QDir> +#include <QFile> #define MAXCMDLINEARGS 128 @@ -146,20 +144,15 @@ void addClientProperty(const QString& key, const QString& value) */ void fetchCustomClientProperties() { -#if !QT_CONFIG(process) - QSKIP("This test requires QProcess support"); -#else - QString script = "hostinfo.sh"; //### TBD: Windows implementation (hostinfo.bat) - - QProcess runScript; - runScript.setWorkingDirectory(QCoreApplication::applicationDirPath()); - runScript.start("sh", QStringList() << script, QIODevice::ReadOnly); - if (!runScript.waitForFinished(5000) || runScript.error() != QProcess::UnknownError) { - qWarning() << "QBaselineTest: Error running script" << runScript.workingDirectory() + QDir::separator() + script << ":" << runScript.errorString(); - qDebug() << " stderr:" << runScript.readAllStandardError().trimmed(); - } - while (!runScript.atEnd()) { - QByteArray line = runScript.readLine().trimmed(); // ###local8bit? utf8? + QFile file("hostinfo.txt"); + if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) + return; + QTextStream in(&file); + + while (!in.atEnd()) { + QString line = in.readLine().trimmed(); // ###local8bit? utf8? + if (line.startsWith(QLatin1Char('#'))) // Ignore comments in file + continue; QString key, val; int colonPos = line.indexOf(':'); if (colonPos > 0) { @@ -171,7 +164,6 @@ void fetchCustomClientProperties() else qDebug() << "Unparseable script output ignored:" << line; } -#endif // QT_CONFIG(process) } |