Commit Graph

62068 Commits

Author SHA1 Message Date
Timothée Keller
530d092eae Windows QPA: Move transient children with a window move
When moving a window with keyboard shortcuts, popup menus currently do
not follow along. Allow this to happen by accounting for a window's
transient children, and moving them after the owning window has finished
its move.

Fixes: QTBUG-106483
Pick-to: 6.6 6.5
Change-Id: Id51a7c0163e4fdd2d139565f2bf500a3fc997488
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-06-27 16:36:06 +00:00
Tor Arne Vestbø
35063254fd Fix missing references to 'Qt Widgets - Application Example'
Amends eda71105ff

Pick-to: 6.5 6.6
Change-Id: I44fa9acef37667d635d5770ce5d50fc52d92aa88
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-06-27 17:39:23 +02:00
Tor Arne Vestbø
71f156fff0 Fix qdoc link warnings after moving a few examples to manual tests
Pick-to: 6.5 6.6
Change-Id: I81a6e9d52e858c3f733d4c527c70408772813b56
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-27 17:39:23 +02:00
Laszlo Agocs
821c404ef2 rhi: multiview: Exercise instancing in the test
Just to make sure instanced drawing does not regress. Relevant
particularly with Metal.

Fixes: QTBUG-114885
Change-Id: Ib39066d32985bf25ca02d5aa54d9cf654772be9a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-27 17:39:23 +02:00
Topi Reinio
43ea57b901 Use a global value for warning limit when testing documentation in CI
The most common limit for the maximum number of allowed documentation
warnings is zero. Use a global value for 'warninglimit', adopted by
all Qt module documentation projects that include the configuration
from qtbase/doc/global.

This allows for a temporary increase of the limit across all modules as
needed - for example, when updating the QDoc binary that the CI
provisions to a version that introduces new types of documentation
warnings.

Increase this base limit temporarily to 10 to help re-enable
documentation testing in CI as it's currently disabled.

Task-number: QTBUG-113326
Change-Id: I8b66951ca9324bcfaec3b5a7ec2cff544c62feb0
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2023-06-27 15:12:31 +00:00
Michael Klein
69de333e1f QNetworkReply: Propagate proxy errors properly
Map QNetworkError::HostNotFoundError and QNetworkError::ConnectionRefusedError
 to ProxyNotFoundError resp. ProxyConnectionRefusedError when it originated
from the communication with the proxy server.

Fixes: QTBUG-68821
Pick-to: 6.5 6.6
Change-Id: I21b91f2667ba0cd329d4ece1fe543472cdab2d22
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-06-27 17:12:31 +02:00
Richard Moe Gustavsen
d74235db5d tst_qcombobox: skip popupPositionAfterStyleChange on QEMU
The test turns out to be flaky on QEMU.

Fixes: QTBUG-114760
Pick-to: 6.6 6.5
Change-Id: I264f79e9a056e82d4e6735e6ead0710ddabd8eba
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-27 13:58:55 +02:00
Laszlo Agocs
7fee97cb2e Update windeployqt with dxc
Basically an adjusted version of findD3dCompiler() that looks for two, not one, DLLs. The logic is the same, with added support for ARM64, though this has not been verified in practice.

Fixes: QTBUG-114789
Change-Id: I1fec51fc98a5146e2770e13cf2f3b160ac4282d6
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
2023-06-27 13:58:55 +02:00
Giuseppe D'Angelo
3ec24e329c SSL: upgrade the default DH parameters
We have been using as default DH parameters the 1024-bit MODP group.
This is now considered insecure, and applications should use the
2048-bit at a minimum [1]. This commit therefore replaces the parameters
with the 2048-bit MODP group from [2].

To double check the data, use openssl asn1parse to verify that the prime
matches. For instance:

1) put the encoded string in a `encoded.txt` file (c&p from the source,
   removing the double quotes)
2) put the hexadecimal value of the 2048-bit group in a `reference.txt`
   file (c&p from [2])
3) compare the output of openssl asn1parse with the reference. For
   instance like this:

    $ diff <(openssl asn1parse < encoded.txt | grep -m 1 INTEGER | perl -pe 's/.*://; s/\n//') <(perl -0777 -pe 's/\s//g' reference.txt) && echo OK
    OK

[1] https://datatracker.ietf.org/doc/html/rfc8247#section-2.4
[2] https://datatracker.ietf.org/doc/html/rfc3526#section-3

[ChangeLog][QtNetwork][QSslDiffieHellmanParameters] The default
Diffie-Hellman parameters are now using the 2048-bit MODP group from
RFC 3526.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I47133cd78ba0e954b8f93a3da09fa2c760c9f7a8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-06-27 10:55:27 +02:00
Ahmad Samir
543ae6e6a4 QStorageInfo/Linux: use readAll() with /proc/self/mountinfo
This minimizes any multi-threading / file-locking issues as the file is
closed once the contents are read.

This change assumes /proc/self/mountinfo is available on Linux systems,
and doesn't fallback to setmntent(). It's been around since at least
Linux Kernel 2.4.0.

This requires exporting qstrntoll() for the unittests (using
QT_AUTOTEST_EXPORT and wrapping the those unittests in "#ifdef
QT_BUILD_INTERNAL"), otherwise linking fails.

Fixes: QTBUG-77059
Change-Id: I0363258a9979ea6dadfe5e36c02534ffbd3386c5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-06-27 02:28:21 +03:00
Laszlo Agocs
74bd7a7019 rhi: metal: Add support for multiview rendering
Some shortcomings and unexpected problems are not unlikely.
The basic feature, with 2 views going to a texture array's
0 and 1 elements, seems to be working with macOS, also with
MSAA. Instanced drawing has not been verified. (relevant
because layered rendering works via instancing in Metal
and the QRhi backend has to adjust the instance count
in every draw call)

Fixes: QTBUG-114774
Change-Id: I3655e0d2c658b88c4cd6b52a32f94134324e4ac9
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-27 00:48:30 +02:00
Tor Arne Vestbø
2a65849e10 Move dock widgets example to manual test
Pick-to: 6.5 6.6
Change-Id: I23ca3f2450df8f6c71509235ccec655d88d0d6d7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 23:15:02 +02:00
Tor Arne Vestbø
fc0e82f58a Move dirview example to manual test
Pick-to: 6.5 6.6
Change-Id: I9057d5efb1cdf3e425e879f8cc96a544c1892e77
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 23:15:02 +02:00
Tor Arne Vestbø
65e7303ec9 Move digital clock example to manual test
Pick-to: 6.5 6.6
Change-Id: I043c0060a71d9de2f3e74aab0759d07a20880c3a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 23:15:02 +02:00
Tor Arne Vestbø
e46fb69a87 Move chart example to manual test
Pick-to: 6.5 6.6
Change-Id: I95a40834853a0157d8fa6137431bfd86ce855b2f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 23:15:02 +02:00
Tor Arne Vestbø
3a8265a429 Move character map example to manual test
Pick-to: 6.5 6.6
Change-Id: Ie27fe436fc7ae7774beaa78f8a27f6009027753a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 23:15:01 +02:00
Tor Arne Vestbø
288c7ef557 Move calendar example to manual test
Pick-to: 6.5 6.6
Change-Id: Ie2215ae0feeb322888619aed632e20db9b69e20b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 23:15:01 +02:00
Laszlo Agocs
f3cf1fd760 rhi: d3d12: Handle wants-debug-info flag on the dxc path
Task-number: QTBUG-114768
Change-Id: I529f53dd85ef6a6e337cf13208aaa6dbf535fd26
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-26 21:28:24 +02:00
Laszlo Agocs
97d7fdfeee rhi: gl: Implement msaa resolve for multiview
Task-number: QTBUG-114790
Change-Id: I295547576ff6fe45c8fe9d03ecd678d323b9ee30
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-26 21:28:24 +02:00
Laszlo Agocs
07d900dd57 rhi: gl: Make resolve on par with other backends
Just handling attachments with a render buffer set and only one
attachment is not what other backends do. They support all attachments
and also the cases of multisample (2D) textures and multisample texture
arrays.

By extension this allows multisample 2D texture arrays. (GL 3.2+/GLES
3.1+) This was previously not working probably since the correct texture
target was never used.

Pick-to: 6.6
Change-Id: Ibe929faaf86824a596f9794240d1becc51f68e43
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-26 21:28:24 +02:00
Laszlo Agocs
6576da1c16 rhi: d3d12: Fix resolving with multiview
Follow what got documented in the previous patch.

Task-number: QTBUG-114790
Change-Id: I3e8b3028639c3e4edd39eb0f9446f7eae5f96f3b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-26 21:28:24 +02:00
Laszlo Agocs
2574b4bb40 Add an option to exercise MSAA in the multiview test
Task-number: QTBUG-114790
Change-Id: Id9378abb13e56062bf1db6c7360595b7a2f1afc6
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-26 21:28:24 +02:00
Laszlo Agocs
2f619c2ddf rhi: vulkan: Fix multisample resolve with multiview
Task-number: QTBUG-114790
Change-Id: I3afccc3f7ae2d05aa9aa0e0943aeadc080016f0e
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-26 21:28:24 +02:00
Thiago Macieira
003c29511d QMetaContainer: add missing #include <iterator>
For std::iterator_traits, tags, std::advance, std::distance, etc.

Pick-to: 6.2 6.5 6.6
Fixes: QTBUG-114583
Change-Id: I443cf0c8a76243eead33fffd1768e904ae823f75
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-06-26 19:28:24 +00:00
Thiago Macieira
7d0431bb8b tst_QFile: remove the timer in unixPipe and socketPair
We were basically timing the qSleep, which is pointless. We don't need
to verify that qSleep(X) spends at least X time. Because it also
doesn't. Somehow, QNX can execute 1000 ms sleeps in 996 ms.

Amends commit 30e5ff3ff2.

Pick-to: 6.6 6.5
Change-Id: I46b5dede27114be29724fffd176a66c1799075b7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 12:28:24 -07:00
Tor Arne Vestbø
42b58f8cb4 Move border layout example to manual test
Pick-to: 6.5 6.6
Change-Id: I3f45043a64275f8678288e1d9839271eafa1fd2b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 20:47:45 +02:00
Tor Arne Vestbø
6c96218b43 Move qpa examples to manual tests
Pick-to: 6.6 6.5
Change-Id: I7b25b1c8100f04eec3d9a571f59a1babef55b1d5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 20:47:45 +02:00
Tor Arne Vestbø
21f3a6d8c5 macOS: Propagate mouse enter/exit for windows embedded into foreign windows
Similar to the isEmbedded() case, when the parent of a QWindow is a
foreign window, created via QWindow::fromWinId(), we don't have a
QNSView parent that will handle mouse enter/exit on our behalf.

Longer term we probably want to fold this case into the isEmbedded()
case, but as that function is used other places too this requires
some more research, so for now let's fix hover events.

Fixes: QTBUG-114605
Pick-to: 6.5 6.6
Change-Id: Ib61aefc84ed080417a6820a4a365555424b208be
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 20:47:45 +02:00
Giuseppe D'Angelo
dae24df07f QtNetwork: code tidies: use the 4-arg connect overload
The 3-arg connect is error-prone and makes the lifetime of the
connection unclear.

Change-Id: I43dabe3d25ffc2b711aa50dec525d72a8810861c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-06-26 20:47:44 +02:00
Tor Arne Vestbø
2ffa125c2d Fix build with -sanitize undefined
Fixes: QTBUG-114865
Pick-to: 6.5 6.6
Change-Id: If21f0faa8aacc84745c972438c2e30940716fb66
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-06-26 19:32:11 +02:00
Timothée Keller
1d3b06a1ab Windows QPA: Fix dpi change when changing screens with keyboard
If moving a window from a screen to another using keyboard shortcuts,
the screen change detection happens after the handleDpiChange() call
which essentially makes Qt think the window stayed on the old monitor.
Instead of checking against currentScreen DPI, check against savedDpi
which should not have this problem.

Task-number: QTBUG-106483
Pick-to: 6.6 6.5
Change-Id: Ic30dc1b16bbaf9306a086c8d3042f5341d3848c1
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-06-26 17:32:11 +00:00
Mikolaj Boc
58a47edda1 Use a sanitized JS export name for WASM modules
Previously, a target name with a JS special character (like, -, for
example), would lead to an invalid export name being generated for
WASM modules. Sanitize these by replacing any non-alphanumeric
character with underscores, as is done for feature names.

Change-Id: I01fbc50bddedd011a9584f673d79d88a3bc09bbb
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-06-26 19:32:10 +02:00
Tor Arne Vestbø
e27841c2fb Add XDG theme file for example icons
Allows easy use from the examples.

Pick-to: 6.6
Change-Id: I731ea5641e247db2937aa1b12d1e91dd7dcb2848
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 17:32:10 +00:00
Tor Arne Vestbø
f4a80552c2 Move permissions example to manual test
Pick-to: 6.5 6.6
Change-Id: If7482ff20079d91ddba26a1abcb06b3054cc72ad
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-06-26 18:45:25 +02:00
Tor Arne Vestbø
69cc7f946a iOS: Propagate UIColor.tintColor as QPalette::AccentColor
Pick-to: 6.6
Change-Id: Ib7418782f22abd8b60747d9df65810ff288a8246
Reviewed-by: Doris Verria <doris.verria@qt.io>
2023-06-26 18:45:25 +02:00
Santhosh Kumar
491534006e Fix disabled and inactive group palettes for windows native style
The dark mode related changes for windows didn't update disabled and
inactive group palettes, and this makes text in certain context
(such as menu bar) appear with enabled color. The windows theme API
populateLightSystemPalette() is responsible for this and it updates
palettes for color roles and certain inactive scenarios but not for
disabled.

This patch set makes existing systemPalette(Qt::ColorScheme) to be
available in QWindowsTheme and it updates palette depending on color
scheme. From now on, this API updates palettes for windows native
style. Its to be noted that window native style use light palette
irrespective of color scheme.

Fixes: QTBUG-114821
Pick-to: 6.5 6.6
Change-Id: Iff4f35900293b8e7030ec121ca21856daa094dc0
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-06-26 18:45:25 +02:00
Laszlo Agocs
1c4dbd14ae rhi: d3d12: Fix more than one window with the same QRhi
This is what maps to the Vulkan and Metal backend. Taking the
frame slot from the other swapchain was a mistake. It should use
the frame slot from the current swapchain.

Pick-to: 6.6
Fixes: QTBUG-114826
Change-Id: I1585088ce9a963f1710168d3ebc0d2e5f1e9ab21
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-26 18:45:25 +02:00
Laszlo Agocs
00f0384f79 Allow storing the view mask buffer binding in QShader metadata
Task-number: QTBUG-114774
Change-Id: I53b348b0f3bade2df69cddc866503b7c5b0e046b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-26 18:45:25 +02:00
Laszlo Agocs
582e9015cf rhi: multiview test: Fix leftover resourceUpdate call
This should not be there because 'u' is passed to beginPass().

Change-Id: I95ba8ed400baa06948b4d4c6bbf7ca2d07a5480f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-06-26 18:45:25 +02:00
Mike Chen
4afcdc488f Fix QTextEdit/QPlanTextEdit palette not updated on ActivationChange
When a QTextEdit/QPlanTextEdit window loses focus and receives
PaletteChange event, the ColorGroup that controls the palette for
the QWidgetTextControl will be set to 'Inactive'. However, the
QTextEdit does not update the palette when the window is activated again.
This can become more noticeable in applications where different colors
are used for the 'Inactive' and 'Active' ColorGroups.

Pick-to: 6.5 6.6
Change-Id: Idd4dcc55b2bf8e671e7dd9cbd040782e1c3bf1a3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-26 16:21:30 +00:00
Mårten Nordheim
02ca59c4c8 tst_QNetworkReply: split extremely long line
Gerrit says it refuses to color lines that exceed 500 characters, so
let's split this line to get colors back.

Pick-to: 6.6 6.5
Change-Id: Iab6d37332e27ecdeaf1420da6fa242ca65f0aab5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-06-26 14:32:22 +02:00
Topi Reinio
577174d505 Doc: Clarify that the rich text engine has limited support for HTML tags
Fixes: QTBUG-108482
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I10983c5737b8c4453e79467e5a41fd6dfe11069f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-06-26 12:09:34 +00:00
Mikolaj Boc
f2c0f35c39 Skip the tst_QRegularExpression::threadSafety test on WASM temporarily
The test needs investigation. Skip it for now so that we can enable
CI for WASM but leave a note to investigate it.

Task-number: QTBUG-109954
Change-Id: I445996e969e7016a4d92a7e70da10b6d84a0fc71
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-06-26 11:58:27 +01:00
Amanda Hamblin-Trué
ce39beea0c Revamp Bindable Properties Example
The use of Q_ASSERT(false) is bogus as we don't need to test here, but
want to signal unreachability.
Q_UNREACHABLE_RETURN allows us to tell the compiler that the point
can't be reached while also getting rid of the no return error.

Task-number: QTBUG-114689
Pick-to: 6.6 6.5
Change-Id: I007cd243055237bcc21772a4130a6c1a44fd882d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-06-26 12:16:25 +02:00
Piotr Wierciński
9f11a038b5 wasm: update emscripten to 3.1.37
Qt 6.6 will require emscripten 3.1.37

Pick-to: 6.6
Change-Id: Id036d799d5730ac8d8a5f7914d56a1ed421f9222
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
2023-06-26 07:58:11 +02:00
Ahmad Samir
9bb1efe33d QStringBuilder: one less macro in unittests
Two QCOMPARE calls aren't worth the extra indirection.

Change-Id: If3b54d303c28582c7df29a3f1c4dc1a2c2a974f4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-26 03:02:34 +03:00
Ahmad Samir
83f20dad5c qtconfigmacros.h: add note to QT_AUTOTEST_EXPORT docs
About the requirement of wrapping unitests in "#ifdef
QT_BUILD_INTERNAL".

Stating the obvious (which wasn't obvious to me until Thiago pointed it
out in code review, so).

Change-Id: If8b3dda43a7034b8304d2b93c0fbedbdbdb184b6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-26 03:02:34 +03:00
Giuseppe D'Angelo
5c9d820aeb QT_NO_CONTEXTLESS_CONNECT: docs tidies
Missing verb from sentence...

Change-Id: If0afbe3cb7197ec620a61e0b90e379592b581d74
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-25 22:25:13 +02:00
Giuseppe D'Angelo
842cfcec80 QObject: introduce QT_NO_CONTEXTLESS_CONNECT
The 3-arguments overload of connect() is error-prone / easy to misuse:

* it's easy to e.g. connect to a lambda, and capture local state in the
  lambda. By not passing a receiver/context, the connection won't get
  disconnected if the local state gets destroyed (effectively, it
  creates a "dangling connection");

* in a multithread scenario, one may not realize that the connection is
  forced to be direct. If the signal is emitted in another thread than
  the one establishing the connection¹, then the functor will be invoked
  in that other thread. (Not that "the thread establishing the
  connection" has ever mattered, but again, this API is error-prone.)

Add a macro that allows users to disable the overload in their project.
I'm not going for deprecation because there's simply too much code
around that uses it.

[ChangeLog][QtCore][QObject] Added the QT_NO_CONTEXTLESS_CONNECT macro.
Defining the macro before including any Qt header will disable
the overload of QObject::connect that does not take a receiver/context
argument.

Change-Id: I86af1029c1a211ea365f417aae9038d3fcacadfd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-24 19:09:30 +02:00
Giuseppe D'Angelo
7297cd808b QtCore: code tidies: use the 4-arg connect overload
The 3-arg connect is error-prone and makes the lifetime of the
connection unclear.

Change-Id: I4f2b54bc086e8f4723a0357d983e3df2f85135ac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-24 19:09:26 +02:00