summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--dist/changes-5.12.0468
-rw-r--r--examples/gui/openglwindow/openglwindow.cpp3
-rw-r--r--mkspecs/android-clang/qmake.conf2
-rw-r--r--mkspecs/android-g++/qmake.conf1
-rw-r--r--mkspecs/features/android/android_deployment_settings.prf26
-rw-r--r--mkspecs/features/mac/default_post.prf7
-rw-r--r--mkspecs/features/qml1_module.prf13
-rw-r--r--mkspecs/features/qml1_plugin.prf13
-rw-r--r--mkspecs/features/qml_module.prf12
-rw-r--r--mkspecs/features/qml_plugin.prf25
-rw-r--r--qmake/generators/makefile.cpp2
-rw-r--r--qmake/generators/unix/unixmake2.cpp2
-rw-r--r--qmake/library/proitems.h2
-rw-r--r--src/3rdparty/angle/SYSTEMINFO_LICENSE22
-rw-r--r--src/3rdparty/angle/TRACEEVENT_LICENSE27
-rw-r--r--src/3rdparty/libjpeg/qt_attribution.json2
-rw-r--r--src/3rdparty/libpng/qt_attribution.json2
-rw-r--r--src/3rdparty/sha3/BRG_ENDIAN_LICENSE21
-rw-r--r--src/3rdparty/sha3/brg_endian.h47
-rw-r--r--src/3rdparty/sha3/brg_endian.h.patch34
-rw-r--r--src/3rdparty/sha3/qt_attribution.json8
-rw-r--r--src/3rdparty/wasm/DejaVuSans.ttfbin493564 -> 757076 bytes
-rw-r--r--src/3rdparty/wasm/qt_attribution.json5
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java2
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp20
-rw-r--r--src/corelib/global/qconfig-bootstrapped.h3
-rw-r--r--src/corelib/global/qglobal.cpp2
-rw-r--r--src/corelib/global/qglobalstatic.qdoc10
-rw-r--r--src/corelib/global/qlibraryinfo.cpp14
-rw-r--r--src/corelib/global/qlogging.cpp2
-rw-r--r--src/corelib/global/qnamespace.qdoc6
-rw-r--r--src/corelib/global/qnumeric_p.h36
-rw-r--r--src/corelib/global/qrandom.cpp1
-rw-r--r--src/corelib/io/io.pri26
-rw-r--r--src/corelib/io/qdir.cpp11
-rw-r--r--src/corelib/io/qprocess.cpp8
-rw-r--r--src/corelib/io/qresource.cpp18
-rw-r--r--src/corelib/io/qsettings.cpp4
-rw-r--r--src/corelib/io/qsettings.h7
-rw-r--r--src/corelib/io/qsettings_mac.cpp2
-rw-r--r--src/corelib/io/qsettings_win.cpp3
-rw-r--r--src/corelib/io/qsettings_winrt.cpp3
-rw-r--r--src/corelib/kernel/qcoreapplication_p.h2
-rw-r--r--src/corelib/kernel/qdeadlinetimer.cpp5
-rw-r--r--src/corelib/kernel/qeventdispatcher_cf.mm2
-rw-r--r--src/corelib/kernel/qtimer.cpp29
-rw-r--r--src/corelib/kernel/qtimer.h2
-rw-r--r--src/corelib/serialization/qcborstream.cpp6
-rw-r--r--src/corelib/serialization/qcborvalue.cpp4
-rw-r--r--src/corelib/thread/qthread.cpp9
-rw-r--r--src/corelib/tools/qmap.cpp2
-rw-r--r--src/corelib/tools/qregularexpression.cpp4
-rw-r--r--src/corelib/tools/qscopeguard.qdoc30
-rw-r--r--src/corelib/tools/qshareddata.cpp7
-rw-r--r--src/corelib/tools/qstring.cpp2
-rw-r--r--src/corelib/tools/qtimezone.cpp2
-rw-r--r--src/gui/image/qiconloader.cpp6
-rw-r--r--src/gui/itemmodels/qstandarditemmodel.cpp3
-rw-r--r--src/gui/kernel/qplatformdialoghelper.cpp6
-rw-r--r--src/gui/kernel/qplatformgraphicsbufferhelper.cpp6
-rw-r--r--src/gui/kernel/qplatforminputcontextfactory.cpp6
-rw-r--r--src/gui/opengl/qopenglfunctions.cpp1
-rw-r--r--src/gui/opengl/qopengltexturecache.cpp2
-rw-r--r--src/gui/painting/qcolor.cpp88
-rw-r--r--src/gui/text/qfont.cpp2
-rw-r--r--src/gui/text/qtextdocument.cpp2
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp21
-rw-r--r--src/gui/text/qtextengine.cpp21
-rw-r--r--src/gui/text/qtextformat.cpp3
-rw-r--r--src/gui/text/qtextlayout.cpp60
-rw-r--r--src/network/socket/qabstractsocket.cpp10
-rw-r--r--src/network/ssl/qssl.cpp2
-rw-r--r--src/network/ssl/qssl.h5
-rw-r--r--src/network/ssl/qsslcontext_openssl11.cpp87
-rw-r--r--src/network/ssl/qsslcontext_opensslpre11.cpp15
-rw-r--r--src/network/ssl/qsslsocket_mac.cpp12
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp6
-rw-r--r--src/network/ssl/qsslsocket_openssl11_symbols_p.h4
-rw-r--r--src/network/ssl/qsslsocket_openssl_symbols.cpp4
-rw-r--r--src/network/ssl/qsslsocket_winrt.cpp2
-rw-r--r--src/opengl/qgl.cpp19
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm18
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm2
-rw-r--r--src/platformsupport/services/genericunix/qgenericunixservices.cpp4
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes.cpp10
-rw-r--r--src/platformsupport/themes/genericunix/qgenericunixthemes_p.h4
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm9
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm4
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm17
-rw-r--r--src/plugins/platforms/cocoa/qnsview_drawing.mm61
-rw-r--r--src/plugins/platforms/cocoa/qnswindow.mm10
-rw-r--r--src/plugins/platforms/cocoa/qnswindowdelegate.h3
-rw-r--r--src/plugins/platforms/cocoa/qnswindowdelegate.mm44
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsintegration.cpp1
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsscreen.cpp10
-rw-r--r--src/plugins/platforms/minimalegl/qminimaleglintegration.cpp1
-rw-r--r--src/plugins/platforms/windows/qwindowsinputcontext.cpp13
-rw-r--r--src/plugins/platforms/windows/qwindowspointerhandler.cpp67
-rw-r--r--src/plugins/platforms/windows/qwindowspointerhandler.h1
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp2
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm8
-rw-r--r--src/testlib/qtestcase.h2
-rw-r--r--src/tools/androiddeployqt/main.cpp99
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp2
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp37
-rw-r--r--src/widgets/dialogs/qfiledialog_p.h2
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp2
-rw-r--r--src/widgets/effects/qpixmapfilter.cpp10
-rw-r--r--src/widgets/kernel/qapplication_p.h2
-rw-r--r--src/widgets/styles/qcommonstyle.cpp2
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp16
-rw-r--r--tests/auto/corelib/io/io.pro3
-rw-r--r--tests/auto/corelib/io/qresourceengine/.gitattributes1
-rw-r--r--tests/auto/corelib/io/qresourceengine/testqrc/aliasdir/aliasdir.txt2
-rw-r--r--tests/auto/corelib/io/qresourceengine/testqrc/blahblah.txt2
-rw-r--r--tests/auto/corelib/io/qresourceengine/testqrc/currentdir.txt2
-rw-r--r--tests/auto/corelib/io/qresourceengine/testqrc/currentdir2.txt2
-rw-r--r--tests/auto/corelib/io/qresourceengine/testqrc/otherdir/otherdir.txt2
-rw-r--r--tests/auto/corelib/io/qresourceengine/testqrc/subdir/subdir.txt2
-rw-r--r--tests/auto/corelib/io/qresourceengine/testqrc/test/test/test1.txt2
-rw-r--r--tests/auto/corelib/io/qresourceengine/testqrc/test/test/test2.txt2
-rw-r--r--tests/auto/corelib/io/qresourceengine/testqrc/test/testdir.txt2
-rw-r--r--tests/auto/corelib/io/qresourceengine/testqrc/test/testdir2.txt2
-rw-r--r--tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp115
-rw-r--r--tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST1
-rw-r--r--tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp179
-rw-r--r--tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp5
-rw-r--r--tests/auto/gui/kernel/qguieventdispatcher/BLACKLIST5
-rw-r--r--tests/auto/gui/painting/qcolor/tst_qcolor.cpp3
-rw-r--r--tests/auto/network/access/qnetworkreply/BLACKLIST3
-rw-r--r--tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp60
-rw-r--r--tests/auto/opengl/qglthreads/tst_qglthreads.cpp5
-rw-r--r--tests/manual/dialogs/main.cpp2
134 files changed, 1680 insertions, 607 deletions
diff --git a/.gitignore b/.gitignore
index f133a2124e..b9188d84f7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -98,7 +98,6 @@ qt*-config.pri
/bin/qhelpgenerator
/bin/qlalr
/bin/qml
-/bin/qml1plugindump
/bin/qmleasing
/bin/qmlimportscanner
/bin/qmljs
diff --git a/dist/changes-5.12.0 b/dist/changes-5.12.0
new file mode 100644
index 0000000000..b5e664fc5a
--- /dev/null
+++ b/dist/changes-5.12.0
@@ -0,0 +1,468 @@
+Qt 5.12 introduces many new features and improvements as well as bugfixes
+over the 5.11.x series. 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.
+
+****************************************************************************
+* Important Behavior Changes *
+****************************************************************************
+
+ - QtCore:
+ * [QTBUG-34460] qFatal() no longer uses std::abort() on Windows, as
+ there are circumstances where global destructors are still run after
+ that call, leading to possible deadlocks.
+ - QRegularExpression:
+ * [QTBUG-66781] Regular expressions are now automatically optimized
+ (including JIT compiling) on their first usage. The pattern options
+ OptimizeOnFirstUsageOption and DontAutomaticallyOptimizeOption no
+ longer have any effect, and will get removed in a future version of
+ Qt. QRegularExpression::optimize() can be still used to compile and
+ optimize the regular expression in advance (before any match), if
+ needed.
+ - QDataStream:
+ * [QTBUG-59978][QTBUG-67995] version bumped up to 18 to account for
+ changes in the serialization of QGradient.
+ - Dialogs:
+ * QFileSystemModel now uses QRegularExpression internally for wildcard
+ matching. Note that QRegularExpression might not give the exact same
+ result as QRegExp as its implementation follows strictly the glob
+ patterns definition for wildcard expressions.
+
+****************************************************************************
+* Third-Party Code *
+****************************************************************************
+
+ - Sources of xcb-xinput 1.13 were bundled and are available via -qt-xcb.
+ - The minimal required version of libxcb is now 1.9. Bundled xcb sources
+ were updated to libxcb 1.9.1 built with xcb-proto 1.8.
+ - [QTBUG-67654] Updated CLDR to version 33.1
+ - [QTBUG-66561][QTBUG-70008] double-conversion got updated to upstream
+ version 3.1.1.
+ - libjpeg-turbo was updated to version 2.0.0
+ - libpng was updated to version 1.6.35
+ - Sqlite was updated to version 3.25.2
+ - [QTBUG-71109] updated bundled libxkbcommon 0.4.1 -> 0.8.2 (up to
+ 31f1f355700870c6615399fbfa7934934b3a9a57)
+ - PCRE2 was updated to version 10.32.
+ - Added documentation for the SLJIT part of pcre2, which is available
+ under the BSD-2-Clause license.
+
+****************************************************************************
+* Tools *
+****************************************************************************
+
+ - rcc:
+ * Added a --list-mapping option which shows a mapping of resource paths
+ to file system paths.
+
+ - qmake
+ * New CONFIG options lrelease and embed_translations were added.
+ CONFIG+=lrelease does run lrelease on translation files listed in
+ TRANSLATIONS and EXTRA_TRANSLATIONS. CONFIG+=embed_translations does
+ include the generated .qm files as resources under :/i18n/.
+
+ - uic
+ * [QTBUG-65251][QTBUG-51602] The -no-stringliteral option is now
+ deprecated and UIC will not generate QStringLiteral anymore.
+
+****************************************************************************
+* QtCore *
+****************************************************************************
+
+ - Added support for CBOR:
+ * Added QCborStreamReader and QCborStreamWriter, classes for low-level
+ reading and writing of CBOR streams.
+ * Added QCborValue, QCborArray and QCborMap, classes that permit DOM-like
+ access to CBOR data. The API is similar to QJsonValue, QJsonArray and
+ QJsonObject, respectively.
+
+ - QByteArray:
+ * Added QByteArray::isUpper() and QByteArray::isLower() to check if a
+ byte array contains only uppercase or only lowercase Latin1 letters.
+ * Added compare(), which takes Qt::CaseSensitivity as one of the
+ parameters. This function is more efficient than using toLower() or
+ toUpper() and then comparing.
+ * [QTBUG-66187] QByteArray::toInt(), QByteArray::toDouble() and the
+ other number conversion functions now ignore leading and trailing
+ whitespaces, as their QString counterparts already did. For
+ consistency reasons, the same behavior was added to
+ qEnvironmentVariableIntValue() also.
+
+ - QCommandLineParser:
+ * [QTBUG-70174] Fixed a bug that caused the help output to show two
+ options or more in the same line if the options didn't have a
+ description.
+
+ - QCryptographicHash:
+ * Add a static method, hashLength, which returns the length of the
+ output of a hash function in bytes.
+
+ - QDir:
+ * QDir now uses QRegularExpression internally for wildcard matching.
+ Note that QRegularExpression might not give the exact same result as
+ QRegExp as its implementation follows strictly the glob patterns
+ definition for wildcard expressions. Nevertheless, the tests for QDir
+ return the same results as before.
+ * QDir::tempPath() now reports the canonical path of the temporary
+ directory, with any symlinks resolved.
+ * On Windows, QDir::drives() no longer returns drives whose media were
+ ejected.
+
+ - QExplicitlySharedDataPointer:
+ * [QTBUG-66635][QTBUG-66946] Added operator== for nullptr.
+
+ - QFile:
+ * [QTBUG-13470] When opening a file, if Truncate is asked for, or
+ implied by other flags, it shall be attempted, regardless of what
+ other options are selected. We previously did this on Windows; now we
+ do so also on Unix (even when appending).
+
+ - QFileSystemWatcher:
+ * [QTBUG-69320] Fixed a bug that caused addPaths() to crash on Windows
+ if adding a path to be watched on removable storage, if that
+ addPaths() was called on a thread not created by QThread and no
+ QEventLoop has been created yet.
+
+ - QFlags's operator| for enum types in the Qt namespace are now declared
+ in the Qt namespace itself.
+
+ - QLocale:
+ * [QTBUG-57802] Added support for World and Europe as (numeric)
+ "country" codes ("territory" in CLDR terms), thereby enabling support
+ for Yiddish and Esperanto, among other locales using such codes.
+
+ - Logging:
+ * [QTBUG-69548] Qt will now accept qtlogging.ini files written by
+ QSettings.
+
+ - QMetaType can now register constructor for a set of dynamic types.
+
+ - QRegularExpression:
+ * Implemented support for wildcard patterns through a static method.
+ * QRegularExpression now provides anchoredPattern() which is a helper
+ function to build regular expressions used for exact matching.
+ * Implemented support for wildcard patterns. Warning: QRegularExpression
+ might not give the exact same result as QRegExp as its implementation
+ follows strictly the glob patterns definition for the wildcard
+ expressions.
+
+ - [QTBUG-62894] Introduced QScopeGuard.
+
+ - QSharedDataPointer:
+ * [QTBUG-66635][QTBUG-66946] Added operator== for nullptr.
+
+ - QSortFilterProxyModel:
+ * [QTBUG-46810] QSortFilterProxyModel now supports QRegularExpression.
+ * Setters of both the filterRegExp and filterRegularExpression
+ properties are now slots and can be used with the old as well as the
+ new syntax.
+
+ - QString:
+ * Added the functions QString::isUpper() and QString::isLower() to check
+ if a string contains only uppercase or only lowercase letters.
+
+ - QTextCodec:
+ * [QTBUG-56203] QTextCodec automatically deregisters on destruction now.
+
+ - QTimer:
+ * [QTBUG-69800] Fixed singleShot() methods that lacked proper "const"
+ qualification to QObject context receivers.
+ * Added QTimer::connectTo(), a shorthand way of connecting to the
+ timeout() signal.
+
+ - QTranslator:
+ * [QTBUG-31031] It is now possible to load qm files without any
+ translations. This is particularly useful for the language the
+ untranslated strings are written in; logic to load translations can
+ now handle the source language like all other languages.
+
+ - QUndoStack:
+ * [QTBUG-40040] Exposed canUndo, canRedo, undoText, redoText and clean as
+ Q_PROPERTYs.
+
+ - QUrl:
+ * Fixed a bug that caused QUrl::matches to incorrectly compare two URLs
+ with different hostnames or different usernames as equal, if certain
+ QUrl::RemoveXxx options were passed.
+
+ - other:
+ * Added an overload of q{To,From}{Big,Little}Endian that operates on a
+ memory region.
+ * Added the QT_TR_N_NOOP(), QT_TRANSLATE_N_NOOP(), and
+ QT_TRANSLATE_N_NOOP3() macros for numeral dependent delayed
+ translation.
+
+****************************************************************************
+* QtGui *
+****************************************************************************
+
+ - QBitmap:
+ * Added overloaded QBitmap::fromImage that takes QImage rvalue.
+
+ - QDocumentWriter:
+ * [QTBUG-63581] QDocumentWriter now supports table borders, table
+ alignment, table width, column widths, line height and image
+ resolution when exporting QTextDocuments to ODF files.
+
+ - QGradient:
+ * [QTBUG-59978][QTBUG-67995] Added ObjectMode coordinate mode.
+
+ - QGuiApplication:
+ * [QTBUG-26413] Fixed queryKeyboardModifiers() on macOS to actually return
+ the current modifier key state.
+
+ - QImage:
+ * [QTBUG-45858] QImage now supports 64bit image formats with 16 bits per
+ color channel, compatible with 16bpc PNG or RGBA16 OpenGL formats.
+
+ - QIntValidator:
+ * [QTBUG-59650] Input value with over the highest acceptable value, but
+ with no more digits than the maximum value, is now considered
+ intermediate.
+
+ - QOpenGLShader:
+ * [QTBUG-66074] QOpenGLShader has been fixed to expose geometry and
+ tessellation evaluation/control shaders with OpenGL ES 3.2.
+
+ - QPagedPaintDevice:
+ * The default constructor has been deprecated since that class is
+ not meant to be used standalone. The two public but internal
+ devicePageLayout() methods are now deprecated.
+
+ - QPainter:
+ * [QTBUG-67248] Fixed drawTiledPixmap() and texture-brush painting with
+ high-DPR images.
+ * QPainter::drawTiledPixmap() now tiles in the device independent
+ coordinate system.
+
+ - QPicture:
+ * [QTBUG-71208] Fixed a crash reading malformed picture file.
+
+ - QStandardItemModel:
+ * itemData does not return role 255 any more.
+
+ - QTextImageFormat:
+ * Added two new functions to the class: setQuality(int=100) and
+ quality(). They are currently used by QTextODFWriter to determine the
+ image type and quality when exporting images to ODT files.
+
+ - Text:
+ * [QTBUG-57479] Non-breaking spaces are now displayed as a degree symbol
+ when QTextOption::ShowTabsAndSpaces is used.
+ * [QTBUG-69085] Fixed position of text cursor set by clicking outside
+ the bounds of a text line that ends with a surrogate pair or ligature.
+ * [QTBUG-70293] Fixed a crash that can happen when calling a setter on a
+ QTextCursor after its QTextDocument has been deleted.
+
+****************************************************************************
+* QtNetwork *
+****************************************************************************
+
+ - Added DTLS over UDP support.
+
+ - QPasswordDigestor:
+ * [QTBUG-30550] Added QPasswordDigestor
+
+ - QSslKey:
+ * [QTBUG-17718] The OpenSSL backend can now load encrypted PKCS#8
+ DER-encoded keys.
+ * [QTBUG-59068] Added support for PKCS#8-encoded keys in the generic SSL
+ back-end (used for SecureTransport on macOS and for WinRT). Note that
+ it does not support keys encrypted with a PKCS#12 algorithm.
+
+ - QSslSocket:
+ * Enabled ALPN (and thus HTTP/2 negotiation) in SecureTransport backend
+ (macOS).
+ * [QTBUG-69420] Implemented renegotiation for SecureTransport backend.
+
+ - SSL:
+ * The OpenSSL 1.1 backend also works with OpenSSL 1.1.1 (and thus can
+ negotiate TLS 1.3).
+ * [QTBUG-68156] OpenSSL >= 1.0 is now required to build Qt with OpenSSL
+ support.
+
+****************************************************************************
+* QtSql *
+****************************************************************************
+
+ - MySQL:
+ * Now supports MySQL versions >= 8.0.1.
+ * [QTBUG-57028] The TIME data type is now treated like a string-based
+ type in order to respect the full range of the TIME data type.
+
+****************************************************************************
+* QtTest *
+****************************************************************************
+
+ - QCOMPARE:
+ * Now outputs contents of std::tuple on failure.
+ * [QTBUG-65845] QtTest now prints values of QFlags that failed to compare.
+
+****************************************************************************
+* QtWidgets *
+****************************************************************************
+
+ - Itemviews:
+ * [QTBUG-12129][QTBUG-14949][QTBUG-57891] Fixed eliding of multi-line
+ items.
+
+ - QAbstractSpinBox:
+ * [QTBUG-67380] The Qt::ControlModifier now increases the number of steps a
+ QAbstractSpinBox takes for the following interactions: scrolling, up/down
+ keyboard keys and the spin box buttons. Previously, Qt::ControlModifier
+ only affected scrolling.
+
+ - QApplication:
+ * [QTBUG-67736] QApplication no longer sends a mouse move event to the
+ entered widget if it sends synthetic enter and leave events.
+
+ - QHeaderView:
+ * [QTBUG-23203] Padding/margin is now taken into account when the text gets
+ elided.
+ * [QTBUG-59501] The qss padding attribute is now honored in all cases.
+ * [QTBUG-62091] The size of the decoration is now taken into account in
+ paintSection().
+ * [QTBUG-65017] The drag'n'drop indicator is now using the correct font.
+ * [QTBUG-69431] setDefaultSectionSize() now checks if the given value is
+ inside min/max section size.
+ * [QTBUG-70084] The section indicator is now high-DPI-aware.
+
+ - QItemDelegate:
+ * [QTBUG-16134] Fixed text height calculation when the item has a
+ decoration or checkbox.
+
+ - QLineEdit:
+ * [QTBUG-44046] The textEdited() signal is now emitted even if the
+ QValidator has changed the user input.
+ * [QTBUG-57448] Added inputRejected() signal for when a key press is not
+ accepted by the QLineEdit. For instance, when an invalid key is
+ pressed for a validator set.
+
+ - QListView:
+ * [QTBUG-27110] The pseudo states :first/:middle/:last are now respected.
+ * [QTBUG-56606] Added itemAlignment property.
+ * [QTBUG-67440] Fixed a bug that caused items on internal move to be
+ deleted.
+
+ - QMenu:
+ * [QTBUG-69199] Removed icon highlight when a stylesheet was applied by
+ the application.
+
+ - QMessageBox:
+ * [QTBUG-35545] On Android and iOS it's now possible to show a
+ QMessageBox with custom buttons as a native dialog.
+
+ - QSpinBox/QDoubleSpinBox:
+ * Added an option for adaptive decimal step size.
+
+ - QSplashScreen:
+ * [QTBUG-43081] The alignment when the message is passed as HTML is now
+ correctly honored.
+
+ - QStyle:
+ * QStyle::SH_SpinBox_StepModifier allows the developer to pick which
+ keyboard modifier increases the number of steps a QAbstractSpinBox
+ takes for the following interactions: scrolling, up/down keyboard keys
+ and the spin box buttons. The Qt::ShiftModifier can now be used, or
+ the feature can be disabled using Qt::NoModifier. Previously, only
+ Qt::ControlModifier could be used as the modifier.
+
+ - QTabBar:
+ * [QTBUG-18146] Fixed mixed up CSS pseudo class for left and right.
+
+ - QTableView:
+ * [QTBUG-48244][QTBUG-49548] Fixed calculating geometries for editors.
+ * [QTBUG-70215] Fixed PageUp not getting to top when first row is hidden.
+
+ - QTableWidget:
+ * Fixed handling of Qt::EditRole and Qt::DisplayRole in setItemData().
+
+ - QTreeView:
+ * [QTBUG-39486] Sped up expanding items when pressing asterisk.
+
+ - QWidget:
+ * [QTBUG-68393][QTBUG-69619][QTBUG-10907] Fixed several bugs that
+ incorrectly reordered tabs for compound widgets under some special
+ circumstances.
+ * [QTBUG-65199] enterEvent() and leaveEvent() now occur when a hovering
+ drawing tablet stylus enters or leaves a widget.
+ * Added the Qt::WA_StyleSheetTarget attribute to indicate that a widget
+ was affected by a style sheet.
+
+****************************************************************************
+* Android *
+****************************************************************************
+
+ - Added Android edit context menu.
+ - Removed old debugging bridge. To be able to debug Qt on Android apps the
+ user must use QtCreator 4.6.1+.
+ - [QTBUG-63735] The system no longer restarts the application when the user
+ replaces SIM card or changes the logical density of the screen.
+ - [QTBUG-70280] ARM64 builds now default to android-21 instead of failing.
+ - [QTBUG-35545] QMessageBox now supports buttons with custom labels.
+
+****************************************************************************
+* Linux *
+****************************************************************************
+
+ - QFileDialog will use the native dialogs provided by the platform theme
+ instead of trying to use Flatpak portal to select directories.
+
+****************************************************************************
+* macOS *
+****************************************************************************
+
+ - QtGui:
+ * [QTBUG-63800] Fixed display of condensed fonts when NoFontMerging is
+ in use.
+
+ - Text:
+ * [QTBUG-69955] Fixed font weights on macOS 10.14.
+
+****************************************************************************
+* Windows *
+****************************************************************************
+
+ - [QTBUG-55762] The dimensions of invisible margins inside the frames of
+ Windows 10 windows will now be disregarded in the positioning of Qt
+ windows to avoid a misplaced look (offset by a few pixels from the
+ expected position).
+ - [QTBUG-44964][QTBUG-60437] The application attributes
+ AA_CompressTabletEvents and AA_CompressHighFrequencyEvents are now
+ supported on Windows 8 and above for touch/pen input, with the same
+ defaults as on X11 (compress touch events, don't compress tablet events)
+
+ - QTimeZone:
+ * [QTBUG-42021] Changed MS-Win to use ICU for time-zone data, when
+ available, in preference to MS's TZ APIs. The choice is made when
+ building Qt. This will give reliable results when non-DST transitions
+ arise, or when a zone's DST is not simple (e.g. interrupted by
+ Ramadan).
+
+****************************************************************************
+* winrt *
+****************************************************************************
+
+ - Added support to Windows UI Automation to the WinRT QPA, allowing
+ Qt-based UWP applications to operate with accessibility and
+ programmatic UI control tools.
+
+****************************************************************************
+* X11 *
+****************************************************************************
+
+ - [QTBUG-39624] The xcb plugin was ported to use libxcb-xinput instead of
+ libXi for XInput2 support. The -xinput2 configure option was replaced by
+ -xcb-xinput.
diff --git a/examples/gui/openglwindow/openglwindow.cpp b/examples/gui/openglwindow/openglwindow.cpp
index 57a996a876..a0c85006bd 100644
--- a/examples/gui/openglwindow/openglwindow.cpp
+++ b/examples/gui/openglwindow/openglwindow.cpp
@@ -88,7 +88,8 @@ void OpenGLWindow::render()
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
- m_device->setSize(size());
+ m_device->setSize(size() * devicePixelRatio());
+ m_device->setDevicePixelRatio(devicePixelRatio());
QPainter painter(m_device);
render(&painter);
diff --git a/mkspecs/android-clang/qmake.conf b/mkspecs/android-clang/qmake.conf
index 1f5e690329..a0a369bb44 100644
--- a/mkspecs/android-clang/qmake.conf
+++ b/mkspecs/android-clang/qmake.conf
@@ -41,6 +41,8 @@ ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/$$A
ANDROID_STDCPP_PATH = $$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++_shared.so
+ANDROID_USE_LLVM = true
+
exists($$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++.so): \
ANDROID_CXX_STL_LIBS = -lc++
else: \
diff --git a/mkspecs/android-g++/qmake.conf b/mkspecs/android-g++/qmake.conf
index e72c802405..0cb3558f96 100644
--- a/mkspecs/android-g++/qmake.conf
+++ b/mkspecs/android-g++/qmake.conf
@@ -16,6 +16,7 @@ QMAKE_LINK = $$QMAKE_CXX
ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/$$NDK_TOOLCHAIN_VERSION/libs/$$ANDROID_TARGET_ARCH
ANDROID_STDCPP_PATH = $$ANDROID_SOURCES_CXX_STL_LIBDIR/libgnustl_shared.so
ANDROID_CXX_STL_LIBS = -lgnustl_shared -lgcc
+ANDROID_USE_LLVM = false
exists($$NDK_ROOT/sysroot/usr/include): \
QMAKE_CFLAGS += --sysroot=$$NDK_ROOT/sysroot \
diff --git a/mkspecs/features/android/android_deployment_settings.prf b/mkspecs/features/android/android_deployment_settings.prf
index e6b2431f9a..0db3230ce7 100644
--- a/mkspecs/features/android/android_deployment_settings.prf
+++ b/mkspecs/features/android/android_deployment_settings.prf
@@ -17,17 +17,22 @@ contains(TEMPLATE, ".*app"):!build_pass:!android-embedded {
isEmpty(NDK_ROOT): NDK_ROOT = $$DEFAULT_ANDROID_NDK_ROOT
FILE_CONTENT += " \"ndk\": $$emitString($$NDK_ROOT),"
- NDK_TOOLCHAIN_PREFIX = $$(ANDROID_NDK_TOOLCHAIN_PREFIX)
- isEmpty(NDK_TOOLCHAIN_PREFIX) {
- equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLCHAIN_PREFIX = x86
- else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLCHAIN_PREFIX = x86_64
- else: equals(ANDROID_TARGET_ARCH, mips): NDK_TOOLCHAIN_PREFIX = mipsel-linux-android
- else: equals(ANDROID_TARGET_ARCH, mips64): NDK_TOOLCHAIN_PREFIX = mips64el-linux-android
- else: equals(ANDROID_TARGET_ARCH, arm64-v8a): NDK_TOOLCHAIN_PREFIX = aarch64-linux-android
- else: NDK_TOOLCHAIN_PREFIX = arm-linux-androideabi
+ equals(ANDROID_USE_LLVM, true) {
+ FILE_CONTENT += " \"toolchain-prefix\": \"llvm\","
+ FILE_CONTENT += " \"tool-prefix\": \"llvm\","
+ } else {
+ NDK_TOOLCHAIN_PREFIX = $$(ANDROID_NDK_TOOLCHAIN_PREFIX)
+ isEmpty(NDK_TOOLCHAIN_PREFIX) {
+ equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLCHAIN_PREFIX = x86
+ else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLCHAIN_PREFIX = x86_64
+ else: equals(ANDROID_TARGET_ARCH, mips): NDK_TOOLCHAIN_PREFIX = mipsel-linux-android
+ else: equals(ANDROID_TARGET_ARCH, mips64): NDK_TOOLCHAIN_PREFIX = mips64el-linux-android
+ else: equals(ANDROID_TARGET_ARCH, arm64-v8a): NDK_TOOLCHAIN_PREFIX = aarch64-linux-android
+ else: NDK_TOOLCHAIN_PREFIX = arm-linux-androideabi
+ }
+ FILE_CONTENT += " \"toolchain-prefix\": $$emitString($$NDK_TOOLCHAIN_PREFIX),"
+ FILE_CONTENT += " \"tool-prefix\": $$emitString($$NDK_TOOLS_PREFIX),"
}
- FILE_CONTENT += " \"toolchain-prefix\": $$emitString($$NDK_TOOLCHAIN_PREFIX),"
- FILE_CONTENT += " \"tool-prefix\": $$emitString($$NDK_TOOLS_PREFIX),"
NDK_TOOLCHAIN_VERSION = $$(ANDROID_NDK_TOOLCHAIN_VERSION)
isEmpty(NDK_TOOLCHAIN_VERSION): NDK_TOOLCHAIN_VERSION = $$DEFAULT_ANDROID_NDK_TOOLCHAIN_VERSION
@@ -63,6 +68,7 @@ contains(TEMPLATE, ".*app"):!build_pass:!android-embedded {
QML_ROOT_PATH = $$_PRO_FILE_PWD_
FILE_CONTENT += " \"qml-root-path\": $$emitString($$QML_ROOT_PATH),"
FILE_CONTENT += " \"stdcpp-path\": $$emitString($$ANDROID_STDCPP_PATH),"
+ FILE_CONTENT += " \"useLLVM\": $$ANDROID_USE_LLVM,"
FILE_CONTENT += " \"application-binary\": $$emitString($$absolute_path($$DESTDIR, $$OUT_PWD)/$$TARGET)"
FILE_CONTENT += "}"
diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
index 99f68b78f5..c01e99fe8e 100644
--- a/mkspecs/features/mac/default_post.prf
+++ b/mkspecs/features/mac/default_post.prf
@@ -259,3 +259,10 @@ isEmpty(xcode_product_bundle_target): \
xcode_product_bundle_target = ${PRODUCT_NAME:rfc1034identifier}
xcode_product_bundle_identifier_setting.value = "$${xcode_product_bundle_identifier_setting.value}.$${xcode_product_bundle_target}"
QMAKE_MAC_XCODE_SETTINGS += xcode_product_bundle_identifier_setting
+
+!macx-xcode {
+ generate_xcode_project.commands = @$(QMAKE) -spec macx-xcode $(EXPORT__PRO_FILE_)
+ generate_xcode_project.target = xcodeproj
+ QMAKE_EXTRA_VARIABLES += _PRO_FILE_
+ QMAKE_EXTRA_TARGETS += generate_xcode_project
+}
diff --git a/mkspecs/features/qml1_module.prf b/mkspecs/features/qml1_module.prf
deleted file mode 100644
index 33c3e44808..0000000000
--- a/mkspecs/features/qml1_module.prf
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# W A R N I N G
-# -------------
-#
-# This file is not part of the Qt API. It exists purely as an
-# implementation detail. It may change from version to version
-# without notice, or even be removed.
-#
-# We mean it.
-#
-
-CONFIG += qml1_target
-load(qml_module)
diff --git a/mkspecs/features/qml1_plugin.prf b/mkspecs/features/qml1_plugin.prf
deleted file mode 100644
index cb1f0ce267..0000000000
--- a/mkspecs/features/qml1_plugin.prf
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# W A R N I N G
-# -------------
-#
-# This file is not part of the Qt API. It exists purely as an
-# implementation detail. It may change from version to version
-# without notice, or even be removed.
-#
-# We mean it.
-#
-
-CONFIG += qml1_target
-load(qml_plugin)
diff --git a/mkspecs/features/qml_module.prf b/mkspecs/features/qml_module.prf
index 65212b2abf..bd84ce597a 100644
--- a/mkspecs/features/qml_module.prf
+++ b/mkspecs/features/qml_module.prf
@@ -23,15 +23,9 @@ for(qmlf, AUX_QML_FILES): fq_aux_qml_files += $$absolute_path($$qmlf, $$_PRO_FIL
load(qt_build_paths)
-qml1_target {
- DESTDIR = $$MODULE_BASE_OUTDIR/imports/$$TARGETPATH
- instbase = $$[QT_INSTALL_IMPORTS]
-} else {
- DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
- instbase = $$[QT_INSTALL_QML]
-}
+DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
-!qml1_target:static: \
+static: \
CONFIG += builtin_resources
else: \
CONFIG += install_qml_files
@@ -52,7 +46,7 @@ qmldir.base = $$_PRO_FILE_PWD_
# Tools need qmldir and plugins.qmltypes always installed on the file system
qmldir.files = $$qmldir_file $$fq_aux_qml_files
install_qml_files: qmldir.files += $$fq_qml_files
-qmldir.path = $$instbase/$$TARGETPATH
+qmldir.path = $$[QT_INSTALL_QML]/$$TARGETPATH
INSTALLS += qmldir
!debug_and_release|!build_all|CONFIG(release, debug|release) {
diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf
index cd6377dcc6..ad8ecdf5f1 100644
--- a/mkspecs/features/qml_plugin.prf
+++ b/mkspecs/features/qml_plugin.prf
@@ -48,15 +48,9 @@ exists($$QMLTYPEFILE): AUX_QML_FILES += $$QMLTYPEFILE
load(qt_build_paths)
-qml1_target {
- DESTDIR = $$MODULE_BASE_OUTDIR/imports/$$TARGETPATH
- instbase = $$[QT_INSTALL_IMPORTS]
-} else {
- DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
- instbase = $$[QT_INSTALL_QML]
-}
+DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
-target.path = $$instbase/$$TARGETPATH
+target.path = $$[QT_INSTALL_QML]/$$TARGETPATH
INSTALLS += target
# Some final setup
@@ -75,20 +69,11 @@ load(qt_common)
# directory. Then review and commit the changes made to plugins.qmltypes.
#
!cross_compile {
- qml1_target {
- qmlplugindump = qml1plugindump
- importpath.name = QML_IMPORT_PATH
- } else {
- qmlplugindump = qmlplugindump
- importpath.name = QML2_IMPORT_PATH
- }
+ qmlplugindump = qmlplugindump
+ importpath.name = QML2_IMPORT_PATH
importpath.value =
for(qmod, QTREPOS) {
- qml1_target: \
- qmod = $$qmod/imports
- else: \
- qmod = $$qmod/qml
- exists($$qmod): importpath.value += $$shell_path($$qmod)
+ exists($$qmod/qml): importpath.value += $$shell_path($$qmod/qml)
}
importpath.value = $$unique(importpath.value)
QT_TOOL_ENV = importpath
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index e41e391cad..b7e591d2ab 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1101,8 +1101,6 @@ QString
MakefileGenerator::prlFileName(bool fixify)
{
QString ret = project->first("PRL_TARGET") + Option::prl_ext;
- if(!project->isEmpty("QMAKE_BUNDLE"))
- ret.prepend(project->first("QMAKE_BUNDLE") + Option::dir_sep);
if(fixify) {
if(!project->isEmpty("DESTDIR"))
ret.prepend(project->first("DESTDIR").toQString());
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 976751b02c..d3abedb50b 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -1225,6 +1225,8 @@ void UnixMakefileGenerator::init2()
else
ar_cmd.append("$(AR) $(TARGETA) $(OBJECTS)");
if (!project->isEmpty("QMAKE_BUNDLE")) {
+ project->values("PRL_TARGET").prepend(
+ project->first("QMAKE_BUNDLE") + Option::dir_sep + project->first("TARGET"));
ProString bundle_loc = project->first("QMAKE_BUNDLE_LOCATION");
if(!bundle_loc.isEmpty() && !bundle_loc.startsWith("/"))
bundle_loc.prepend("/");
diff --git a/qmake/library/proitems.h b/qmake/library/proitems.h
index 2b09fc2074..71e5e05367 100644
--- a/qmake/library/proitems.h
+++ b/qmake/library/proitems.h
@@ -133,7 +133,7 @@ public:
bool contains(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(s, 0, cs) >= 0; }
bool contains(const char *s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(QLatin1String(s), 0, cs) >= 0; }
bool contains(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const { return indexOf(c, 0, cs) >= 0; }
- int toLongLong(bool *ok = nullptr, int base = 10) const { return toQStringRef().toLongLong(ok, base); }
+ qlonglong toLongLong(bool *ok = nullptr, int base = 10) const { return toQStringRef().toLongLong(ok, base); }
int toInt(bool *ok = nullptr, int base = 10) const { return toQStringRef().toInt(ok, base); }
short toShort(bool *ok = nullptr, int base = 10) const { return toQStringRef().toShort(ok, base); }
diff --git a/src/3rdparty/angle/SYSTEMINFO_LICENSE b/src/3rdparty/angle/SYSTEMINFO_LICENSE
new file mode 100644
index 0000000000..c12444e3bc
--- /dev/null
+++ b/src/3rdparty/angle/SYSTEMINFO_LICENSE
@@ -0,0 +1,22 @@
+Copyright (C) 2009 Apple Inc. All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/src/3rdparty/angle/TRACEEVENT_LICENSE b/src/3rdparty/angle/TRACEEVENT_LICENSE
new file mode 100644
index 0000000000..34d6cd9268
--- /dev/null
+++ b/src/3rdparty/angle/TRACEEVENT_LICENSE
@@ -0,0 +1,27 @@
+Copyright 2013 The Chromium Authors. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/src/3rdparty/libjpeg/qt_attribution.json b/src/3rdparty/libjpeg/qt_attribution.json
index 57c5001f6c..8fbdfdb9b7 100644
--- a/src/3rdparty/libjpeg/qt_attribution.json
+++ b/src/3rdparty/libjpeg/qt_attribution.json
@@ -2,7 +2,7 @@
"Id": "libjpeg",
"Name": "LibJPEG-turbo",
"QDocModule": "qtgui",
- "QtUsage": "Used in the QJPEG image plugin. Configure with -no-jpeg to avoid.",
+ "QtUsage": "Used in the qjpeg image plugin. Configure with -system-libjpeg or -no-libjpeg to avoid.",
"Description": "The Independent JPEG Group's JPEG software",
"Homepage": "http://libjpeg-turbo.virtualgl.org/",
diff --git a/src/3rdparty/libpng/qt_attribution.json b/src/3rdparty/libpng/qt_attribution.json
index f9039a50f6..2f82b4c1c6 100644
--- a/src/3rdparty/libpng/qt_attribution.json
+++ b/src/3rdparty/libpng/qt_attribution.json
@@ -2,7 +2,7 @@
"Id": "libpng",
"Name": "LibPNG",
"QDocModule": "qtgui",
- "QtUsage": "Used in the qpng image plugin. Configure with -system-png or -no-png to avoid.",
+ "QtUsage": "Used in the qpng image plugin. Configure with -system-libpng or -no-libpng to avoid.",
"Description": "libpng is the official PNG reference library.",
"Homepage": "http://www.libpng.org/pub/png/libpng.html",
diff --git a/src/3rdparty/sha3/BRG_ENDIAN_LICENSE b/src/3rdparty/sha3/BRG_ENDIAN_LICENSE
index 0a4fdcbc3b..175347c263 100644
--- a/src/3rdparty/sha3/BRG_ENDIAN_LICENSE
+++ b/src/3rdparty/sha3/BRG_ENDIAN_LICENSE
@@ -1,21 +1,14 @@
-Copyright (c) 1998-2008, Brian Gladman, Worcester, UK. All rights reserved.
-
-LICENSE TERMS
+Copyright (c) 1998-2013, Brian Gladman, Worcester, UK. All rights reserved.
The redistribution and use of this software (with or without changes)
is allowed without the payment of fees or royalties provided that:
- 1. source code distributions include the above copyright notice, this
- list of conditions and the following disclaimer;
-
- 2. binary distributions include the above copyright notice, this list
- of conditions and the following disclaimer in their documentation;
-
- 3. the name of the copyright holder is not used to endorse products
- built using this software without specific written permission.
+ source code distributions include the above copyright notice, this
+ list of conditions and the following disclaimer;
-DISCLAIMER
+ binary distributions include the above copyright notice, this list
+ of conditions and the following disclaimer in their documentation.
This software is provided 'as is' with no explicit or implied warranties
-in respect of its properties, including, but not limited to, correctness
-and/or fitness for purpose.
+in respect of its operation, including, but not limited to, correctness
+and fitness for purpose.
diff --git a/src/3rdparty/sha3/brg_endian.h b/src/3rdparty/sha3/brg_endian.h
index 7226eb3bec..09d2a8b6a9 100644
--- a/src/3rdparty/sha3/brg_endian.h
+++ b/src/3rdparty/sha3/brg_endian.h
@@ -1,29 +1,22 @@
/*
- ---------------------------------------------------------------------------
- Copyright (c) 1998-2008, Brian Gladman, Worcester, UK. All rights reserved.
+---------------------------------------------------------------------------
+Copyright (c) 1998-2013, Brian Gladman, Worcester, UK. All rights reserved.
- LICENSE TERMS
+The redistribution and use of this software (with or without changes)
+is allowed without the payment of fees or royalties provided that:
- The redistribution and use of this software (with or without changes)
- is allowed without the payment of fees or royalties provided that:
+ source code distributions include the above copyright notice, this
+ list of conditions and the following disclaimer;
- 1. source code distributions include the above copyright notice, this
- list of conditions and the following disclaimer;
+ binary distributions include the above copyright notice, this list
+ of conditions and the following disclaimer in their documentation.
- 2. binary distributions include the above copyright notice, this list
- of conditions and the following disclaimer in their documentation;
-
- 3. the name of the copyright holder is not used to endorse products
- built using this software without specific written permission.
-
- DISCLAIMER
-
- This software is provided 'as is' with no explicit or implied warranties
- in respect of its properties, including, but not limited to, correctness
- and/or fitness for purpose.
- ---------------------------------------------------------------------------
- Issue Date: 20/12/2007
- Changes for ARM 9/9/2010
+This software is provided 'as is' with no explicit or implied warranties
+in respect of its operation, including, but not limited to, correctness
+and fitness for purpose.
+---------------------------------------------------------------------------
+Issue Date: 20/12/2007
+Changes for ARM 9/9/2010 [Downstream relative to Gladman's GitHub, upstream to Qt]
*/
#ifndef _BRG_ENDIAN_H
@@ -32,7 +25,12 @@
#define IS_BIG_ENDIAN 4321 /* byte 0 is most significant (mc68k) */
#define IS_LITTLE_ENDIAN 1234 /* byte 0 is least significant (i386) */
-#if 0
+/* This is needed when using clang with MSVC to avoid including */
+/* endian.h and byteswap.h which are not present on Windows */
+#if defined( _MSC_VER ) && defined( __clang__ )
+# undef __GNUC__
+#endif
+
/* Include files where endian defines and byteswap functions may reside */
#if defined( __sun )
# include <sys/isa_defs.h>
@@ -42,14 +40,13 @@
defined( __CYGWIN32__ ) || defined( __DJGPP__ ) || defined( __osf__ )
# include <machine/endian.h>
#elif defined( __linux__ ) || defined( __GNUC__ ) || defined( __GNU_LIBRARY__ )
-# if !defined( __MINGW32__ ) && !defined( _AIX )
+# if !defined( __MINGW32__ ) && !defined( _AIX ) && !defined(Q_OS_QNX)
# include <endian.h>
# if !defined( __BEOS__ )
# include <byteswap.h>
# endif
# endif
#endif
-#endif
/* Now attempt to set the define for platform byte order using any */
/* of the four forms SYMBOL, _SYMBOL, __SYMBOL & __SYMBOL__, which */
@@ -134,7 +131,7 @@
#elif 0 /* **** EDIT HERE IF NECESSARY **** */
# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
#else
-# error Please edit lines 132 or 134 in brg_endian.h to set the platform byte order
+# error Please edit lines 129 or 131 in brg_endian.h to set the platform byte order
#endif
#endif
diff --git a/src/3rdparty/sha3/brg_endian.h.patch b/src/3rdparty/sha3/brg_endian.h.patch
new file mode 100644
index 0000000000..395133ad2a
--- /dev/null
+++ b/src/3rdparty/sha3/brg_endian.h.patch
@@ -0,0 +1,34 @@
+diff -ub /home/eddy/.sys/tmp/sha/brg_endian.h /home/eddy/work/Qt-5.12/qtbase/src/3rdparty/sha3/brg_endian.h
+--- upstream/sha/brg_endian.h 2018-10-22 16:27:04.106128670 +0200
++++ qtbase/src/3rdparty/sha3/brg_endian.h 2018-10-22 16:30:35.098891562 +0200
+@@ -16,6 +16,7 @@
+ and fitness for purpose.
+ ---------------------------------------------------------------------------
+ Issue Date: 20/12/2007
++Changes for ARM 9/9/2010 [Downstream relative to Gladman's GitHub, upstream to Qt]
+ */
+
+ #ifndef _BRG_ENDIAN_H
+@@ -119,12 +120,18 @@
+ defined( THINK_C ) || defined( __VMCMS__ ) || defined( _AIX )
+ # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
+
+-#elif 0 /* **** EDIT HERE IF NECESSARY **** */
++#elif defined(__arm__)
++# ifdef __BIG_ENDIAN
++# define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
++# else
++# define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
++# endif
++#elif 1 /* **** EDIT HERE IF NECESSARY **** */
+ # define PLATFORM_BYTE_ORDER IS_LITTLE_ENDIAN
+ #elif 0 /* **** EDIT HERE IF NECESSARY **** */
+ # define PLATFORM_BYTE_ORDER IS_BIG_ENDIAN
+ #else
+-# error Please edit lines 126 or 128 in brg_endian.h to set the platform byte order
++# error Please edit lines 129 or 131 in brg_endian.h to set the platform byte order
+ #endif
+
+ #endif
+
+Diff finished. Mon Oct 22 16:31:46 2018
diff --git a/src/3rdparty/sha3/qt_attribution.json b/src/3rdparty/sha3/qt_attribution.json
index 5e6e993e19..4e53cfae0f 100644
--- a/src/3rdparty/sha3/qt_attribution.json
+++ b/src/3rdparty/sha3/qt_attribution.json
@@ -4,13 +4,15 @@
"Name": "Secure Hash Algorithm SHA-3 - brg_endian",
"QDocModule": "qtcore",
"QtUsage": "Used in Qt Core (QCryptographicHash).",
+ "Files": "apply brg_endian.h.patch to upstream from https://github.com/BrianGladman/sha/",
"Files": "brg_endian.h",
"Description": "SHA-3, originally known as Keccak, is a cryptographic hash function.",
- "License": "BSD 3-clause \"New\" or \"Revised\" License",
+ "Version": "https://github.com/BrianGladman/sha/ commit 4b9e13ead2c5b5e41ca27c65de4dd69ae0bac228",
+ "License": "BSD 2-clause \"Simplified\" License",
"LicenseFile": "BRG_ENDIAN_LICENSE",
- "LicenseId": "BSD-3-Clause",
- "Copyright": "Copyright (c) 1998-2008, Brian Gladman, Worcester, UK. All rights reserved."
+ "LicenseId": "BSD-2-Clause",
+ "Copyright": "Copyright (c) 1998-2013, Brian Gladman, Worcester, UK. All rights reserved."
},
{
"Id": "sha3_keccak",
diff --git a/src/3rdparty/wasm/DejaVuSans.ttf b/src/3rdparty/wasm/DejaVuSans.ttf
index 7e411a71be..e5f7eecce4 100644
--- a/src/3rdparty/wasm/DejaVuSans.ttf
+++ b/src/3rdparty/wasm/DejaVuSans.ttf
Binary files differ
diff --git a/src/3rdparty/wasm/qt_attribution.json b/src/3rdparty/wasm/qt_attribution.json
index 5d89e4adfa..d569fdc167 100644
--- a/src/3rdparty/wasm/qt_attribution.json
+++ b/src/3rdparty/wasm/qt_attribution.json
@@ -24,10 +24,11 @@
"Description": "The DejaVu fonts are a font family based on the Vera Fonts.",
"Homepage": "https://dejavu-fonts.github.io/",
+ "Version": "2.37",
"License": "Bitstream Vera Font License",
"LicenseFile": "DEJAVU-LICENSE",
- "Copyright": "Copyright (C) 2003 Bitstream,Inc
+ "Copyright": "Copyright (c) 2003 by Bitstream, Inc
Copyright (c) 2006 by Tavmjong Bah
(c) American Mathematical Society"
}
-] \ No newline at end of file
+]
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
index 61f6afe85d..adc67e93fb 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
@@ -177,6 +177,8 @@ public class QtNative
File f = new File(libName);
if (f.exists())
System.load(libName);
+ else
+ Log.i(QtTAG, "Can't find '" + libName + "'");
} catch (SecurityException e) {
Log.i(QtTAG, "Can't load '" + libName + "'", e);
} catch (Exception e) {
diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp
index c73e782b76..7fdff974c1 100644
--- a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp
@@ -595,8 +595,7 @@ namespace QT_NAMESPACE {
//! [43]
class MyClass : public QObject
{
-
- private:
+private:
Q_DISABLE_COPY(MyClass)
};
@@ -605,22 +604,21 @@ class MyClass : public QObject
//! [44]
class MyClass : public QObject
{
-
- private:
- MyClass(const MyClass &);
- MyClass &operator=(const MyClass &);
+private:
+ MyClass(const MyClass &) = delete;
+ MyClass &operator=(const MyClass &) = delete;
};
//! [44]
//! [45]
- QWidget w = QWidget();
+QWidget w = QWidget();
//! [45]
//! [46]
- // Instead of comparing with 0.0
- qFuzzyCompare(0.0,1.0e-200); // This will return false
- // Compare adding 1 to both values will fix the problem
- qFuzzyCompare(1 + 0.0, 1 + 1.0e-200); // This will return true
+// Instead of comparing with 0.0
+qFuzzyCompare(0.0, 1.0e-200); // This will return false
+// Compare adding 1 to both values will fix the problem
+qFuzzyCompare(1 + 0.0, 1 + 1.0e-200); // This will return true
//! [46]
//! [47]
diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h
index 224d162fb0..dfcc3c9c7f 100644
--- a/src/corelib/global/qconfig-bootstrapped.h
+++ b/src/corelib/global/qconfig-bootstrapped.h
@@ -104,7 +104,6 @@
#else
# define QT_FEATURE_renameat2 -1
#endif
-#define QT_FEATURE_settings -1
#define QT_FEATURE_sharedmemory -1
#define QT_FEATURE_slog2 -1
#ifdef __GLIBC_PREREQ
@@ -127,11 +126,13 @@
#define QT_FEATURE_commandlineparser -1
#define QT_NO_COMPRESS
#define QT_JSON_READONLY
+#define QT_FEATURE_settings 1
#define QT_NO_STANDARDPATHS
#define QT_FEATURE_textcodec -1
#else
#define QT_FEATURE_codecs -1
#define QT_FEATURE_commandlineparser 1
+#define QT_FEATURE_settings -1
#define QT_FEATURE_textcodec 1
#endif
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 14fb4e77da..046d4b7b2a 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -3833,7 +3833,7 @@ bool qunsetenv(const char *varName)
dependent delayed translation in the given \a context with the given
\a comment.
The \a context is typically a class and also needs to be specified
- as a string literal. The string literal \a disambiguation should be
+ as a string literal. The string literal \a comment should be
a short semantic tag to tell apart otherwise identical strings.
The macro tells lupdate to collect the string, and expands to an
diff --git a/src/corelib/global/qglobalstatic.qdoc b/src/corelib/global/qglobalstatic.qdoc
index dbea04ecab..e7935d5a9b 100644
--- a/src/corelib/global/qglobalstatic.qdoc
+++ b/src/corelib/global/qglobalstatic.qdoc
@@ -435,6 +435,7 @@
*/
/*!
+ \keyword qglobalstatic-operator-type-ptr
\fn template <typename T, T *(&innerFunction)(), QBasicAtomicInt &guard> QGlobalStatic<T, innerFunction, guard>::operator Type*()
This function returns the address of the contents of this global static. If
@@ -476,10 +477,11 @@
by this function. If the contents have already been destroyed, this
function will return a null pointer.
- This function is equivalent to \l {operator Type *()}. It is provided for
- compatibility with the private Q_GLOBAL_STATIC implementation that existed
- in Qt 4.x and 5.0. New code should avoid using it and should instead treat
- the object as a smart pointer.
+ This function is equivalent to \l {qglobalstatic-operator-type-ptr}
+ {operator Type *()}. It is provided for compatibility with the private
+ Q_GLOBAL_STATIC implementation that existed in Qt 4.x and 5.0. New code
+ should avoid using it and should instead treat the object as a smart
+ pointer.
*/
/*!
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index e727f00c8e..4119012d85 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -41,7 +41,9 @@
#include "qdir.h"
#include "qstringlist.h"
#include "qfile.h"
+#if QT_CONFIG(settings)
#include "qsettings.h"
+#endif
#include "qlibraryinfo.h"
#include "qscopedpointer.h"
@@ -67,7 +69,7 @@ QT_BEGIN_NAMESPACE
extern void qDumpCPUFeatures(); // in qsimd.cpp
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
struct QLibrarySettings
{
@@ -204,7 +206,7 @@ QSettings *QLibraryInfoPrivate::findConfiguration()
return 0; //no luck
}
-#endif // QT_NO_SETTINGS
+#endif // settings
/*!
\class QLibraryInfo
@@ -464,7 +466,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
#endif // QT_BUILD_QMAKE, started inside location !
QString ret;
bool fromConf = false;
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
#ifdef QT_BUILD_QMAKE
// Logic for choosing the right data source: if EffectivePaths are requested
// and qt.conf with that section is present, use it, otherwise fall back to
@@ -547,7 +549,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
ret = QDir::fromNativeSeparators(ret);
}
}
-#endif // QT_NO_SETTINGS
+#endif // settings
#ifndef QT_BUILD_QMAKE_BOOTSTRAP
if (!fromConf) {
@@ -646,7 +648,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group)
QStringList QLibraryInfo::platformPluginArguments(const QString &platformName)
{
-#if !defined(QT_BUILD_QMAKE) && !defined(QT_NO_SETTINGS)
+#if !defined(QT_BUILD_QMAKE) && QT_CONFIG(settings)
QScopedPointer<const QSettings> settings(QLibraryInfoPrivate::findConfiguration());
if (!settings.isNull()) {
const QString key = QLatin1String(platformsSection)
@@ -657,7 +659,7 @@ QStringList QLibraryInfo::platformPluginArguments(const QString &platformName)
}
#else
Q_UNUSED(platformName);
-#endif // !QT_BUILD_QMAKE && !QT_NO_SETTINGS
+#endif // !QT_BUILD_QMAKE && settings
return QStringList();
}
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 396aee8696..168934c202 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -1885,7 +1885,7 @@ static void qt_message_fatal(QtMsgType, const QMessageLogContext &context, const
// [support.start.term]). So we bypass std::abort() and directly
// terminate the application.
-# ifdef Q_CC_MSVC
+# if defined(Q_CC_MSVC) && !defined(Q_CC_INTEL)
if (IsProcessorFeaturePresent(PF_FASTFAIL_AVAILABLE))
__fastfail(FAST_FAIL_FATAL_APP_EXIT);
# else
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 42009e0b5e..652efb10bf 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -3187,8 +3187,12 @@
\value ScrollUpdate The scrolling distance has changed (default).
- \value ScrollEnd Scrolling has ended, but the scrolling distance
+ \value ScrollEnd Scrolling has ended, and the scrolling distance
did not change anymore.
+
+ \value ScrollMomentum The user no longer touches the input device,
+ but scrolling continues due to scroll momentum.
+ This value was introduced in Qt 5.12.
*/
/*!
diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h
index 9c8514f5a3..e318c3759b 100644
--- a/src/corelib/global/qnumeric_p.h
+++ b/src/corelib/global/qnumeric_p.h
@@ -64,6 +64,10 @@
#include <float.h>
#endif
+# if defined(Q_OS_INTEGRITY) && defined(Q_PROCESSOR_ARM_64)
+#include <arm64_ghs.h>
+#endif
+
#if !defined(Q_CC_MSVC) && (defined(Q_OS_QNX) || defined(Q_CC_INTEL))
# include <math.h>
# ifdef isnan
@@ -323,6 +327,38 @@ mul_overflow(T v1, T v2, T *r)
return lr > std::numeric_limits<T>::max() || lr < std::numeric_limits<T>::min();
}
+# if defined(Q_OS_INTEGRITY) && defined(Q_PROCESSOR_ARM_64)
+template <> inline bool mul_overflow(quint64 v1, quint64 v2, quint64 *r)
+{
+ *r = v1 * v2;
+ return __MULUH64(v1, v2);
+}
+template <> inline bool mul_overflow(qint64 v1, qint64 v2, qint64 *r)
+{
+ qint64 high = __MULSH64(v1, v2);
+ if (high == 0) {
+ *r = v1 * v2;
+ return *r < 0;
+ }
+ if (high == -1) {
+ *r = v1 * v2;
+ return *r >= 0;
+ }
+ return true;
+}
+
+template <> inline bool mul_overflow(uint64_t v1, uint64_t v2, uint64_t *r)
+{
+ return mul_overflow<quint64>(v1,v2,reinterpret_cast<quint64*>(r));
+}
+
+template <> inline bool mul_overflow(int64_t v1, int64_t v2, int64_t *r)
+{
+ return mul_overflow<qint64>(v1,v2,reinterpret_cast<qint64*>(r));
+}
+
+#endif
+
# if defined(Q_CC_MSVC) && defined(Q_PROCESSOR_X86)
// We can use intrinsics for the unsigned operations with MSVC
template <> inline bool add_overflow(unsigned v1, unsigned v2, unsigned *r)
diff --git a/src/corelib/global/qrandom.cpp b/src/corelib/global/qrandom.cpp
index 23e5e499b2..03534cf453 100644
--- a/src/corelib/global/qrandom.cpp
+++ b/src/corelib/global/qrandom.cpp
@@ -218,6 +218,7 @@ struct QRandomGenerator::SystemGenerator
#endif // Q_OS_WINRT
static SystemGenerator &self();
+ typedef quint32 result_type;
void generate(quint32 *begin, quint32 *end) Q_DECL_NOEXCEPT_EXPR(FillBufferNoexcept);
// For std::mersenne_twister_engine implementations that use something
diff --git a/src/corelib/io/io.pri b/src/corelib/io/io.pri
index c6a5407e51..086d642c26 100644
--- a/src/corelib/io/io.pri
+++ b/src/corelib/io/io.pri
@@ -34,8 +34,6 @@ HEADERS += \
io/qurlquery.h \
io/qurltlds_p.h \
io/qtldurl_p.h \
- io/qsettings.h \
- io/qsettings_p.h \
io/qfsfileengine_p.h \
io/qfsfileengine_iterator_p.h \
io/qfilesystementry_p.h \
@@ -73,7 +71,6 @@ SOURCES += \
io/qurlidna.cpp \
io/qurlquery.cpp \
io/qurlrecode.cpp \
- io/qsettings.cpp \
io/qfsfileengine.cpp \
io/qfsfileengine_iterator.cpp \
io/qfilesystementry.cpp \
@@ -121,6 +118,24 @@ qtConfig(processenvironment) {
SOURCES += io/qprocess_unix.cpp
}
+qtConfig(settings) {
+ SOURCES += \
+ io/qsettings.cpp
+ HEADERS += \
+ io/qsettings.h \
+ io/qsettings_p.h
+
+ win32 {
+ !winrt {
+ SOURCES += io/qsettings_win.cpp
+ } else {
+ SOURCES += io/qsettings_winrt.cpp
+ }
+ } else: darwin:!nacl {
+ SOURCES += io/qsettings_mac.cpp
+ }
+}
+
win32 {
SOURCES += io/qfsfileengine_win.cpp
SOURCES += io/qlockfile_win.cpp
@@ -136,7 +151,6 @@ win32 {
io/qwindowspipewriter_p.h
SOURCES += \
- io/qsettings_win.cpp \
io/qstandardpaths_win.cpp \
io/qstorageinfo_win.cpp \
io/qwindowspipereader.cpp \
@@ -146,7 +160,6 @@ win32 {
} else {
SOURCES += \
io/qstandardpaths_winrt.cpp \
- io/qsettings_winrt.cpp \
io/qstorageinfo_stub.cpp
}
} else:unix {
@@ -162,9 +175,6 @@ win32 {
../3rdparty/forkfd/forkfd.h
INCLUDEPATH += ../3rdparty/forkfd
}
- !nacl:mac: {
- SOURCES += io/qsettings_mac.cpp
- }
mac {
SOURCES += io/qstorageinfo_mac.cpp
qtConfig(processenvironment): \
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 0998d7ffd1..7df461ddce 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -1040,7 +1040,8 @@ QStringList QDir::nameFilters() const
list of filters specified by \a nameFilters.
Each name filter is a wildcard (globbing) filter that understands
- \c{*} and \c{?} wildcards. (See \l{Wildcard matching}.)
+ \c{*} and \c{?} wildcards. See \l{QRegularExpression#Wildcard matching}
+ {QRegularExpression Wildcard Matching}.
For example, the following code sets three name filters on a QDir
to ensure that only files with extensions typically used for C++
@@ -2120,8 +2121,8 @@ QString QDir::rootPath()
patterns in the list of \a filters; otherwise returns \c false. The
matching is case insensitive.
- \sa {Wildcard matching}, QRegularExpression::wildcardToRegularExpression(),
- entryList(), entryInfoList()
+ \sa {QRegularExpression#Wildcard matching}{QRegularExpression Wildcard Matching},
+ entryList(), entryInfoList()
*/
bool QDir::match(const QStringList &filters, const QString &fileName)
{
@@ -2143,8 +2144,8 @@ bool QDir::match(const QStringList &filters, const QString &fileName)
contain multiple patterns separated by spaces or semicolons.
The matching is case insensitive.
- \sa {Wildcard matching}, QRegularExpression::wildcardToRegularExpression,
- entryList(), entryInfoList()
+ \sa {QRegularExpression#Wildcard matching}{QRegularExpression Wildcard Matching},
+ entryList(), entryInfoList()
*/
bool QDir::match(const QString &filter, const QString &fileName)
{
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 890867cd51..e1f4a3a311 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -112,12 +112,12 @@ QT_BEGIN_NAMESPACE
\relates QProcess
Disables the
- \l {QProcess::start(const QString &, OpenMode)}{QProcess::start()}
- overload taking a single string.
+ \l {QProcess::start(const QString &, QIODevice::OpenMode)}
+ {QProcess::start}() overload taking a single string.
In most cases where it is used, the user intends for the first argument
to be treated atomically as per the other overload.
- \sa QProcess::start(const QString &command, OpenMode mode)
+ \sa QProcess::start(const QString &command, QIODevice::OpenMode mode)
*/
/*!
@@ -2557,7 +2557,7 @@ bool QProcess::startDetached(const QString &program,
After the \a command string has been split and unquoted, this function
behaves like the overload which takes the arguments as a string list.
- \sa start(const QString &command, OpenMode mode)
+ \sa start(const QString &command, QIODevice::OpenMode mode)
*/
bool QProcess::startDetached(const QString &command)
{
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 8a0d2e0200..9cfaa4d623 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -1288,7 +1288,6 @@ bool QResourceFileEngine::close()
{
Q_D(QResourceFileEngine);
d->offset = 0;
- d->uncompressed.clear();
return true;
}
@@ -1503,14 +1502,25 @@ uchar *QResourceFileEnginePrivate::map(qint64 offset, qint64 size, QFile::Memory
{
Q_Q(QResourceFileEngine);
Q_UNUSED(flags);
+
+ qint64 max = resource.size();
+ if (resource.isCompressed()) {
+ uncompress();
+ max = uncompressed.size();
+ }
+
qint64 end;
if (offset < 0 || size <= 0 || !resource.isValid() ||
- add_overflow(offset, size, &end) || end > resource.size()) {
+ add_overflow(offset, size, &end) || end > max) {
q->setError(QFile::UnspecifiedError, QString());
return 0;
}
- uchar *address = const_cast<uchar *>(resource.data());
- return (address + offset);
+
+ const uchar *address = resource.data();
+ if (resource.isCompressed())
+ address = reinterpret_cast<const uchar *>(uncompressed.constData());
+
+ return const_cast<uchar *>(address) + offset;
}
bool QResourceFileEnginePrivate::unmap(uchar *ptr)
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 3886b16dcf..74ec1801d0 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -41,8 +41,6 @@
#include "qplatformdefs.h"
#include "qsettings.h"
-#ifndef QT_NO_SETTINGS
-
#include "qsettings_p.h"
#include "qcache.h"
#include "qfile.h"
@@ -3617,5 +3615,3 @@ QT_END_NAMESPACE
#ifndef QT_BOOTSTRAPPED
#include "moc_qsettings.cpp"
#endif
-
-#endif // QT_NO_SETTINGS
diff --git a/src/corelib/io/qsettings.h b/src/corelib/io/qsettings.h
index 947507b642..32290a3390 100644
--- a/src/corelib/io/qsettings.h
+++ b/src/corelib/io/qsettings.h
@@ -45,10 +45,7 @@
#include <QtCore/qstring.h>
#include <QtCore/qscopedpointer.h>
-QT_BEGIN_NAMESPACE
-QT_END_NAMESPACE
-
-#ifndef QT_NO_SETTINGS
+QT_REQUIRE_CONFIG(settings);
#include <ctype.h>
@@ -212,6 +209,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_SETTINGS
-
#endif // QSETTINGS_H
diff --git a/src/corelib/io/qsettings_mac.cpp b/src/corelib/io/qsettings_mac.cpp
index 28f01eae4d..443e6bb00a 100644
--- a/src/corelib/io/qsettings_mac.cpp
+++ b/src/corelib/io/qsettings_mac.cpp
@@ -38,7 +38,6 @@
****************************************************************************/
#include "qsettings.h"
-#ifndef QT_NO_SETTINGS
#include "qsettings_p.h"
#include "qdatetime.h"
@@ -664,4 +663,3 @@ bool QConfFileSettingsPrivate::writePlistFile(QIODevice &file, const ParsedSetti
}
QT_END_NAMESPACE
-#endif //QT_NO_SETTINGS
diff --git a/src/corelib/io/qsettings_win.cpp b/src/corelib/io/qsettings_win.cpp
index 1881d0dc7e..dd3468e1f8 100644
--- a/src/corelib/io/qsettings_win.cpp
+++ b/src/corelib/io/qsettings_win.cpp
@@ -39,8 +39,6 @@
#include "qsettings.h"
-#ifndef QT_NO_SETTINGS
-
#include "qsettings_p.h"
#include "qvector.h"
#include "qmap.h"
@@ -864,4 +862,3 @@ QSettingsPrivate *QSettingsPrivate::create(const QString &fileName, QSettings::F
}
QT_END_NAMESPACE
-#endif // QT_NO_SETTINGS
diff --git a/src/corelib/io/qsettings_winrt.cpp b/src/corelib/io/qsettings_winrt.cpp
index 4c757f9dda..e91d4d64a2 100644
--- a/src/corelib/io/qsettings_winrt.cpp
+++ b/src/corelib/io/qsettings_winrt.cpp
@@ -39,8 +39,6 @@
#include "qsettings.h"
-#ifndef QT_NO_SETTINGS
-
#include "qsettings_p.h"
#include "qvector.h"
#include "qmap.h"
@@ -690,4 +688,3 @@ QSettingsPrivate *QSettingsPrivate::create(const QString &fileName, QSettings::F
}
QT_END_NAMESPACE
-#endif // QT_NO_SETTINGS
diff --git a/src/corelib/kernel/qcoreapplication_p.h b/src/corelib/kernel/qcoreapplication_p.h
index cd995c17f1..b3479414ab 100644
--- a/src/corelib/kernel/qcoreapplication_p.h
+++ b/src/corelib/kernel/qcoreapplication_p.h
@@ -53,7 +53,9 @@
#include "QtCore/qcoreapplication.h"
#include "QtCore/qtranslator.h"
+#if QT_CONFIG(settings)
#include "QtCore/qsettings.h"
+#endif
#ifndef QT_NO_QOBJECT
#include "private/qobject_p.h"
#endif
diff --git a/src/corelib/kernel/qdeadlinetimer.cpp b/src/corelib/kernel/qdeadlinetimer.cpp
index 466056d513..6aa886cfe1 100644
--- a/src/corelib/kernel/qdeadlinetimer.cpp
+++ b/src/corelib/kernel/qdeadlinetimer.cpp
@@ -720,6 +720,11 @@ QDeadlineTimer QDeadlineTimer::addNSecs(QDeadlineTimer dt, qint64 nsecs) Q_DECL_
Returns the time remaining before the deadline.
*/
+/*!
+ \fn QPair<qint64, unsigned> QDeadlineTimer::_q_data() const
+ \internal
+*/
+
// the rest of the functions are in qelapsedtimer_xxx.cpp
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qeventdispatcher_cf.mm b/src/corelib/kernel/qeventdispatcher_cf.mm
index 8881305b18..b7b379e2c1 100644
--- a/src/corelib/kernel/qeventdispatcher_cf.mm
+++ b/src/corelib/kernel/qeventdispatcher_cf.mm
@@ -58,7 +58,7 @@
QT_USE_NAMESPACE
-/*!
+/*
During scroll view panning, and possibly other gestures, UIKit will
request a switch to UITrackingRunLoopMode via GSEventPushRunLoopMode,
which records the new runloop mode and stops the current runloop.
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index 2059aae3eb..13f027074a 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -571,30 +571,43 @@ void QTimer::singleShot(int msec, Qt::TimerType timerType, const QObject *receiv
*/
/*!
- \fn template<typename Functor> QMetaObject::Connection callOnTimeout(Functor functor, Qt::ConnectionType connectionType = Qt::AutoConnection)
+ \fn template <typename Functor> QMetaObject::Connection QTimer::callOnTimeout(Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection)
\since 5.12
\overload
- Creates a connection from the timeout() signal to \a functor, and returns a
+ Creates a connection from the timeout() signal to \a slot, and returns a
handle to the connection.
This method is provided for convenience.
- It's equivalent to calling \c {QObject::connect(timer, &QTimer::timeout, timer, functor, connectionType)}.
+ It's equivalent to calling \c {QObject::connect(timer, &QTimer::timeout, timer, slot, connectionType)}.
\sa QObject::connect(), timeout()
*/
/*!
- \fn template<typename Functor> QMetaObject::Connection callOnTimeout(QObject *context, Functor function, Qt::ConnectionType connectionType = Qt::AutoConnection)
+ \fn template <typename Functor> QMetaObject::Connection QTimer::callOnTimeout(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection)
\since 5.12
\overload callOnTimeout()
- Creates a connection from the timeout() signal to \a function, which could be a pointer
- to a member function of \a context, or it could be a functor to be placed in a specific
- event loop of \a context. It returns a handle to the connection.
+ Creates a connection from the timeout() signal to \a slot to be placed in a specific
+ event loop of \a context, and returns a handle to the connection.
This method is provided for convenience. It's equivalent to calling
- \c {QObject::connect(timer, &QTimer::timeout, context, function, connectionType)}.
+ \c {QObject::connect(timer, &QTimer::timeout, context, slot, connectionType)}.
+
+ \sa QObject::connect(), timeout()
+*/
+
+/*!
+ \fn template <typename PointerToMemberFunction> QMetaObject::Connection QTimer::callOnTimeout(const QObject *receiver, PointerToMemberFunction slot, Qt::ConnectionType connectionType = Qt::AutoConnection)
+ \since 5.12
+ \overload callOnTimeout()
+
+ Creates a connection from the timeout() signal to the \a slot in the \a receiver object. Returns
+ a handle to the connection.
+
+ This method is provided for convenience. It's equivalent to calling
+ \c {QObject::connect(timer, &QTimer::timeout, receiver, slot, connectionType)}.
\sa QObject::connect(), timeout()
*/
diff --git a/src/corelib/kernel/qtimer.h b/src/corelib/kernel/qtimer.h
index 9ff340854f..66f317c567 100644
--- a/src/corelib/kernel/qtimer.h
+++ b/src/corelib/kernel/qtimer.h
@@ -100,6 +100,8 @@ public:
QMetaObject::Connection callOnTimeout(Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
template <typename Functor>
QMetaObject::Connection callOnTimeout(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
+ template <typename PointerToMemberFunction>
+ QMetaObject::Connection callOnTimeout(const QObject *receiver, PointerToMemberFunction slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
#else
// singleShot to a QObject slot
template <typename Duration, typename Func1>
diff --git a/src/corelib/serialization/qcborstream.cpp b/src/corelib/serialization/qcborstream.cpp
index 39f9e2e70a..546f9ffe57 100644
--- a/src/corelib/serialization/qcborstream.cpp
+++ b/src/corelib/serialization/qcborstream.cpp
@@ -1438,12 +1438,14 @@ bool QCborStreamWriter::endMap()
*/
/*!
- \variable Container QCborStreamReader::StringResult::data
+ \variable QCborStreamReader::StringResult::data
+
Contains the actual data from the string if \l status is \c Ok.
*/
/*!
- \variable QCborStreamReader::StringResultCode QCborStreamReader::StringResult::status
+ \variable QCborStreamReader::StringResult::status
+
Contains the status of the attempt of reading the string from the stream.
*/
diff --git a/src/corelib/serialization/qcborvalue.cpp b/src/corelib/serialization/qcborvalue.cpp
index 2e2bac3f65..9e8c98837c 100644
--- a/src/corelib/serialization/qcborvalue.cpp
+++ b/src/corelib/serialization/qcborvalue.cpp
@@ -222,7 +222,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \variable qint64 QCborParserError::offset
+ \variable QCborParserError::offset
This field contains the offset from the beginning of the data where the
error was detected. The offset should point to the beginning of the item
@@ -233,7 +233,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \variable QCborError QCborParserError::error
+ \variable QCborParserError::error
This field contains the error code that indicates what decoding problem was
found.
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index d2d6435004..d3f60eea4f 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -298,12 +298,9 @@ QThreadPrivate::~QThreadPrivate()
\warning The handle returned by this function is used for internal
purposes and should not be used in any application code.
- \warning On Windows, the returned value is a pseudo-handle for the
- current thread. It can't be used for numerical comparison. i.e.,
- this function returns the DWORD (Windows-Thread ID) returned by
- the Win32 function getCurrentThreadId(), not the HANDLE
- (Windows-Thread HANDLE) returned by the Win32 function
- getCurrentThread().
+ \note On Windows, this function returns the DWORD (Windows-Thread
+ ID) returned by the Win32 function GetCurrentThreadId(), not the pseudo-HANDLE
+ (Windows-Thread HANDLE) returned by the Win32 function GetCurrentThread().
*/
/*!
diff --git a/src/corelib/tools/qmap.cpp b/src/corelib/tools/qmap.cpp
index d7844f3128..5f7275c5f8 100644
--- a/src/corelib/tools/qmap.cpp
+++ b/src/corelib/tools/qmap.cpp
@@ -537,7 +537,7 @@ void QMapDataBase::freeData(QMapDataBase *d)
\sa operator=()
*/
-/*! \fn template <class Key, class T> QMap<Key, T>::QMap(const std::map<Key, T> & other)
+/*! \fn template <class Key, class T> QMap<Key, T>::QMap(const typename std::map<Key, T> & other)
Constructs a copy of \a other.
diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp
index fec5f620fc..908e7ff0d6 100644
--- a/src/corelib/tools/qregularexpression.cpp
+++ b/src/corelib/tools/qregularexpression.cpp
@@ -2000,8 +2000,8 @@ QString QRegularExpression::wildcardToRegularExpression(const QString &pattern)
\since 5.12
- Returns the expression wrapped between the \c{\A} and \c{\z} anchors to be
- used for exact matching.
+ Returns the \a expression wrapped between the \c{\A} and \c{\z} anchors to
+ be used for exact matching.
\sa {Porting from QRegExp's Exact Matching}
*/
diff --git a/src/corelib/tools/qscopeguard.qdoc b/src/corelib/tools/qscopeguard.qdoc
index 7cbc3e9c7b..70e13ab2fd 100644
--- a/src/corelib/tools/qscopeguard.qdoc
+++ b/src/corelib/tools/qscopeguard.qdoc
@@ -30,24 +30,36 @@
QT_BEGIN_NAMESPACE
/*!
- \fn const QScopeGuard<F> qScopeGuard(F f)
- \inmodule QtCore
- \brief The qScopeGuard function can be used to call a function at the end of the scope.
+ \class QScopeGuard
\since 5.12
+ \inmodule QtCore
+ \brief Provides a scope guard for calling a function at the of
+ a scope.
+*/
+
+/*!
+ \fn template <typename F> const QScopeGuard<F> qScopeGuard(F f)
+ \inmodule QtCore
+ \relates QScopeGuard
+ \brief The qScopeGuard function can be used to call a function at the end
+ of the scope.
\ingroup misc
- QScopeGuard<F> is a class which sole purpose is to run a function F in its destructor.
- This is useful for guaranteeing your cleanup code is executed whether the function is exited normally,
- exited early by a return statement, or exited by an exception.
+ QScopeGuard<F> is a class which sole purpose is to run a function \e F in
+ its destructor. This is useful for guaranteeing your cleanup code is
+ executed, whether the function is exited normally, exited early by a return
+ statement, or exited by an exception.
- If F is a lambda then you cannot instantiate the template directly, therefore the qScopeGuard() helper
- is provided and QScopeGuard<F> is made a private implementation detail.
+ If \e F is a lambda then you cannot instantiate the template directly,
+ therefore the qScopeGuard() helper is provided and QScopeGuard<F> is made a
+ private implementation detail.
Example usage is as follows:
\snippet code/src_corelib_tools_qscopeguard.cpp 0
- \note Exceptions are not supported. The callable shouldn't throw when executed, copied or moved.
+ \note Exceptions are not supported. The callable shouldn't throw when
+ executed, copied or moved.
\sa QScopedValueRollback
*/
diff --git a/src/corelib/tools/qshareddata.cpp b/src/corelib/tools/qshareddata.cpp
index bc4291e20f..c334f71fa0 100644
--- a/src/corelib/tools/qshareddata.cpp
+++ b/src/corelib/tools/qshareddata.cpp
@@ -579,6 +579,13 @@ QT_BEGIN_NAMESPACE
the shared data object if the reference count became 0.
*/
+/*! \fn template <class T> T *QExplicitlySharedDataPointer<T>::take()
+ \since 5.12
+
+ Returns a pointer to the shared object, and resets \e this to be null.
+ That is, this function sets the \e{d pointer} of \e this to \c nullptr.
+ */
+
/*! \fn template <class T> QExplicitlySharedDataPointer<T>::operator bool () const
Returns \c true if the \e{d pointer} of \e this is \e not null.
*/
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 560453de84..90713bab10 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -254,7 +254,7 @@ inline RetType UnrollTailLoop<0>::exec(Number, RetType returnIfExited, Functor1,
/*!
* \internal
*
- * Searches for character \a \c in the string \a str and returns a pointer to
+ * Searches for character \a c in the string \a str and returns a pointer to
* it. Unlike strchr() and wcschr() (but like glibc's strchrnul()), if the
* character is not found, this function returns a pointer to the end of the
* string -- that is, \c{str.end()}.
diff --git a/src/corelib/tools/qtimezone.cpp b/src/corelib/tools/qtimezone.cpp
index db6be581ec..cbc6b50c98 100644
--- a/src/corelib/tools/qtimezone.cpp
+++ b/src/corelib/tools/qtimezone.cpp
@@ -217,7 +217,7 @@ Q_GLOBAL_STATIC(QTimeZoneSingleton, global_tz);
This class includes data obtained from the CLDR data files under the terms
of the Unicode Data Files and Software License. See
- \l{Unicode CLDR (Unicode Common Locale Data Repository)} for the details.
+ \l{Unicode Common Locale Data Repository (CLDR)} for details.
\sa QDateTime
*/
diff --git a/src/gui/image/qiconloader.cpp b/src/gui/image/qiconloader.cpp
index 228de3adc3..a9adde8c8d 100644
--- a/src/gui/image/qiconloader.cpp
+++ b/src/gui/image/qiconloader.cpp
@@ -50,7 +50,9 @@
#include <QtCore/qmath.h>
#include <QtCore/QList>
#include <QtCore/QDir>
+#if QT_CONFIG(settings)
#include <QtCore/QSettings>
+#endif
#include <QtGui/QPainter>
#include <private/qhexstring_p.h>
@@ -348,7 +350,7 @@ QIconTheme::QIconTheme(const QString &themeName)
m_valid = true;
}
}
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
if (themeIndex.exists()) {
const QSettings indexReader(themeIndex.fileName(), QSettings::IniFormat);
const QStringList keys = indexReader.allKeys();
@@ -407,7 +409,7 @@ QIconTheme::QIconTheme(const QString &themeName)
if (!m_parents.contains(QLatin1String("hicolor")))
m_parents.append(QLatin1String("hicolor"));
}
-#endif //QT_NO_SETTINGS
+#endif // settings
}
QThemeIconInfo QIconLoader::findIconHelper(const QString &themeName,
diff --git a/src/gui/itemmodels/qstandarditemmodel.cpp b/src/gui/itemmodels/qstandarditemmodel.cpp
index aa640f4d7e..81c60cdb6a 100644
--- a/src/gui/itemmodels/qstandarditemmodel.cpp
+++ b/src/gui/itemmodels/qstandarditemmodel.cpp
@@ -3018,6 +3018,9 @@ bool QStandardItemModel::setData(const QModelIndex &index, const QVariant &value
/*!
\since 5.12
Removes the data stored in all the roles for the given \a index.
+ Returns \c true if \a index is valid and data was cleared, \c false
+ otherwise.
+
\sa setData(), data()
*/
#endif
diff --git a/src/gui/kernel/qplatformdialoghelper.cpp b/src/gui/kernel/qplatformdialoghelper.cpp
index 6a0adca9ca..8b3a2ad193 100644
--- a/src/gui/kernel/qplatformdialoghelper.cpp
+++ b/src/gui/kernel/qplatformdialoghelper.cpp
@@ -42,7 +42,9 @@
#include <QtCore/QCoreApplication>
#include <QtCore/QVariant>
#include <QtCore/QSharedData>
+#if QT_CONFIG(settings)
#include <QtCore/QSettings>
+#endif
#include <QtCore/QUrl>
#include <QtCore/QVector>
#include <QtGui/QColor>
@@ -296,7 +298,7 @@ QColorDialogStaticData::QColorDialogStaticData() : customSet(false)
void QColorDialogStaticData::readSettings()
{
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
const QSettings settings(QSettings::UserScope, QStringLiteral("QtProject"));
for (int i = 0; i < int(CustomColorCount); ++i) {
const QVariant v = settings.value(QLatin1String("Qt/customColors/") + QString::number(i));
@@ -308,7 +310,7 @@ void QColorDialogStaticData::readSettings()
void QColorDialogStaticData::writeSettings() const
{
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
if (customSet) {
const_cast<QColorDialogStaticData*>(this)->customSet = false;
QSettings settings(QSettings::UserScope, QStringLiteral("QtProject"));
diff --git a/src/gui/kernel/qplatformgraphicsbufferhelper.cpp b/src/gui/kernel/qplatformgraphicsbufferhelper.cpp
index 924266997d..c98aead5c2 100644
--- a/src/gui/kernel/qplatformgraphicsbufferhelper.cpp
+++ b/src/gui/kernel/qplatformgraphicsbufferhelper.cpp
@@ -57,6 +57,12 @@
QT_BEGIN_NAMESPACE
/*!
+ \namespace QPlatformGraphicsBufferHelper
+ \inmodule QtGui
+ \internal
+*/
+
+/*!
Convenience function to both lock and bind the \a graphicsBuffer to a texture.
This function will first try to lock with texture read and texture write
access. If this succeeds it will use the bindToTexture function to bind the
diff --git a/src/gui/kernel/qplatforminputcontextfactory.cpp b/src/gui/kernel/qplatforminputcontextfactory.cpp
index c59d89fabe..df7b95d8df 100644
--- a/src/gui/kernel/qplatforminputcontextfactory.cpp
+++ b/src/gui/kernel/qplatforminputcontextfactory.cpp
@@ -48,14 +48,14 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
(QPlatformInputContextFactoryInterface_iid, QLatin1String("/platforminputcontexts"), Qt::CaseInsensitive))
#endif
QStringList QPlatformInputContextFactory::keys()
{
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
return loader()->keyMap().values();
#else
return QStringList();
@@ -70,7 +70,7 @@ QString QPlatformInputContextFactory::requested()
QPlatformInputContext *QPlatformInputContextFactory::create(const QString& key)
{
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
if (!key.isEmpty()) {
QStringList paramList = key.split(QLatin1Char(':'));
const QString platform = paramList.takeFirst().toLower();
diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp
index b4ff21f3fd..92770cb55f 100644
--- a/src/gui/opengl/qopenglfunctions.cpp
+++ b/src/gui/opengl/qopenglfunctions.cpp
@@ -142,6 +142,7 @@ void CLASS::init(QOpenGLContext *context) \
\value BlendColor glBlendColor() is available.
\value BlendEquation glBlendEquation() is available.
\value BlendEquationSeparate glBlendEquationSeparate() is available.
+ \value BlendEquationAdvanced Advanced blend equations are available.
\value BlendFuncSeparate glBlendFuncSeparate() is available.
\value BlendSubtract Blend subtract mode is available.
\value CompressedTextures Compressed texture functions are available.
diff --git a/src/gui/opengl/qopengltexturecache.cpp b/src/gui/opengl/qopengltexturecache.cpp
index 8de0b25fee..ef07dbe109 100644
--- a/src/gui/opengl/qopengltexturecache.cpp
+++ b/src/gui/opengl/qopengltexturecache.cpp
@@ -97,7 +97,7 @@ void QOpenGLTextureCacheWrapper::cleanupTexturesForPixmapData(QPlatformPixmap *p
QOpenGLTextureCache::QOpenGLTextureCache(QOpenGLContext *ctx)
: QOpenGLSharedResource(ctx->shareGroup())
- , m_cache(64 * 1024) // 64 MB cache
+ , m_cache(256 * 1024) // 256 MB cache
{
}
diff --git a/src/gui/painting/qcolor.cpp b/src/gui/painting/qcolor.cpp
index ef3296a6d4..a504e35c37 100644
--- a/src/gui/painting/qcolor.cpp
+++ b/src/gui/painting/qcolor.cpp
@@ -54,77 +54,77 @@ QT_BEGIN_NAMESPACE
/*!
\internal
- If s[0..1] is a valid hex number, returns its integer value,
+ If s[0..n] is a valid hex number, returns its integer value,
otherwise returns -1.
*/
-static inline int hex2int(const char *s)
+static inline int hex2int(const char *s, int n)
{
- const int hi = QtMiscUtils::fromHex(s[0]);
- if (hi < 0)
+ if (n < 0)
return -1;
- const int lo = QtMiscUtils::fromHex(s[1]);
- if (lo < 0)
- return -1;
- return (hi << 4) | lo;
-}
-
-/*!
- \internal
- If s is a valid hex digit, returns its integer value,
- multiplied by 0x11, otherwise returns -1.
- */
-static inline int hex2int(char s)
-{
- const int h = QtMiscUtils::fromHex(s);
- return h < 0 ? h : (h << 4) | h;
+ int result = 0;
+ for (; n > 0; --n) {
+ result = result * 16;
+ const int h = QtMiscUtils::fromHex(*s++);
+ if (h < 0)
+ return -1;
+ result += h;
+ }
+ return result;
}
-static bool get_hex_rgb(const char *name, size_t len, QRgb *rgb)
+static bool get_hex_rgb(const char *name, size_t len, QRgba64 *rgb)
{
if (name[0] != '#')
return false;
name++;
--len;
int a, r, g, b;
- a = 255;
+ a = 65535;
if (len == 12) {
- r = hex2int(name);
- g = hex2int(name + 4);
- b = hex2int(name + 8);
+ r = hex2int(name + 0, 4);
+ g = hex2int(name + 4, 4);
+ b = hex2int(name + 8, 4);
} else if (len == 9) {
- r = hex2int(name);
- g = hex2int(name + 3);
- b = hex2int(name + 6);
+ r = hex2int(name + 0, 3);
+ g = hex2int(name + 3, 3);
+ b = hex2int(name + 6, 3);
+ r = (r << 4) | (r >> 8);
+ g = (g << 4) | (g >> 8);
+ b = (b << 4) | (b >> 8);
} else if (len == 8) {
- a = hex2int(name);
- r = hex2int(name + 2);
- g = hex2int(name + 4);
- b = hex2int(name + 6);
+ a = hex2int(name + 0, 2) * 0x101;
+ r = hex2int(name + 2, 2) * 0x101;
+ g = hex2int(name + 4, 2) * 0x101;
+ b = hex2int(name + 6, 2) * 0x101;
} else if (len == 6) {
- r = hex2int(name);
- g = hex2int(name + 2);
- b = hex2int(name + 4);
+ r = hex2int(name + 0, 2) * 0x101;
+ g = hex2int(name + 2, 2) * 0x101;
+ b = hex2int(name + 4, 2) * 0x101;
} else if (len == 3) {
- r = hex2int(name[0]);
- g = hex2int(name[1]);
- b = hex2int(name[2]);
+ r = hex2int(name + 0, 1) * 0x1111;
+ g = hex2int(name + 1, 1) * 0x1111;
+ b = hex2int(name + 2, 1) * 0x1111;
} else {
r = g = b = -1;
}
- if ((uint)r > 255 || (uint)g > 255 || (uint)b > 255 || (uint)a > 255) {
+ if ((uint)r > 65535 || (uint)g > 65535 || (uint)b > 65535 || (uint)a > 65535) {
*rgb = 0;
return false;
}
- *rgb = qRgba(r, g ,b, a);
+ *rgb = qRgba64(r, g ,b, a);
return true;
}
bool qt_get_hex_rgb(const char *name, QRgb *rgb)
{
- return get_hex_rgb(name, qstrlen(name), rgb);
+ QRgba64 rgba64;
+ if (!get_hex_rgb(name, qstrlen(name), &rgba64))
+ return false;
+ *rgb = rgba64.toArgb32();
+ return true;
}
-static bool get_hex_rgb(const QChar *str, size_t len, QRgb *rgb)
+static bool get_hex_rgb(const QChar *str, size_t len, QRgba64 *rgb)
{
if (len > 13)
return false;
@@ -948,9 +948,9 @@ bool QColor::setColorFromString(String name)
}
if (name[0] == QLatin1Char('#')) {
- QRgb rgba;
+ QRgba64 rgba;
if (get_hex_rgb(name.data(), name.size(), &rgba)) {
- setRgba(rgba);
+ setRgba64(rgba);
return true;
} else {
invalidate();
@@ -1366,7 +1366,7 @@ QRgba64 QColor::rgba64() const Q_DECL_NOTHROW
Sets the RGB64 value to \a rgba, including its alpha.
- \sa \setRgba(), rgba64()
+ \sa setRgba(), rgba64()
*/
void QColor::setRgba64(QRgba64 rgba) Q_DECL_NOTHROW
{
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 27d804a3b4..3654c28fc5 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -1287,7 +1287,7 @@ QFont::StyleStrategy QFont::styleStrategy() const
/*!
Returns the StyleHint.
- The style hint affects the \l{#fontmatching}{font matching algorithm}.
+ The style hint affects the \l{QFont#fontmatching}{font matching algorithm}.
See \l QFont::StyleHint for the list of available hints.
\sa setStyleHint(), QFont::StyleStrategy, QFontInfo::styleHint()
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 008f695da0..4f187c6701 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -155,7 +155,7 @@ bool Qt::mightBeRichText(const QString& text)
This function is defined in the \c <QTextDocument> header file.
- \sa escape(), mightBeRichText()
+ \sa QString::toHtmlEscaped(), mightBeRichText()
*/
QString Qt::convertFromPlainText(const QString &plain, Qt::WhiteSpaceMode mode)
{
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index a9227f0171..ebd7a7d69f 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -2709,7 +2709,8 @@ void QTextDocumentLayoutPrivate::layoutBlock(const QTextBlock &bl, int blockPosi
qreal(q->paintDevice()->logicalDpiY()) / qreal(qt_defaultDpi()) : 1;
getLineHeightParams(blockFormat, line, scaling, &lineAdjustment, &lineBreakHeight, &lineHeight, &lineBottom);
- if (layoutStruct->pageHeight > 0 && layoutStruct->absoluteY() + lineBreakHeight > layoutStruct->pageBottom) {
+ if (layoutStruct->pageHeight > 0 && layoutStruct->absoluteY() + lineBreakHeight > layoutStruct->pageBottom &&
+ layoutStruct->pageHeight >= lineBreakHeight) {
layoutStruct->newPage();
floatMargins(layoutStruct->y, layoutStruct, &left, &right);
@@ -3049,18 +3050,12 @@ void QTextDocumentLayout::resizeInlineObject(QTextInlineObject item, int posInDo
QSizeF inlineSize = (pos == QTextFrameFormat::InFlow ? intrinsic : QSizeF(0, 0));
item.setWidth(inlineSize.width());
- QFontMetrics m(f.font());
- switch (f.verticalAlignment())
- {
- case QTextCharFormat::AlignMiddle:
- item.setDescent(inlineSize.height() / 2);
- item.setAscent(inlineSize.height() / 2);
- break;
- case QTextCharFormat::AlignBaseline:
- item.setDescent(m.descent());
- item.setAscent(inlineSize.height() - m.descent());
- break;
- default:
+ if (f.verticalAlignment() == QTextCharFormat::AlignMiddle) {
+ QFontMetrics m(f.font());
+ qreal halfX = m.xHeight()/2.;
+ item.setAscent((inlineSize.height() + halfX) / 2.);
+ item.setDescent((inlineSize.height() - halfX) / 2.);
+ } else {
item.setDescent(0);
item.setAscent(inlineSize.height());
}
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 4e9b00f9c9..8de16038ad 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1962,19 +1962,24 @@ const QCharAttributes *QTextEngine::attributes() const
void QTextEngine::shape(int item) const
{
- if (layoutData->items.at(item).analysis.flags == QScriptAnalysis::Object) {
+ auto &li = layoutData->items[item];
+ if (li.analysis.flags == QScriptAnalysis::Object) {
ensureSpace(1);
if (block.docHandle()) {
docLayout()->resizeInlineObject(QTextInlineObject(item, const_cast<QTextEngine *>(this)),
- layoutData->items[item].position + block.position(),
- format(&layoutData->items[item]));
+ li.position + block.position(),
+ format(&li));
}
- } else if (layoutData->items.at(item).analysis.flags == QScriptAnalysis::Tab) {
+ // fix log clusters to point to the previous glyph, as the object doesn't have a glyph of it's own.
+ // This is required so that all entries in the array get initialized and are ordered correctly.
+ ushort *lc = logClusters(&li);
+ *lc = item ? lc[-1] : 0;
+ } else if (li.analysis.flags == QScriptAnalysis::Tab) {
// set up at least the ascent/descent/leading of the script item for the tab
- fontEngine(layoutData->items[item],
- &layoutData->items[item].ascent,
- &layoutData->items[item].descent,
- &layoutData->items[item].leading);
+ fontEngine(li, &li.ascent, &li.descent, &li.leading);
+ // see the comment above
+ ushort *lc = logClusters(&li);
+ *lc = item ? lc[-1] : 0;
} else {
shapeText(item);
}
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index 18de8408b5..e814f4f718 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -649,6 +649,7 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &stream, QTextFormat &fmt)
\value ImageName
\value ImageWidth
\value ImageHeight
+ \value ImageQuality
Selection properties
@@ -2274,7 +2275,7 @@ QList<QTextOption::Tab> QTextBlockFormat::tabPositions() const
\fn void QTextBlockFormat::setHeadingLevel(int level)
\since 5.12
- Sets the paragraph's heading level, where 1 is the highest-level heading
+ Sets the paragraph's heading \a level, where 1 is the highest-level heading
type (usually with the largest possible heading font size), and increasing
values are progressively deeper into the document (and usually with smaller
font sizes). For example when reading an HTML H1 tag, the heading level is
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index ec49406548..e85b408db9 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -1834,6 +1834,9 @@ void QTextLine::layout_helper(int maxGlyphs)
lbh.logClusters = eng->layoutData->logClustersPtr;
lbh.previousGlyph = 0;
+ bool hasInlineObject = false;
+ QFixed maxInlineObjectHeight = 0;
+
while (newItem < eng->layoutData->items.size()) {
lbh.resetRightBearing();
lbh.softHyphenWidth = 0;
@@ -1862,8 +1865,11 @@ void QTextLine::layout_helper(int maxGlyphs)
lbh.tmpData.leading = qMax(lbh.tmpData.leading + lbh.tmpData.ascent,
current.leading + current.ascent) - qMax(lbh.tmpData.ascent,
current.ascent);
- lbh.tmpData.ascent = qMax(lbh.tmpData.ascent, current.ascent);
- lbh.tmpData.descent = qMax(lbh.tmpData.descent, current.descent);
+ if (current.analysis.flags != QScriptAnalysis::Object) {
+ // objects need some special treatment as they can special alignment or be floating
+ lbh.tmpData.ascent = qMax(lbh.tmpData.ascent, current.ascent);
+ lbh.tmpData.descent = qMax(lbh.tmpData.descent, current.descent);
+ }
if (current.analysis.flags == QScriptAnalysis::Tab && (alignment & (Qt::AlignLeft | Qt::AlignRight | Qt::AlignCenter | Qt::AlignJustify))) {
lbh.whiteSpaceOrObject = true;
@@ -1911,9 +1917,18 @@ void QTextLine::layout_helper(int maxGlyphs)
if (eng->block.docHandle()) {
QTextInlineObject inlineObject(item, eng);
- eng->docLayout()->positionInlineObject(inlineObject, eng->block.position() + current.position, inlineObject.format());
+ QTextFormat f = inlineObject.format();
+ eng->docLayout()->positionInlineObject(inlineObject, eng->block.position() + current.position, f);
+ QTextCharFormat::VerticalAlignment valign = f.toCharFormat().verticalAlignment();
+ if (valign != QTextCharFormat::AlignTop && valign != QTextCharFormat::AlignBottom) {
+ lbh.tmpData.ascent = qMax(lbh.tmpData.ascent, current.ascent);
+ lbh.tmpData.descent = qMax(lbh.tmpData.descent, current.descent);
+ }
}
+ hasInlineObject = true;
+ maxInlineObjectHeight = qMax(maxInlineObjectHeight, current.ascent + current.descent);
+
lbh.tmpData.textWidth += current.width;
newItem = item + 1;
@@ -2049,6 +2064,43 @@ found:
line += lbh.tmpData;
}
+ if (hasInlineObject && eng->block.docHandle()) {
+ // position top/bottom aligned inline objects
+ if (maxInlineObjectHeight > line.ascent + line.descent) {
+ // extend line height if required
+ QFixed toAdd = (maxInlineObjectHeight - line.ascent - line.descent)/2;
+ line.ascent += toAdd;
+ line.descent = maxInlineObjectHeight - line.ascent;
+ }
+ int startItem = eng->findItem(line.from);
+ int endItem = eng->findItem(line.from + line.length);
+ if (endItem < 0)
+ endItem = eng->layoutData->items.size();
+ for (int item = startItem; item < endItem; ++item) {
+ QScriptItem &current = eng->layoutData->items[item];
+ if (current.analysis.flags == QScriptAnalysis::Object) {
+ QTextInlineObject inlineObject(item, eng);
+ QTextCharFormat::VerticalAlignment align = inlineObject.format().toCharFormat().verticalAlignment();
+ QFixed height = current.ascent + current.descent;
+ switch (align) {
+ case QTextCharFormat::AlignTop:
+ current.ascent = line.ascent;
+ current.descent = height - line.ascent;
+ break;
+ case QTextCharFormat::AlignBottom:
+ current.descent = line.descent;
+ current.ascent = height - line.descent;
+ break;
+ default:
+ break;
+ }
+ Q_ASSERT(line.ascent >= current.ascent);
+ Q_ASSERT(line.descent >= current.descent);
+ }
+ }
+ }
+
+
LB_DEBUG("line length = %d, ascent=%f, descent=%f, textWidth=%f (spacew=%f)", line.length, line.ascent.toReal(),
line.descent.toReal(), line.textWidth.toReal(), lbh.spaceData.width.toReal());
LB_DEBUG(" : '%s'", eng->layoutData->string.mid(line.from, line.length).toUtf8().data());
@@ -2522,6 +2574,8 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR
QFixed itemY = y - si.ascent;
if (format.verticalAlignment() == QTextCharFormat::AlignTop) {
itemY = y - lineBase;
+ } else if (format.verticalAlignment() == QTextCharFormat::AlignBottom) {
+ itemY = y + line.descent - si.ascent - si.descent;
}
QRectF itemRect(iterator.x.toReal(), itemY.toReal(), iterator.itemWidth.toReal(), si.height().toReal());
diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp
index 4d9fda00ce..2f93c5fa2b 100644
--- a/src/network/socket/qabstractsocket.cpp
+++ b/src/network/socket/qabstractsocket.cpp
@@ -424,7 +424,7 @@
Note that by combining this option with ReuseAddressHint, you will
also allow your service to rebind an existing shared address. On
Unix, this is equivalent to the SO_REUSEADDR socket option. On Windows,
- this option is ignored.
+ this is the default behavior, so this option is ignored.
\value DontShareAddress Bind the address and port exclusively, so that
no other services are allowed to rebind. By passing this option to
@@ -444,7 +444,7 @@
\value DefaultForPlatform The default option for the current platform.
On Unix and \macos, this is equivalent to (DontShareAddress
- + ReuseAddressHint), and on Windows, its equivalent to ShareAddress.
+ + ReuseAddressHint), and on Windows, it is equivalent to ShareAddress.
*/
/*! \enum QAbstractSocket::PauseMode
@@ -455,7 +455,7 @@
The only notification currently supported is QSslSocket::sslErrors().
\value PauseNever Do not pause data transfer on the socket. This is the
- default and matches the behaviour of Qt 4.
+ default and matches the behavior of Qt 4.
\value PauseOnSslErrors Pause data transfer on the socket upon receiving an
SSL error notification. I.E. QSslSocket::sslErrors().
*/
@@ -1538,11 +1538,9 @@ void QAbstractSocket::setPauseMode(PauseModes pauseMode)
Binds to \a address on port \a port, using the BindMode \a mode.
- Binds this socket to the address \a address and the port \a port.
-
For UDP sockets, after binding, the signal QUdpSocket::readyRead() is emitted
whenever a UDP datagram arrives on the specified address and port.
- Thus, This function is useful to write UDP servers.
+ Thus, this function is useful to write UDP servers.
For TCP sockets, this function may be used to specify which interface to use
for an outgoing connection, which is useful in case of multiple network
diff --git a/src/network/ssl/qssl.cpp b/src/network/ssl/qssl.cpp
index 3a0983e8b5..19d99bc489 100644
--- a/src/network/ssl/qssl.cpp
+++ b/src/network/ssl/qssl.cpp
@@ -129,6 +129,8 @@ Q_LOGGING_CATEGORY(lcSsl, "qt.network.ssl");
\value DtlsV1_0OrLater DTLSv1.0 and later versions.
\value DtlsV1_2 DTLSv1.2
\value DtlsV1_2OrLater DTLSv1.2 and later versions.
+ \value TlsV1_3 TLSv1.3. (Since Qt 5.12)
+ \value TlsV1_3OrLater TLSv1.3 and later versions. (Since Qt 5.12)
\value UnknownProtocol The cipher's protocol cannot be determined.
\value AnyProtocol The socket understands SSLv2, SSLv3, TLSv1.0 and all
supported later versions of TLS. This value is used by QSslSocket only.
diff --git a/src/network/ssl/qssl.h b/src/network/ssl/qssl.h
index dd268cd86d..60362cb410 100644
--- a/src/network/ssl/qssl.h
+++ b/src/network/ssl/qssl.h
@@ -91,12 +91,13 @@ namespace QSsl {
TlsV1_1OrLater,
TlsV1_2OrLater,
-#if QT_CONFIG(dtls) || defined(Q_CLANG_QDOC)
DtlsV1_0,
DtlsV1_0OrLater,
DtlsV1_2,
DtlsV1_2OrLater,
-#endif
+
+ TlsV1_3,
+ TlsV1_3OrLater,
UnknownProtocol = -1
};
diff --git a/src/network/ssl/qsslcontext_openssl11.cpp b/src/network/ssl/qsslcontext_openssl11.cpp
index 708cb7bb0e..02ce466c80 100644
--- a/src/network/ssl/qsslcontext_openssl11.cpp
+++ b/src/network/ssl/qsslcontext_openssl11.cpp
@@ -105,7 +105,24 @@ init_context:
isDtls = true;
sslContext->ctx = q_SSL_CTX_new(client ? q_DTLS_client_method() : q_DTLS_server_method());
break;
+#else // dtls
+ case QSsl::DtlsV1_0:
+ case QSsl::DtlsV1_0OrLater:
+ case QSsl::DtlsV1_2:
+ case QSsl::DtlsV1_2OrLater:
+ sslContext->ctx = nullptr;
+ unsupportedProtocol = true;
+ qCWarning(lcSsl, "DTLS protocol requested, but feature 'dtls' is disabled");
+ break;
#endif // dtls
+ case QSsl::TlsV1_3:
+ case QSsl::TlsV1_3OrLater:
+#if !defined(TLS1_3_VERSION)
+ qCWarning(lcSsl, "TLS 1.3 is not supported");
+ sslContext->ctx = nullptr;
+ unsupportedProtocol = true;
+ break;
+#endif // TLS1_3_VERSION
default:
// The ssl options will actually control the supported methods
sslContext->ctx = q_SSL_CTX_new(client ? q_TLS_client_method() : q_TLS_server_method());
@@ -155,6 +172,16 @@ init_context:
minVersion = TLS1_2_VERSION;
maxVersion = TLS1_2_VERSION;
break;
+ case QSsl::TlsV1_3:
+#ifdef TLS1_3_VERSION
+ minVersion = TLS1_3_VERSION;
+ maxVersion = TLS1_3_VERSION;
+#else
+ // This protocol is not supported by OpenSSL 1.1 and we handle
+ // it as an error (see the code above).
+ Q_UNREACHABLE();
+#endif // TLS1_3_VERSION
+ break;
// Ranges:
case QSsl::TlsV1SslV3:
case QSsl::AnyProtocol:
@@ -192,6 +219,17 @@ init_context:
maxVersion = DTLS_MAX_VERSION;
break;
#endif // dtls
+ case QSsl::TlsV1_3OrLater:
+#ifdef TLS1_3_VERSION
+ minVersion = TLS1_3_VERSION;
+ maxVersion = 0;
+ break;
+#else
+ // This protocol is not supported by OpenSSL 1.1 and we handle
+ // it as an error (see the code above).
+ Q_UNREACHABLE();
+ break;
+#endif // TLS1_3_VERSION
case QSsl::SslV2:
// This protocol is not supported by OpenSSL 1.1 and we handle
// it as an error (see the code above).
@@ -223,23 +261,52 @@ init_context:
// http://www.openssl.org/docs/ssl/SSL_CTX_set_mode.html
q_SSL_CTX_set_mode(sslContext->ctx, SSL_MODE_RELEASE_BUFFERS);
+ auto filterCiphers = [](const QList<QSslCipher> &ciphers, bool selectTls13)
+ {
+ QByteArray cipherString;
+ bool first = true;
+
+ for (const QSslCipher &cipher : qAsConst(ciphers)) {
+ const bool isTls13Cipher = cipher.protocol() == QSsl::TlsV1_3 || cipher.protocol() == QSsl::TlsV1_3OrLater;
+ if (selectTls13 != isTls13Cipher)
+ continue;
+
+ if (first)
+ first = false;
+ else
+ cipherString.append(':');
+ cipherString.append(cipher.name().toLatin1());
+ }
+ return cipherString;
+ };
+
// Initialize ciphers
- QByteArray cipherString;
- bool first = true;
QList<QSslCipher> ciphers = sslContext->sslConfiguration.ciphers();
if (ciphers.isEmpty())
ciphers = isDtls ? q_getDefaultDtlsCiphers() : QSslSocketPrivate::defaultCiphers();
- for (const QSslCipher &cipher : qAsConst(ciphers)) {
- if (first)
- first = false;
- else
- cipherString.append(':');
- cipherString.append(cipher.name().toLatin1());
+ const QByteArray preTls13Ciphers = filterCiphers(ciphers, false);
+
+ if (preTls13Ciphers.size()) {
+ if (!q_SSL_CTX_set_cipher_list(sslContext->ctx, preTls13Ciphers.data())) {
+ sslContext->errorStr = QSslSocket::tr("Invalid or empty cipher list (%1)").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ return;
+ }
}
- if (!q_SSL_CTX_set_cipher_list(sslContext->ctx, cipherString.data())) {
- sslContext->errorStr = QSslSocket::tr("Invalid or empty cipher list (%1)").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
+ const QByteArray tls13Ciphers = filterCiphers(ciphers, true);
+#ifdef TLS1_3_VERSION
+ if (tls13Ciphers.size()) {
+ if (!q_SSL_CTX_set_ciphersuites(sslContext->ctx, tls13Ciphers.data())) {
+ sslContext->errorStr = QSslSocket::tr("Invalid or empty cipher list (%1)").arg(QSslSocketBackendPrivate::getErrorsFromOpenSsl());
+ sslContext->errorCode = QSslError::UnspecifiedError;
+ return;
+ }
+ }
+#endif // TLS1_3_VERSION
+ if (!preTls13Ciphers.size() && !tls13Ciphers.size()) {
+ sslContext->errorStr = QSslSocket::tr("Invalid or empty cipher list (%1)").arg(QStringLiteral(""));
sslContext->errorCode = QSslError::UnspecifiedError;
return;
}
diff --git a/src/network/ssl/qsslcontext_opensslpre11.cpp b/src/network/ssl/qsslcontext_opensslpre11.cpp
index c8be2ecb31..34537d1da4 100644
--- a/src/network/ssl/qsslcontext_opensslpre11.cpp
+++ b/src/network/ssl/qsslcontext_opensslpre11.cpp
@@ -104,6 +104,15 @@ init_context:
isDtls = true;
sslContext->ctx = q_SSL_CTX_new(client ? q_DTLS_client_method() : q_DTLS_server_method());
break;
+#else // dtls
+ case QSsl::DtlsV1_0:
+ case QSsl::DtlsV1_0OrLater:
+ case QSsl::DtlsV1_2:
+ case QSsl::DtlsV1_2OrLater:
+ sslContext->ctx = nullptr;
+ unsupportedProtocol = true;
+ qCWarning(lcSsl, "DTLS protocol requested, but feature 'dtls' is disabled");
+ break;
#endif // dtls
case QSsl::SslV2:
#ifndef OPENSSL_NO_SSL2
@@ -168,6 +177,12 @@ init_context:
unsupportedProtocol = true;
#endif
break;
+ case QSsl::TlsV1_3:
+ case QSsl::TlsV1_3OrLater:
+ // TLS 1.3 is not supported by the system, but chosen deliberately -> error
+ sslContext->ctx = nullptr;
+ unsupportedProtocol = true;
+ break;
}
if (!client && isDtls && configuration.peerVerifyMode() != QSslSocket::VerifyNone) {
diff --git a/src/network/ssl/qsslsocket_mac.cpp b/src/network/ssl/qsslsocket_mac.cpp
index aa4fb4fe8e..66623cebef 100644
--- a/src/network/ssl/qsslsocket_mac.cpp
+++ b/src/network/ssl/qsslsocket_mac.cpp
@@ -1107,6 +1107,18 @@ bool QSslSocketBackendPrivate::setSessionProtocol()
return false;
}
+ // SecureTransport has kTLSProtocol13 constant and also, kTLSProtocolMaxSupported.
+ // Calling SSLSetProtocolVersionMax/Min with any of these two constants results
+ // in errInvalidParam and a failure to set the protocol version. This means
+ // no TLS 1.3 on macOS and iOS.
+ switch (configuration.protocol) {
+ case QSsl::TlsV1_3:
+ case QSsl::TlsV1_3OrLater:
+ qCWarning(lcSsl) << plainSocket << "SecureTransport does not support TLS 1.3";
+ return false;
+ default:;
+ }
+
OSStatus err = errSecSuccess;
if (configuration.protocol == QSsl::SslV3) {
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index c4306abdf8..5a49b56c9d 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -174,6 +174,8 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(const SSL_CIPHER
ciph.d->protocol = QSsl::TlsV1_1;
else if (protoString == QLatin1String("TLSv1.2"))
ciph.d->protocol = QSsl::TlsV1_2;
+ else if (protoString == QLatin1String("TLSv1.3"))
+ ciph.d->protocol = QSsl::TlsV1_3;
if (descriptionList.at(2).startsWith(QLatin1String("Kx=")))
ciph.d->keyExchangeMethod = descriptionList.at(2).mid(3).toString();
@@ -285,6 +287,8 @@ long QSslSocketBackendPrivate::setupOpenSslOptions(QSsl::SslProtocol protocol, Q
options = SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TLSv1;
else if (protocol == QSsl::TlsV1_2OrLater)
options = SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TLSv1|SSL_OP_NO_TLSv1_1;
+ else if (protocol == QSsl::TlsV1_3OrLater)
+ options = SSL_OP_ALL|SSL_OP_NO_SSLv2|SSL_OP_NO_SSLv3|SSL_OP_NO_TLSv1|SSL_OP_NO_TLSv1_1|SSL_OP_NO_TLSv1_2;
#endif
else
options = SSL_OP_ALL;
@@ -1291,6 +1295,8 @@ QSsl::SslProtocol QSslSocketBackendPrivate::sessionProtocol() const
return QSsl::TlsV1_1;
case 0x303:
return QSsl::TlsV1_2;
+ case 0x304:
+ return QSsl::TlsV1_3;
}
return QSsl::UnknownProtocol;
diff --git a/src/network/ssl/qsslsocket_openssl11_symbols_p.h b/src/network/ssl/qsslsocket_openssl11_symbols_p.h
index 844c3437be..fae007e12d 100644
--- a/src/network/ssl/qsslsocket_openssl11_symbols_p.h
+++ b/src/network/ssl/qsslsocket_openssl11_symbols_p.h
@@ -130,6 +130,10 @@ const char *q_OpenSSL_version(int type);
unsigned long q_SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *session);
unsigned long q_SSL_set_options(SSL *s, unsigned long op);
+#ifdef TLS1_3_VERSION
+int q_SSL_CTX_set_ciphersuites(SSL_CTX *ctx, const char *str);
+#endif
+
#if QT_CONFIG(dtls)
// Functions and types required for DTLS support:
extern "C"
diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
index 5482440b98..781b3d6640 100644
--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
+++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
@@ -161,6 +161,7 @@ DEFINEFUNC(void, OPENSSL_sk_free, OPENSSL_STACK *a, a, return, DUMMYARG)
DEFINEFUNC2(void *, OPENSSL_sk_value, OPENSSL_STACK *a, a, int b, b, return nullptr, return)
DEFINEFUNC(int, SSL_session_reused, SSL *a, a, return 0, return)
DEFINEFUNC2(unsigned long, SSL_CTX_set_options, SSL_CTX *ctx, ctx, unsigned long op, op, return 0, return)
+DEFINEFUNC2(int, SSL_CTX_set_ciphersuites, SSL_CTX *ctx, ctx, const char *str, str, return 0, return)
DEFINEFUNC3(size_t, SSL_get_client_random, SSL *a, a, unsigned char *out, out, size_t outlen, outlen, return 0, return)
DEFINEFUNC3(size_t, SSL_SESSION_get_master_key, const SSL_SESSION *ses, ses, unsigned char *out, out, size_t outlen, outlen, return 0, return)
DEFINEFUNC6(int, CRYPTO_get_ex_new_index, int class_index, class_index, long argl, argl, void *argp, argp, CRYPTO_EX_new *new_func, new_func, CRYPTO_EX_dup *dup_func, dup_func, CRYPTO_EX_free *free_func, free_func, return -1, return)
@@ -966,6 +967,9 @@ bool q_resolveOpenSslSymbols()
RESOLVEFUNC(OPENSSL_sk_value)
RESOLVEFUNC(DH_get0_pqg)
RESOLVEFUNC(SSL_CTX_set_options)
+#ifdef TLS1_3_VERSION
+ RESOLVEFUNC(SSL_CTX_set_ciphersuites)
+#endif // TLS 1.3 or OpenSSL > 1.1.1
RESOLVEFUNC(SSL_get_client_random)
RESOLVEFUNC(SSL_SESSION_get_master_key)
RESOLVEFUNC(SSL_session_reused)
diff --git a/src/network/ssl/qsslsocket_winrt.cpp b/src/network/ssl/qsslsocket_winrt.cpp
index e72edcbc52..cc69b9ac96 100644
--- a/src/network/ssl/qsslsocket_winrt.cpp
+++ b/src/network/ssl/qsslsocket_winrt.cpp
@@ -251,6 +251,8 @@ void QSslSocketBackendPrivate::startClientEncryption()
case QSsl::TlsV1_0OrLater:
case QSsl::TlsV1_1OrLater:
case QSsl::TlsV1_2OrLater:
+ case QSsl::TlsV1_3:
+ case QSsl::TlsV1_3OrLater:
// TlsV1_0OrLater, TlsV1_1OrLater and TlsV1_2OrLater are disabled on WinRT
// because there is no good way to map them to the native API.
setErrorAndEmit(QAbstractSocket::SslInvalidUserDataError,
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 666cc19bbe..1909e7492f 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -5202,25 +5202,6 @@ void QGLWidgetPrivate::cleanupColormaps()
{
}
-Q_GLOBAL_STATIC(QString, qt_gl_lib_name)
-
-void qt_set_gl_library_name(const QString& name)
-{
- qt_gl_lib_name()->operator=(name);
-}
-
-const QString qt_gl_library_name()
-{
- if (qt_gl_lib_name()->isNull()) {
-# if defined(QT_OPENGL_ES_2)
- return QLatin1String("GLESv2");
-# else
- return QLatin1String("GL");
-# endif
- }
- return *qt_gl_lib_name();
-}
-
void QGLContextGroup::addShare(const QGLContext *context, const QGLContext *share) {
Q_ASSERT(context && share);
if (context->d_ptr->group == share->d_ptr->group)
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index 5ac28ce798..3718ebdda6 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -50,7 +50,9 @@
#include "qcoretextfontdatabase_p.h"
#include "qfontengine_coretext_p.h"
+#if QT_CONFIG(settings)
#include <QtCore/QSettings>
+#endif
#include <QtCore/QtEndian>
#ifndef QT_NO_FREETYPE
#include <QtFontDatabaseSupport/private/qfontengine_ft_p.h>
@@ -116,21 +118,25 @@ QCoreTextFontDatabase::QCoreTextFontDatabase()
: m_hasPopulatedAliases(false)
{
#ifdef Q_OS_MACX
- QSettings appleSettings(QLatin1String("apple.com"));
- QVariant appleValue = appleSettings.value(QLatin1String("AppleAntiAliasingThreshold"));
- if (appleValue.isValid())
- QCoreTextFontEngine::antialiasingThreshold = appleValue.toInt();
-
/*
font_smoothing = 0 means no smoothing, while 1-3 means subpixel
antialiasing with different hinting styles (but we don't care about the
exact value, only if subpixel rendering is available or not)
*/
int font_smoothing = 0;
+
+#if QT_CONFIG(settings)
+ QSettings appleSettings(QLatin1String("apple.com"));
+ QVariant appleValue = appleSettings.value(QLatin1String("AppleAntiAliasingThreshold"));
+ if (appleValue.isValid())
+ QCoreTextFontEngine::antialiasingThreshold = appleValue.toInt();
+
appleValue = appleSettings.value(QLatin1String("AppleFontSmoothing"));
if (appleValue.isValid()) {
font_smoothing = appleValue.toInt();
- } else {
+ } else
+#endif // settings
+ {
// non-Apple displays do not provide enough information about subpixel rendering so
// draw text with cocoa and compare pixel colors to see if subpixel rendering is enabled
int w = 10;
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index 6543759a3d..0430e79bac 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -41,7 +41,9 @@
#include <qpa/qplatformfontdatabase.h>
#include <QtCore/qendian.h>
+#if QT_CONFIG(settings)
#include <QtCore/qsettings.h>
+#endif
#include <QtCore/qoperatingsystemversion.h>
#include <private/qimage_p.h>
diff --git a/src/platformsupport/services/genericunix/qgenericunixservices.cpp b/src/platformsupport/services/genericunix/qgenericunixservices.cpp
index 67884cef92..7fff50b2a1 100644
--- a/src/platformsupport/services/genericunix/qgenericunixservices.cpp
+++ b/src/platformsupport/services/genericunix/qgenericunixservices.cpp
@@ -45,7 +45,9 @@
#if QT_CONFIG(process)
# include <QtCore/QProcess>
#endif
+#if QT_CONFIG(settings)
#include <QtCore/QSettings>
+#endif
#include <QtCore/QStandardPaths>
#include <QtCore/QUrl>
@@ -93,7 +95,7 @@ static inline QByteArray detectDesktopEnvironment()
// This can be a path in /usr/share/xsessions
int slash = desktopSession.lastIndexOf('/');
if (slash != -1) {
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
QSettings desktopFile(QFile::decodeName(desktopSession + ".desktop"), QSettings::IniFormat);
desktopFile.beginGroup(QStringLiteral("Desktop Entry"));
QByteArray desktopName = desktopFile.value(QStringLiteral("DesktopNames")).toByteArray();
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
index 43d49cbbc8..1003812767 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
@@ -53,7 +53,9 @@
#include <QtCore/QMimeDatabase>
#endif
#include <QtCore/QLoggingCategory>
+#if QT_CONFIG(settings)
#include <QtCore/QSettings>
+#endif
#include <QtCore/QVariant>
#include <QtCore/QStandardPaths>
#include <QtCore/QStringList>
@@ -261,7 +263,7 @@ static QIcon xdgFileIcon(const QFileInfo &fileInfo)
}
#endif
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
class QKdeThemePrivate : public QPlatformThemePrivate
{
public:
@@ -688,7 +690,7 @@ QPlatformSystemTrayIcon *QKdeTheme::createPlatformSystemTrayIcon() const
}
#endif
-#endif // QT_NO_SETTINGS
+#endif // settings
/*!
\class QGnomeTheme
@@ -834,7 +836,7 @@ QPlatformTheme *QGenericUnixTheme::createUnixTheme(const QString &name)
{
if (name == QLatin1String(QGenericUnixTheme::name))
return new QGenericUnixTheme;
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
if (name == QLatin1String(QKdeTheme::name))
if (QPlatformTheme *kdeTheme = QKdeTheme::createKdeTheme())
return kdeTheme;
@@ -859,7 +861,7 @@ QStringList QGenericUnixTheme::themeNames()
const QList<QByteArray> desktopNames = desktopEnvironment.split(':');
for (const QByteArray &desktopName : desktopNames) {
if (desktopEnvironment == "KDE") {
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
result.push_back(QLatin1String(QKdeTheme::name));
#endif
} else if (gtkBasedEnvironments.contains(desktopName)) {
diff --git a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
index 865a624694..a5963b79ea 100644
--- a/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
+++ b/src/platformsupport/themes/genericunix/qgenericunixthemes_p.h
@@ -96,7 +96,7 @@ public:
static const char *name;
};
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
class QKdeThemePrivate;
class QKdeTheme : public QPlatformTheme
@@ -123,7 +123,7 @@ public:
static const char *name;
};
-#endif // QT_NO_SETTINGS
+#endif // settings
class QGnomeThemePrivate;
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm
index 936fecf8de..1bd1029863 100644
--- a/src/plugins/platforms/cocoa/qcocoaintegration.mm
+++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm
@@ -340,12 +340,17 @@ QCocoaScreen *QCocoaIntegration::screenForNSScreen(NSScreen *nsScreen)
bool QCocoaIntegration::hasCapability(QPlatformIntegration::Capability cap) const
{
switch (cap) {
- case ThreadedPixmaps:
#ifndef QT_NO_OPENGL
- case OpenGL:
case ThreadedOpenGL:
+ // AppKit expects rendering to happen on the main thread, and we can
+ // easily end up in situations where rendering on secondary threads
+ // will result in visual artifacts, bugs, or even deadlocks, when
+ // building with SDK 10.14 or higher which enbles view layer-backing.
+ return QMacVersion::buildSDK() < QOperatingSystemVersion(QOperatingSystemVersion::MacOSMojave);
+ case OpenGL:
case BufferQueueingOpenGL:
#endif
+ case ThreadedPixmaps:
case WindowMasks:
case MultipleWindows:
case ForeignWindows:
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 3143abf182..8515190bd7 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -1549,7 +1549,9 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)
QWindowSystemInterface::SynchronousDelivery>(window(), targetScreen);
}
- nsWindow.delegate = [[QNSWindowDelegate alloc] initWithQCocoaWindow:this];
+ static QSharedPointer<QNSWindowDelegate> sharedDelegate([[QNSWindowDelegate alloc] init],
+ [](QNSWindowDelegate *delegate) { [delegate release]; });
+ nsWindow.delegate = sharedDelegate.get();
// Prevent Cocoa from releasing the window on close. Qt
// handles the close event asynchronously and we want to
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 9bd53ed334..03c5001270 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -71,7 +71,7 @@
@end
@interface QT_MANGLE_NAMESPACE(QNSView) (Drawing) <CALayerDelegate>
-- (BOOL)wantsLayerHelper;
+- (void)initDrawing;
@end
@interface QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) : NSObject
@@ -152,19 +152,8 @@
self.focusRingType = NSFocusRingTypeNone;
self.cursor = nil;
- self.wantsLayer = [self wantsLayerHelper];
-
- // Enable high-DPI OpenGL for retina displays. Enabling has the side
- // effect that Cocoa will start calling glViewport(0, 0, width, height),
- // overriding any glViewport calls in application code. This is usually not a
- // problem, except if the application wants to have a "custom" viewport.
- // (like the hellogl example)
- if (m_platformWindow->window()->supportsOpenGL()) {
- self.wantsBestResolutionOpenGLSurface = qt_mac_resolveOption(YES, m_platformWindow->window(),
- "_q_mac_wantsBestResolutionOpenGLSurface", "QT_MAC_WANTS_BEST_RESOLUTION_OPENGL_SURFACE");
- // See also QCocoaGLContext::makeCurrent for software renderer workarounds.
- }
+ [self initDrawing];
[self registerDragTypes];
[[NSNotificationCenter defaultCenter] addObserver:self
@@ -177,6 +166,8 @@
- (void)dealloc
{
+ qCDebug(lcQpaWindow) << "Deallocating" << self;
+
if (m_trackingArea) {
[self removeTrackingArea:m_trackingArea];
[m_trackingArea release];
diff --git a/src/plugins/platforms/cocoa/qnsview_drawing.mm b/src/plugins/platforms/cocoa/qnsview_drawing.mm
index 4f9d17504d..e9af90a45c 100644
--- a/src/plugins/platforms/cocoa/qnsview_drawing.mm
+++ b/src/plugins/platforms/cocoa/qnsview_drawing.mm
@@ -41,6 +41,24 @@
@implementation QT_MANGLE_NAMESPACE(QNSView) (Drawing)
+- (void)initDrawing
+{
+ self.wantsLayer = [self layerExplicitlyRequested]
+ || [self shouldUseMetalLayer]
+ || [self layerEnabledByMacOS];
+
+ // Enable high-DPI OpenGL for retina displays. Enabling has the side
+ // effect that Cocoa will start calling glViewport(0, 0, width, height),
+ // overriding any glViewport calls in application code. This is usually not a
+ // problem, except if the application wants to have a "custom" viewport.
+ // (like the hellogl example)
+ if (m_platformWindow->window()->supportsOpenGL()) {
+ self.wantsBestResolutionOpenGLSurface = qt_mac_resolveOption(YES, m_platformWindow->window(),
+ "_q_mac_wantsBestResolutionOpenGLSurface", "QT_MAC_WANTS_BEST_RESOLUTION_OPENGL_SURFACE");
+ // See also QCocoaGLContext::makeCurrent for software renderer workarounds.
+ }
+}
+
- (BOOL)isOpaque
{
if (!m_platformWindow)
@@ -71,23 +89,38 @@
m_platformWindow->handleExposeEvent(exposedRegion);
}
-- (BOOL)shouldUseMetalLayer
+- (BOOL)layerEnabledByMacOS
{
- // MetalSurface needs a layer, and so does VulkanSurface (via MoltenVK)
- QSurface::SurfaceType surfaceType = m_platformWindow->window()->surfaceType();
- return surfaceType == QWindow::MetalSurface || surfaceType == QWindow::VulkanSurface;
+ // AppKit has its own logic for this, but if we rely on that, our layers are created
+ // by AppKit at a point where we've already set up other parts of the platform plugin
+ // based on the presence of layers or not. Once we've rewritten these parts to support
+ // dynamically picking up layer enablement we can let AppKit do its thing.
+ return QMacVersion::buildSDK() >= QOperatingSystemVersion::MacOSMojave
+ && QMacVersion::currentRuntime() >= QOperatingSystemVersion::MacOSMojave;
}
-- (BOOL)wantsLayerHelper
+- (BOOL)layerExplicitlyRequested
{
- Q_ASSERT(m_platformWindow);
+ static bool wantsLayer = [&]() {
+ int wantsLayer = qt_mac_resolveOption(-1, m_platformWindow->window(),
+ "_q_mac_wantsLayer", "QT_MAC_WANTS_LAYER");
- bool wantsLayer = qt_mac_resolveOption(true, m_platformWindow->window(),
- "_q_mac_wantsLayer", "QT_MAC_WANTS_LAYER");
+ if (wantsLayer != -1 && [self layerEnabledByMacOS]) {
+ qCWarning(lcQpaDrawing) << "Layer-backing can not be explicitly controlled on 10.14 when built against the 10.14 SDK";
+ return true;
+ }
- bool layerForSurfaceType = [self shouldUseMetalLayer];
+ return wantsLayer == 1;
+ }();
- return wantsLayer || layerForSurfaceType;
+ return wantsLayer;
+}
+
+- (BOOL)shouldUseMetalLayer
+{
+ // MetalSurface needs a layer, and so does VulkanSurface (via MoltenVK)
+ QSurface::SurfaceType surfaceType = m_platformWindow->window()->surfaceType();
+ return surfaceType == QWindow::MetalSurface || surfaceType == QWindow::VulkanSurface;
}
- (CALayer *)makeBackingLayer
@@ -115,6 +148,14 @@
return [super makeBackingLayer];
}
+- (void)setLayer:(CALayer *)layer
+{
+ qCDebug(lcQpaDrawing) << "Making" << self << "layer-backed with" << layer
+ << "due to being" << ([self layerExplicitlyRequested] ? "explicitly requested"
+ : [self shouldUseMetalLayer] ? "needed by surface type" : "enabled by macOS");
+ [super setLayer:layer];
+}
+
- (NSViewLayerContentsRedrawPolicy)layerContentsRedrawPolicy
{
// We need to set this explicitly since the super implementation
diff --git a/src/plugins/platforms/cocoa/qnswindow.mm b/src/plugins/platforms/cocoa/qnswindow.mm
index 1b9dd95cbc..c17ad47aba 100644
--- a/src/plugins/platforms/cocoa/qnswindow.mm
+++ b/src/plugins/platforms/cocoa/qnswindow.mm
@@ -238,11 +238,7 @@ static bool isMouseEvent(NSEvent *ev)
- (void)closeAndRelease
{
- qCDebug(lcQpaWindow) << "closeAndRelease" << self;
-
- [self.delegate release];
- self.delegate = nil;
-
+ qCDebug(lcQpaWindow) << "Closing and releasing" << self;
[self close];
[self release];
}
@@ -251,7 +247,9 @@ static bool isMouseEvent(NSEvent *ev)
#pragma clang diagnostic ignored "-Wobjc-missing-super-calls"
- (void)dealloc
{
- qCDebug(lcQpaWindow) << "dealloc" << self;
+ qCDebug(lcQpaWindow) << "Deallocating" << self;
+ self.delegate = nil;
+
qt_objcDynamicSuper();
}
#pragma clang diagnostic pop
diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.h b/src/plugins/platforms/cocoa/qnswindowdelegate.h
index e71afcbb2a..be870deb3a 100644
--- a/src/plugins/platforms/cocoa/qnswindowdelegate.h
+++ b/src/plugins/platforms/cocoa/qnswindowdelegate.h
@@ -48,9 +48,6 @@ class QCocoaWindow;
QT_END_NAMESPACE
@interface QT_MANGLE_NAMESPACE(QNSWindowDelegate) : NSObject <NSWindowDelegate>
-
-- (instancetype)initWithQCocoaWindow:(QT_PREPEND_NAMESPACE(QCocoaWindow) *)cocoaWindow;
-
@end
QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSWindowDelegate);
diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
index 97309ea990..14f1ca0114 100644
--- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm
+++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm
@@ -49,23 +49,17 @@
static QRegExp whitespaceRegex = QRegExp(QStringLiteral("\\s*"));
-@implementation QNSWindowDelegate {
- QCocoaWindow *m_cocoaWindow;
-}
-
-- (instancetype)initWithQCocoaWindow:(QCocoaWindow *)cocoaWindow
+static QCocoaWindow *toPlatformWindow(NSWindow *window)
{
- if ((self = [self init]))
- m_cocoaWindow = cocoaWindow;
- return self;
+ return qnsview_cast(window.contentView).platformWindow;
}
-- (BOOL)windowShouldClose:(NSNotification *)notification
+@implementation QNSWindowDelegate
+
+- (BOOL)windowShouldClose:(NSWindow *)window
{
- Q_UNUSED(notification);
- if (m_cocoaWindow) {
- return m_cocoaWindow->windowShouldClose();
- }
+ if (QCocoaWindow *platformWindow = toPlatformWindow(window))
+ return platformWindow->windowShouldClose();
return YES;
}
@@ -79,14 +73,16 @@ static QRegExp whitespaceRegex = QRegExp(QStringLiteral("\\s*"));
- (NSRect)windowWillUseStandardFrame:(NSWindow *)window defaultFrame:(NSRect)proposedFrame
{
Q_UNUSED(proposedFrame);
- Q_ASSERT(window == m_cocoaWindow->nativeWindow());
- const QWindow *w = m_cocoaWindow->window();
+
+ QCocoaWindow *platformWindow = toPlatformWindow(window);
+ Q_ASSERT(platformWindow);
+ const QWindow *w = platformWindow->window();
// maximumSize() refers to the client size, but AppKit expects the full frame size
QSizeF maximumSize = w->maximumSize() + QSize(0, w->frameMargins().top());
// The window should never be larger than the current screen geometry
- const QRectF screenGeometry = m_cocoaWindow->screen()->geometry();
+ const QRectF screenGeometry = platformWindow->screen()->geometry();
maximumSize = maximumSize.boundedTo(screenGeometry.size());
// Use the current frame position for the initial maximized frame,
@@ -113,6 +109,8 @@ static QRegExp whitespaceRegex = QRegExp(QStringLiteral("\\s*"));
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- (NSSize)windowWillResize:(NSWindow *)window toSize:(NSSize)frameSize
{
+ Q_ASSERT(toPlatformWindow(window));
+
qCDebug(lcQpaWindow) << window << "will resize to" << QSizeF::fromCGSize(frameSize)
<< "- disabling screen updates temporarily";
@@ -131,6 +129,8 @@ static QRegExp whitespaceRegex = QRegExp(QStringLiteral("\\s*"));
- (void)windowDidResize:(NSNotification *)notification
{
NSWindow *window = notification.object;
+ Q_ASSERT(toPlatformWindow(window));
+
qCDebug(lcQpaWindow) << window << "was resized - re-enabling screen updates";
NSEnableScreenUpdates();
}
@@ -138,23 +138,27 @@ static QRegExp whitespaceRegex = QRegExp(QStringLiteral("\\s*"));
- (BOOL)window:(NSWindow *)window shouldPopUpDocumentPathMenu:(NSMenu *)menu
{
- Q_UNUSED(window);
Q_UNUSED(menu);
+ QCocoaWindow *platformWindow = toPlatformWindow(window);
+ Q_ASSERT(platformWindow);
+
// Only pop up document path if the filename is non-empty. We allow whitespace, to
// allow faking a window icon by setting the file path to a single space character.
- return !whitespaceRegex.exactMatch(m_cocoaWindow->window()->filePath());
+ return !whitespaceRegex.exactMatch(platformWindow->window()->filePath());
}
- (BOOL)window:(NSWindow *)window shouldDragDocumentWithEvent:(NSEvent *)event from:(NSPoint)dragImageLocation withPasteboard:(NSPasteboard *)pasteboard
{
- Q_UNUSED(window);
Q_UNUSED(event);
Q_UNUSED(dragImageLocation);
Q_UNUSED(pasteboard);
+ QCocoaWindow *platformWindow = toPlatformWindow(window);
+ Q_ASSERT(platformWindow);
+
// Only allow drag if the filename is non-empty. We allow whitespace, to
// allow faking a window icon by setting the file path to a single space.
- return !whitespaceRegex.exactMatch(m_cocoaWindow->window()->filePath());
+ return !whitespaceRegex.exactMatch(platformWindow->window()->filePath());
}
@end
diff --git a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
index 43f2e31a49..72420199e3 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsintegration.cpp
@@ -198,6 +198,7 @@ QPlatformBackingStore *QEglFSIntegration::createPlatformBackingStore(QWindow *wi
static_cast<QEglFSWindow *>(window->handle())->setBackingStore(bs);
return bs;
#else
+ Q_UNUSED(window);
return nullptr;
#endif
}
diff --git a/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp
index d5c22b3d37..285dbd93d3 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp
@@ -183,6 +183,8 @@ void QEglFSScreen::handleCursorMove(const QPoint &pos)
if (enter && leave)
QWindowSystemInterface::handleEnterLeaveEvent(enter, leave, enter->mapFromGlobal(pos), pos);
+#else
+ Q_UNUSED(pos);
#endif
}
@@ -231,7 +233,13 @@ QPixmap QEglFSScreen::grabWindow(WId wid, int x, int y, int width, int height) c
return QPixmap::fromImage(img).copy(rect);
}
}
-#endif // QT_NO_OPENGL
+#else // QT_NO_OPENGL
+ Q_UNUSED(wid);
+ Q_UNUSED(x);
+ Q_UNUSED(y);
+ Q_UNUSED(width);
+ Q_UNUSED(height);
+#endif
return QPixmap();
}
diff --git a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
index 5d31af53d5..da58441d67 100644
--- a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
+++ b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp
@@ -132,6 +132,7 @@ QPlatformBackingStore *QMinimalEglIntegration::createPlatformBackingStore(QWindo
#ifndef QT_NO_OPENGL
return new QMinimalEglBackingStore(window);
#else
+ Q_UNUSED(window);
return nullptr;
#endif
}
diff --git a/src/plugins/platforms/windows/qwindowsinputcontext.cpp b/src/plugins/platforms/windows/qwindowsinputcontext.cpp
index 30da0da1de..d1e99c037b 100644
--- a/src/plugins/platforms/windows/qwindowsinputcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsinputcontext.cpp
@@ -242,7 +242,18 @@ QRectF QWindowsInputContext::keyboardRect() const
bool QWindowsInputContext::isInputPanelVisible() const
{
HWND hwnd = getVirtualKeyboardWindowHandle();
- return hwnd && ::IsWindowEnabled(hwnd) && ::IsWindowVisible(hwnd);
+ if (hwnd && ::IsWindowEnabled(hwnd) && ::IsWindowVisible(hwnd))
+ return true;
+ // check if the Input Method Editor is open
+ if (inputMethodAccepted()) {
+ if (QWindow *window = QGuiApplication::focusWindow()) {
+ if (QWindowsWindow *platformWindow = QWindowsWindow::windowsWindowOf(window)) {
+ if (HIMC himc = ImmGetContext(platformWindow->handle()))
+ return ImmGetOpenStatus(himc);
+ }
+ }
+ }
+ return false;
}
void QWindowsInputContext::showInputPanel()
diff --git a/src/plugins/platforms/windows/qwindowspointerhandler.cpp b/src/plugins/platforms/windows/qwindowspointerhandler.cpp
index 2b6c696979..0bac382a90 100644
--- a/src/plugins/platforms/windows/qwindowspointerhandler.cpp
+++ b/src/plugins/platforms/windows/qwindowspointerhandler.cpp
@@ -336,6 +336,38 @@ static void getMouseEventInfo(UINT message, POINTER_BUTTON_CHANGE_TYPE changeTyp
*mouseButton = buttonMapping.value(changeType, Qt::NoButton);
}
+static Qt::MouseButtons mouseButtonsFromPointerFlags(POINTER_FLAGS pointerFlags)
+{
+ Qt::MouseButtons result = Qt::NoButton;
+ if (pointerFlags & POINTER_FLAG_FIRSTBUTTON)
+ result |= Qt::LeftButton;
+ if (pointerFlags & POINTER_FLAG_SECONDBUTTON)
+ result |= Qt::RightButton;
+ if (pointerFlags & POINTER_FLAG_THIRDBUTTON)
+ result |= Qt::MiddleButton;
+ if (pointerFlags & POINTER_FLAG_FOURTHBUTTON)
+ result |= Qt::XButton1;
+ if (pointerFlags & POINTER_FLAG_FIFTHBUTTON)
+ result |= Qt::XButton2;
+ return result;
+}
+
+static Qt::MouseButtons mouseButtonsFromKeyState(WPARAM keyState)
+{
+ Qt::MouseButtons result = Qt::NoButton;
+ if (keyState & MK_LBUTTON)
+ result |= Qt::LeftButton;
+ if (keyState & MK_RBUTTON)
+ result |= Qt::RightButton;
+ if (keyState & MK_MBUTTON)
+ result |= Qt::MiddleButton;
+ if (keyState & MK_XBUTTON1)
+ result |= Qt::XButton1;
+ if (keyState & MK_XBUTTON2)
+ result |= Qt::XButton2;
+ return result;
+}
+
static QWindow *getWindowUnderPointer(QWindow *window, QPoint globalPos)
{
QWindow *currentWindowUnderPointer = QWindowsScreen::windowAt(globalPos, CWP_SKIPINVISIBLE | CWP_SKIPTRANSPARENT);
@@ -405,23 +437,6 @@ QTouchDevice *QWindowsPointerHandler::ensureTouchDevice()
return m_touchDevice;
}
-Qt::MouseButtons QWindowsPointerHandler::queryMouseButtons()
-{
- Qt::MouseButtons result = 0;
- const bool mouseSwapped = GetSystemMetrics(SM_SWAPBUTTON);
- if (GetAsyncKeyState(VK_LBUTTON) < 0)
- result |= mouseSwapped ? Qt::RightButton: Qt::LeftButton;
- if (GetAsyncKeyState(VK_RBUTTON) < 0)
- result |= mouseSwapped ? Qt::LeftButton : Qt::RightButton;
- if (GetAsyncKeyState(VK_MBUTTON) < 0)
- result |= Qt::MidButton;
- if (GetAsyncKeyState(VK_XBUTTON1) < 0)
- result |= Qt::XButton1;
- if (GetAsyncKeyState(VK_XBUTTON2) < 0)
- result |= Qt::XButton2;
- return result;
-}
-
bool QWindowsPointerHandler::translateMouseTouchPadEvent(QWindow *window, HWND hwnd,
QtWindows::WindowsEventType et,
MSG msg, PVOID vPointerInfo)
@@ -430,7 +445,7 @@ bool QWindowsPointerHandler::translateMouseTouchPadEvent(QWindow *window, HWND h
const QPoint globalPos = QPoint(pointerInfo->ptPixelLocation.x, pointerInfo->ptPixelLocation.y);
const QPoint localPos = QWindowsGeometryHint::mapFromGlobal(hwnd, globalPos);
const Qt::KeyboardModifiers keyModifiers = QWindowsKeyMapper::queryKeyboardModifiers();
- const Qt::MouseButtons mouseButtons = queryMouseButtons();
+ const Qt::MouseButtons mouseButtons = mouseButtonsFromPointerFlags(pointerInfo->pointerFlags);
QWindow *currentWindowUnderPointer = getWindowUnderPointer(window, globalPos);
QWindowsWindow *platformWindow = static_cast<QWindowsWindow *>(window->handle());
@@ -452,6 +467,11 @@ bool QWindowsPointerHandler::translateMouseTouchPadEvent(QWindow *window, HWND h
keyModifiers, Qt::MouseEventNotSynthesized);
return false; // To allow window dragging, etc.
} else {
+ if (eventType == QEvent::MouseButtonPress) {
+ // Implement "Click to focus" for native child windows (unless it is a native widget window).
+ if (!window->isTopLevel() && !window->inherits("QWidgetWindow") && QGuiApplication::focusWindow() != window)
+ window->requestActivate();
+ }
if (currentWindowUnderPointer != m_windowUnderPointer) {
if (m_windowUnderPointer && m_windowUnderPointer == m_currentWindow) {
QWindowSystemInterface::handleLeaveEvent(m_windowUnderPointer);
@@ -609,6 +629,7 @@ bool QWindowsPointerHandler::translateTouchEvent(QWindow *window, HWND hwnd,
bool QWindowsPointerHandler::translatePenEvent(QWindow *window, HWND hwnd, QtWindows::WindowsEventType et,
MSG msg, PVOID vPenInfo)
{
+#if QT_CONFIG(tabletevent)
if (et & QtWindows::NonClientEventFlag)
return false; // Let DefWindowProc() handle Non Client messages.
@@ -703,6 +724,14 @@ bool QWindowsPointerHandler::translatePenEvent(QWindow *window, HWND hwnd, QtWin
}
}
return true;
+#else
+ Q_UNUSED(window);
+ Q_UNUSED(hwnd);
+ Q_UNUSED(et);
+ Q_UNUSED(msg);
+ Q_UNUSED(vPenInfo);
+ return false;
+#endif
}
// Process old-style mouse messages here.
@@ -788,7 +817,7 @@ bool QWindowsPointerHandler::translateMouseEvent(QWindow *window, HWND hwnd, QtW
m_windowUnderPointer = currentWindowUnderPointer;
}
- const Qt::MouseButtons mouseButtons = queryMouseButtons();
+ const Qt::MouseButtons mouseButtons = mouseButtonsFromKeyState(msg.wParam);
if (!discardEvent)
QWindowSystemInterface::handleMouseEvent(window, localPos, globalPos, mouseButtons, Qt::NoButton, QEvent::MouseMove,
diff --git a/src/plugins/platforms/windows/qwindowspointerhandler.h b/src/plugins/platforms/windows/qwindowspointerhandler.h
index c4d0e0ce4a..3861ebf919 100644
--- a/src/plugins/platforms/windows/qwindowspointerhandler.h
+++ b/src/plugins/platforms/windows/qwindowspointerhandler.h
@@ -61,7 +61,6 @@ public:
bool translateMouseEvent(QWindow *window, HWND hwnd, QtWindows::WindowsEventType et, MSG msg, LRESULT *result);
QTouchDevice *touchDevice() const { return m_touchDevice; }
QTouchDevice *ensureTouchDevice();
- Qt::MouseButtons queryMouseButtons();
QWindow *windowUnderMouse() const { return m_windowUnderPointer.data(); }
void clearWindowUnderMouse() { m_windowUnderPointer = nullptr; }
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
index 6316aa2d99..2ffb5d2629 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp
@@ -649,8 +649,6 @@ QFunctionPointer QGLXContext::getProcAddress(const char *procName)
#endif
{
#if QT_CONFIG(library)
- extern const QString qt_gl_library_name();
-// QLibrary lib(qt_gl_library_name());
QLibrary lib(QLatin1String("GL"));
if (!lib.load())
lib.setFileNameAndVersion(QLatin1String("GL"), 1);
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index 1fd3420899..b84448d5e2 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -3229,7 +3229,13 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
break;
case PE_IndicatorTabClose: {
// Make close button visible only on the hovered tab.
- if (QTabBar *tabBar = qobject_cast<QTabBar*>(w->parentWidget())) {
+ QTabBar *tabBar = qobject_cast<QTabBar*>(w->parentWidget());
+ if (!tabBar) {
+ // QStyleSheetStyle instead of CloseButton (which has
+ // a QTabBar as a parent widget) uses the QTabBar itself:
+ tabBar = qobject_cast<QTabBar *>(const_cast<QWidget*>(w));
+ }
+ if (tabBar) {
const bool documentMode = tabBar->documentMode();
const QTabBarPrivate *tabBarPrivate = static_cast<QTabBarPrivate *>(QObjectPrivate::get(tabBar));
const int hoveredTabIndex = tabBarPrivate->hoveredTabIndex();
diff --git a/src/testlib/qtestcase.h b/src/testlib/qtestcase.h
index 39364df8ef..5d566b835e 100644
--- a/src/testlib/qtestcase.h
+++ b/src/testlib/qtestcase.h
@@ -151,7 +151,7 @@ do {\
// Ideally we'd use qWaitFor instead of QTRY_LOOP_IMPL, but due
// to a compiler bug on MSVC < 2017 we can't (see QTBUG-59096)
#define QTRY_IMPL(expr, timeout)\
- const int qt_test_step = 50; \
+ const int qt_test_step = timeout < 350 ? timeout / 7 + 1 : 50; \
const int qt_test_timeoutValue = timeout; \
QTRY_LOOP_IMPL((expr), qt_test_timeoutValue, qt_test_step); \
QTRY_TIMEOUT_DEBUG_IMPL((expr), qt_test_timeoutValue, qt_test_step)\
diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp
index 3b78d2487f..587ae21e4f 100644
--- a/src/tools/androiddeployqt/main.cpp
+++ b/src/tools/androiddeployqt/main.cpp
@@ -157,6 +157,7 @@ struct Options
QString toolchainVersion;
QString toolchainPrefix;
QString toolPrefix;
+ bool useLLVM = false;
QString ndkHost;
// Package information
@@ -707,7 +708,7 @@ bool readInputFile(Options *options)
return false;
}
- options->sdkPath = sdkPath.toString();
+ options->sdkPath = QDir::fromNativeSeparators(sdkPath.toString());
if (options->androidPlatform.isEmpty()) {
options->androidPlatform = detectLatestAndroidPlatform(options->sdkPath);
@@ -809,6 +810,11 @@ bool readInputFile(Options *options)
}
{
+ const QJsonValue value = jsonObject.value(QStringLiteral("useLLVM"));
+ options->useLLVM = value.toBool(false);
+ }
+
+ {
const QJsonValue toolchainPrefix = jsonObject.value(QStringLiteral("toolchain-prefix"));
if (toolchainPrefix.isUndefined()) {
fprintf(stderr, "No toolchain prefix defined in json file.\n");
@@ -827,7 +833,7 @@ bool readInputFile(Options *options)
}
}
- {
+ if (!options->useLLVM) {
const QJsonValue toolchainVersion = jsonObject.value(QStringLiteral("toolchain-version"));
if (toolchainVersion.isUndefined()) {
fprintf(stderr, "No toolchain version defined in json file.\n");
@@ -863,15 +869,17 @@ bool readInputFile(Options *options)
{
const QJsonValue stdcppPath = jsonObject.value(QStringLiteral("stdcpp-path"));
- if (!stdcppPath.isUndefined()) {
- options->stdCppPath = stdcppPath.toString();
- auto name = QFileInfo(options->stdCppPath).baseName();
- if (!name.startsWith(QLatin1String("lib"))) {
- fprintf(stderr, "Invalid STD C++ library name.\n");
- return false;
- }
- options->stdCppName = name.mid(3);
+ if (stdcppPath.isUndefined()) {
+ fprintf(stderr, "No stdcpp-path defined in json file.\n");
+ return false;
+ }
+ options->stdCppPath = stdcppPath.toString();
+ auto name = QFileInfo(options->stdCppPath).baseName();
+ if (!name.startsWith(QLatin1String("lib"))) {
+ fprintf(stderr, "Invalid STD C++ library name.\n");
+ return false;
}
+ options->stdCppName = name.mid(3);
}
{
@@ -1546,14 +1554,16 @@ QStringList getQtLibsFromElf(const Options &options, const QString &fileName)
{
QString readElf = options.ndkPath
+ QLatin1String("/toolchains/")
- + options.toolchainPrefix
- + QLatin1Char('-')
- + options.toolchainVersion
- + QLatin1String("/prebuilt/")
+ + options.toolchainPrefix;
+
+ if (!options.useLLVM)
+ readElf += QLatin1Char('-') + options.toolchainVersion;
+
+ readElf += QLatin1String("/prebuilt/")
+ options.ndkHost
+ QLatin1String("/bin/")
- + options.toolPrefix
- + QLatin1String("-readelf");
+ + options.toolPrefix +
+ (options.useLLVM ? QLatin1String("-readobj") : QLatin1String("-readelf"));
#if defined(Q_OS_WIN32)
readElf += QLatin1String(".exe");
#endif
@@ -1563,27 +1573,40 @@ QStringList getQtLibsFromElf(const Options &options, const QString &fileName)
return QStringList();
}
- readElf = QString::fromLatin1("%1 -d -W %2").arg(shellQuote(readElf)).arg(shellQuote(fileName));
+ if (options.useLLVM)
+ readElf = QString::fromLatin1("%1 -needed-libs %2").arg(shellQuote(readElf), shellQuote(fileName));
+ else
+ readElf = QString::fromLatin1("%1 -d -W %2").arg(shellQuote(readElf), shellQuote(fileName));
FILE *readElfCommand = openProcess(readElf);
- if (readElfCommand == 0) {
+ if (!readElfCommand) {
fprintf(stderr, "Cannot execute command %s", qPrintable(readElf));
return QStringList();
}
QStringList ret;
+ bool readLibs = false;
char buffer[512];
while (fgets(buffer, sizeof(buffer), readElfCommand) != 0) {
QByteArray line = QByteArray::fromRawData(buffer, qstrlen(buffer));
- if (line.contains("(NEEDED)") && line.contains("Shared library:") ) {
- const int pos = line.lastIndexOf('[') + 1;
- QString libraryName = QLatin1String("lib/") + QString::fromLatin1(line.mid(pos, line.length() - pos - 2));
- if (QFile::exists(absoluteFilePath(&options, libraryName))) {
- ret += libraryName;
+ QString library;
+ if (options.useLLVM) {
+ line = line.trimmed();
+ if (!readLibs) {
+ readLibs = line.startsWith("NeededLibraries");
+ continue;
}
-
+ if (!line.startsWith("lib"))
+ continue;
+ library = QString::fromLatin1(line);
+ } else if (line.contains("(NEEDED)") && line.contains("Shared library:")) {
+ const int pos = line.lastIndexOf('[') + 1;
+ library = QString::fromLatin1(line.mid(pos, line.length() - pos - 2));
}
+ QString libraryName = QLatin1String("lib/") + library;
+ if (QFile::exists(absoluteFilePath(&options, libraryName)))
+ ret += libraryName;
}
pclose(readElfCommand);
@@ -1837,10 +1860,12 @@ bool stripFile(const Options &options, const QString &fileName)
{
QString strip = options.ndkPath
+ QLatin1String("/toolchains/")
- + options.toolchainPrefix
- + QLatin1Char('-')
- + options.toolchainVersion
- + QLatin1String("/prebuilt/")
+ + options.toolchainPrefix;
+
+ if (!options.useLLVM)
+ strip += QLatin1Char('-') + options.toolchainVersion;
+
+ strip += QLatin1String("/prebuilt/")
+ options.ndkHost
+ QLatin1String("/bin/")
+ options.toolPrefix
@@ -1854,7 +1879,10 @@ bool stripFile(const Options &options, const QString &fileName)
return false;
}
- strip = QString::fromLatin1("%1 %2").arg(shellQuote(strip)).arg(shellQuote(fileName));
+ if (options.useLLVM)
+ strip = QString::fromLatin1("%1 -strip-all -strip-all-gnu %2").arg(shellQuote(strip), shellQuote(fileName));
+ else
+ strip = QString::fromLatin1("%1 %2").arg(shellQuote(strip), shellQuote(fileName));
FILE *stripCommand = openProcess(strip);
if (stripCommand == 0) {
@@ -2423,22 +2451,15 @@ bool copyStdCpp(Options *options)
if (options->verbose)
fprintf(stdout, "Copying STL library\n");
- QString filePath = !options->stdCppPath.isEmpty() ? options->stdCppPath
- : options->ndkPath
- + QLatin1String("/sources/cxx-stl/gnu-libstdc++/")
- + options->toolchainVersion
- + QLatin1String("/libs/")
- + options->architecture
- + QLatin1String("/libgnustl_shared.so");
- if (!QFile::exists(filePath)) {
- fprintf(stderr, "STL library does not exist at %s\n", qPrintable(filePath));
+ if (!QFile::exists(options->stdCppPath)) {
+ fprintf(stderr, "STL library does not exist at %s\n", qPrintable(options->stdCppPath));
return false;
}
const QString destinationDirectory = options->outputDirectory
+ QLatin1String("/libs/") + options->architecture;
- if (!copyFileIfNewer(filePath, destinationDirectory + QLatin1String("/lib")
+ if (!copyFileIfNewer(options->stdCppPath, destinationDirectory + QLatin1String("/lib")
+ options->stdCppName + QLatin1String(".so"),
options->verbose)) {
return false;
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index be60ea60b0..93e49466cb 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -57,7 +57,9 @@
#include "qpainter.h"
#include "qpixmap.h"
#include "qpushbutton.h"
+#if QT_CONFIG(settings)
#include "qsettings.h"
+#endif
#include "qsharedpointer.h"
#include "qstyle.h"
#include "qstyleoption.h"
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 5c6c03d3aa..69496dbd29 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -57,7 +57,9 @@
#include <qmessagebox.h>
#endif
#include <stdlib.h>
+#if QT_CONFIG(settings)
#include <qsettings.h>
+#endif
#include <qdebug.h>
#if QT_CONFIG(mimetype)
#include <qmimedatabase.h>
@@ -221,6 +223,9 @@ Q_GLOBAL_STATIC(QUrl, lastVisitedDir)
of QFileDialog that contains the Q_OBJECT macro, or the platform
does not have a native dialog of the type that you require.
+ \note This option must be set before changing dialog properties
+ or showing the dialog.
+
\value ReadOnly Indicates that the model is readonly.
\value HideNameFilterDetails Indicates if the file name filter details are
@@ -383,7 +388,7 @@ QFileDialog::QFileDialog(const QFileDialogArgs &args)
*/
QFileDialog::~QFileDialog()
{
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
Q_D(QFileDialog);
d->saveSettings();
#endif
@@ -722,6 +727,16 @@ bool QFileDialogPrivate::usingWidgets() const
Sets the given \a option to be enabled if \a on is true; otherwise,
clears the given \a option.
+ Options (particularly the DontUseNativeDialogs option) should be set
+ before changing dialog properties or showing the dialog.
+
+ Setting options while the dialog is visible is not guaranteed to have
+ an immediate effect on the dialog (depending on the option and on the
+ platform).
+
+ Setting options after changing other properties may cause these
+ values to have no effect.
+
\sa options, testOption()
*/
void QFileDialog::setOption(Option option, bool on)
@@ -752,9 +767,15 @@ bool QFileDialog::testOption(Option option) const
By default, all options are disabled.
- Options should be set before showing the dialog. Setting them while the
- dialog is visible is not guaranteed to have an immediate effect on the
- dialog (depending on the option and on the platform).
+ Options (particularly the DontUseNativeDialogs option) should be set
+ before changing dialog properties or showing the dialog.
+
+ Setting options while the dialog is visible is not guaranteed to have
+ an immediate effect on the dialog (depending on the option and on the
+ platform).
+
+ Setting options after changing other properties may cause these
+ values to have no effect.
\sa setOption(), testOption()
*/
@@ -2720,7 +2741,7 @@ void QFileDialog::accept()
}
}
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
void QFileDialogPrivate::saveSettings()
{
Q_Q(QFileDialog);
@@ -2778,7 +2799,7 @@ bool QFileDialogPrivate::restoreFromSettings()
return restoreWidgetState(history, settings.value(QLatin1String("sidebarWidth"), -1).toInt());
}
-#endif // QT_NO_SETTINGS
+#endif // settings
bool QFileDialogPrivate::restoreWidgetState(QStringList &history, int splitterPosition)
{
@@ -2851,7 +2872,7 @@ void QFileDialogPrivate::init(const QUrl &directory, const QString &nameFilter,
else
q->selectUrl(directory);
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
// Try to restore from the FileDialog settings group; if it fails, fall back
// to the pre-5.5 QByteArray serialized settings.
if (!restoreFromSettings()) {
@@ -3016,7 +3037,7 @@ void QFileDialogPrivate::createWidgets()
createToolButtons();
createMenuActions();
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
// Try to restore from the FileDialog settings group; if it fails, fall back
// to the pre-5.5 QByteArray serialized settings.
if (!restoreFromSettings()) {
diff --git a/src/widgets/dialogs/qfiledialog_p.h b/src/widgets/dialogs/qfiledialog_p.h
index 3a93a53911..2e49696b77 100644
--- a/src/widgets/dialogs/qfiledialog_p.h
+++ b/src/widgets/dialogs/qfiledialog_p.h
@@ -187,7 +187,7 @@ public:
#endif
}
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
void saveSettings();
bool restoreFromSettings();
#endif
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index d8cd19ef1a..32190151bc 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -1839,7 +1839,7 @@ void QMessageBox::aboutQt(QWidget *parent, const QString &title)
"<p>Qt provides single-source portability across all major desktop "
"operating systems. It is also available for embedded Linux and other "
"embedded and mobile operating systems.</p>"
- "<p>Qt is available under three different licensing options designed "
+ "<p>Qt is available under multiple licensing options designed "
"to accommodate the needs of our various users.</p>"
"<p>Qt licensed under our commercial license agreement is appropriate "
"for development of proprietary/commercial software where you do not "
diff --git a/src/widgets/effects/qpixmapfilter.cpp b/src/widgets/effects/qpixmapfilter.cpp
index b330afebed..e1e8175423 100644
--- a/src/widgets/effects/qpixmapfilter.cpp
+++ b/src/widgets/effects/qpixmapfilter.cpp
@@ -1105,13 +1105,15 @@ void QPixmapColorizeFilter::draw(QPainter *painter, const QPointF &dest, const Q
if (srcRect.isNull()) {
srcImage = src.toImage();
- srcImage = srcImage.convertToFormat(srcImage.hasAlphaChannel() ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32);
+ const auto format = srcImage.hasAlphaChannel() ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32;
+ srcImage = std::move(srcImage).convertToFormat(format);
destImage = QImage(srcImage.size(), srcImage.format());
} else {
QRect rect = srcRect.toAlignedRect().intersected(src.rect());
srcImage = src.copy(rect).toImage();
- srcImage = srcImage.convertToFormat(srcImage.hasAlphaChannel() ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32);
+ const auto format = srcImage.hasAlphaChannel() ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32;
+ srcImage = std::move(srcImage).convertToFormat(format);
destImage = QImage(rect.size(), srcImage.format());
}
destImage.setDevicePixelRatio(src.devicePixelRatioF());
@@ -1130,7 +1132,7 @@ void QPixmapColorizeFilter::draw(QPainter *painter, const QPointF &dest, const Q
bufPainter.setOpacity(d->strength);
bufPainter.drawImage(0, 0, destImage);
bufPainter.end();
- destImage = buffer;
+ destImage = std::move(buffer);
}
if (srcImage.hasAlphaChannel())
@@ -1334,7 +1336,7 @@ void QPixmapDropShadowFilter::draw(QPainter *p,
qt_blurImage(&blurPainter, tmp, d->radius, false, true);
blurPainter.end();
- tmp = blurred;
+ tmp = std::move(blurred);
// blacken the image...
tmpPainter.begin(&tmp);
diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h
index 2d9468cc21..05bc2468c1 100644
--- a/src/widgets/kernel/qapplication_p.h
+++ b/src/widgets/kernel/qapplication_p.h
@@ -113,7 +113,7 @@ public:
bool tryCloseAllWindows() override;
#if 0 // Used to be included in Qt4 for Q_WS_X11
-#ifndef QT_NO_SETTINGS
+#if QT_CONFIG(settings)
static bool x11_apply_settings();
#endif
static void reset_instance_pointer();
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 0821c6af59..ccf4252b79 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -105,7 +105,9 @@
#endif
#include <qfileinfo.h>
#include <qdir.h>
+#if QT_CONFIG(settings)
#include <qsettings.h>
+#endif
#include <qvariant.h>
#include <qpixmapcache.h>
#if QT_CONFIG(animation)
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 121de548b0..5ed7195b60 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -5641,22 +5641,18 @@ QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComp
} else {
sliderlen = maxlen;
}
- const int sliderPosition = sb->orientation == Qt::Horizontal && sb->direction == Qt::RightToLeft ? sb->maximum - sb->sliderPosition + sb->minimum : sb->sliderPosition;
int sliderstart = (styleOptionSlider.orientation == Qt::Horizontal ? contentRect.left() : contentRect.top())
- + sliderPositionFromValue(sb->minimum, sb->maximum, sliderPosition,
+ + sliderPositionFromValue(sb->minimum, sb->maximum, sb->sliderPosition,
maxlen - sliderlen, sb->upsideDown);
QRect sr = (sb->orientation == Qt::Horizontal)
? QRect(sliderstart, contentRect.top(), sliderlen, contentRect.height())
: QRect(contentRect.left(), sliderstart, contentRect.width(), sliderlen);
- if (sc == SC_ScrollBarSlider) {
- return sr;
- } else if (sc == SC_ScrollBarSubPage) {
- return QRect(contentRect.topLeft(), sb->orientation == Qt::Horizontal ? sr.bottomLeft() : sr.topRight());
- } else { // SC_ScrollBarAddPage
- return QRect(sb->orientation == Qt::Horizontal ? sr.topRight() : sr.bottomLeft(), contentRect.bottomRight());
- }
- break;
+ if (sc == SC_ScrollBarSubPage)
+ sr = QRect(contentRect.topLeft(), sb->orientation == Qt::Horizontal ? sr.bottomLeft() : sr.topRight());
+ else if (sc == SC_ScrollBarAddPage)
+ sr = QRect(sb->orientation == Qt::Horizontal ? sr.topRight() : sr.bottomLeft(), contentRect.bottomRight());
+ return visualRect(styleOptionSlider.direction, grooveRect, sr);
}
case SC_ScrollBarAddLine: pe = PseudoElement_ScrollBarAddLine; break;
case SC_ScrollBarSubLine: pe = PseudoElement_ScrollBarSubLine; break;
diff --git a/tests/auto/corelib/io/io.pro b/tests/auto/corelib/io/io.pro
index 3c93fd5e1f..eee2c0e30d 100644
--- a/tests/auto/corelib/io/io.pro
+++ b/tests/auto/corelib/io/io.pro
@@ -65,6 +65,9 @@ win32:!qtConfig(private_tests): SUBDIRS -= \
qprocess \
qprocess-noapplication
+!qtConfig(settings): SUBDIRS -= \
+ qsettings
+
winrt: SUBDIRS -= \
qstorageinfo
diff --git a/tests/auto/corelib/io/qresourceengine/.gitattributes b/tests/auto/corelib/io/qresourceengine/.gitattributes
index add3716d81..88edd3681a 100644
--- a/tests/auto/corelib/io/qresourceengine/.gitattributes
+++ b/tests/auto/corelib/io/qresourceengine/.gitattributes
@@ -1 +1,2 @@
testqrc/test.qrc -crlf
+*.txt -crlf
diff --git a/tests/auto/corelib/io/qresourceengine/testqrc/aliasdir/aliasdir.txt b/tests/auto/corelib/io/qresourceengine/testqrc/aliasdir/aliasdir.txt
index 21a3dfa0b8..dcf7937f0a 100644
--- a/tests/auto/corelib/io/qresourceengine/testqrc/aliasdir/aliasdir.txt
+++ b/tests/auto/corelib/io/qresourceengine/testqrc/aliasdir/aliasdir.txt
@@ -1 +1 @@
-"This is a korean text file"
+"This is a korean text file"
diff --git a/tests/auto/corelib/io/qresourceengine/testqrc/blahblah.txt b/tests/auto/corelib/io/qresourceengine/testqrc/blahblah.txt
index 436c4d11c3..19f0805d8d 100644
--- a/tests/auto/corelib/io/qresourceengine/testqrc/blahblah.txt
+++ b/tests/auto/corelib/io/qresourceengine/testqrc/blahblah.txt
@@ -1 +1 @@
-qwerty
+qwerty
diff --git a/tests/auto/corelib/io/qresourceengine/testqrc/currentdir.txt b/tests/auto/corelib/io/qresourceengine/testqrc/currentdir.txt
index 38e389979a..65f1f43def 100644
--- a/tests/auto/corelib/io/qresourceengine/testqrc/currentdir.txt
+++ b/tests/auto/corelib/io/qresourceengine/testqrc/currentdir.txt
@@ -1 +1 @@
-"This is the current dir"
+"This is the current dir"
diff --git a/tests/auto/corelib/io/qresourceengine/testqrc/currentdir2.txt b/tests/auto/corelib/io/qresourceengine/testqrc/currentdir2.txt
index 6ac16a3306..7d89108011 100644
--- a/tests/auto/corelib/io/qresourceengine/testqrc/currentdir2.txt
+++ b/tests/auto/corelib/io/qresourceengine/testqrc/currentdir2.txt
@@ -1 +1 @@
-"This is also the current dir"
+"This is also the current dir"
diff --git a/tests/auto/corelib/io/qresourceengine/testqrc/otherdir/otherdir.txt b/tests/auto/corelib/io/qresourceengine/testqrc/otherdir/otherdir.txt
index b0e4a124ee..e1b430f33b 100644
--- a/tests/auto/corelib/io/qresourceengine/testqrc/otherdir/otherdir.txt
+++ b/tests/auto/corelib/io/qresourceengine/testqrc/otherdir/otherdir.txt
@@ -1 +1 @@
-"This is the other dir"
+"This is the other dir"
diff --git a/tests/auto/corelib/io/qresourceengine/testqrc/subdir/subdir.txt b/tests/auto/corelib/io/qresourceengine/testqrc/subdir/subdir.txt
index b6115207a2..4506acf413 100644
--- a/tests/auto/corelib/io/qresourceengine/testqrc/subdir/subdir.txt
+++ b/tests/auto/corelib/io/qresourceengine/testqrc/subdir/subdir.txt
@@ -1 +1 @@
-"This is in the sub directory"
+"This is in the sub directory"
diff --git a/tests/auto/corelib/io/qresourceengine/testqrc/test/test/test1.txt b/tests/auto/corelib/io/qresourceengine/testqrc/test/test/test1.txt
index adc01d1354..8baef1b4ab 100644
--- a/tests/auto/corelib/io/qresourceengine/testqrc/test/test/test1.txt
+++ b/tests/auto/corelib/io/qresourceengine/testqrc/test/test/test1.txt
@@ -1 +1 @@
-abc
+abc
diff --git a/tests/auto/corelib/io/qresourceengine/testqrc/test/test/test2.txt b/tests/auto/corelib/io/qresourceengine/testqrc/test/test/test2.txt
index 3f48e3cdc3..24c5735c3e 100644
--- a/tests/auto/corelib/io/qresourceengine/testqrc/test/test/test2.txt
+++ b/tests/auto/corelib/io/qresourceengine/testqrc/test/test/test2.txt
@@ -1 +1 @@
-def
+def
diff --git a/tests/auto/corelib/io/qresourceengine/testqrc/test/testdir.txt b/tests/auto/corelib/io/qresourceengine/testqrc/test/testdir.txt
index 40ee68dccb..b8cb3a8c01 100644
--- a/tests/auto/corelib/io/qresourceengine/testqrc/test/testdir.txt
+++ b/tests/auto/corelib/io/qresourceengine/testqrc/test/testdir.txt
@@ -1 +1 @@
-"This is in the test directory"
+"This is in the test directory"
diff --git a/tests/auto/corelib/io/qresourceengine/testqrc/test/testdir2.txt b/tests/auto/corelib/io/qresourceengine/testqrc/test/testdir2.txt
index 051430298a..dccfdc9bcf 100644
--- a/tests/auto/corelib/io/qresourceengine/testqrc/test/testdir2.txt
+++ b/tests/auto/corelib/io/qresourceengine/testqrc/test/testdir2.txt
@@ -1 +1 @@
-"This is another file in this directory"
+"This is another file in this directory"
diff --git a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
index ab49dea6d8..0b50c391b8 100644
--- a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
+++ b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp
@@ -1,6 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2018 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@@ -104,7 +105,7 @@ void tst_QResourceEngine::cleanupTestCase()
void tst_QResourceEngine::checkStructure_data()
{
QTest::addColumn<QString>("pathName");
- QTest::addColumn<QString>("contents");
+ QTest::addColumn<QByteArray>("contents");
QTest::addColumn<QStringList>("containedFiles");
QTest::addColumn<QStringList>("containedDirs");
QTest::addColumn<QLocale>("locale");
@@ -134,7 +135,7 @@ void tst_QResourceEngine::checkStructure_data()
QTest::newRow("root dir") << QString(":/")
- << QString()
+ << QByteArray()
<< (QStringList()
#if defined(BUILTIN_TESTDATA)
<< "parentdir.txt"
@@ -146,7 +147,7 @@ void tst_QResourceEngine::checkStructure_data()
<< qlonglong(0);
QTest::newRow("secondary root") << QString(":/secondary_root/")
- << QString()
+ << QByteArray()
<< QStringList()
<< (QStringList() << QLatin1String("runtime_resource"))
<< QLocale::c()
@@ -157,73 +158,73 @@ void tst_QResourceEngine::checkStructure_data()
for(int i = 0; i < roots.size(); ++i) {
const QString root = roots.at(i);
- QTest::newRow(QString(root + "prefix dir").toLatin1().constData()) << QString(root + "test/abc/123/+++")
- << QString()
+ QTest::addRow("%s prefix dir", qPrintable(root)) << QString(root + "test/abc/123/+++")
+ << QByteArray()
<< (QStringList() << QLatin1String("currentdir.txt") << QLatin1String("currentdir2.txt") << QLatin1String("parentdir.txt"))
<< (QStringList() << QLatin1String("subdir"))
<< QLocale::c()
<< qlonglong(0);
- QTest::newRow(QString(root + "parent to prefix").toLatin1().constData()) << QString(root + "test/abc/123")
- << QString()
+ QTest::addRow("%s parent to prefix", qPrintable(root)) << QString(root + "test/abc/123")
+ << QByteArray()
<< QStringList()
<< (QStringList() << QLatin1String("+++"))
<< QLocale::c()
<< qlonglong(0);
- QTest::newRow(QString(root + "two parents prefix").toLatin1().constData()) << QString(root + "test/abc")
- << QString()
+ QTest::addRow("%s two parents prefix", qPrintable(root)) << QString(root + "test/abc")
+ << QByteArray()
<< QStringList()
<< QStringList(QLatin1String("123"))
<< QLocale::c()
<< qlonglong(0);
- QTest::newRow(QString(root + "test dir ").toLatin1().constData()) << QString(root + "test")
- << QString()
+ QTest::addRow("%s test dir ", qPrintable(root)) << QString(root + "test")
+ << QByteArray()
<< (QStringList() << QLatin1String("testdir.txt"))
<< (QStringList() << QLatin1String("abc") << QLatin1String("test"))
<< QLocale::c()
<< qlonglong(0);
- QTest::newRow(QString(root + "prefix no slashes").toLatin1().constData()) << QString(root + "withoutslashes")
- << QString()
+ QTest::addRow("%s prefix no slashes", qPrintable(root)) << QString(root + "withoutslashes")
+ << QByteArray()
<< QStringList("blahblah.txt")
<< QStringList()
<< QLocale::c()
<< qlonglong(0);
- QTest::newRow(QString(root + "other dir").toLatin1().constData()) << QString(root + "otherdir")
- << QString()
+ QTest::addRow("%s other dir", qPrintable(root)) << QString(root + "otherdir")
+ << QByteArray()
<< QStringList(QLatin1String("otherdir.txt"))
<< QStringList()
<< QLocale::c()
<< qlonglong(0);
- QTest::newRow(QString(root + "alias dir").toLatin1().constData()) << QString(root + "aliasdir")
- << QString()
+ QTest::addRow("%s alias dir", qPrintable(root)) << QString(root + "aliasdir")
+ << QByteArray()
<< QStringList(QLatin1String("aliasdir.txt"))
<< QStringList()
<< QLocale::c()
<< qlonglong(0);
- QTest::newRow(QString(root + "second test dir").toLatin1().constData()) << QString(root + "test/test")
- << QString()
+ QTest::addRow("%s second test dir", qPrintable(root)) << QString(root + "test/test")
+ << QByteArray()
<< (QStringList() << QLatin1String("test1.txt") << QLatin1String("test2.txt"))
<< QStringList()
<< QLocale::c()
<< qlonglong(0);
info = QFileInfo(QFINDTESTDATA("testqrc/test/test/test1.txt"));
- QTest::newRow(QString(root + "test1 text").toLatin1().constData()) << QString(root + "test/test/test1.txt")
- << QString("abc")
+ QTest::addRow("%s test1 text", qPrintable(root)) << QString(root + "test/test/test1.txt")
+ << QByteArray("abc\n")
<< QStringList()
<< QStringList()
<< QLocale::c()
<< qlonglong(info.size());
info = QFileInfo(QFINDTESTDATA("testqrc/blahblah.txt"));
- QTest::newRow(QString(root + "text no slashes").toLatin1().constData()) << QString(root + "withoutslashes/blahblah.txt")
- << QString("qwerty")
+ QTest::addRow("%s text no slashes", qPrintable(root)) << QString(root + "withoutslashes/blahblah.txt")
+ << QByteArray("qwerty\n")
<< QStringList()
<< QStringList()
<< QLocale::c()
@@ -231,96 +232,96 @@ void tst_QResourceEngine::checkStructure_data()
info = QFileInfo(QFINDTESTDATA("testqrc/test/test/test2.txt"));
- QTest::newRow(QString(root + "test1 text").toLatin1().constData()) << QString(root + "test/test/test2.txt")
- << QString("def")
+ QTest::addRow("%s test1 text", qPrintable(root)) << QString(root + "test/test/test2.txt")
+ << QByteArray("def\n")
<< QStringList()
<< QStringList()
<< QLocale::c()
<< qlonglong(info.size());
info = QFileInfo(QFINDTESTDATA("testqrc/currentdir.txt"));
- QTest::newRow(QString(root + "currentdir text").toLatin1().constData()) << QString(root + "test/abc/123/+++/currentdir.txt")
- << QString("\"This is the current dir\" ")
+ QTest::addRow("%s currentdir text", qPrintable(root)) << QString(root + "test/abc/123/+++/currentdir.txt")
+ << QByteArray("\"This is the current dir\"\n")
<< QStringList()
<< QStringList()
<< QLocale::c()
<< qlonglong(info.size());
info = QFileInfo(QFINDTESTDATA("testqrc/currentdir2.txt"));
- QTest::newRow(QString(root + "currentdir text2").toLatin1().constData()) << QString(root + "test/abc/123/+++/currentdir2.txt")
- << QString("\"This is also the current dir\" ")
+ QTest::addRow("%s currentdir text2", qPrintable(root)) << QString(root + "test/abc/123/+++/currentdir2.txt")
+ << QByteArray("\"This is also the current dir\"\n")
<< QStringList()
<< QStringList()
<< QLocale::c()
<< qlonglong(info.size());
info = QFileInfo(QFINDTESTDATA("parentdir.txt"));
- QTest::newRow(QString(root + "parentdir text").toLatin1().constData()) << QString(root + "test/abc/123/+++/parentdir.txt")
- << QString("abcdefgihklmnopqrstuvwxyz ")
+ QTest::addRow("%s parentdir text", qPrintable(root)) << QString(root + "test/abc/123/+++/parentdir.txt")
+ << QByteArray("abcdefgihklmnopqrstuvwxyz \n")
<< QStringList()
<< QStringList()
<< QLocale::c()
<< qlonglong(info.size());
info = QFileInfo(QFINDTESTDATA("testqrc/subdir/subdir.txt"));
- QTest::newRow(QString(root + "subdir text").toLatin1().constData()) << QString(root + "test/abc/123/+++/subdir/subdir.txt")
- << QString("\"This is in the sub directory\" ")
+ QTest::addRow("%s subdir text", qPrintable(root)) << QString(root + "test/abc/123/+++/subdir/subdir.txt")
+ << QByteArray("\"This is in the sub directory\"\n")
<< QStringList()
<< QStringList()
<< QLocale::c()
<< qlonglong(info.size());
info = QFileInfo(QFINDTESTDATA("testqrc/test/testdir.txt"));
- QTest::newRow(QString(root + "testdir text").toLatin1().constData()) << QString(root + "test/testdir.txt")
- << QString("\"This is in the test directory\" ")
+ QTest::addRow("%s testdir text", qPrintable(root)) << QString(root + "test/testdir.txt")
+ << QByteArray("\"This is in the test directory\"\n")
<< QStringList()
<< QStringList()
<< QLocale::c()
<< qlonglong(info.size());
info = QFileInfo(QFINDTESTDATA("testqrc/otherdir/otherdir.txt"));
- QTest::newRow(QString(root + "otherdir text").toLatin1().constData()) << QString(root + "otherdir/otherdir.txt")
- << QString("\"This is the other dir\" ")
+ QTest::addRow("%s otherdir text", qPrintable(root)) << QString(root + "otherdir/otherdir.txt")
+ << QByteArray("\"This is the other dir\"\n")
<< QStringList()
<< QStringList()
<< QLocale::c()
<< qlonglong(info.size());
info = QFileInfo(QFINDTESTDATA("testqrc/test/testdir2.txt"));
- QTest::newRow(QString(root + "alias text").toLatin1().constData()) << QString(root + "aliasdir/aliasdir.txt")
- << QString("\"This is another file in this directory\" ")
+ QTest::addRow("%s alias text", qPrintable(root)) << QString(root + "aliasdir/aliasdir.txt")
+ << QByteArray("\"This is another file in this directory\"\n")
<< QStringList()
<< QStringList()
<< QLocale::c()
<< qlonglong(info.size());
info = QFileInfo(QFINDTESTDATA("testqrc/aliasdir/aliasdir.txt"));
- QTest::newRow(QString(root + "korean text").toLatin1().constData()) << QString(root + "aliasdir/aliasdir.txt")
- << QString("\"This is a korean text file\" ")
+ QTest::addRow("%s korean text", qPrintable(root)) << QString(root + "aliasdir/aliasdir.txt")
+ << QByteArray("\"This is a korean text file\"\n")
<< QStringList()
<< QStringList()
<< QLocale("ko")
<< qlonglong(info.size());
info = QFileInfo(QFINDTESTDATA("testqrc/aliasdir/aliasdir.txt"));
- QTest::newRow(QString(root + "korean text 2").toLatin1().constData()) << QString(root + "aliasdir/aliasdir.txt")
- << QString("\"This is a korean text file\" ")
+ QTest::addRow("%s korean text 2", qPrintable(root)) << QString(root + "aliasdir/aliasdir.txt")
+ << QByteArray("\"This is a korean text file\"\n")
<< QStringList()
<< QStringList()
<< QLocale("ko_KR")
<< qlonglong(info.size());
info = QFileInfo(QFINDTESTDATA("testqrc/test/german.txt"));
- QTest::newRow(QString(root + "german text").toLatin1().constData()) << QString(root + "aliasdir/aliasdir.txt")
- << QString("Deutsch")
+ QTest::addRow("%s german text", qPrintable(root)) << QString(root + "aliasdir/aliasdir.txt")
+ << QByteArray("Deutsch\n")
<< QStringList()
<< QStringList()
<< QLocale("de")
<< qlonglong(info.size());
info = QFileInfo(QFINDTESTDATA("testqrc/test/german.txt"));
- QTest::newRow(QString(root + "german text 2").toLatin1().constData()) << QString(root + "aliasdir/aliasdir.txt")
- << QString("Deutsch")
+ QTest::addRow("%s german text 2", qPrintable(root)) << QString(root + "aliasdir/aliasdir.txt")
+ << QByteArray("Deutsch\n")
<< QStringList()
<< QStringList()
<< QLocale("de_DE")
@@ -329,8 +330,8 @@ void tst_QResourceEngine::checkStructure_data()
QFile file(QFINDTESTDATA("testqrc/aliasdir/compressme.txt"));
file.open(QFile::ReadOnly);
info = QFileInfo(QFINDTESTDATA("testqrc/aliasdir/compressme.txt"));
- QTest::newRow(QString(root + "compressed text").toLatin1().constData()) << QString(root + "aliasdir/aliasdir.txt")
- << QString(file.readAll())
+ QTest::addRow("%s compressed text", qPrintable(root)) << QString(root + "aliasdir/aliasdir.txt")
+ << file.readAll()
<< QStringList()
<< QStringList()
<< QLocale("de_CH")
@@ -341,7 +342,7 @@ void tst_QResourceEngine::checkStructure_data()
void tst_QResourceEngine::checkStructure()
{
QFETCH(QString, pathName);
- QFETCH(QString, contents);
+ QFETCH(QByteArray, contents);
QFETCH(QStringList, containedFiles);
QFETCH(QStringList, containedDirs);
QFETCH(QLocale, locale);
@@ -401,8 +402,18 @@ void tst_QResourceEngine::checkStructure()
QFile file(pathName);
QVERIFY(file.open(QFile::ReadOnly));
- QByteArray ba = file.readAll();
- QVERIFY(QString(ba).startsWith(contents));
+ // check contents
+ QCOMPARE(file.readAll(), contents);
+
+ // check memory map too
+ uchar *ptr = file.map(0, file.size(), QFile::MapPrivateOption);
+ QVERIFY2(ptr, qPrintable(file.errorString()));
+ QByteArray ba = QByteArray::fromRawData(reinterpret_cast<const char *>(ptr), file.size());
+ QCOMPARE(ba, contents);
+
+ // check that it is still valid after closing the file
+ file.close();
+ QCOMPARE(ba, contents);
}
QLocale::setDefault(QLocale::system());
}
diff --git a/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST b/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST
index b1590a5ccf..06588188d4 100644
--- a/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST
+++ b/tests/auto/corelib/kernel/qeventdispatcher/BLACKLIST
@@ -3,3 +3,4 @@ windows
[registerTimer]
windows
winrt
+osx
diff --git a/tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp b/tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp
index 5784f0728c..49c10c6a24 100644
--- a/tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp
+++ b/tests/auto/corelib/kernel/qeventdispatcher/tst_qeventdispatcher.cpp
@@ -28,6 +28,7 @@
#ifdef QT_GUI_LIB
# include <QtGui/QGuiApplication>
+# define tst_QEventDispatcher tst_QGuiEventDispatcher
#else
# include <QtCore/QCoreApplication>
#endif
@@ -92,77 +93,151 @@ void tst_QEventDispatcher::initTestCase()
}
}
+class TimerManager {
+ Q_DISABLE_COPY(TimerManager)
+
+public:
+ TimerManager(QAbstractEventDispatcher *eventDispatcher, QObject *parent)
+ : m_eventDispatcher(eventDispatcher), m_parent(parent)
+ {
+ }
+
+ ~TimerManager()
+ {
+ if (!registeredTimers().isEmpty())
+ m_eventDispatcher->unregisterTimers(m_parent);
+ }
+
+ TimerManager(TimerManager &&) = delete;
+ TimerManager &operator=(TimerManager &&) = delete;
+
+ int preciseTimerId() const { return m_preciseTimerId; }
+ int coarseTimerId() const { return m_coarseTimerId; }
+ int veryCoarseTimerId() const { return m_veryCoarseTimerId; }
+
+ bool foundPrecise() const { return m_preciseTimerId > 0; }
+ bool foundCoarse() const { return m_coarseTimerId > 0; }
+ bool foundVeryCoarse() const { return m_veryCoarseTimerId > 0; }
+
+ QList<QAbstractEventDispatcher::TimerInfo> registeredTimers() const
+ {
+ return m_eventDispatcher->registeredTimers(m_parent);
+ }
+
+ void registerAll()
+ {
+ // start 3 timers, each with the different timer types and different intervals
+ m_preciseTimerId = m_eventDispatcher->registerTimer(
+ PreciseTimerInterval, Qt::PreciseTimer, m_parent);
+ m_coarseTimerId = m_eventDispatcher->registerTimer(
+ CoarseTimerInterval, Qt::CoarseTimer, m_parent);
+ m_veryCoarseTimerId = m_eventDispatcher->registerTimer(
+ VeryCoarseTimerInterval, Qt::VeryCoarseTimer, m_parent);
+ QVERIFY(m_preciseTimerId > 0);
+ QVERIFY(m_coarseTimerId > 0);
+ QVERIFY(m_veryCoarseTimerId > 0);
+ findTimers();
+ }
+
+ void unregister(int timerId)
+ {
+ m_eventDispatcher->unregisterTimer(timerId);
+ findTimers();
+ }
+
+ void unregisterAll()
+ {
+ m_eventDispatcher->unregisterTimers(m_parent);
+ findTimers();
+ }
+
+private:
+ void findTimers()
+ {
+ bool foundPrecise = false;
+ bool foundCoarse = false;
+ bool foundVeryCoarse = false;
+ const QList<QAbstractEventDispatcher::TimerInfo> timers = registeredTimers();
+ for (int i = 0; i < timers.count(); ++i) {
+ const QAbstractEventDispatcher::TimerInfo &timerInfo = timers.at(i);
+ if (timerInfo.timerId == m_preciseTimerId) {
+ QCOMPARE(timerInfo.interval, int(PreciseTimerInterval));
+ QCOMPARE(timerInfo.timerType, Qt::PreciseTimer);
+ foundPrecise = true;
+ } else if (timerInfo.timerId == m_coarseTimerId) {
+ QCOMPARE(timerInfo.interval, int(CoarseTimerInterval));
+ QCOMPARE(timerInfo.timerType, Qt::CoarseTimer);
+ foundCoarse = true;
+ } else if (timerInfo.timerId == m_veryCoarseTimerId) {
+ QCOMPARE(timerInfo.interval, int(VeryCoarseTimerInterval));
+ QCOMPARE(timerInfo.timerType, Qt::VeryCoarseTimer);
+ foundVeryCoarse = true;
+ }
+ }
+ if (!foundPrecise)
+ m_preciseTimerId = -1;
+ if (!foundCoarse)
+ m_coarseTimerId = -1;
+ if (!foundVeryCoarse)
+ m_veryCoarseTimerId = -1;
+ }
+
+ QAbstractEventDispatcher *m_eventDispatcher = nullptr;
+
+ int m_preciseTimerId = -1;
+ int m_coarseTimerId = -1;
+ int m_veryCoarseTimerId = -1;
+
+ QObject *m_parent = nullptr;
+};
+
// test that the eventDispatcher's timer implementation is complete and working
void tst_QEventDispatcher::registerTimer()
{
-#define FIND_TIMERS() \
- do { \
- foundPrecise = false; \
- foundCoarse = false; \
- foundVeryCoarse = false; \
- for (int i = 0; i < registeredTimers.count(); ++i) { \
- const QAbstractEventDispatcher::TimerInfo &timerInfo = registeredTimers.at(i); \
- if (timerInfo.timerId == preciseTimerId) { \
- QCOMPARE(timerInfo.interval, int(PreciseTimerInterval)); \
- QCOMPARE(timerInfo.timerType, Qt::PreciseTimer); \
- foundPrecise = true; \
- } else if (timerInfo.timerId == coarseTimerId) { \
- QCOMPARE(timerInfo.interval, int(CoarseTimerInterval)); \
- QCOMPARE(timerInfo.timerType, Qt::CoarseTimer); \
- foundCoarse = true; \
- } else if (timerInfo.timerId == veryCoarseTimerId) { \
- QCOMPARE(timerInfo.interval, int(VeryCoarseTimerInterval)); \
- QCOMPARE(timerInfo.timerType, Qt::VeryCoarseTimer); \
- foundVeryCoarse = true; \
- } \
- } \
- } while (0)
-
- // start 3 timers, each with the different timer types and different intervals
- int preciseTimerId = eventDispatcher->registerTimer(PreciseTimerInterval, Qt::PreciseTimer, this);
- int coarseTimerId = eventDispatcher->registerTimer(CoarseTimerInterval, Qt::CoarseTimer, this);
- int veryCoarseTimerId = eventDispatcher->registerTimer(VeryCoarseTimerInterval, Qt::VeryCoarseTimer, this);
- QVERIFY(preciseTimerId > 0);
- QVERIFY(coarseTimerId > 0);
- QVERIFY(veryCoarseTimerId > 0);
+ TimerManager timers(eventDispatcher, this);
+ timers.registerAll();
+ if (QTest::currentTestFailed())
+ return;
// check that all 3 are present in the eventDispatcher's registeredTimer() list
- QList<QAbstractEventDispatcher::TimerInfo> registeredTimers = eventDispatcher->registeredTimers(this);
- QCOMPARE(registeredTimers.count(), 3);
- bool foundPrecise, foundCoarse, foundVeryCoarse;
- FIND_TIMERS();
- QVERIFY(foundPrecise && foundCoarse && foundVeryCoarse);
+ QCOMPARE(timers.registeredTimers().count(), 3);
+ QVERIFY(timers.foundPrecise());
+ QVERIFY(timers.foundCoarse());
+ QVERIFY(timers.foundVeryCoarse());
// process events, waiting for the next event... this should only fire the precise timer
receivedEventType = -1;
timerIdFromEvent = -1;
QTRY_COMPARE_WITH_TIMEOUT(receivedEventType, int(QEvent::Timer), PreciseTimerInterval * 2);
- QCOMPARE(timerIdFromEvent, preciseTimerId);
+ QCOMPARE(timerIdFromEvent, timers.preciseTimerId());
// now unregister it and make sure it's gone
- eventDispatcher->unregisterTimer(preciseTimerId);
- registeredTimers = eventDispatcher->registeredTimers(this);
- QCOMPARE(registeredTimers.count(), 2);
- FIND_TIMERS();
- QVERIFY(!foundPrecise && foundCoarse && foundVeryCoarse);
+ timers.unregister(timers.preciseTimerId());
+ if (QTest::currentTestFailed())
+ return;
+ QCOMPARE(timers.registeredTimers().count(), 2);
+ QVERIFY(!timers.foundPrecise());
+ QVERIFY(timers.foundCoarse());
+ QVERIFY(timers.foundVeryCoarse());
// do the same again for the coarse timer
receivedEventType = -1;
timerIdFromEvent = -1;
QTRY_COMPARE_WITH_TIMEOUT(receivedEventType, int(QEvent::Timer), CoarseTimerInterval * 2);
- QCOMPARE(timerIdFromEvent, coarseTimerId);
+ QCOMPARE(timerIdFromEvent, timers.coarseTimerId());
// now unregister it and make sure it's gone
- eventDispatcher->unregisterTimer(coarseTimerId);
- registeredTimers = eventDispatcher->registeredTimers(this);
- QCOMPARE(registeredTimers.count(), 1);
- FIND_TIMERS();
- QVERIFY(!foundPrecise && !foundCoarse && foundVeryCoarse);
+ timers.unregister(timers.coarseTimerId());
+ if (QTest::currentTestFailed())
+ return;
+ QCOMPARE(timers.registeredTimers().count(), 1);
+ QVERIFY(!timers.foundPrecise());
+ QVERIFY(!timers.foundCoarse());
+ QVERIFY(timers.foundVeryCoarse());
// not going to wait for the VeryCoarseTimer, would take too long, just unregister it
- eventDispatcher->unregisterTimers(this);
- registeredTimers = eventDispatcher->registeredTimers(this);
- QVERIFY(registeredTimers.isEmpty());
-
-#undef FIND_TIMERS
+ timers.unregisterAll();
+ if (QTest::currentTestFailed())
+ return;
+ QVERIFY(timers.registeredTimers().isEmpty());
}
void tst_QEventDispatcher::sendPostedEvents_data()
diff --git a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
index 18098f16bf..c23ee3b0ba 100644
--- a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
+++ b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp
@@ -2135,11 +2135,12 @@ void tst_QRegularExpression::threadSafety()
QFETCH(QString, pattern);
QFETCH(QString, subject);
+ QElapsedTimer time;
+ time.start();
static const int THREAD_SAFETY_ITERATIONS = 50;
-
const int threadCount = qMax(QThread::idealThreadCount(), 4);
- for (int threadSafetyIteration = 0; threadSafetyIteration < THREAD_SAFETY_ITERATIONS; ++threadSafetyIteration) {
+ for (int threadSafetyIteration = 0; threadSafetyIteration < THREAD_SAFETY_ITERATIONS && time.elapsed() < 2000; ++threadSafetyIteration) {
QRegularExpression re(pattern);
QVector<MatcherThread *> threads;
diff --git a/tests/auto/gui/kernel/qguieventdispatcher/BLACKLIST b/tests/auto/gui/kernel/qguieventdispatcher/BLACKLIST
new file mode 100644
index 0000000000..b1590a5ccf
--- /dev/null
+++ b/tests/auto/gui/kernel/qguieventdispatcher/BLACKLIST
@@ -0,0 +1,5 @@
+[sendPostedEvents]
+windows
+[registerTimer]
+windows
+winrt
diff --git a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
index ece7a30830..72bad03a6a 100644
--- a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
+++ b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
@@ -318,6 +318,9 @@ void tst_QColor::namehex_data()
QTest::newRow("global color darkCyan") << "#008080" << QColor(Qt::darkCyan);
QTest::newRow("global color darkMagenta") << "#800080" << QColor(Qt::darkMagenta);
QTest::newRow("global color darkYellow") << "#808000" << QColor(Qt::darkYellow);
+ QTest::newRow("#RGB") << "#888" << QColor(0x88, 0x88, 0x88);
+ QTest::newRow("#RRRGGGBBB") << "#80F80F80F" << QColor(qRgba64(0x80f8, 0x80f8, 0x80f8, 0xffff));
+ QTest::newRow("#RRRRGGGGBBBB") << "#808180818081" << QColor(qRgba64(0x8081, 0x8081, 0x8081, 0xffff));
QTest::newRow("transparent red") << "#66ff0000" << QColor(255, 0, 0, 102);
QTest::newRow("invalid red") << "#gg0000" << QColor();
QTest::newRow("invalid transparent") << "#gg00ff00" << QColor();
diff --git a/tests/auto/network/access/qnetworkreply/BLACKLIST b/tests/auto/network/access/qnetworkreply/BLACKLIST
index fab8224431..4d29a830e9 100644
--- a/tests/auto/network/access/qnetworkreply/BLACKLIST
+++ b/tests/auto/network/access/qnetworkreply/BLACKLIST
@@ -8,6 +8,9 @@ windows
*
[getErrors:ftp-host]
linux
+# QTBUG-71953
+[getFromHttp:success-external]
+*
[getFromHttpIntoBuffer]
windows
[getFromHttpIntoBuffer2]
diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
index 395b30846d..3e55278b4f 100644
--- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
+++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
@@ -1025,6 +1025,26 @@ void tst_QSslSocket::protocol()
socket->abort();
}
#endif
+#ifdef TLS1_3_VERSION
+ {
+ // qt-test-server probably doesn't allow TLSV1.3
+ socket->setProtocol(QSsl::TlsV1_3);
+ QCOMPARE(socket->protocol(), QSsl::TlsV1_3);
+ socket->connectToHostEncrypted(QtNetworkSettings::serverName(), 443);
+ if (setProxy && !socket->waitForEncrypted())
+ QSKIP("TLS 1.3 is not supported by the test server or the test is flaky - see QTBUG-29941");
+ QCOMPARE(socket->protocol(), QSsl::TlsV1_3);
+ socket->abort();
+ QCOMPARE(socket->protocol(), QSsl::TlsV1_3);
+ socket->connectToHost(QtNetworkSettings::serverName(), 443);
+ QVERIFY2(socket->waitForConnected(), qPrintable(socket->errorString()));
+ socket->startClientEncryption();
+ if (setProxy && !socket->waitForEncrypted())
+ QSKIP("TLS 1.3 is not supported by the test server or the test is flaky - see QTBUG-29941");
+ QCOMPARE(socket->sessionProtocol(), QSsl::TlsV1_3);
+ socket->abort();
+ }
+#endif // TLS1_3_VERSION
#if !defined(OPENSSL_NO_SSL2) && !defined(QT_SECURETRANSPORT)
{
// qt-test-server allows SSLV2.
@@ -1279,7 +1299,9 @@ void tst_QSslSocket::protocolServerSide_data()
QTest::newRow("tls1.0orlater-tls1.0") << QSsl::TlsV1_0OrLater << QSsl::TlsV1_0 << true;
QTest::newRow("tls1.0orlater-tls1.1") << QSsl::TlsV1_0OrLater << QSsl::TlsV1_1 << true;
QTest::newRow("tls1.0orlater-tls1.2") << QSsl::TlsV1_0OrLater << QSsl::TlsV1_2 << true;
-
+#ifdef TLS1_3_VERSION
+ QTest::newRow("tls1.0orlater-tls1.3") << QSsl::TlsV1_0OrLater << QSsl::TlsV1_3 << true;
+#endif
#if !defined(OPENSSL_NO_SSL2) && !defined(QT_SECURETRANSPORT)
QTest::newRow("tls1.1orlater-ssl2") << QSsl::TlsV1_1OrLater << QSsl::SslV2 << false;
#endif
@@ -1290,7 +1312,9 @@ void tst_QSslSocket::protocolServerSide_data()
QTest::newRow("tls1.1orlater-tls1.0") << QSsl::TlsV1_1OrLater << QSsl::TlsV1_0 << false;
QTest::newRow("tls1.1orlater-tls1.1") << QSsl::TlsV1_1OrLater << QSsl::TlsV1_1 << true;
QTest::newRow("tls1.1orlater-tls1.2") << QSsl::TlsV1_1OrLater << QSsl::TlsV1_2 << true;
-
+#ifdef TLS1_3_VERSION
+ QTest::newRow("tls1.1orlater-tls1.3") << QSsl::TlsV1_1OrLater << QSsl::TlsV1_3 << true;
+#endif
#if !defined(OPENSSL_NO_SSL2) && !defined(QT_SECURETRANSPORT)
QTest::newRow("tls1.2orlater-ssl2") << QSsl::TlsV1_2OrLater << QSsl::SslV2 << false;
#endif
@@ -1300,6 +1324,21 @@ void tst_QSslSocket::protocolServerSide_data()
QTest::newRow("tls1.2orlater-tls1.0") << QSsl::TlsV1_2OrLater << QSsl::TlsV1_0 << false;
QTest::newRow("tls1.2orlater-tls1.1") << QSsl::TlsV1_2OrLater << QSsl::TlsV1_1 << false;
QTest::newRow("tls1.2orlater-tls1.2") << QSsl::TlsV1_2OrLater << QSsl::TlsV1_2 << true;
+#ifdef TLS1_3_VERSION
+ QTest::newRow("tls1.2orlater-tls1.3") << QSsl::TlsV1_2OrLater << QSsl::TlsV1_3 << true;
+#endif
+#ifdef TLS1_3_VERSION
+#if !defined(OPENSSL_NO_SSL2) && !defined(QT_SECURETRANSPORT)
+ QTest::newRow("tls1.3orlater-ssl2") << QSsl::TlsV1_3OrLater << QSsl::SslV2 << false;
+#endif
+#if !defined(OPENSSL_NO_SSL3)
+ QTest::newRow("tls1.3orlater-ssl3") << QSsl::TlsV1_3OrLater << QSsl::SslV3 << false;
+#endif
+ QTest::newRow("tls1.3orlater-tls1.0") << QSsl::TlsV1_3OrLater << QSsl::TlsV1_0 << false;
+ QTest::newRow("tls1.3orlater-tls1.1") << QSsl::TlsV1_3OrLater << QSsl::TlsV1_1 << false;
+ QTest::newRow("tls1.3orlater-tls1.2") << QSsl::TlsV1_3OrLater << QSsl::TlsV1_2 << false;
+ QTest::newRow("tls1.3orlater-tls1.3") << QSsl::TlsV1_3OrLater << QSsl::TlsV1_3 << true;
+#endif // TLS1_3_VERSION
QTest::newRow("any-tls1.0") << QSsl::AnyProtocol << QSsl::TlsV1_0 << true;
QTest::newRow("any-tls1ssl3") << QSsl::AnyProtocol << QSsl::TlsV1SslV3 << true;
@@ -3511,7 +3550,12 @@ protected:
socket = new QSslSocket(this);
socket->setSslConfiguration(config);
socket->setPeerVerifyMode(peerVerifyMode);
- socket->setProtocol(protocol);
+ if (QSslSocket::sslLibraryVersionNumber() > 0x10101000L) {
+ // FIXME. With OpenSSL 1.1.1 and TLS 1.3 PSK auto-test is broken.
+ socket->setProtocol(QSsl::TlsV1_2);
+ } else {
+ socket->setProtocol(protocol);
+ }
if (ignoreSslErrors)
connect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(ignoreErrorSlot()));
@@ -3891,6 +3935,11 @@ void tst_QSslSocket::pskServer()
return;
QSslSocket socket;
+#ifdef TLS1_3_VERSION
+ // FIXME: with OpenSSL 1.1.1 (thus TLS 1.3) test is known to fail
+ // due to the different PSK mechanism (?) - to be investigated ASAP.
+ socket.setProtocol(QSsl::TlsV1_2);
+#endif
this->socket = &socket;
QSignalSpy connectedSpy(&socket, SIGNAL(connected()));
@@ -3976,6 +4025,11 @@ void tst_QSslSocket::signatureAlgorithm_data()
if (QSslSocket::sslLibraryVersionNumber() < 0x10002000L)
QSKIP("Signature algorithms cannot be tested with OpenSSL < 1.0.2");
+ if (QSslSocket::sslLibraryVersionNumber() >= 0x10101000L) {
+ // FIXME: investigate if this test makes any sense with TLS 1.3.
+ QSKIP("Test is not valid for TLS 1.3/OpenSSL 1.1.1");
+ }
+
QTest::addColumn<QByteArrayList>("serverSigAlgPairs");
QTest::addColumn<QSsl::SslProtocol>("serverProtocol");
QTest::addColumn<QByteArrayList>("clientSigAlgPairs");
diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
index 09bea20d26..b7b5b505a0 100644
--- a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
+++ b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
@@ -355,6 +355,11 @@ void tst_QGLThreads::renderInThread()
QFETCH(bool, resize);
QFETCH(bool, update);
+#if defined(Q_OS_MACOS)
+ if (resize)
+ QSKIP("gldSetZero crashes in render thread, QTBUG-68524");
+#endif
+
ThreadSafeGLWidget widget;
widget.resize(200, 200);
SceneRenderingThread thread(&widget);
diff --git a/tests/manual/dialogs/main.cpp b/tests/manual/dialogs/main.cpp
index fc4adebcc0..2676ceeb52 100644
--- a/tests/manual/dialogs/main.cpp
+++ b/tests/manual/dialogs/main.cpp
@@ -94,7 +94,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
QMenu *editMenu = menuBar()->addMenu(tr("&Edit"));
QAction *action = editMenu->addAction(tr("Cut"));
- action->setShortcut(QKeySequence(QKeySequence::Quit));
+ action->setShortcut(QKeySequence(QKeySequence::Cut));
action = editMenu->addAction(tr("Copy"));
action->setShortcut(QKeySequence(QKeySequence::Copy));
action = editMenu->addAction(tr("Paste"));