summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@qt.io>2019-11-21 11:30:20 +0100
committerFrederik Gladhorn <frederik.gladhorn@qt.io>2019-11-21 11:30:20 +0100
commit578a020e65dff8d7bf316e959e2270d2699b8d0a (patch)
tree271e9b6e006ad9ceaf77485f4e5ddf4a5ddb0807
parente55a61a77f0c87c05661a0335dfdb12673c6a27f (diff)
parent73a764c24700089228b4092e983061f788c6d232 (diff)
Merge 5.14 into 5.14.0
-rwxr-xr-xconfigure3
-rw-r--r--doc/global/includes/standardpath/functiondocs.qdocinc129
-rw-r--r--examples/widgets/animation/sub-attaq/mainwindow.cpp1
-rw-r--r--qmake/Makefile.win322
-rw-r--r--qmake/generators/unix/unixmake.cpp21
-rw-r--r--qmake/generators/unix/unixmake2.cpp11
-rw-r--r--src/3rdparty/freetype/src/sfnt/pngshim.c1
-rw-r--r--src/corelib/global/qlibraryinfo.cpp4
-rw-r--r--src/corelib/io/qstandardpaths.cpp66
-rw-r--r--src/corelib/io/qtemporaryfile.cpp6
-rw-r--r--src/corelib/time/qtimezoneprivate.cpp6
-rw-r--r--src/gui/image/image.pri8
-rw-r--r--src/gui/image/qicon.cpp12
-rw-r--r--src/gui/kernel/qevent.cpp1
-rw-r--r--src/gui/kernel/qhighdpiscaling.cpp9
-rw-r--r--src/gui/rhi/qshader.cpp6
-rw-r--r--src/platformsupport/fontdatabases/fontdatabases.pro7
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp3
-rw-r--r--src/sql/kernel/qsqlquery.cpp3
-rw-r--r--src/widgets/doc/snippets/simplemodel-use/main.cpp7
-rw-r--r--src/widgets/doc/src/model-view-programming.qdoc13
-rw-r--r--src/widgets/itemviews/qtreeview.cpp2
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol_p.h2
-rw-r--r--src/xml/dom/qdom.cpp19
-rw-r--r--tests/auto/corelib/text/qlocale/tst_qlocale.cpp6
-rw-r--r--tests/auto/corelib/time/qtimezone/BLACKLIST12
-rw-r--r--tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp11
-rw-r--r--tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp2
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp14
-rw-r--r--tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp8
-rw-r--r--tests/auto/xml/dom/qdom/tst_qdom.cpp69
31 files changed, 341 insertions, 123 deletions
diff --git a/configure b/configure
index 19016d5c12..6657870e4b 100755
--- a/configure
+++ b/configure
@@ -446,8 +446,7 @@ while [ "$#" -gt 0 ]; do
-android-ndk| \
-android-ndk-platform| \
-android-ndk-host| \
- -android-arch| \
- -android-toolchain-version)
+ -android-arch)
VAR=`echo $1 | sed 's,^-\(.*\),\1,'`
shift
VAL="$1"
diff --git a/doc/global/includes/standardpath/functiondocs.qdocinc b/doc/global/includes/standardpath/functiondocs.qdocinc
new file mode 100644
index 0000000000..4385b6446d
--- /dev/null
+++ b/doc/global/includes/standardpath/functiondocs.qdocinc
@@ -0,0 +1,129 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+//! [displayName]
+
+ Returns a localized display name for the given location \a type
+ or an empty QString if no relevant location can be found.
+
+//! [displayName]
+
+
+//! [findExecutable]
+
+ Finds the executable named \a executableName in the specified
+ \a paths, or the system paths if paths is empty.
+
+ On most operating systems the system path is determined by the
+ \c PATH environment variable. The directories where to search for
+ the executable can be set in the paths argument. To search in
+ both your own paths and the system paths, call findExecutable
+ twice, once with paths set and once with paths empty.
+ Symlinks are not resolved in order to preserve behavior for the
+ case of executables whose behavior depends on the name they are
+ invoked with
+ .
+ \note On Windows, the usual executable extensions (from the PATHEXT
+ environment variable) are automatically appended. For example, the
+ findExecutable("foo") call finds \c foo.exe or \c foo.bat if
+ present.
+
+ Returns the absolute file path to the executable, or an empty
+ string if not found.
+
+//! [findExecutable]
+
+//! [locate]
+
+ Finds a file or directory called \a fileName in the standard
+ locations for \a type.
+
+ The \a options flag lets you specify whether to look for files
+ or directories. By default, this flag is set to \c LocateFile.
+
+ Returns the absolute path to the first file or directory found,
+ otherwise returns an empty string.
+
+//! [locate]
+
+//! [locateAll]
+
+ Finds all files or directories by the name, \a fileName, in the
+ standard locations for \a type.
+
+ The \a options flag lets you specify whether to look for files
+ or directories. By default, this flag is set to \c LocateFile.
+
+ Returns the list of all the files that were found.
+
+//! [locateAll]
+
+//! [setTestModeEnabled]
+
+ If \a testMode is \c true, this enables a special "test mode" in
+ QStandardPaths, which changes writable locations to point to
+ test directories. This prevents auto tests from reading
+ or writing to the current user's configuration.
+
+ It affects the locations into which test programs might write
+ files: \c GenericDataLocation, \c DataLocation, \c ConfigLocation,
+ \c GenericConfigLocation, \c AppConfigLocation,
+ \c GenericCacheLocation, and \c CacheLocation. Other locations
+ are not affected.
+
+ On Unix, \c XDG_DATA_HOME is set to \c{~/.qttest/share},
+ \c XDG_CONFIG_HOME is set to \c{~/.qttest/config}, and
+ \c XDG_CACHE_HOME is set to \c{~/.qttest/cache}.
+
+ On macOS, data goes to \c{~/.qttest/Application Support},
+ cache goes to \c{~/.qttest/Cache}, and config goes to
+ \c{~/.qttest/Preferences}.
+
+ On Windows, everything goes to a "qttest" directory under
+ \c{%APPDATA%}.
+
+//! [setTestModeEnabled]
+
+//! [standardLocations]
+
+ Returns all the directories where files of \a type belong.
+
+ The list of directories is sorted from high to low priority,
+ starting with writableLocation() if it can be determined.
+ This list is empty if no locations for type are defined.
+
+//! [standardLocations]
+
+//! [writableLocation]
+
+ Returns the directory where files of \a type should be written to,
+ or an empty string if the location cannot be determined.
+
+ \note The storage location returned may not exist; that is,
+ it may need to be created by the system or the user.
+
+//! [writableLocation]
diff --git a/examples/widgets/animation/sub-attaq/mainwindow.cpp b/examples/widgets/animation/sub-attaq/mainwindow.cpp
index 8f545ecebd..f9617a22eb 100644
--- a/examples/widgets/animation/sub-attaq/mainwindow.cpp
+++ b/examples/widgets/animation/sub-attaq/mainwindow.cpp
@@ -56,6 +56,7 @@
#include <QGraphicsView>
#include <QApplication>
#include <QMenu>
+#include <QMenuBar>
#include <QLayout>
#ifndef QT_NO_OPENGL
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index 7324817af2..4e7724f14e 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -13,7 +13,7 @@ QMKSRC = $(SOURCE_PATH)\qmake
!if "$(QMAKESPEC)" == "win32-icc"
CXX = icl
LINKER = xilink
-CFLAGS_EXTRA = /Zc:forScope /Qstd=c++11 /O3
+CFLAGS_EXTRA = /Zc:forScope /Qstd=c++11
!elseif "$(QMAKESPEC)" == "win32-clang-msvc"
CXX = clang-cl
LINKER = lld-link
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index e56e8c41b6..f7bd6dc663 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -208,15 +208,15 @@ UnixMakefileGenerator::init()
escapeFilePath(pchBaseName + language + headerSuffix));
const ProStringList pchArchs = project->values("QMAKE_PCH_ARCHS");
for (const ProString &arch : pchArchs) {
- QString suffix = headerSuffix;
- suffix.replace(QLatin1String("${QMAKE_PCH_ARCH}"), arch.toQString());
+ QString file = pchBaseName + language + headerSuffix;
+ file.replace(QLatin1String("${QMAKE_PCH_ARCH}"), arch.toQString());
if (project->isActiveConfig("clang_pch_style")
- && (suffix.endsWith(QLatin1String(".pch"))
- || suffix.endsWith(QLatin1String(".gch")))) {
- suffix.chop(4); // must omit header suffix for -include to recognize the PCH
+ && (file.endsWith(QLatin1String(".pch"))
+ || file.endsWith(QLatin1String(".gch")))) {
+ file.chop(4); // must omit header suffix for -include to recognize the PCH
}
pchFlags.replace(QLatin1String("${QMAKE_PCH_OUTPUT_") + arch + QLatin1Char('}'),
- escapeFilePath(pchBaseName + language + suffix));
+ escapeFilePath(file));
}
}
}
@@ -363,10 +363,11 @@ QStringList
if (pchArchs.isEmpty())
pchArchs << ProString(); // normal single-arch PCH
for (const ProString &arch : qAsConst(pchArchs)) {
- QString suffix = header_suffix;
- if (!arch.isEmpty())
- suffix.replace(QLatin1String("${QMAKE_PCH_ARCH}"), arch.toQString());
- QString precompiledHeader = header_prefix + language + suffix;
+ QString precompiledHeader = header_prefix + language + header_suffix;
+ if (!arch.isEmpty()) {
+ precompiledHeader.replace(QLatin1String("${QMAKE_PCH_ARCH}"),
+ arch.toQString());
+ }
if (!ret.contains(precompiledHeader))
ret += precompiledHeader;
}
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 20f2c88444..550fa9d834 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -1017,10 +1017,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if (pchArchs.isEmpty())
pchArchs << ProString(); // normal single-arch PCH
for (const ProString &arch : qAsConst(pchArchs)) {
- auto suffix = header_suffix.toQString();
+ QString file = precomph_out_dir + header_prefix + language + header_suffix;
if (!arch.isEmpty())
- suffix.replace(QStringLiteral("${QMAKE_PCH_ARCH}"), arch.toQString());
- precomp_files += precomph_out_dir + header_prefix + language + suffix;
+ file.replace(QStringLiteral("${QMAKE_PCH_ARCH}"), arch.toQString());
+ precomp_files += file;
}
}
}
@@ -1140,7 +1140,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\n\techo \"// Automatically generated, do not modify\" > " << sourceFile_f
<< "\n\trm -f " << escapeFilePath(pchArchOutput);
} else {
- t << "\n\t" << mkdir_p_asstring(pchOutputDir);
+ QString outDir = pchOutputDir;
+ if (!arch.isEmpty())
+ outDir.replace(QStringLiteral("${QMAKE_PCH_ARCH}"), arch.toQString());
+ t << "\n\t" << mkdir_p_asstring(outDir);
}
auto pchArchFlags = pchFlags;
diff --git a/src/3rdparty/freetype/src/sfnt/pngshim.c b/src/3rdparty/freetype/src/sfnt/pngshim.c
index ca85d9751f..fc78b6d5df 100644
--- a/src/3rdparty/freetype/src/sfnt/pngshim.c
+++ b/src/3rdparty/freetype/src/sfnt/pngshim.c
@@ -68,6 +68,7 @@
( ( __clang_major__ >= 4 ) || \
( ( __clang_major__ == 3 ) && ( __clang_minor__ >= 2 ) ) ) ) ) && \
defined( __OPTIMIZE__ ) && \
+ !defined( __EMSCRIPTEN__ ) && \
__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#ifdef __clang__
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 8bcf67e73d..276741c9fb 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -887,10 +887,10 @@ void qt_core_boilerplate()
"\n"
"Installation prefix: %s\n"
"Library path: %s\n"
- "Include path: %s\n",
+ "Plugin path: %s\n",
qt_configure_prefix_path_str + 12,
qt_configure_strs + qt_configure_str_offsets[QT_PREPEND_NAMESPACE(QLibraryInfo)::LibrariesPath - 1],
- qt_configure_strs + qt_configure_str_offsets[QT_PREPEND_NAMESPACE(QLibraryInfo)::HeadersPath - 1]);
+ qt_configure_strs + qt_configure_str_offsets[QT_PREPEND_NAMESPACE(QLibraryInfo)::PluginsPath - 1]);
QT_PREPEND_NAMESPACE(qDumpCPUFeatures)();
diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp
index 3b5f2f97da..6ebef3ee20 100644
--- a/src/corelib/io/qstandardpaths.cpp
+++ b/src/corelib/io/qstandardpaths.cpp
@@ -357,22 +357,14 @@ QT_BEGIN_NAMESPACE
/*!
\fn QString QStandardPaths::writableLocation(StandardLocation type)
- Returns the directory where files of \a type should be written to, or an empty string
- if the location cannot be determined.
-
- \note The storage location returned can be a directory that does not exist; i.e., it
- may need to be created by the system or the user.
+ \include standardpath/functiondoc.qdocinc writableLocation
*/
/*!
\fn QStringList QStandardPaths::standardLocations(StandardLocation type)
- Returns all the directories where files of \a type belong.
-
- The list of directories is sorted from high to low priority, starting with
- writableLocation() if it can be determined. This list is empty if no locations
- for \a type are defined.
+ \include standardpath/functiondoc.qdocinc standardLocations
\sa writableLocation()
*/
@@ -396,11 +388,7 @@ static bool existsAsSpecified(const QString &path, QStandardPaths::LocateOptions
}
/*!
- Tries to find a file or directory called \a fileName in the standard locations
- for \a type.
-
- The full path to the first file or directory (depending on \a options) found is returned.
- If no such file or directory can be found, an empty string is returned.
+ \include standardpath/functiondoc.qdocinc locate
*/
QString QStandardPaths::locate(StandardLocation type, const QString &fileName, LocateOptions options)
{
@@ -414,12 +402,7 @@ QString QStandardPaths::locate(StandardLocation type, const QString &fileName, L
}
/*!
- Tries to find all files or directories called \a fileName in the standard locations
- for \a type.
-
- The \a options flag allows to specify whether to look for files or directories.
-
- Returns the list of all the files that were found.
+ \include standardpath/functiondoc.qdocinc locateAll
*/
QStringList QStandardPaths::locateAll(StandardLocation type, const QString &fileName, LocateOptions options)
{
@@ -492,23 +475,7 @@ static inline QString
#endif // Q_OS_WIN
/*!
- Finds the executable named \a executableName in the paths specified by \a paths,
- or the system paths if \a paths is empty.
-
- On most operating systems the system path is determined by the PATH environment variable.
-
- The directories where to search for the executable can be set in the \a paths argument.
- To search in both your own paths and the system paths, call findExecutable twice, once with
- \a paths set and once with \a paths empty.
-
- Symlinks are not resolved, in order to preserve behavior for the case of executables
- whose behavior depends on the name they are invoked with.
-
- \note On Windows, the usual executable extensions (from the PATHEXT environment variable)
- are automatically appended, so that for instance findExecutable("foo") will find foo.exe
- or foo.bat if present.
-
- Returns the absolute file path to the executable, or an empty string if not found.
+ \include standardpath/functiondoc.qdocinc findExecutable
*/
QString QStandardPaths::findExecutable(const QString &executableName, const QStringList &paths)
{
@@ -566,10 +533,7 @@ QString QStandardPaths::findExecutable(const QString &executableName, const QStr
}
/*!
- \fn QString QStandardPaths::displayName(StandardLocation type)
-
- Returns a localized display name for the given location \a type or
- an empty QString if no relevant location can be found.
+ \include standardpath/functiondoc.qdocinc displayName
*/
#if !defined(Q_OS_MAC) && !defined(QT_BOOTSTRAPPED)
@@ -626,23 +590,7 @@ QString QStandardPaths::displayName(StandardLocation type)
/*!
\fn void QStandardPaths::setTestModeEnabled(bool testMode)
- If \a testMode is true, this enables a special "test mode" in
- QStandardPaths, which changes writable locations
- to point to test directories, in order to prevent auto tests from reading from
- or writing to the current user's configuration.
-
- This affects the locations into which test programs might write files:
- GenericDataLocation, DataLocation, ConfigLocation, GenericConfigLocation,
- AppConfigLocation, GenericCacheLocation, CacheLocation.
- Other locations are not affected.
-
- On Unix, \c XDG_DATA_HOME is set to \e ~/.qttest/share, \c XDG_CONFIG_HOME is
- set to \e ~/.qttest/config, and \c XDG_CACHE_HOME is set to \e ~/.qttest/cache.
-
- On \macos, data goes to \e ~/.qttest/Application Support, cache goes to
- \e ~/.qttest/Cache, and config goes to \e ~/.qttest/Preferences.
-
- On Windows, everything goes to a "qttest" directory under Application Data.
+ \include standardpath/functiondoc.qdocinc setTestModeEnabled
*/
static bool qsp_testMode = false;
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index acd31f4d84..55d13dad70 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -631,6 +631,12 @@ QString QTemporaryFilePrivate::defaultTemplateName()
case sensitive. If the template is not present in the filename,
QTemporaryFile appends the generated part to the filename given.
+ \note On Linux, QTemporaryFile will attempt to create unnamed temporary
+ files. If that succeeds, open() will return true but exists() will be
+ false. If you call fileName() or any function that calls it,
+ QTemporaryFile will give the file a name, so most applications will
+ not see a difference.
+
\sa QDir::tempPath(), QFile
*/
diff --git a/src/corelib/time/qtimezoneprivate.cpp b/src/corelib/time/qtimezoneprivate.cpp
index 569b343187..00dc8b4ced 100644
--- a/src/corelib/time/qtimezoneprivate.cpp
+++ b/src/corelib/time/qtimezoneprivate.cpp
@@ -632,7 +632,13 @@ bool QTimeZonePrivate::isValidId(const QByteArray &ianaId)
// Somewhat slack hand-rolled version:
const int MinSectionLength = 1;
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
+ // Android has its own naming of zones.
+ // "Canada/East-Saskatchewan" has a 17-character second component.
+ const int MaxSectionLength = 17;
+#else
const int MaxSectionLength = 14;
+#endif
int sectionLength = 0;
for (const char *it = ianaId.begin(), * const end = ianaId.end(); it != end; ++it, ++sectionLength) {
const char ch = *it;
diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri
index 3b2ced3f58..1f42f28d1e 100644
--- a/src/gui/image/image.pri
+++ b/src/gui/image/image.pri
@@ -79,6 +79,14 @@ qtConfig(png) {
HEADERS += image/qpnghandler_p.h
SOURCES += image/qpnghandler.cpp
QMAKE_USE_PRIVATE += libpng
+
+ win32:mingw {
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86048
+ GCC_VERSION = "$${QMAKE_GCC_MAJOR_VERSION}.$${QMAKE_GCC_MINOR_VERSION}.$${QMAKE_GCC_PATCH_VERSION}"
+ equals(GCC_VERSION, "8.1.0") {
+ QMAKE_CXXFLAGS += -fno-reorder-blocks-and-partition
+ }
+ }
}
# SIMD
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index df8220a0c6..84e387e317 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -165,6 +165,11 @@ QIconPrivate::QIconPrivate(QIconEngine *e)
qreal QIconPrivate::pixmapDevicePixelRatio(qreal displayDevicePixelRatio, const QSize &requestedSize, const QSize &actualSize)
{
QSize targetSize = requestedSize * displayDevicePixelRatio;
+ if ((actualSize.width() == targetSize.width() && actualSize.height() <= targetSize.height()) ||
+ (actualSize.width() <= targetSize.width() && actualSize.height() == targetSize.height())) {
+ // Correctly scaled for dpr, just having different aspect ratio
+ return displayDevicePixelRatio;
+ }
qreal scale = 0.5 * (qreal(actualSize.width()) / qreal(targetSize.width()) +
qreal(actualSize.height() / qreal(targetSize.height())));
return qMax(qreal(1.0), displayDevicePixelRatio *scale);
@@ -185,7 +190,12 @@ QPixmapIconEngine::~QPixmapIconEngine()
void QPixmapIconEngine::paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, QIcon::State state)
{
- QSize pixmapSize = rect.size() * qt_effective_device_pixel_ratio(0);
+ qreal dpr = 1.0;
+ if (QCoreApplication::testAttribute(Qt::AA_UseHighDpiPixmaps)) {
+ auto paintDevice = painter->device();
+ dpr = paintDevice ? paintDevice->devicePixelRatioF() : qApp->devicePixelRatio();
+ }
+ const QSize pixmapSize = rect.size() * dpr;
QPixmap px = pixmap(pixmapSize, mode, state);
painter->drawPixmap(rect, px);
}
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp
index 2b28052dd5..f555f4dc05 100644
--- a/src/gui/kernel/qevent.cpp
+++ b/src/gui/kernel/qevent.cpp
@@ -846,6 +846,7 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos,
/*!
Constructs a wheel event object.
+ \since 5.12
The \a pos provides the location of the mouse cursor
within the window. The position in global coordinates is specified
by \a globalPos.
diff --git a/src/gui/kernel/qhighdpiscaling.cpp b/src/gui/kernel/qhighdpiscaling.cpp
index 0782a49481..fde6bb0180 100644
--- a/src/gui/kernel/qhighdpiscaling.cpp
+++ b/src/gui/kernel/qhighdpiscaling.cpp
@@ -56,6 +56,9 @@ Q_LOGGING_CATEGORY(lcScaling, "qt.scaling");
#ifndef QT_NO_HIGHDPISCALING
static const char legacyDevicePixelEnvVar[] = "QT_DEVICE_PIXEL_RATIO";
+
+// Note: QT_AUTO_SCREEN_SCALE_FACTOR is Done on X11, and should be kept
+// working as-is. It's Deprecated on all other platforms.
static const char legacyAutoScreenEnvVar[] = "QT_AUTO_SCREEN_SCALE_FACTOR";
static const char enableHighDpiScalingEnvVar[] = "QT_ENABLE_HIGHDPI_SCALING";
@@ -104,12 +107,6 @@ static inline qreal initialGlobalScaleFactor()
if (dpr > 0)
result = dpr;
}
-
- if (qEnvironmentVariableIsSet(legacyAutoScreenEnvVar)) {
- qWarning("Warning: %s is deprecated. Instead use:\n"
- " %s to enable platform plugin controlled per-screen factors.",
- legacyAutoScreenEnvVar, enableHighDpiScalingEnvVar);
- }
}
return result;
}
diff --git a/src/gui/rhi/qshader.cpp b/src/gui/rhi/qshader.cpp
index c22b029dc8..9d35d83336 100644
--- a/src/gui/rhi/qshader.cpp
+++ b/src/gui/rhi/qshader.cpp
@@ -348,10 +348,10 @@ void QShader::removeShader(const QShaderKey &key)
static void writeShaderKey(QDataStream *ds, const QShaderKey &k)
{
- *ds << k.source();
+ *ds << int(k.source());
*ds << k.sourceVersion().version();
*ds << k.sourceVersion().flags();
- *ds << k.sourceVariant();
+ *ds << int(k.sourceVariant());
}
/*!
@@ -369,7 +369,7 @@ QByteArray QShader::serialized() const
return QByteArray();
ds << QSB_VERSION;
- ds << d->stage;
+ ds << int(d->stage);
ds << d->desc.toBinaryJson();
ds << d->shaders.count();
for (auto it = d->shaders.cbegin(), itEnd = d->shaders.cend(); it != itEnd; ++it) {
diff --git a/src/platformsupport/fontdatabases/fontdatabases.pro b/src/platformsupport/fontdatabases/fontdatabases.pro
index f2bac9ab94..c3985ed398 100644
--- a/src/platformsupport/fontdatabases/fontdatabases.pro
+++ b/src/platformsupport/fontdatabases/fontdatabases.pro
@@ -17,9 +17,10 @@ qtConfig(freetype) {
unix {
include($$PWD/genericunix/genericunix.pri)
- qtConfig(fontconfig) {
- include($$PWD/fontconfig/fontconfig.pri)
- }
+}
+
+qtConfig(fontconfig) {
+ include($$PWD/fontconfig/fontconfig.pri)
}
win32:!winrt {
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index 95ca40fc95..efda6b67ce 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -317,8 +317,7 @@ bool QXcbIntegration::hasCapability(QPlatformIntegration::Capability cap) const
case OpenGL:
case ThreadedOpenGL:
{
- const auto *connection = qAsConst(m_connections).first();
- if (const auto *integration = connection->glIntegration())
+ if (const auto *integration = defaultConnection()->glIntegration())
return cap != ThreadedOpenGL || integration->supportsThreadedOpenGL();
return false;
}
diff --git a/src/sql/kernel/qsqlquery.cpp b/src/sql/kernel/qsqlquery.cpp
index e7c444f5b9..34a3ba3755 100644
--- a/src/sql/kernel/qsqlquery.cpp
+++ b/src/sql/kernel/qsqlquery.cpp
@@ -182,6 +182,9 @@ QSqlQueryPrivate::~QSqlQueryPrivate()
You can retrieve the values of all the fields in a single variable
(a map) using boundValues().
+ \note Not all SQL operations support binding values. Refer to your database
+ system's documentation to check their availability.
+
\section1 Approaches to Binding Values
Below we present the same example using each of the four
diff --git a/src/widgets/doc/snippets/simplemodel-use/main.cpp b/src/widgets/doc/snippets/simplemodel-use/main.cpp
index 3e106c8eea..940669e101 100644
--- a/src/widgets/doc/snippets/simplemodel-use/main.cpp
+++ b/src/widgets/doc/snippets/simplemodel-use/main.cpp
@@ -79,8 +79,11 @@ int main(int argc, char *argv[])
//! [0]
QFileSystemModel *model = new QFileSystemModel;
- QModelIndex parentIndex = model->index(QDir::currentPath());
- int numRows = model->rowCount(parentIndex);
+ connect(model, &QFileSystemModel::directoryLoaded, [model](const QString &directory) {
+ QModelIndex parentIndex = model->index(directory);
+ int numRows = model->rowCount(parentIndex);
+ });
+ model->setRootPath(QDir::currentPath);
//! [0]
//! [1]
diff --git a/src/widgets/doc/src/model-view-programming.qdoc b/src/widgets/doc/src/model-view-programming.qdoc
index 236582ef3f..ede1ebf932 100644
--- a/src/widgets/doc/src/model-view-programming.qdoc
+++ b/src/widgets/doc/src/model-view-programming.qdoc
@@ -465,14 +465,19 @@
Although this does not show a normal way of using a model, it demonstrates
the conventions used by models when dealing with model indexes.
+ QFileSystemModel loading is asynchronous to minimize system resource use.
+ We have to take that into account when dealing with this model.
+
We construct a file system model in the following way:
\snippet simplemodel-use/main.cpp 0
- In this case, we set up a default QFileSystemModel, obtain a parent index
- using a specific implementation of \l{QFileSystemModel::}{index()}
- provided by that model, and we count the number of rows in the model using
- the \l{QFileSystemModel::}{rowCount()} function.
+ In this case, we start by setting up a default QFileSystemModel. We connect
+ it to a lambda, in which we will obtain a parent index using a specific
+ implementation of \l{QFileSystemModel::}{index()} provided by that model.
+ In the lambda, we count the number of rows in the model using the
+ \l{QFileSystemModel::}{rowCount()} function. Finally, we set the root path
+ of the QFileSystemModel so it starts loading data and triggers the lambda.
For simplicity, we are only interested in the items in the first column
of the model. We examine each row in turn, obtaining a model index for
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index 413cc2a9cd..034c1f4b4f 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -233,7 +233,9 @@ void QTreeView::setModel(QAbstractItemModel *model)
d->viewItems.clear();
d->expandedIndexes.clear();
d->hiddenIndexes.clear();
+ d->geometryRecursionBlock = true; // do not update geometries due to signals from the headers
d->header->setModel(model);
+ d->geometryRecursionBlock = false;
QAbstractItemView::setModel(model);
// QAbstractItemView connects to a private slot
diff --git a/src/widgets/widgets/qwidgetlinecontrol_p.h b/src/widgets/widgets/qwidgetlinecontrol_p.h
index 8ebed25084..a8fffd23dc 100644
--- a/src/widgets/widgets/qwidgetlinecontrol_p.h
+++ b/src/widgets/widgets/qwidgetlinecontrol_p.h
@@ -217,7 +217,7 @@ public:
void cursorWordBackward(bool mark) { moveCursor(m_textLayout.previousCursorPosition(m_cursor, QTextLayout::SkipWords), mark); }
void home(bool mark) { moveCursor(0, mark); }
- void end(bool mark) { moveCursor(text().length(), mark); }
+ void end(bool mark) { moveCursor(m_text.length(), mark); }
int xToPos(int x, QTextLine::CursorPosition = QTextLine::CursorBetweenCharacters) const;
QRect rectForPos(int pos) const;
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 8d232237bf..04151c3f31 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -4818,20 +4818,20 @@ void QDomElement::setAttribute(const QString& name, const QString& value)
\fn void QDomElement::setAttribute(const QString& name, int value)
\overload
- The number is formatted according to the current locale.
+ The formatting always uses QLocale::C.
*/
/*!
\fn void QDomElement::setAttribute(const QString& name, uint value)
\overload
- The number is formatted according to the current locale.
+ The formatting always uses QLocale::C.
*/
/*!
\overload
- The number is formatted according to the current locale.
+ The formatting always uses QLocale::C.
*/
void QDomElement::setAttribute(const QString& name, qlonglong value)
{
@@ -4845,7 +4845,7 @@ void QDomElement::setAttribute(const QString& name, qlonglong value)
/*!
\overload
- The number is formatted according to the current locale.
+ The formatting always uses QLocale::C.
*/
void QDomElement::setAttribute(const QString& name, qulonglong value)
{
@@ -4859,7 +4859,7 @@ void QDomElement::setAttribute(const QString& name, qulonglong value)
/*!
\overload
- The number is formatted according to the current locale.
+ The formatting always uses QLocale::C.
*/
void QDomElement::setAttribute(const QString& name, float value)
{
@@ -4873,19 +4873,14 @@ void QDomElement::setAttribute(const QString& name, float value)
/*!
\overload
- The number is formatted according to the current locale.
+ The formatting always uses QLocale::C.
*/
void QDomElement::setAttribute(const QString& name, double value)
{
if (!impl)
return;
QString x;
- char buf[256];
- int count = qsnprintf(buf, sizeof(buf), "%.16g", value);
- if (count > 0)
- x = QString::fromLatin1(buf, count);
- else
- x.setNum(value); // Fallback
+ x.setNum(value);
IMPL->setAttribute(name, x);
}
diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
index 3aa3d97dbc..20ed7500b5 100644
--- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
@@ -595,10 +595,7 @@ void tst_QLocale::emptyCtor_data()
ADD_CTOR_TEST("zz_zz", "C");
ADD_CTOR_TEST("zz...", "C");
ADD_CTOR_TEST("en.bla", "en_US");
-#if !(defined(Q_OS_DARWIN) && QT_HAS_FEATURE(address_sanitizer))
- // See QTBUG-69875
ADD_CTOR_TEST("en@bla", "en_US");
-#endif
ADD_CTOR_TEST("en_blaaa", "en_US");
ADD_CTOR_TEST("en_zz", "en_US");
ADD_CTOR_TEST("en_GB.bla", "en_GB");
@@ -607,10 +604,7 @@ void tst_QLocale::emptyCtor_data()
// Empty optional fields, but with punctuators supplied
ADD_CTOR_TEST("en.", "en_US");
-#if !(defined(Q_OS_DARWIN) && QT_HAS_FEATURE(address_sanitizer))
- // See QTBUG-69875
ADD_CTOR_TEST("en@", "en_US");
-#endif
ADD_CTOR_TEST("en.@", "en_US");
ADD_CTOR_TEST("en_", "en_US");
ADD_CTOR_TEST("en_.", "en_US");
diff --git a/tests/auto/corelib/time/qtimezone/BLACKLIST b/tests/auto/corelib/time/qtimezone/BLACKLIST
index 840c3b1181..b820bab3d9 100644
--- a/tests/auto/corelib/time/qtimezone/BLACKLIST
+++ b/tests/auto/corelib/time/qtimezone/BLACKLIST
@@ -2,10 +2,6 @@
[dataStreamTest]
android
-# QTBUG-69128
-[isTimeZoneIdAvailable]
-android
-
# QTBUG-69129
[specificTransition]
android
@@ -75,10 +71,14 @@ android
android
[transitionEachZone:Asia/Chita@1970]
android
+[transitionEachZone:Asia/Choibalsan@1970]
+android
[transitionEachZone:Asia/Dushanbe@1970]
android
[transitionEachZone:Asia/Ho_Chi_Minh@1970]
android
+[transitionEachZone:Asia/Hovd@1970]
+android
[transitionEachZone:Asia/Kathmandu@1970]
android
[transitionEachZone:Asia/Katmandu@1970]
@@ -109,6 +109,10 @@ android
android
[transitionEachZone:Asia/Thimphu@1970]
android
+[transitionEachZone:Asia/Ulaanbaatar@1970]
+android
+[transitionEachZone:Asia/Ulan_Bator@1970]
+android
[transitionEachZone:Asia/Ust-Nera@1970]
android
[transitionEachZone:Atlantic/Cape_Verde@1970]
diff --git a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
index 9f51ff8ba8..f425691d9c 100644
--- a/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
+++ b/tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp
@@ -706,6 +706,7 @@ void tst_QTimeZone::isValidId_data()
// a-z, A-Z, 0-9, '.', '-', '_' are valid chars
// Can't start with '-'
// Parts separated by '/', each part min 1 and max of 14 chars
+ // (Android has parts with lengths up to 17, so tolerates this as a special case.)
#define TESTSET(name, section, valid) \
QTest::newRow(name " front") << QByteArray(section "/xyz/xyz") << valid; \
QTest::newRow(name " middle") << QByteArray("xyz/" section "/xyz") << valid; \
@@ -713,8 +714,13 @@ void tst_QTimeZone::isValidId_data()
TESTSET("empty", "", false);
TESTSET("minimal", "m", true);
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
+ TESTSET("maximal", "East-Saskatchewan", true); // Android actually uses this
+ TESTSET("too long", "North-Saskatchewan", false); // ... but thankfully not this.
+#else
TESTSET("maximal", "12345678901234", true);
TESTSET("too long", "123456789012345", false);
+#endif
TESTSET("bad hyphen", "-hyphen", false);
TESTSET("good hyphen", "hy-phen", true);
@@ -759,8 +765,13 @@ void tst_QTimeZone::isValidId_data()
QTest::newRow("a,z alone") << QByteArray("a,z") << false;
QTest::newRow("/z alone") << QByteArray("/z") << false;
QTest::newRow("-z alone") << QByteArray("-z") << false;
+#if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED)
+ QTest::newRow("long alone") << QByteArray("12345678901234567") << true;
+ QTest::newRow("over-long alone") << QByteArray("123456789012345678") << false;
+#else
QTest::newRow("long alone") << QByteArray("12345678901234") << true;
QTest::newRow("over-long alone") << QByteArray("123456789012345") << false;
+#endif
#else
QSKIP("This test requires a Qt -developer-build.");
diff --git a/tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp b/tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp
index f95d48f042..01181ce20e 100644
--- a/tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp
+++ b/tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp
@@ -67,7 +67,7 @@ void tst_QScopedGuard::exceptions()
bool caught = false;
QT_TRY
{
- auto cleanup = qScopeGuard([&caught] { s_globalState++; });
+ auto cleanup = qScopeGuard([] { s_globalState++; });
QT_THROW(std::bad_alloc()); //if Qt compiled without exceptions this is noop
s_globalState = 100;
}
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
index 44195d3b25..58ca924fe2 100644
--- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
@@ -2862,6 +2862,7 @@ public:
};
Node *root;
+ bool crash = false;
EvilModel(QObject *parent = nullptr): QAbstractItemModel(parent), root(new Node)
{}
@@ -2870,6 +2871,11 @@ public:
delete root;
}
+ void setCrash()
+ {
+ crash = true;
+ }
+
void change()
{
emit layoutAboutToBeChanged();
@@ -2938,6 +2944,10 @@ public:
QVariant data(const QModelIndex &idx, int role) const override
{
+ if (crash) {
+ QTest::qFail("Should not get here...", __FILE__, __LINE__);
+ return QVariant();
+ }
if (idx.isValid() && role == Qt::DisplayRole) {
Node *parentNode = root;
if (idx.isValid()) {
@@ -2957,6 +2967,7 @@ void tst_QTreeView::evilModel_data()
{
QTest::addColumn<bool>("visible");
QTest::newRow("visible") << false;
+ QTest::newRow("visible") << true;
}
void tst_QTreeView::evilModel()
@@ -3126,6 +3137,9 @@ void tst_QTreeView::evilModel()
model.change();
view.setRootIndex(secondLevel);
+
+ model.setCrash();
+ view.setModel(nullptr);
}
void tst_QTreeView::indexRowSizeHint()
diff --git a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
index 0cfbc651ad..d37fb5c173 100644
--- a/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
+++ b/tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
@@ -762,6 +762,14 @@ void tst_QLineEdit::keypress_inputMask_data()
}
{
QTestEventList keys;
+ // inserting at end
+ addKeySequenceStandardKey(keys, QKeySequence::MoveToEndOfLine);
+ keys.addKeyClick(Qt::Key_Left);
+ keys.addKeyClick(Qt::Key_0);
+ QTest::newRow("insert at end") << QString("9-9-9") << keys << QString("--0") << QString(" - -0");
+ }
+ {
+ QTestEventList keys;
// inserting '12.12' then two backspaces
addKeySequenceStandardKey(keys, QKeySequence::MoveToStartOfLine);
keys.addKeyClick(Qt::Key_1);
diff --git a/tests/auto/xml/dom/qdom/tst_qdom.cpp b/tests/auto/xml/dom/qdom/tst_qdom.cpp
index b09a3447e3..99639df5b0 100644
--- a/tests/auto/xml/dom/qdom/tst_qdom.cpp
+++ b/tests/auto/xml/dom/qdom/tst_qdom.cpp
@@ -57,6 +57,7 @@ private slots:
void toString_02();
void hasAttributes_data();
void hasAttributes();
+ void setGetAttributes();
void save_data();
void save();
void saveWithSerialization() const;
@@ -392,6 +393,74 @@ void tst_QDom::hasAttributes()
QTEST( visitedNodes, "visitedNodes" );
}
+void tst_QDom::setGetAttributes()
+{
+ QDomDocument doc;
+ QDomElement rootNode = doc.createElement("Root");
+ doc.appendChild(rootNode);
+
+ const QLocale oldLocale = QLocale();
+ QLocale::setDefault(QLocale::German); // decimal separator != '.'
+
+ const QString qstringVal("QString");
+ const qlonglong qlonglongVal = std::numeric_limits<qlonglong>::min();
+ const qulonglong qulonglongVal = std::numeric_limits<qulonglong>::max();
+ const int intVal = std::numeric_limits<int>::min();
+ const uint uintVal = std::numeric_limits<uint>::max();
+ const float floatVal = 0.1234f;
+ const double doubleVal = 0.1234;
+
+ rootNode.setAttribute("qstringVal", qstringVal);
+ rootNode.setAttribute("qlonglongVal", qlonglongVal);
+ rootNode.setAttribute("qulonglongVal", qulonglongVal);
+ rootNode.setAttribute("intVal", intVal);
+ rootNode.setAttribute("uintVal", uintVal);
+ rootNode.setAttribute("floatVal", floatVal);
+ rootNode.setAttribute("doubleVal", doubleVal);
+
+ QDomElement nsNode = doc.createElement("NS");
+ rootNode.appendChild(nsNode);
+ nsNode.setAttributeNS("namespace", "qstringVal", qstringVal);
+ nsNode.setAttributeNS("namespace", "qlonglongVal", qlonglongVal);
+ nsNode.setAttributeNS("namespace", "qulonglongVal", qulonglongVal);
+ nsNode.setAttributeNS("namespace", "intVal", intVal);
+ nsNode.setAttributeNS("namespace", "uintVal", uintVal);
+ nsNode.setAttributeNS("namespace", "floatVal", floatVal); // not available atm
+ nsNode.setAttributeNS("namespace", "doubleVal", doubleVal);
+
+ bool bOk;
+ QCOMPARE(rootNode.attribute("qstringVal"), qstringVal);
+ QCOMPARE(rootNode.attribute("qlonglongVal").toLongLong(&bOk), qlonglongVal);
+ QVERIFY(bOk);
+ QCOMPARE(rootNode.attribute("qulonglongVal").toULongLong(&bOk), qulonglongVal);
+ QVERIFY(bOk);
+ QCOMPARE(rootNode.attribute("intVal").toInt(&bOk), intVal);
+ QVERIFY(bOk);
+ QCOMPARE(rootNode.attribute("uintVal").toUInt(&bOk), uintVal);
+ QVERIFY(bOk);
+ QCOMPARE(rootNode.attribute("floatVal").toFloat(&bOk), floatVal);
+ QVERIFY(bOk);
+ QCOMPARE(rootNode.attribute("doubleVal").toDouble(&bOk), doubleVal);
+ QVERIFY(bOk);
+
+ QCOMPARE(nsNode.attributeNS("namespace", "qstringVal"), qstringVal);
+ QCOMPARE(nsNode.attributeNS("namespace", "qlonglongVal").toLongLong(&bOk), qlonglongVal);
+ QVERIFY(bOk);
+ QCOMPARE(nsNode.attributeNS("namespace", "qulonglongVal").toULongLong(&bOk), qulonglongVal);
+ QVERIFY(bOk);
+ QCOMPARE(nsNode.attributeNS("namespace", "intVal").toInt(&bOk), intVal);
+ QVERIFY(bOk);
+ QCOMPARE(nsNode.attributeNS("namespace", "uintVal").toUInt(&bOk), uintVal);
+ QVERIFY(bOk);
+ QCOMPARE(nsNode.attributeNS("namespace", "floatVal").toFloat(&bOk), floatVal);
+ QVERIFY(bOk);
+ QCOMPARE(nsNode.attributeNS("namespace", "doubleVal").toDouble(&bOk), doubleVal);
+ QVERIFY(bOk);
+
+ QLocale::setDefault(oldLocale);
+}
+
+
int tst_QDom::hasAttributesHelper( const QDomNode& node )
{
int visitedNodes = 1;