Commit Graph

55956 Commits

Author SHA1 Message Date
Edward Welbourne
7db6aa4395 Fix overflow issue discovered by MSVC in C++20 mode
In setMSecsSinceEpoch(), when epochMSecsToLocalTime() fails (e.g. when
msecs is near one end of time and the offset being added causes
overflow), the call to setDateTime(d, ...) is bypassed so the d-ptr is
not updated and getStatus(d) returns the status prior to the function
call. The new status being prepared by the function should thus not be
updated to getStatus(d) unless setDateTime(d, ...) was called.

This amends commit 74eddd5bf0

Done-with: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Fixes: QTBUG-102157
Pick-to: 6.3
Change-Id: I25e358070907f22d9e4fb0030fa82ec290c7a730
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-05 19:40:17 +02:00
Edward Welbourne
d9ae822e05 Minor post-""_L1-ification tidy-up in QDateTimeParser
Change-Id: Ibbead3922446b820bfe6def5f1278fd7825f0425
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-05 19:40:17 +02:00
Edward Welbourne
1c359df621 QDateTimeParser: Correct a comment which was exactly wrong
Change-Id: I90c2b2bce4aeb5fe9edf70122c6546976583e1bf
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-05 19:40:17 +02:00
Andreas Buhr
edf9b23145 Extend androidtestrunner default timeout to 8 minutes
qmake had a feature to set androidtestrunner's timeout. This
feature is not yet ported to CMake. So with CMake, we always
have androidtestrunner's default timeout. Which was
five minutes. We have several tests which take just shy of five
minutes and are thus flaky.
This patch extends the timeout to eight minutes. This should be
a temporary workaround until the timeout feature is implemented
in CMake.

Task-number: QTBUG-101596
Pick-to: 6.2 6.3
Change-Id: Ia67ed6ab40a40f1b82861bd15bd04528ee9334ee
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-04-05 19:40:17 +02:00
Andreas Buhr
ea6f556186 Activate tst_qmessagebox for Android
tst_qmessagebox was disabled because it crashed.
It does not any more. Now it hangs, which
is a new problem.

Fixes: QTBUG-87671
Task-number: QTBUG-101217
Pick-to: 6.2 6.3
Change-Id: Iec15cf82a4112ee79182ec091622e40147bd3e7f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-04-05 18:40:17 +01:00
Laszlo Agocs
a5db072dc2 rhi: Add explicit subclass for RTs from swapchains
We want to enable gaining access to the underlying resource(s) by
inspecting a QRhiRenderTarget. This is not currently possible for
swapchains since there is nothing that references the actual
QRhiSwapChain. To clean this up, make an explicit, new
QRhiSwapChainRenderTarget subclass. Thus the logic already used in a
couple of places to examine the resources attached to a
QRhiTextureRenderTarget can now work with swapchain render targets too,
by branching based on the resourceType().

This eliminates the somewhat odd setup where a "RenderTarget" resource
is QRhiRenderTarget corresponding (but not exposing!) a swapchain,
whereas a "TextureRenderTarget" is a QRhiTextureRenderTarget which
is a subclass of QRhiRenderTarget. Now we correctly have an (abstract)
base and two subclasses, one for each type of render targets.

Besides, it allows us to clean up the oddly named
Q...ReferenceRenderTarget classes in the backends, which initially tried
to indicate that this "render target" merely references (or, in
practice, is) a swapchain. We can now have a nice and symmetrical
Q...SwapChainRenderTarget and Q...TextureRenderTarget naming scheme.

Change-Id: Ib07e9be99a316eec67b94de0860e08f5f4638959
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-04-05 19:40:17 +02:00
Mårten Nordheim
d72f2ca9ea QMetaType: Add qHash() overload
This is needed for use in QHash and similar.
It's essentially the same as using the integer id, but typesafe

Change-Id: I9515b8e178c8f9828934cb0bb099cce5553ec393
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-04-05 17:24:28 +00:00
Marc Mutz
d2d202c648 QtNetwork: sweep Q_DECLARE_METATYPE → QT_DECL_METATYPE_EXTERN [1/2]: public API
It's one of our best tools to improve compile times.

Can't backport to Qt 6.3 or 6.2 because this change introduces new
exported symbols.

Task-number: QTBUG-102206
Change-Id: I6bfa532be34ca847d3b9034d16c94efed3d602c3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-04-05 16:27:16 +02:00
Marc Mutz
bfd2d30169 WhenAllContext: optimize atomic operations
The old code performed one load-acquire (in the assertion) and one
ordered(!) fetch_sub() (in the pre-decrement operator) where one
relaxed fetch_sub() would suffice (it's just a counter).

Fix by caching the result of the relaxed fetch_sub() and performing
the following checks on the cached result.

As drive-bys, rename the atomic member variable (to catch any outside
uses) and make the ctor explicit.

Found by locally disabling the QAtomic<T> -> T implicit conversion
operators.

Change-Id: Ifdc11c2c4807b71f4cab2ba9f5405ace7d8d71a9
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-04-05 14:27:16 +00:00
Tatiana Borisova
8116fdde1c Reorganize work with graphical libraries on INTEGRITY
- Currently we manually unpack all platform libraries,
  that are required for GUI apps, and pack it into single eglmegapack.a library.
  It could be better do not execute such additional step,
  but have possibility to add required graphical libs
  to cmake interface lib via toolchain file list variable.

Pick-to: 6.2 6.3
Change-Id: Ic4122600f02e6828d528ee4f00075f8c27f42e38
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-04-05 17:27:15 +03:00
Tommi Mänttäri
aa8bada10b CI: add Windows host support for QNX
Add required environment variable configurations to COIN for
building Qt SW in Windows host for QNX OS.

Task-number: QTBUG-101292
Pick-to: 6.3 6.2
Change-Id: I3ea4cbaaebb693a0a46b5f9cbd08209805366ca7
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
2022-04-05 17:03:40 +03:00
Tommi Mänttäri
e506c84eb2 CI: use HOME directory for QNX license and PATH in Linux host builds
To ensure that both Linux and Windows host builds are equivalent
the Linux host builds need to use the common QNX SDP file that
support both host environments. This new QNX SDP does not include
QNX license files like previously, instead they are separately
installed by the Ansible scripts of the CI system to the $HOME/.qnx
directory. That directory is also supposed to be used for any possible
binaries found via PATH environment variable.

Task-number: QTBUG-101292
Pick-to: 6.3 6.2
Change-Id: I97ad71f00e8289e708c51565f86c6d0c84a9ae84
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
2022-04-05 17:03:40 +03:00
Nodir Temirkhodjaev
99f22e3fc8 QSplitter: Don't move handle in non-pressed state
Fixes: QTBUG-102249
Pick-to: 6.2 6.3
Change-Id: Ib1d74447e346760d1fc9960e11486e8dc7ea3bc0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-04-05 17:03:40 +03:00
David Skoland
cd1ac8666c Correct documentation in QMainWindow in regards to centralwidget
It's quite clear from the code in qmainwindow.cpp and
qmainwindowlayout.cpp that centralWidget returns nullptr (not zero)
if it's not set. This also seems to be perfectly well supported,
contrary to the note given.

Change-Id: Ib7ab37f3645089fb85d7262717b7147b5871c1ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2022-04-05 15:01:12 +02:00
Timur Pocheptsov
306f44a176 QCocoaTheme: use NSColor.controlAccentColor for QMenu items
The highligh color we have looks too different to what system menus
have. Accent color seems to be better matching this color, though
it's not really what we can see in menus, which are transparent and blend
with watever lies below them.

Fixes: QTBUG-75386
Change-Id: I03f66808eb885594862ad9b31398cae4ca186593
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-04-05 15:01:12 +02:00
Joerg Bornemann
b5ed3cb7ba qmake: Add support for C++23
Add the CONFIG value c++2b that represent the upcoming C++23 standard.
Add QMAKE_CXXFLAGS_CXX2B and QMAKE_CXXFLAGS_GNUCXX2B.
On MSVC, use /std:c++latest when c++2b is active.

This fixes an issue with MSVC where c++latest implied the /std:c++20
compiler flag.

Pick-to: 5.15 6.2 6.3
Fixes: QTBUG-102202
Change-Id: Ie00ee5793c1a649195013c8c19efc8d59cf0acc9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-04-05 14:27:50 +02:00
Pasi Petäjäjärvi
6c760f8cef CI: Blacklist mixedScripts for QNX
QNX tests are run under QEMU so have the same problem as Ubuntu.

Pick-to: 6.2 6.3
Task-number: QTBUG-100928
Change-Id: Id7c7639b743062c777502e2ba8b28f9bb18deb19
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-04-05 12:27:49 +00:00
Marc Mutz
fa67208f8f QBufferPrivate: use NSDMI
Removes some #ifdef'ery.

Also remove the unneeded dtor. While this is a polymophic class, it's
not in a header, so we won't run into the scenario described in
QTBUG-45582.

Pick-to: 6.3
Change-Id: I1a8598402ff2a564cc53da2f85ed3ed00ca3ddbf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-04-05 13:47:16 +02:00
Marc Mutz
5d6d127271 QFutureInterface: optimize atomic load
As all other 20+ users of the state variable, use a relaxed atomic
load under the protection of the mutex. There's no need for the
loadAcquire() that the implicit conversion operator uses under the
hood, because a) we're under mutex protection and b) the state doesn't
guard any other data but itself.

Found by disabling said implicit conversion operators.

Change-Id: I2a76242271cec96175cde503ca883805db6b9212
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-04-05 13:47:15 +02:00
Marc Mutz
a6657bef40 QPropertyBindingSourceLocation: fix BiC in source_location ctors
Since the class is exported, both ctors from source_location (std and
experimental) need to be in the DLL, otherwise a Qt built with C++20
(using std::source_location) may break C++17 users that, however, have
experimental::source_location (and therefore expect the DLL to export
it).

This is exactly the same issue we had with QPolygon and
QVector::begin() with and w/o QT_STRICT_ITERTORS, therefore the same
fix applies, with the difference that we don't need a separate TU here
to inject the missing symbols, because both versions can be
overloaded.

[ChangeLog][QtCore][QPropertyBindingSourceLocation] (Windows only)
Fixed a binary-incompatibility where source_location constructors were
missing in the ABI.

Pick-to: 6.3 6.2
Change-Id: I4a514565cceea5f92975eff3a3e936efa5f7d8da
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-05 13:47:15 +02:00
Marc Mutz
1c9f990332 QtGui: sweep Q_DECLARE_METATYPE → QT_DECL_METATYPE_EXTERN [2/2]: private API
It's one of our best tools to improve compile times.

Can't backport to Qt 6.2 because the macros don't exist there.

Pick-to: 6.3
Task-number: QTBUG-102206
Change-Id: I80734b4d43928fce0e66329b5b897a2738db9b30
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-05 11:47:15 +00:00
Marc Mutz
53327f5751 QtGui: sweep Q_DECLARE_METATYPE → QT_DECL_METATYPE_EXTERN [1/2]: public API
It's one of our best tools to improve compile times.

Can't backport to Qt 6.3 or 6.2 because this change introduces new
exported symbols.

Task-number: QTBUG-102206
Change-Id: Ib8224ed60afa893744f369fe7394d27e89b66c11
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-05 13:47:15 +02:00
Morten Johan Sørvig
2d85244802 wasm: Make sure all qstdweb classes have val()
These are sometimes needed for passing objects on
to native API.

Change-Id: I89a1a95e6d51932ae3b49eec072261bcb5dbb463
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-04-05 13:32:11 +02:00
Jarkko Koivikko
8bca441b6f Android: Fix deadlock caused by a race between permissions query and IM
Android permissions query blocks Qt main thread. If the input method
was activated before the permissions query started, android would try
to invoke input method before returning back to permissions query.
This will cause a deadlock.

Fix the issue by moving the deadlock counter to Qt core and
incrementing the value before the permissions query. This will prevent
the input method queries to enter Qt main thread.

Fixes: QTBUG-99484
Pick-to: 6.2 6.3 6.3.0
Change-Id: I54ea59578880cde4095c26fa2a6a264c4dc1b7ff
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-04-05 12:06:23 +03:00
Tor Arne Vestbø
e6c80fc011 Remove unused parameter in NmakeMakefileGenerator::suppressBuiltinRules()
Change-Id: I05100656d89ca464c9ef57a442dac7f75da235aa
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-04-05 11:06:23 +02:00
Tor Arne Vestbø
316a140acb QFontDatabase: Update docs for QGuiApplication::fontDatabaseChanged()
The signal can be emitted not only when user fonts are added or removed,
but also when the system fonts change.

Change-Id: I8f066ac87e7bc68843cd9014cd3c31af2f3a7890
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-04-05 11:06:23 +02:00
Dimitrios Apostolou
0b4446e16f qt-testrunner: be more strict if bad XML log files are written
If a test returns 0 but writes an XML logfile that contains FAIL or a
corrupted XML file, then qt-testrunner considers it a CRASH and exits
with 3.

Previously any test execution returning 0 (success) was considered
a PASS. Changing this behavior with this patch finds a lot of test
crashes on Android (QTBUG-100470), because the tests are run indirectly
on the emulator and the test wrapper process could not detect the crash,
thus returning 0 to qt-testrunner. But the corrupt XML file is caught
now.

Likewise, if a test returns != 0 but the XML logfile contains only PASS,
qt-testrunner considers it a FAIL. This used to be the case but now
tests are added.

Finally changed logging for such cases from INFO to WARNING.

Task-number: QTBUG-100470
Change-Id: I404c9d2211c7de027bf776d1914519d37f513ca1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-04-05 12:06:23 +03:00
Marc Mutz
ade96f461d [doc] Fix typo in QBuffer::setBuffer() description
Pick-to: 6.3 6.2 5.15
Change-Id: I0afb0f114ddf7ceb5e99cb1bca3db99fd6e29223
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-05 10:30:00 +02:00
Venugopal Shivashankar
98a94cd6da Doc: Add qdoc macro for tabbed content
The macro enables tabbed content in the online style
only. It's usage must be gaurded with a conditional
block as shown in the following example to handle
the offline style usecase:

 \if(onlinedocs)
   \tab {build-qt-app}{tab-cmake}{CMake}{selected}
   \tab {build-qt-app}{tab-qmake}{qmake}{}
   \tabcontent {tab-cmake}
 \else
   \section1 Using CMake
 \endif
   CMake-specific instructions go here
 \if(onlinedocs)
   \endtabcontent
   \tabcontent {tab-qmake}
 \else
   \section1 Using qmake
 \endif
   qmake-specific instructions go here
 \if(onlinedocs)
   \endtabcontent
 \endif

Pick-to: 6.2 6.3
Change-Id: I02d50c057280a9ffea913642284e67ddcda7aa94
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2022-04-05 10:30:00 +02:00
Liang Qi
27efadec22 xcb: Correctly set physical size for screen with RandR 1.5
This amends 9a4c98e556.

Fixes: QTBUG-101038
Pick-to: 6.3
Change-Id: Ie75953af475dc606b34c3e274438075f20bdd8ae
Reviewed-by: Liang Qi <liang.qi@qt.io>
2022-04-04 17:48:14 +00:00
Alexandru Croitor
d26c1ba4de CMake: Make sure the strip_for_binary project works with Makefiles
The printed lib path did not appear when building the project with the
Unix Makefiles generator.

Make sure the printing does not depend on the shell used by the
generator, by making it VERBATIM.

Amends 39f657032b

Pick-to: 6.2 6.3
Task-number: QTBUG-101653
Change-Id: I3853bbed3b121ecdc8b2e9da42eb3399f347b8c2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-04-04 15:41:20 +02:00
Alexandru Croitor
7694b01aaf coin: Don't package installed example binaries
To do that, we install the example binaries into a new directory
rather than the main install dir.
The contents of the dir is not archived by the Coin agent.

This decreases the size of the binary artifacts.
This will be especially important when the examples contain deploy logic
which will install the shared Qt libraries next to each example binary.

Pick-to: 6.2 6.3
Task-number: QTBUG-90820
Change-Id: I0b112698514309bb9b0794ce4117e8bf30c3a819
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-04-04 15:41:20 +02:00
Alexandru Croitor
9a18facc66 CMake: Allow specifying custom install dir for non-EP examples
Originally, QT_INTERNAL_EXAMPLES_INSTALL_PREFIX was added to
control the installation of examples when they are built as
ExternalProjects, and was not considered for the non-EP case because
we hoped to switch entirely to EP-based building.

Due to some unsolved issues regarding using EP builds in CI, add the
ability to control the installation of non-EP examples.

This will be used in the CI to allow removing the hacky
INSTALL_EXAMPLEDIR and INSTALL_EXAMPLESDIR assignments in example
projects.

It is also likely that we will not deprecate the non-EP based
building, because it is useful for IDE integration (EP targets
are not as developer-friendly to work with in an IDE in regards
to rebuilding).

Amends 98c89c8cc1

Pick-to: 6.2 6.3
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: I02264aaa1daa2c80bb9ef3d02b1831b4ca5d2b84
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-04-04 15:41:20 +02:00
Alexandru Croitor
33f631920f CMake: Rename QT_INTERNAL_CUSTOM_INSTALL_DIR
to QT_INTERNAL_EXAMPLES_INSTALL_PREFIX so it's clear that the
variable only affects the location of where examples
are installed.

And make sure the paths are passed as CMake paths.

Amends 1031fa1547

Pick-to: 6.2 6.3
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: Ib92c55488b736d980da2bd88255de78e183de824
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-04-04 15:41:20 +02:00
Alexandru Croitor
c926ef55de CMake: Allow passing -v to ninja when building examples as EPs
By default when building ExternalProjects, even if the main ninja
invocation has -v passed, that won't be passed to the nested ninja
calls.

When building examples in the CI, we want to see the full command line
invocations.

Allow passing -v to the nested EP ninja calls by configuring Qt with
-DQT_INTERNAL_VERBOSE_EXAMPLES=ON, which we will use in our CI.

We don't want to add -v by default because if the main ninja does not
have one, the nested calls will still be verbose.

Pick-to: 6.2 6.3
Change-Id: Ifd4b312c6eaa7354e8870f4fb0a77fadf0f33ab7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-04-04 15:41:20 +02:00
Alexandru Croitor
2061cea0f3 CMake: Pass -v to ninja when using ctest --build-and-test
So we can see the command line invocations of the built cmake
auto tests.

To achieve that, we create a ninja shell script wrapper, because
ctest --build-and-test does not currently allow specifying custom
build tool options.

Details at
https://gitlab.kitware.com/cmake/cmake/-/issues/22443

Pick-to: 6.2 6.3
Change-Id: I7fb3b7f7f802943a7013c859b2cf39842a34e2e4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-04-04 15:41:20 +02:00
Alexey Edelev
a42e7839b2 Make possible to set android SDK/NDK roots from environment
Read the ANDROID_<SDK|NDK>_ROOT environment variables in qt toolchain
file and use them to chainload the android toolchain file.

Pick-to: 6.2 6.3
Change-Id: I1940ffbaa557974fc26005f4d051030f2cc5c7e0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-04-04 15:41:19 +02:00
Assam Boudjelthia
855ca9f48a Android: skip flaky tst_qcalendarwidget::showPrevNext()
Pick-to: 6.2 6.3
Task-number: QTBUG-102258
Change-Id: I96b5003e0b4266250e526439370603b47562cdea
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-04-04 14:27:22 +03:00
Allan Sandfeld Jensen
b18959ad7e Multithread qdrawhelper routines
Adds multi-threading to span handling routines in
qdrawhelper, effectively multi-threading almost all fills.

Also increases the number of spans processed at a time to
make the multithreading wider.

Change-Id: Iad04e187f880666855bebcd87d668f6c6fb5db7b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-04-04 12:27:22 +01:00
Mitch Curtis
3346611a47 QPA: improve plugin and theme documentation and logging output
This makes it easier to understand which plugin and theme are loaded.

Change-Id: I0eee395e1b7da5d5017d8f7839beefb547fdc7b0
Pick-to: 6.2 6.3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-04-04 18:41:12 +08:00
Marc Mutz
61157c8354 QBuffer: fix writing more than two GiB of data
In Qt 6, QByteArray can hold more than two GiB of data on 64-bit
platforms, so QBuffer should be able to handle writes of more than two
GiB, too. But the implementation didn't check for overflow and held
sizes in int variables, so it happily reported success but wrote data
only mod INT_MAX.

Fix by carefully avoiding overflow and using size variables of proper
type.

[ChangeLog][QtCore][QBuffer] Fixed silent data truncation when writing
more than two GiB at once on 64-bit platforms.

Pick-to: 6.3 6.2
Fixes: QTBUG-102171
Change-Id: Ib666f9f7db24495b4ed64191a48b35edc410f7e9
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-04-04 08:17:09 +02:00
Allan Sandfeld Jensen
30873cc720 Re-fix C++20 ambiguous relational operators after adding QJsonValueConstRef
Change-Id: I573ffe2eb4a63b52a8e3982f6feb1b195913e538
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-04-03 15:29:44 +00:00
Marc Mutz
360f3de390 QtDBus: optimize handling of isDebugging
This is part of a series of patches deprecating implicit conversions
of QAtomic<T> variables to T.

Use relaxed atomic loads and stores on the 'isDebugging' variable. The
old code used the implict conversions to and from int and therefore
loadAcquire/storeRelease. Here, the int is the only value, it's not
guarding the construction of any other data, so relaxed loads and
stores suffice.

A further optimization would be to make the initial value of
isDebugging 0, to send it into the BSS instead of the TEXT/DATA
segment, but seeing as this is just compiled in for the auto-tests,
this patch leaves that particular change for another round (or never).

Pick-to: 6.3
Change-Id: Ide92f6c1a12137fcbc3ec15e146f6dcbdb6b481b
Reviewed-by: David Faure <david.faure@kdab.com>
2022-04-03 16:18:43 +02:00
Marc Mutz
e4186b2b28 QtDBus: sweep Q_DECLARE_METATYPE → QT_DECL_METATYPE_EXTERN
It's one of our best tools to improve compile times.

Can't backport to Qt 6.3 or 6.2 because this change introduces new
exported symbols.

Task-number: QTBUG-102206
Change-Id: Iae9d4017a984c845a76d0b9b088ad3e467fe1d54
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-04-03 16:18:43 +02:00
Marc Mutz
e191edfad0 QMetaType: don't allocate memory just to look up a key in a QHash
Use fromRawData() to create a QByteArray-as-a-view instead.

Pick-to: 6.3
Change-Id: Ic6083ec438bc089a6f11d7e4718eca72c0d51fe3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-03 16:18:42 +02:00
Marc Mutz
01dab0b953 QGlobalStatic: mark functions that inspect the guard noexcept
Because they are.

Pick-to: 6.3
Change-Id: I60e94ebbe6fcd624195aeaed5de76cabc61c3178
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-04-03 16:18:42 +02:00
Marc Mutz
b0e4d53b63 QMetaType: don't create a registry just to query its emptiness
The function-call operator of QGlobalStatic creates the payload object
unless is has already been deleted. When performing read-only
operations on the payload object, it's better to use
QGlobalStatic::exists() + the dereference operator instead, because
that prevents the creation of the payload just to find it empty.

Pick-to: 6.3
Change-Id: I367add516520d076412cbbc542ee7a3b6ea45c14
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-04-03 12:20:55 +02:00
Marc Mutz
168a02d405 QMetaType: unlock QReadLocker early
Unlock the QReadLocker after we're done with the registry, before we
perform expensive operations such as I/O and QByteArrayList::join().

Pick-to: 6.3
Change-Id: I96549c517a2b4ffe34a70ea83f8c061ff9620795
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-03 12:20:53 +02:00
Ivan Solovev
6f725e6ef9 Revert "Activate all tst_qgridlayout tests on Android"
This reverts commit b39d3cfe30.

Reason for revert: the test fails in dev again

Task-number: QTBUG-87404
Change-Id: Icc51e36e037e9c7e8154266def129dd8ad412775
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-04-02 16:57:32 +00:00
Christian Ehrlicher
4913aca32f Doc: fix documentation for QGraphicsItem::setAcceptedMouseButtons()
Fix the documentation to pass Qt::NoButton instead 0 to
QGraphicsItem::setAcceptedMouseButtons() since 0 is no longer accepted
by QFlags.

Change-Id: Ib98d509382e5b5407a07c74565adb7ee5afbb35f
Pick-to: 6.2 6.3
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2022-04-02 16:47:25 +00:00