Merge remote-tracking branch 'origin/5.13' into 5.14

Conflicts:
	tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp

Change-Id: Idd3ca5cb9a2b95a4c3513b2a4c8966e6f56193f1
This commit is contained in:
Friedemann Kleint 2019-09-09 09:30:43 +02:00 committed by Liang Qi
commit 1d53b6d9f2
26 changed files with 487 additions and 100 deletions

109
dist/changes-5.12.5 vendored Normal file
View File

@ -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.

141
dist/changes-5.13.1 vendored Normal file
View File

@ -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.

View File

@ -1,6 +1,8 @@
TEMPLATE = aux TEMPLATE = aux
global_docs.files = $$PWD/global global_docs.files = \
$$PWD/global \
$$PWD/config
global_docs.path = $$[QT_INSTALL_DOCS] global_docs.path = $$[QT_INSTALL_DOCS]
INSTALLS += global_docs INSTALLS += global_docs
!prefix_build:!equals(OUT_PWD, $$PWD): \ !prefix_build:!equals(OUT_PWD, $$PWD): \

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the documentation of the Qt Toolkit. ** This file is part of the documentation of the Qt Toolkit.
@ -61,6 +61,18 @@
\externalpage http://doc.qt.io/qtcreator/creator-quick-tour.html \externalpage http://doc.qt.io/qtcreator/creator-quick-tour.html
\title Qt Creator: User Interface \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 \externalpage http://doc.qt.io/qtcreator/creator-cli.html
\title Qt Creator: Using Command Line Options \title Qt Creator: Using Command Line Options
@ -125,7 +137,7 @@
\externalpage http://doc.qt.io/qtcreator/quick-signals.html \externalpage http://doc.qt.io/qtcreator/quick-signals.html
\title Qt Creator: Connecting Objects to Signals \title Qt Creator: Connecting Objects to Signals
*/ */
* /*! /*!
\externalpage http://doc.qt.io/qtcreator/quick-dynamic-properties.html \externalpage http://doc.qt.io/qtcreator/quick-dynamic-properties.html
\title Qt Creator: Specifying Dynamic Properties \title Qt Creator: Specifying Dynamic Properties
*/ */
@ -153,6 +165,10 @@
\externalpage http://doc.qt.io/qtcreator/creator-qml-modules-with-plugins.html \externalpage http://doc.qt.io/qtcreator/creator-qml-modules-with-plugins.html
\title Qt Creator: Using QML Modules with Plugins \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 \externalpage http://doc.qt.io/qtcreator/creator-visual-editor.html
\title Qt Creator: Developing Qt Quick Applications \title Qt Creator: Developing Qt Quick Applications
@ -553,6 +569,10 @@
\externalpage http://doc.qt.io/qtcreator/creator-cpu-usage-analyzer.html \externalpage http://doc.qt.io/qtcreator/creator-cpu-usage-analyzer.html
\title Qt Creator: Analyzing CPU Usage \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 \externalpage http://doc.qt.io/qtcreator/creator-autotest.html
\title Qt Creator: Running Autotests \title Qt Creator: Running Autotests
@ -581,3 +601,27 @@
\externalpage http://doc.qt.io/qtcreator/creator-scxml.html \externalpage http://doc.qt.io/qtcreator/creator-scxml.html
\title Qt Creator: Editing State Charts \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
*/

View File

@ -8,7 +8,7 @@ QMAKE_MAC_SDK = macosx
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12 QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12
QMAKE_APPLE_DEVICE_ARCHS = x86_64 QMAKE_APPLE_DEVICE_ARCHS = x86_64
QT_MAC_SDK_VERSION_MIN = 10.13 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.sdk = macosx
device.target = device device.target = device

View File

@ -53,7 +53,11 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura
set(_lib_deps) set(_lib_deps)
set(_link_flags) 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}\") if(EXISTS \"${prl_file_location}\")
file(STRINGS \"${prl_file_location}\" _prl_strings REGEX \"QMAKE_PRL_LIBS_FOR_CMAKE[ \\t]*=\") file(STRINGS \"${prl_file_location}\" _prl_strings REGEX \"QMAKE_PRL_LIBS_FOR_CMAKE[ \\t]*=\")

View File

@ -509,6 +509,56 @@ static QList<QVariantMap> provisioningTeams()
return flatTeams; 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 bool
ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
{ {
@ -820,6 +870,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
} }
if(!project->isActiveConfig("staticlib")) { //DUMP LIBRARIES if(!project->isActiveConfig("staticlib")) { //DUMP LIBRARIES
const ProStringList defaultLibDirs = project->values("QMAKE_DEFAULT_LIBDIRS");
ProStringList &libdirs = project->values("QMAKE_PBX_LIBPATHS"), ProStringList &libdirs = project->values("QMAKE_PBX_LIBPATHS"),
&frameworkdirs = project->values("QMAKE_FRAMEWORKPATH"); &frameworkdirs = project->values("QMAKE_FRAMEWORKPATH");
static const char * const libs[] = { "LIBS", "LIBS_PRIVATE", static const char * const libs[] = { "LIBS", "LIBS_PRIVATE",
@ -827,6 +878,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
for (int i = 0; libs[i]; i++) { for (int i = 0; libs[i]; i++) {
tmp = project->values(libs[i]); tmp = project->values(libs[i]);
for(int x = 0; x < tmp.count();) { for(int x = 0; x < tmp.count();) {
bool libSuffixReplaced = false;
bool remove = false; bool remove = false;
QString library, name; QString library, name;
ProString opt = tmp[x]; ProString opt = tmp[x];
@ -839,49 +891,12 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
QString lib("lib" + name); QString lib("lib" + name);
for (ProStringList::Iterator lit = libdirs.begin(); lit != libdirs.end(); ++lit) { for (ProStringList::Iterator lit = libdirs.begin(); lit != libdirs.end(); ++lit) {
if(project->isActiveConfig("link_prl")) { if(project->isActiveConfig("link_prl")) {
/* This isn't real nice, but it is real useful. This looks in a prl const QString prlFilePath = QMakeMetaInfo::checkLib(
for what the library will ultimately be called so we can stick it Option::normalizePath((*lit) + Option::dir_sep + lib
in the ProjectFile. If the prl format ever changes (not likely) then + Option::prl_ext));
this will not really work. However, more concerning is that it will if (replaceLibrarySuffix(prlFilePath, opt, name, library))
encode the version number in the Project file which might be a bad remove = true;
things in days to come? --Sam libSuffixReplaced = true;
*/
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);
}
}
}
}
}
}
} }
if(!remove) { if(!remove) {
QString extns[] = { ".dylib", ".so", ".a", QString() }; QString extns[] = { ".dylib", ".so", ".a", QString() };
@ -931,6 +946,16 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
} }
} }
if(!library.isEmpty()) { 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); const int slsh = library.lastIndexOf(Option::dir_sep);
if(name.isEmpty()) { if(name.isEmpty()) {
if(slsh != -1) if(slsh != -1)
@ -938,8 +963,10 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
} }
if(slsh != -1) { if(slsh != -1) {
const QString path = QFileInfo(library.left(slsh)).absoluteFilePath(); 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; libdirs += path;
}
} }
library = fileFixify(library, FileFixifyFromOutdir | FileFixifyAbsolute); library = fileFixify(library, FileFixifyFromOutdir | FileFixifyAbsolute);
QString key = keyFor(library); QString key = keyFor(library);

View File

@ -41,6 +41,8 @@ class ProjectBuilderMakefileGenerator : public UnixMakefileGenerator
bool writeSubDirs(QTextStream &); bool writeSubDirs(QTextStream &);
bool writeMakeParts(QTextStream &); bool writeMakeParts(QTextStream &);
bool writeMakefile(QTextStream &) override; bool writeMakefile(QTextStream &) override;
bool replaceLibrarySuffix(const QString &lib_file, const ProString &opt, QString &name,
QString &library);
QString pbxbuild(); QString pbxbuild();
QHash<QString, QString> keys; QHash<QString, QString> keys;

View File

@ -1199,8 +1199,10 @@ void UnixMakefileGenerator::init2()
project->values("QMAKE_FRAMEWORK_VERSION").append(project->first("VER_MAJ")); project->values("QMAKE_FRAMEWORK_VERSION").append(project->first("VER_MAJ"));
if (project->first("TEMPLATE") == "aux") { if (project->first("TEMPLATE") == "aux") {
project->values("PRL_TARGET") = project->values("PRL_TARGET") = {
project->values("TARGET").first().prepend(project->first("QMAKE_PREFIX_STATICLIB")); project->first("QMAKE_PREFIX_STATICLIB") +
project->first("TARGET")
};
} else if (!project->values("QMAKE_APP_FLAG").isEmpty()) { } else if (!project->values("QMAKE_APP_FLAG").isEmpty()) {
if(!project->isEmpty("QMAKE_BUNDLE")) { if(!project->isEmpty("QMAKE_BUNDLE")) {
ProString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION"); ProString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION");

View File

@ -1803,8 +1803,8 @@ static void qt_message_print(QtMsgType msgType, const QMessageLogContext &contex
#ifndef QT_BOOTSTRAPPED #ifndef QT_BOOTSTRAPPED
Q_TRACE(qt_message_print, msgType, context.category, context.function, context.file, context.line, message); 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 // qDebug, qWarning, ... macros do not check whether category is enabledgc
if (isDefaultCategory(context.category)) { if (msgType != QtFatalMsg && isDefaultCategory(context.category)) {
if (QLoggingCategory *defaultCategory = QLoggingCategory::defaultCategory()) { if (QLoggingCategory *defaultCategory = QLoggingCategory::defaultCategory()) {
if (!defaultCategory->isEnabled(msgType)) if (!defaultCategory->isEnabled(msgType))
return; return;

View File

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
** **
** Copyright (C) 2017 Intel Corporation. ** Copyright (C) 2019 Intel Corporation.
** Contact: https://www.qt.io/licensing/ ** Contact: https://www.qt.io/licensing/
** **
** This file is part of the QtCore module of the Qt Toolkit. ** 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 *ptr = reinterpret_cast<unsigned *>(buffer);
unsigned *end = ptr + count; unsigned *end = ptr + count;
int retries = 10;
while (ptr + sizeof(qregisteruint)/sizeof(*ptr) <= end) { 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; goto out;
ptr += sizeof(qregisteruint)/sizeof(*ptr);
} }
if (sizeof(*ptr) != sizeof(qregisteruint) && ptr != end) { while (sizeof(*ptr) != sizeof(qregisteruint) && ptr != end) {
if (_rdrand32_step(ptr)) bool ok = _rdrand32_step(ptr);
goto out; if (!ok && --retries)
++ptr; continue;
if (ok)
++ptr;
break;
} }
out: out:

View File

@ -74,7 +74,7 @@ QT_BEGIN_NAMESPACE
# define QLIBRARY_AS_DEBUG true # define QLIBRARY_AS_DEBUG true
#endif #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 // We don't use separate debug and release libs on UNIX, so we want
// to allow loading plugins, regardless of how they were built. // to allow loading plugins, regardless of how they were built.
# define QT_NO_DEBUG_PLUGIN_CHECK # define QT_NO_DEBUG_PLUGIN_CHECK

View File

@ -281,7 +281,7 @@ static quint32 icon_name_hash(const char *p)
QVector<const char *> QIconCacheGtkReader::lookup(const QStringRef &name) QVector<const char *> QIconCacheGtkReader::lookup(const QStringRef &name)
{ {
QVector<const char *> ret; QVector<const char *> ret;
if (!isValid()) if (!isValid() || name.isEmpty())
return ret; return ret;
QByteArray nameUtf8 = name.toUtf8(); QByteArray nameUtf8 = name.toUtf8();

View File

@ -2762,7 +2762,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
QWindow *window = e->window.data(); QWindow *window = e->window.data();
typedef QPair<Qt::TouchPointStates, QList<QTouchEvent::TouchPoint> > StatesAndTouchPoints; typedef QPair<Qt::TouchPointStates, QList<QTouchEvent::TouchPoint> > StatesAndTouchPoints;
QHash<QWindow *, StatesAndTouchPoints> windowsNeedingEvents; QHash<QWindow *, StatesAndTouchPoints> windowsNeedingEvents;
bool stationaryTouchPointChangedVelocity = false; bool stationaryTouchPointChangedProperty = false;
for (int i = 0; i < e->points.count(); ++i) { for (int i = 0; i < e->points.count(); ++i) {
QTouchEvent::TouchPoint touchPoint = e->points.at(i); QTouchEvent::TouchPoint touchPoint = e->points.at(i);
@ -2842,7 +2842,11 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
if (touchPoint.state() == Qt::TouchPointStationary) { if (touchPoint.state() == Qt::TouchPointStationary) {
if (touchInfo.touchPoint.velocity() != touchPoint.velocity()) { if (touchInfo.touchPoint.velocity() != touchPoint.velocity()) {
touchInfo.touchPoint.setVelocity(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 { } else {
touchInfo.touchPoint = touchPoint; touchInfo.touchPoint = touchPoint;
@ -2883,7 +2887,7 @@ void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::To
break; break;
case Qt::TouchPointStationary: case Qt::TouchPointStationary:
// don't send the event if nothing changed // don't send the event if nothing changed
if (!stationaryTouchPointChangedVelocity) if (!stationaryTouchPointChangedProperty)
continue; continue;
Q_FALLTHROUGH(); Q_FALLTHROUGH();
default: default:

View File

@ -399,6 +399,7 @@ struct QBidiAlgorithm {
analysis[i].bidiDirection = (level & 1) ? QChar::DirR : QChar::DirL; analysis[i].bidiDirection = (level & 1) ? QChar::DirR : QChar::DirL;
runHasContent = true; runHasContent = true;
lastRunWithContent = -1; lastRunWithContent = -1;
++isolatePairPosition;
} }
int runBeforeIsolate = runs.size(); int runBeforeIsolate = runs.size();
ushort newLevel = isRtl ? ((stack.top().level + 1) | 1) : ((stack.top().level + 2) & ~1); ushort newLevel = isRtl ? ((stack.top().level + 1) | 1) : ((stack.top().level + 2) & ~1);
@ -440,21 +441,19 @@ struct QBidiAlgorithm {
doEmbed(true, true, false); doEmbed(true, true, false);
break; break;
case QChar::DirLRI: case QChar::DirLRI:
Q_ASSERT(isolatePairs.at(isolatePairPosition).start == i);
doEmbed(false, false, true); doEmbed(false, false, true);
++isolatePairPosition;
break; break;
case QChar::DirRLI: case QChar::DirRLI:
Q_ASSERT(isolatePairs.at(isolatePairPosition).start == i);
doEmbed(true, false, true); doEmbed(true, false, true);
++isolatePairPosition;
break; break;
case QChar::DirFSI: { case QChar::DirFSI: {
const auto &pair = isolatePairs.at(isolatePairPosition); bool isRtl = false;
Q_ASSERT(pair.start == i); if (isolatePairPosition < isolatePairs.size()) {
bool isRtl = QStringView(text + pair.start + 1, pair.end - pair.start - 1).isRightToLeft(); 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); doEmbed(isRtl, false, true);
++isolatePairPosition;
break; break;
} }

View File

@ -854,8 +854,11 @@ void QHttpNetworkConnectionChannel::_q_disconnected()
QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection); QMetaObject::invokeMethod(connection, "_q_startNextRequest", Qt::QueuedConnection);
} }
state = QHttpNetworkConnectionChannel::IdleState; state = QHttpNetworkConnectionChannel::IdleState;
if (alreadyPipelinedRequests.length()) {
requeueCurrentlyPipelinedRequests(); // If nothing was in a pipeline, no need in calling
// _q_startNextRequest (which it does):
requeueCurrentlyPipelinedRequests();
}
pendingEncrypt = false; pendingEncrypt = false;
} }

View File

@ -1360,6 +1360,18 @@ void QSslSocketBackendPrivate::transmit()
#endif #endif
schannelState = SchannelState::Renegotiate; schannelState = SchannelState::Renegotiate;
renegotiating = true; 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 // We need to call 'continueHandshake' or else there's no guarantee it ever gets called
continueHandshake(); continueHandshake();
break; break;

View File

@ -535,7 +535,7 @@ void QEvdevTouchScreenData::processInputEvent(input_event *data)
m_currentData.state = Qt::TouchPointReleased; m_currentData.state = Qt::TouchPointReleased;
if (m_typeB) if (m_typeB)
m_contacts[m_currentSlot].maj = m_currentData.maj; 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); m_currentData.pressure = qBound(hw_pressure_min, data->value, hw_pressure_max);
if (m_typeB || m_singleTouch) if (m_typeB || m_singleTouch)
m_contacts[m_currentSlot].pressure = m_currentData.pressure; m_contacts[m_currentSlot].pressure = m_currentData.pressure;

View File

@ -42,6 +42,7 @@
#include "qwindowswindow.h" #include "qwindowswindow.h"
#include "qwindowsintegration.h" #include "qwindowsintegration.h"
#include "qwindowscursor.h" #include "qwindowscursor.h"
#include "qwindowstheme.h"
#include <QtCore/qt_windows.h> #include <QtCore/qt_windows.h>
@ -543,10 +544,13 @@ bool QWindowsScreenManager::handleScreenChanges()
// Look for changed monitors, add new ones // Look for changed monitors, add new ones
const WindowsScreenDataList newDataList = monitorData(); const WindowsScreenDataList newDataList = monitorData();
const bool lockScreen = newDataList.size() == 1 && (newDataList.front().flags & QWindowsScreenData::LockScreen); const bool lockScreen = newDataList.size() == 1 && (newDataList.front().flags & QWindowsScreenData::LockScreen);
bool primaryScreenChanged = false;
for (const QWindowsScreenData &newData : newDataList) { for (const QWindowsScreenData &newData : newDataList) {
const int existingIndex = indexOfMonitor(m_screens, newData.name); const int existingIndex = indexOfMonitor(m_screens, newData.name);
if (existingIndex != -1) { if (existingIndex != -1) {
m_screens.at(existingIndex)->handleChanges(newData); m_screens.at(existingIndex)->handleChanges(newData);
if (existingIndex == 0)
primaryScreenChanged = true;
} else { } else {
auto *newScreen = new QWindowsScreen(newData); auto *newScreen = new QWindowsScreen(newData);
m_screens.push_back(newScreen); m_screens.push_back(newScreen);
@ -563,6 +567,8 @@ bool QWindowsScreenManager::handleScreenChanges()
removeScreen(i); removeScreen(i);
} // for existing screens } // for existing screens
} // not lock screen } // not lock screen
if (primaryScreenChanged)
QWindowsTheme::instance()->refreshFonts();
return true; return true;
} }

View File

@ -85,6 +85,8 @@ public:
static bool useNativeMenus(); static bool useNativeMenus();
void refreshFonts();
static const char *name; static const char *name;
private: private:
@ -92,7 +94,6 @@ private:
void clearPalettes(); void clearPalettes();
void refreshPalettes(); void refreshPalettes();
void clearFonts(); void clearFonts();
void refreshFonts();
void refreshIconPixmapSizes(); void refreshIconPixmapSizes();
static QWindowsTheme *m_instance; static QWindowsTheme *m_instance;

View File

@ -659,24 +659,22 @@ int QShortcut::id() const
bool QShortcut::event(QEvent *e) bool QShortcut::event(QEvent *e)
{ {
Q_D(QShortcut); Q_D(QShortcut);
bool handled = false;
if (d->sc_enabled && e->type() == QEvent::Shortcut) { if (d->sc_enabled && e->type() == QEvent::Shortcut) {
auto se = static_cast<QShortcutEvent *>(e); auto se = static_cast<QShortcutEvent *>(e);
if (se->shortcutId() == d->sc_id && se->key() == d->sc_sequence){ if (se->shortcutId() == d->sc_id && se->key() == d->sc_sequence){
#if QT_CONFIG(whatsthis) #if QT_CONFIG(whatsthis)
if (QWhatsThis::inWhatsThisMode()) { if (QWhatsThis::inWhatsThisMode()) {
QWhatsThis::showText(QCursor::pos(), d->sc_whatsthis); QWhatsThis::showText(QCursor::pos(), d->sc_whatsthis);
handled = true;
} else } else
#endif #endif
if (se->isAmbiguous()) if (se->isAmbiguous())
emit activatedAmbiguously(); emit activatedAmbiguously();
else else
emit activated(); emit activated();
handled = true; return true;
} }
} }
return handled; return QObject::event(e);
} }
#endif // QT_NO_SHORTCUT #endif // QT_NO_SHORTCUT

View File

@ -139,6 +139,7 @@ private slots:
void superscriptCrash_qtbug53911(); void superscriptCrash_qtbug53911();
void showLineAndParagraphSeparatorsCrash(); void showLineAndParagraphSeparatorsCrash();
void koreanWordWrap(); void koreanWordWrap();
void tooManyDirectionalCharctersCrash_qtbug77819();
private: private:
QFont testFont; QFont testFont;
@ -2330,5 +2331,21 @@ void tst_QTextLayout::koreanWordWrap()
QCOMPARE(layout.lineAt(1).textLength(), 4); 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) QTEST_MAIN(tst_QTextLayout)
#include "tst_qtextlayout.moc" #include "tst_qtextlayout.moc"

View File

@ -477,6 +477,9 @@ void tst_Http2::goaway_data()
// - server waits for some time (enough for ur to init several streams on a // - 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 // client side); then suddenly it replies with GOAWAY, never processing any
// request. // request.
if (clearTextHTTP2)
QSKIP("This test requires TLS with ALPN to work");
QTest::addColumn<int>("responseTimeoutMS"); QTest::addColumn<int>("responseTimeoutMS");
QTest::newRow("ImmediateGOAWAY") << 0; QTest::newRow("ImmediateGOAWAY") << 0;
QTest::newRow("DelayedGOAWAY") << 1000; QTest::newRow("DelayedGOAWAY") << 1000;

View File

@ -1010,7 +1010,10 @@ void PaintCommands::command_drawPixmap(QRegularExpressionMatch re)
qPrintable(re.captured(1)), pm.width(), pm.height(), pm.depth(), qPrintable(re.captured(1)), pm.width(), pm.height(), pm.depth(),
tx, ty, tw, th, sx, sy, sw, sh); 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", 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); 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));
} }
/***************************************************************************************************/ /***************************************************************************************************/

View File

@ -115,6 +115,7 @@ private slots:
void context(); void context();
void duplicatedShortcutOverride(); void duplicatedShortcutOverride();
void shortcutToFocusProxy(); void shortcutToFocusProxy();
void deleteLater();
protected: protected:
static Qt::KeyboardModifiers toButtons( int key ); static Qt::KeyboardModifiers toButtons( int key );
@ -1263,5 +1264,14 @@ void tst_QShortcut::shortcutToFocusProxy()
QCOMPARE(le.text(), QString()); 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) QTEST_MAIN(tst_QShortcut)
#include "tst_qshortcut.moc" #include "tst_qshortcut.moc"

View File

@ -28,10 +28,8 @@
#include "qbaselinetest.h" #include "qbaselinetest.h"
#include "baselineprotocol.h" #include "baselineprotocol.h"
#if QT_CONFIG(process)
# include <QtCore/QProcess>
#endif
#include <QtCore/QDir> #include <QtCore/QDir>
#include <QFile>
#define MAXCMDLINEARGS 128 #define MAXCMDLINEARGS 128
@ -146,20 +144,15 @@ void addClientProperty(const QString& key, const QString& value)
*/ */
void fetchCustomClientProperties() void fetchCustomClientProperties()
{ {
#if !QT_CONFIG(process) QFile file("hostinfo.txt");
QSKIP("This test requires QProcess support"); if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
#else return;
QString script = "hostinfo.sh"; //### TBD: Windows implementation (hostinfo.bat) QTextStream in(&file);
QProcess runScript; while (!in.atEnd()) {
runScript.setWorkingDirectory(QCoreApplication::applicationDirPath()); QString line = in.readLine().trimmed(); // ###local8bit? utf8?
runScript.start("sh", QStringList() << script, QIODevice::ReadOnly); if (line.startsWith(QLatin1Char('#'))) // Ignore comments in file
if (!runScript.waitForFinished(5000) || runScript.error() != QProcess::UnknownError) { continue;
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?
QString key, val; QString key, val;
int colonPos = line.indexOf(':'); int colonPos = line.indexOf(':');
if (colonPos > 0) { if (colonPos > 0) {
@ -171,7 +164,6 @@ void fetchCustomClientProperties()
else else
qDebug() << "Unparseable script output ignored:" << line; qDebug() << "Unparseable script output ignored:" << line;
} }
#endif // QT_CONFIG(process)
} }