Commit Graph

45407 Commits

Author SHA1 Message Date
Laszlo Agocs
1d7965fc41 windows: Add QT_NO_OPENGL_BUGLIST environment variable
The typical approach of setting QT_OPENGL_BUGLIST to a non-existing file is neither
documented nor is very friendly. Instead, add a QT_NO_* style of variable that
skips reading the JSON config file altogether.

This can then be used in more exotic, possibly virtualized, environments to disable
the driver and adapter discovery, and instead assume that OpenGL is available and
fully usable.

Task-number: QTBUG-82372
Pick-to: 5.15
Change-Id: I192baa83c5d9760ee27873385a246fef87421b16
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-04-21 13:49:47 +02:00
Laszlo Agocs
8524d29ce8 Prevent asserts in certain QWindow re-creation cases
Amends 402efef57b. The original patch
has a problem, namely that it directly calls QPlatformWindow::requestUpdate()
instead of going through QWindow::requestUpdate(). As there is a chance that
an update gets scheduled between the creation of the QPlatformWindow and this
extra, optional invocation of requestUpdate() at the end of QWindow::create(),
this becomes quite unsafe because QPlatformWindow, unlike QWindow, is not
graceful: it will just assert if there is a pending update still.

Solve the whole thing by storing the updateRequestPending flag of QWindowPrivate,
then resetting it, and then going through the safe, public
QWindow::requestUpdate() when our copy of the flag says so.

Task-number: QTBUG-81400
Task-number: QTBUG-70957
Pick-to: 5.15
Change-Id: I99aedfae3928b75301b46a4666c169e657ff8079
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-04-21 13:03:39 +02:00
Edward Welbourne
06d431e37f Rework country setting to match how we return the script setting
Change-Id: I753673ef79b4ad208fa6e0c6a4eb8139cd2ee253
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-04-21 11:46:37 +02:00
Edward Welbourne
4c3ec0caa8 Revert "Revert "QLocale: Actually get the language script for the system locale""
This reverts commit 449390c3a5.
QLocale::system() should behave consistently.
If UI widgets are consulting the system locale where they should be
consulting their configured UI locale, that is a bug in the UI widget
and should not be "fixed" by breaking QLocale.

Change-Id: Ib31cf7882a28b26f9a018fba3adabba94a8c43bf
Pick-to: 5.15
Fixes: QTBUG-49031
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-04-21 11:46:26 +02:00
Edward Welbourne
589e34eb32 Don't fall back to QGuiApplication for line control's layoutDirection
If the widget whose line control we are has its own locale setting,
then we should use that rather than the default UI layout direction.
Instead, the client of the QWidgetLineControl needs to handle the case
where auto-detection of the text direction can't be done based on the
content of the line control.

Fortunately, QWidget's handling of text direction handles setting to
auto gracefully as unsetting, on which it consults the parent widget
to set a sensible default.

Change-Id: Id0d247f1e6e7219b6d0ece5856ca93ee87778c74
Pick-to: 5.15
Fixes: QTBUG-53110
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-04-21 09:46:14 +00:00
Oliver Wolff
47eba45990 winrt: Fix manifest creation for Visual Studio 2019
- 2019 still uses VCLIB version 140
- minVersion and maxVersionTested have to be set for every MSVC version

Change-Id: I9300e03115e2e99fd250ec85bdd7f3367ab00d48
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
2020-04-21 11:21:08 +02:00
Jarek Kobus
df234035d0 Squash again some tests in concurrentmap
After adding new tests, the source code of tst_concurrentmap
grows rapidly with copy/paste/replace pattern.
This intoduce the issue with maintaining the test.
Get rid of separate functions for testing blocking versions
of mapped/mappedReduced and test blocking versions in parallel
with non-blocking flavors. So again, get rid of duplicated code.

Task-number: QTBUG-83258
Change-Id: I4cac6f4e1bfd1b50363dc094610717674aebf2af
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-04-21 10:28:06 +02:00
Jarek Kobus
d998a467ac Add more tests for QtConcurrent::mappedReduced()
Test the case where reduce function of the form:
V function(T &result, const U &intermediate)
has T and U types different. Make use of
numberSumReduce function and corresponding functor
that reduce Number class object to the result of int type.

Fixes: QTBUG-83258
Change-Id: I194d290988b48e7bca91228c0cd5d39efd1b4712
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-04-21 10:22:26 +02:00
Jarek Kobus
82729ddb2a Get rid of code repetition in concurrentmap test
Move tests with initial value next to their original version.
Join new lambda tests into a common functions
testing all possible 16 combinations of
functor / function / member / lambda, as they
test in fact the same function. There is no need
to distinguish lambda case over other cases.
This helps in test readability and maintenance.
Add missing tests for lambdas with a combination
of initial value.

Task-number: QTBUG-83258
Change-Id: I7a3d2bf87384d7feecffaaf39281cd626955b0a4
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-04-21 10:03:49 +02:00
Mårten Nordheim
e03a3882be QAuthenticator: Reset the authentication challenge
Both Negotiate and NTLM are conditioned on the 'challenge' being empty
when starting the authentication process. So let's reset it when we
start the authentication process.

Fixes: QTBUG-83370
Change-Id: I41af6d5bcfe3dd980ca2bedce10ceff4f61047ff
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-04-21 09:33:26 +02:00
Qt Forward Merge Bot
41bc6f40fb Merge remote-tracking branch 'origin/5.14.2' into 5.14
Change-Id: I11019c23d949af45f0be814ab894dee602fb1b1a
2020-04-21 09:31:21 +02:00
Joerg Bornemann
2a0585e7cb CMake: Port the 'pkg-config' feature
Change-Id: If571208aaaba8c1d0af834e8ae11869872d42135
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
2020-04-21 09:01:39 +02:00
Joerg Bornemann
8ef4edc09e CMake: Fix handling of negated feature config values
Consider a negated feature config value like the following:
qt_feature_config("foo" QMAKE_PUBLIC_QT_CONFIG NEGATE)

If this feature was disabled, it would turn up in both,
enabled_features and disabled_features of module .pri files.
Also, QT_CONFIG would contain foo.

Expected however is that QT_CONFIG contains no-foo, and only
disabled_features contains foo.

Fix this by prepending a "no_" prefix to the value, similar to the
"no-" prefix in the qmake build. The qt_correct_config function was
adjusted to recognize "no_foo" and translate it to the qmakeish
"no-foo" config value.

Config values that start with "no_" but do not correspond to a feature
are left untouched. You can still have values like
"no_valley_too_deep" or "no_mountain_too_high".

Change-Id: I23d8b18c84e04ea6dfa25cc6ccd8f7e86211b144
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-21 09:01:27 +02:00
Qt Forward Merge Bot
806bc5fc05 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-04-20 23:39:31 +02:00
Qt Forward Merge Bot
5725cb72f1 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I088f72543f5a964ae073f434b819b5fda4c549c8
2020-04-20 23:39:17 +02:00
Shawn Rutledge
51a348b2e2 Markdown writer: omit space after opening code block fence
The CommonMark spec shows that it's not necessary to have a space
between the code fence and the language string:
https://spec.commonmark.org/0.29/#example-112
This also avoids a needless trailing space after a code fence that
does not include a language string.

Change-Id: I2addd38a196045a7442150760b73269bfe4ffb22
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-20 21:08:32 +02:00
Shawn Rutledge
0fcd782bd3 Markdown writer: don't wrap code block, and detect its end
The end of a code block nested in a list item is now detected;
and if the text of the list item continues after the code block,
it continues to be indented.

Code blocks should never be word-wrapped.

Fixes: QTBUG-80603
Change-Id: I4427f8b1d4807d819616f5cb971e2d006170d9be
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-20 21:08:23 +02:00
Friedemann Kleint
a54294369d rcc: Fix line endings on Windows when redirected
Extend the fix 53d5811b0c
to work for the file generation mode as well.

Pick-to: 5.15
Fixes: PYSIDE-1273
Change-Id: I5a91e2de87b44658f276cea87cbd730452b1bd78
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-04-20 20:25:32 +02:00
Liang Qi
fa83b30ceb Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-04-20 19:09:58 +02:00
Janne Koskinen
559bd88bce Add option to select build target for Integrity
From 11.7.6 onwards you need to select if your build is rel/dbg/chk/cov.
Added env variable where you can add which build target to configure.

Task-number: QTBUG-74716
Change-Id: I9ab3dd6177c5c5fa1da6aa7556784fa86d0d0348
Reviewed-by: Timo Aarnipuro <timo.aarnipuro@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-04-20 19:34:27 +03:00
Edward Welbourne
7202df3689 Replace QTime with QElapsedTimer in benchmarks
Various benchmarks were still using the deprecated timing API.
One didn't even *use* the timer it implemented this way.
One was just using start as a short-hand for assigning to currentTime().

Change-Id: If406d0fb606e454fec056f386bcd0aa6726ee96e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-20 17:44:13 +02:00
Andy Shaw
3e6089b695 sqlite: Fix CVE-2020-11656
This was taken from d09f8c3621d5f7f8 and b64674919f673602 in SQLite,
ref: https://www3.sqlite.org/cgi/src/info/d09f8c3621d5f7f8
https://www.sqlite.org/cgi/src/info/b64674919f673602

[ChangeLog][QtSQL][sqlite] Fixed CVE-2020-11656

Fixes: QTBUG-83652
Change-Id: I99bd59dc10b753ff19822c902dff1fc339d330a8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-20 15:15:54 +02:00
Andy Shaw
441ea6be15 sqlite: Fix CVE-2020-11655
This was taken from 4a302b42c7bf5e11 in SQLite, ref:
https://www3.sqlite.org/cgi/src/info/4a302b42c7bf5e11

[ChangeLog][QtSQL][sqlite] Fixed CVE-2020-11655

Task-number: QTBUG-83652
Change-Id: I5ead78d9ee63aa0f12f1c1014c79373728569f30
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-20 15:15:49 +02:00
Liang Qi
a275d38385 doc: AA_DisableSessionManager was added in 5.14
This amends 404bee752c.

Fixes: QTBUG-83611
Change-Id: Ic3379a646b9c70fb23fd1f3f4bebed6e0b485664
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-04-20 15:14:37 +02:00
Leander Beernaert
dc4e5af752 CMake: Move Resources API into Qt6CoreMacros
Move QT6_ADD_RESOURCE to Qt6CoreMacros in order to avoid the extra
config file step.

Change-Id: Ib445ca35c648cf344ee8795de8bdddc0f0758972
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-20 13:38:53 +02:00
Allan Sandfeld Jensen
13873c6bc6 Add support for high resolution wheel events from Linux 5.0+
They come in as a different relative axis, and we need to ignore the old
axis to not scroll double.

Change-Id: I808cce95417ec9f8058dee26d0a2694dda27944d
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2020-04-20 11:07:27 +00:00
Tor Arne Vestbø
864f18ba2f widgets: Re-calculate focus frame style option after setting new geometry
Fixes: QTBUG-83019
Change-Id: I75d3d93732cb0c5a5b7350f19f0227998bda4791
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit bd78753d62)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-04-20 12:46:30 +02:00
Tor Arne Vestbø
86f228b819 macOS: Restore fallback sizes when setting application or window icons
We removed this logic in 059c3ae66a under the assumption that the icon
would always provide a set of sizes, but for SVG icons this is not
the case.

Change-Id: Ib3cc5740bca32cf4068a71baf99b52fa536da2ca
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-04-20 12:25:07 +02:00
Liang Qi
ad9c70c3bb Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	mkspecs/features/qt_common.prf
	src/network/ssl/qsslsocket_openssl_symbols.cpp
	src/network/ssl/qsslsocket_openssl11_symbols_p.h
	src/network/ssl/qsslsocket_opensslpre11_symbols_p.h
	src/plugins/platforms/wasm/qwasmeventdispatcher.cpp

Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: I04fb3139a0e2efd4bc2f0959f131679f192fa0f8
2020-04-20 10:34:48 +02:00
Giuseppe D'Angelo
dac9548a67 Add the Qt 6.0 deprecation macros
Change-Id: I9146129b1f772c3b028ae782f189aa4421f64b73
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-04-20 10:24:28 +02:00
Leander Beernaert
987c555220 CMake: Relocate quick compiler resource pass to QtDeclarative
Since there's no way to register callbacks or to store functions to be
called later in CMake, the only way to isolate the quick compiler
behavior for qt_add_resources() is to wrap it in a conditional check.

As soon as someone loads Qt6QmlMacros, the variable will set and the
functionality will be available.

Change-Id: I5fbdf2966e7dfdc734512a5b2b973e0ace9da5df
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-20 07:52:28 +00:00
Kylie McClain
a421e40984 linux-clang/qplatformdefs: fix building with musl libc
This is basically a duplicate of the commit which fixed building with
musl, but on linux-g++, 813f468a14.

Change-Id: I399005ac6947ba3f2b4ed5087472cd9d54a0850d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-04-20 01:19:21 -05:00
Nodir Temirkhodjaev
99258db3b7 Fix QLabel with no "picture" feature
Change-Id: I97bc58438791402168bcc58326f199b5675e75ff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-19 18:39:27 +03:00
Ulf Hermann
436aa8a4e4 QMultiHash: Retrieve the value before deleting on take()
Otherwise we may perform a use-after-free.

Change-Id: I58080dfc8bb6ef9a86f2118407a05db8ae1ecfbd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-04-18 20:38:51 +02:00
Sona Kurazyan
a7264d9b8c Make continuations work with move-only types
Use the move-only versions of result reporting and getting operations,
if the type of QFuture is not copyable.

Task-number: QTBUG-81941
Change-Id: Ic9fa978380e2c24e190e68d974051a650b0e5571
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-04-18 12:17:41 +02:00
Joerg Bornemann
3eed6d76b7 CMake: Port the 'ccache' feature
This maps to the CMake variable QT_USE_CCACHE.

Change-Id: I3258027301284d907f6ecde6c65d2c0dde8f0a11
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-17 23:10:11 +02:00
Joerg Bornemann
8a5ffc4f73 CMake: Port the 'ltcg' feature
This maps to the CMake variable CMAKE_INTERPROCEDURAL_OPTIMIZATION.

Change-Id: Id0ce48f176b95c27e74ab80276e89503b1660f79
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-17 23:10:09 +02:00
Joerg Bornemann
34124a4b0b CMake: Make use of CMAKE_CURRENT_FUNCTION_LIST_DIR
Once we can require CMake 3.17 everywhere, we can remove the variable
set up from QtSeparateDebugInfo.cmake.

Change-Id: I91572583654054f5fa47ac1e41be23050a5a8c0b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-17 23:10:08 +02:00
Volker Hilsheimer
eb3b37de83 Remove deprecated members from QtWidgets/itemviews classes
Cleaning up those that are trivial to remove because they have direct
replacements.

Change-Id: Ie9fecd8c4822ed1a8f378b210cc4c4d9a10f7e36
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-04-17 20:49:36 +02:00
Volker Hilsheimer
bd49862e8e Remove deprecated QTest::qWaitForWindowShown overload for QtWidgets
Not used anywhere in qtbase or other modules, so trivial to remove.

Change-Id: I98575e77f181e617675e536ff0dd67ac93a2f0f5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-04-17 20:49:18 +02:00
Volker Hilsheimer
714409b23c Remove deprecated members from QtWidgets/widgets classes
Cleaning up those that are trivial to remove because they have direct
replacements.

The QLabel changes to the pixmap/picture getters provide the following
migration path:

QPixmap *ppix = l->pixmap(); // up to 5.15, warns in 5.15
QPixmap pval = l->pixmap(Qt::ReturnByValue); // new in 5.15, works in 6
QPixmap pixmap = l->pixmap(); // from Qt 6 on

The overload with argument can be deprecated after the first LTS or
so.

Change-Id: I8494ceeea55b2aeda0bd340640ad95cb7c91f7d6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-04-17 20:49:06 +02:00
Joerg Bornemann
30141b2fb7 CMake: Fix location of module .pri files for non-prefix builds
In a non-prefix build, the module .pri files must end up in the
mkspecs/modules subdirectory of qtbase's build directory.

Change-Id: I241f4e274d31de7c1e3c2fa8e5e26fb8747f11c5
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-04-17 20:42:44 +02:00
Joerg Bornemann
9b45ca7411 CMake: Port the 'cross_compile' feature
Change-Id: Iccd1d55e95797740a4a8689462ce9ab1e49a62c1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-17 20:42:42 +02:00
Joerg Bornemann
2e89c61f58 CMake: Write QT_BUILD_PARTS to qmodule.pri
Change-Id: I4bddba38b51df3c70780d94f64a31b3040cb0bc8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-17 20:42:37 +02:00
Joerg Bornemann
9fc13a1188 CMake: Write PKG_CONFIG_EXECUTABLE to qmodule.pri
Change-Id: Ide61cc93d44c659740b72d085fb8b15684bc64fa
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-17 20:42:35 +02:00
Alexandru Croitor
59756b7183 CMake: Generate qmake pri information for building with qmake
Implemented some necessary functionality to generate correct .pri
information, so that qmake can build modules.

Task-number: QTBUG-75666
Change-Id: I63281adfef3d01385928b1d8c4be0b32ac97c4d7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-17 20:42:18 +02:00
Joerg Bornemann
bfcf36d459 CMake: Generate qmake .prl files
This commit also adds a qt_finalize_module function that is called for
every Qt module after all link dependencies have been added.

Change-Id: I489d188d05e368208a8a62828bb12fb395df54bc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-17 20:42:10 +02:00
Joerg Bornemann
6f5c91e985 configurejson2cmake: Remove mention of the system-xcb feature
This feature was removed in commit 60588e1a.

Change-Id: I061410dfab13a2210474014892d1bc828a5b21cf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-17 20:41:44 +02:00
Tor Arne Vestbø
164110f7bb Warn when trying to load an icon without a matching icon engine
A typical case is trying to load an SVG icon without the QtSvg module
built. You want to know what's going on instead of trying to debug why
the icon doesn't produce any valid images.

Change-Id: I4418ad758a1232f1394058368c50e0d87235271e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-17 18:19:07 +02:00
Tor Arne Vestbø
cd41b01f32 macOS: Don't produce NSImages without a single representation
Doing so results in exceptions inside AppKit when passed on to APIs that
expect valid images. It's better to produce nil-images.

Fixes: QTBUG-83494
Change-Id: I1e5bfa2a7fecd75a1ddb95bd1a6dc2e8db6b24f8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-17 18:19:01 +02:00