Commit Graph

57102 Commits

Author SHA1 Message Date
Volker Hilsheimer
38114b8325 Fusion: better support dark themes in the dial
A UI in dark mode will have a dark background. Pick a light color to
draw the notches. Since in the mac style, the dark mode's 'dark' color
is lighter than the 'light' color, pick whichever is lighter.

Pick-to: 6.4
Change-Id: I333ea95b80d7a19504000877337b28839b4a8b9f
Reviewed-by: Doris Verria <doris.verria@qt.io>
2022-07-17 13:20:21 +02:00
Volker Hilsheimer
2738a80acd QWidget: extend timeouts in flaky enterLeaveOnWindowShowHide test
That test has a very flaky history on Windows 11, presumably because
there are even more fade-in/out effects. Wait longer for those to
finish.

Fixes: QTBUG-102239
Pick-to: 6.4 6.3 6.2
Change-Id: I1d59f4422469e60a8c4dc5a52c48f0344e954491
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-17 13:20:04 +02:00
Thiago Macieira
16641f625e QCborValue: free container memory in case of parsing failure
Holding on to the memory we've just allocated could only make sense if
we supported resuming parsing, but I haven't implemented that feature
yet.

Pick-to: 6.2 6.3 6.4
Change-Id: I36b24183fbd041179f2ffffd1700cf7e3558040f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-16 18:21:37 -07:00
Thiago Macieira
b483c67e0f QCborValue: attempt a bit of exception-safety around QList::reserve
We don't promise we're very good at handling exceptions.

Pick-to: 6.4
Task-number: QTBUG-104718
Change-Id: I89c4eb48af38408daa7cfffd16fdcc171db437bd
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-07-16 18:21:37 -07:00
Thiago Macieira
f6e6ae092d QCborValue: further clamp down on memory allocation for CBOR streams
We were allowing up to 1 million elements for each array, which meant 16
MB (32 for maps), and we considered that sufficient. However, because we
do allow up to 1024 levels of recursion, the memory consumption was
actually limited to 16 GB (32 for maps), which is a bit too high for
64-bit applications, and definitely too high for 32-bit ones.

So further clamp down, to a mere 16k elements on 32-bit and 64k on 64-
bit, which limits the memory use to 256 MB on 32-bit and 1 GB on 64-bit.
And additionally apply this exact limit to maps, instead of allowing
them to double the size.

As before, this does not limit the size of non-corrupt streams. This
only limits the initial memory pre-allocation.

Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-104718
Change-Id: I89c4eb48af38408daa7cfffd16fdcb34f08c1949
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-16 18:21:37 -07:00
Shawn Rutledge
65adfd5ec5 Fix QPointerEvent::allPointsGrabbed()
Amends 8932e80d0c to make implementation
match docs: the ! went missing during repeated patch rebasing, apparently.

Pick-to: 6.2 6.3 6.4
Task-number: QTBUG-101932
Change-Id: I3fe910774f5bdf4ab0342a9cf1994bb489f20e87
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-17 00:07:20 +02:00
Thiago Macieira
e1a787a76e forkfd: implement vfork(2)-like support on Linux
fork() works by implementing Copy-On-Write for all pages that either the
parent or the child process write to. So if the parent process continues
running while the child is between fork(2) and execve(2), then it will
keep causing page faults and requiring the OS to duplicate those pages,
which may be expensive (page table updates, TLB flushes, etc.). This
problem is aggravated if the parent process is multithreaded, as the
simple act of running in the parent will cause those threads' stacks to
cause page faults.

The BSD solution for that was vfork(), which has two differences in
behavior: (1) it blocks the parent from running and (2) it shares memory
with it. But it's always been tricky, so POSIX.1-2001 deprecated it and
2008 removed its definition completely. Still, it is available somewhat
widely, and on Linux that can be achieved with clone(2) and the
CLONE_VFORK and CLONE_VM flags, for those two behaviors respectively.

Because of (2), we can't return from the forkfd() function in the child
(as that would trash the stack in the parent process), so to implement
this functionality vforkfd() adds a callback of the same signature as
glibc's clone(2) wrapper (something that hadn't occurred to me when we
attempted to use CLONE_VFORK last time).

On Linux, (1) is no problem, as clone(2) has native forkfd support. But
on other OSes, forkfd() requires the parent to run before the child
execve()s, in order to save the child PID in the list of children we're
going to handle SIGCHLD for in a non-racy way. Investigating if it is
possible to use vfork() anyway is left as an exercise for the reader.

Matching OpenDCDiag pull request:
https://github.com/opendcdiag/opendcdiag/pull/94

Pick-to: 6.4
Fixes: QTBUG-104493
Change-Id: Id0fb9ab0089845ee8843fffd16fa63c7c6f7dd1c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-16 10:50:47 -07:00
Mikolaj Boc
a7e187cf16 Fix losing grip on dragged window on WASM
When a window is being dragged, we should not check for the target
window's resizability in QWasmCompositor::processMouse as:
1) the target window under the cursor might be different from the
dragged window when the pointer is moving quickly
2) we have checked that already when qualifying the window for dragging
when handling EMSCRIPTEN_EVENT_MOUSEDOWN at line 1022

Therefore, the condition for target window's resizability has been
removed.

Change-Id: Ib999d213f1e0a770fa76324fc7bf44c6d4ab806a
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-07-16 10:55:37 +02:00
Mikolaj Boc
e4ed618a66 Introduce new traits constant for determining if type is a gadget
Do it in preparation for other changes around gadget type traits, for
porting qtdeclarative to the new API.

Change-Id: I91cd5aff81a678565cdf1b7e0b57f52bae8a1a80
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-16 00:10:08 +02:00
Timur Pocheptsov
d8ff4d9f57 tst_qnetworkreply: replace server.pem/key pair
OpenSSL v3 fails to set server's certificate, complaining that
"md is too weak".

Pick-to: 6.4 6.3 6.2 5.15
Fixes: QTBUG-49205
Change-Id: Ib21b10ff13bc2621ae2aaaab962efaaf77a854bc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-07-15 22:42:43 +02:00
Mikolaj Boc
ec58600cc9 Refactor code focused around QWasmCompositor::processMouse
Refactoring of the logic around QWasmCompositor::processMouse has been
performed for readability and easier modification, in preparation for
further fixes for event delivery and handling in windows. There should
be no logic changes, just cleaner code.

Change groups:
Members of QWasmCompositor have been prefixed by m_ for easier discerning
of stateful and stateless variables in functions.

Variables renamed to more descriptive, e.g. window2->targetWindow,
globalPoint->targetPointInScreenCoords.

Magic numbers eliminated, e.g. mouseEvent->button == 0 is now
button == Qt::MouseButton::LeftButton.

Some common condition checks have been wrapped into single constants,
e.g. !(htmlWindow->m_windowState & Qt::WindowFullScreen) &&
!(htmlWindow->m_windowState & Qt::WindowMaximized) ==
isTargetWindowResizable

Some nested if-conditions were collapsed.

Some unnecessary checks have been moved to outer if conditions (e.g. for
draggedWindow in EMSCRIPTEN_EVENT_MOUSEMOVE, since the code would crash
anyway because only some parts are guarded against it being nullptr).

Consts introduced so that variables are only used for one purpose.

Made QWasmEventTranslator::translateMouseButton constexpr

Made QWasmWindow::isPointOnTitle behave correctly when the window has
no title bar so that no flag probing is needed prior to calling it.

Made QWasmCursor::setOverrideWasmCursor accept a const ref - having it
accept pointer suggested it might dangle.

Change-Id: I8910622fddad764ee86eb0260b5ad23c7ee7f97a
Reviewed-by: David Skoland <david.skoland@qt.io>
2022-07-15 20:57:01 +02:00
Alexey Edelev
babb4ec4a6 Rename the <module>_timestamp target to <module>_pri_dep_timestamp
Make the target purpose more understandable from its name.

Change-Id: I4f4a56fd3ef338b728d4a81edc2df32cada97f6c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-15 19:27:08 +02:00
Alexey Edelev
4f56b7d841 Fix build with the disabled 'translation' feature
Definition of QMetaObject::metaType() should be outside the
QT_NO_TRANSLATION guard.

Fixes: QTBUG-104959
Pick-to: 6.2 6.3 6.4
Change-Id: Icb1bf6e9cbad8b4c70ca09b5e7eafd125d866557
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-15 14:44:55 +02:00
Ivan Solovev
7d2361b9da Addressbook example: port to QLatin1StringView
This allows to fix the warning:
 qtbase/examples/widgets/itemviews/addressbook/addresswidget.cpp:115:
  warning: loop variable ‘str’ of type ‘const QString&’ binds to a
  temporary constructed from type ‘const char* const’
  [-Wrange-loop-construct]

Pick-to: 6.4
Change-Id: Ibbfa7f9e85fe9ef79291f9da3d161667286b282e
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-07-15 14:44:38 +02:00
Volker Hilsheimer
e6c7d049f4 QGraphicsProxyWidget: make tolerance in mapToGlobal test at least 4
a61bf508e3 reduced the tolerance from 4 to
3 in one case, making the test more rather than less flaky on systems
with a device-pixel-ratio of 1.

Pick-to: 6.4 6.3 6.2
Change-Id: I245443f0dcb1aa40176c127025501b63f12f161b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-15 14:44:32 +02:00
Giuseppe D'Angelo
ef4372dcae QXmlStreamReader: fix C++20 build
Amends 6bc227a06a.

Change-Id: I47384ce60093cb85a651c16667738dac69e0e747
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-07-15 14:44:16 +02:00
Laszlo Papp
a53961da51 Styles: fix typos in the doc
Change-Id: I4b4ee0be40f7cef8bae41d763eaf4c1822e91c43
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-15 08:59:10 +01:00
Volker Hilsheimer
37c829f511 QPalette: detach before modifying resolve mask when resolving
Amends 1d961491d8. We modify the resolve
mask after making a shared copy of 'other', so we must detach. Call the
setter designed for that purpose.

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-98762
Change-Id: I4f45223e74764a341378992172787fae73efb8b7
Reviewed-by: JiDe Zhang <zhangjide@uniontech.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-07-15 09:58:23 +02:00
Fabian Kosmale
2c81ba2df9 QThread: Clean up bindingStatusOrList if object gets deleted
Deal with the case that the object gets deleted between a call to
moveToThread and the start of the thread by removing the object from the
list in that case.

Fixes: QTBUG-104014
Pick-to: 6.4
Change-Id: Ib249b6e8e8dfbc4d1332bb99a57fa9d3cff16465
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-14 19:34:46 +02:00
Ivan Solovev
6db91c0df1 GroupBox example: port away from using deprecated QAction::setMenu()
We can achieve the same UI by using QMenu::addMenu() directly

Task-number: QTBUG-104857
Pick-to: 6.4 6.3 6.2
Change-Id: I627f21bc93646943cf6dfbd3b388352b84f73f0f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-14 16:28:49 +02:00
Volker Hilsheimer
a2c7428e4d QGraphicsWidget: skip test if graphics view fails to show
We set Qt::X11BypassWindowManagerHint on the view, which regularly makes
the test fail on X11 systems in the

QVERIFY(QTest::qWaitForWindowActive(dummyView.data()))

check.

If the view fails to show, skip the test instead of failing, we are not
testing anything X11 specific here, running this test on other platforms
will be good enough.

Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-98921
Change-Id: I46dbcddf51ee1e92eb3bbb29bb57fcc314266bea
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-14 15:55:30 +02:00
Tor Arne Vestbø
845ea89211 Revert "Windows QPA: Add MSWindowsNoRedirectionBitmap flag"
This reverts commit 417bb46352.

The API addition was premature, as it can potentially be handled
by the platform plugin automatically, and if not, should possibly
live in QSurfaceFormat instead.

Change-Id: I5c7050ce9c50b6c6a93ddfa6d2e842db0b9eed0d
Reviewed-by: Yuhang Zhao <2546789017@qq.com>
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2022-07-14 13:24:43 +00:00
Volker Hilsheimer
a61bf508e3 QGraphicsProxyWidget: make tolerance for errors depend on DPI
The test already accepts an error margin for coordinate mapping. It is
still flaky, so make that margin larger if the DPI of the widget >1.

Pick-to: 6.4 6.3 6.2
Change-Id: I0a598e5e94ac82c551cbeb935e2fa08cad048f84
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-07-14 15:24:43 +02:00
Umair Raihan
55dd943996 Add new mkspecs device for Raspberry Pi 4 (64-bit)
The existing mkspecs for Raspberry Pi 4 (devices/linux-rasp-pi4-v3d-g++) was intended to compile Qt application for the 32-bit version of Raspberry Pi, thus it used compiler flags that are incompatible when compiling Qt application for the ARM 64-bit architecture. According to ARM compiler documentation, -mfpu flag is rejected by AArch64 state while its alternative, -mcpu, has to be avoided when -march flag is already defined. -mfloat-abi flag is not valid with AArch64 targets.

To support both 64-bit and 32-bit architectures, I proposed to add this new mkspecs.

See:
https://developer.arm.com/documentation/101754/0618/armclang-Reference/armclang-Command-line-Options/-mfpu
https://developer.arm.com/documentation/101754/0618/armclang-Reference/armclang-Command-line-Options/-mfloat-abi

Pick-to: 6.3 6.4
Change-Id: I36574875e798281688601edd0f166922592d9830
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2022-07-14 15:09:34 +03:00
Tor Arne Vestbø
6767ac20c9 macOS: Distinguish between return and enter when inserting newlines
In most situations the originating key event contains the information
we need, but during confirmation of input method composition the text
of the event might be "~\r", in which case the logic we have on macOS
for generating key events will interpret the key press as a tilde,
and we end up inserting "~~" and fail to deliver the return key.

We should probably treat NSEvents with characters > 1 as a special
case and go via the virtual key map in QAppleKeyMapper, but for now
we manually distinguish enter and return by looking at the modifiers.
This works for enter key presses both via the key itself, and via
Fn+Return.

Fixes: QTBUG-104774
Fixes: QTBUG-103473
Pick-to: 6.2 6.3 6.4
Change-Id: I86d30b154867e8e2b6964967ede2bd0dadb83ef8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-14 14:09:34 +02:00
Tor Arne Vestbø
3ad0f755f5 cmake: Don't reference global data in qt_internal_get_title_case
The only place the function was used was to generate the title case of
a target, so the issue wasn't spotted until now.

Pick-to: 6.2 6.3 6.4
Change-Id: Iee66ecea569e7411c6b5a5e5312cde910a48fa01
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-14 14:09:33 +02:00
Eskil Abrahamsen Blomfeldt
ade2df4c4b Relayout QStaticText when dpi changes
If the cached font has a different DPI than the one used in
QPainter, we need to treat this the same as if other font
properties have changed and redo the layout.

This happened when running the QStaticText test on Wayland,
because the default dpi was 100 and the QPixmap we ended up
drawing to was 96. This caused the pixel size of the font to
be calculated differently when doing drawText() (using 96 dpi)
and drawStaticText() (using the cached 100 dpi).

Pick-to: 6.4
Fixes: QTBUG-100982
Change-Id: Ie4270341bb8a64b6458eb67ba460a282c65dc26b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-07-14 14:09:33 +02:00
Tor Arne Vestbø
fef9e0e216 cmake: Work around bug in CMake's Xcode generator setting INSTALL_PATH
CMake will set the INSTALL_PATH for applications to an empty string,
which confuses Xcode and results in application archives that can't
be distributed on the App Store.

https://gitlab.kitware.com/cmake/cmake/-/issues/15183

Pick-to: 6.2 6.3 6.4
Change-Id: Ie19f41c20fdca1e98b368e3ce4cc524c8df0b23b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-14 10:49:58 +02:00
Tor Arne Vestbø
1d6ce38a82 Explicitly disable bitcode for iOS applications
We disabled building Qt with bitcode in e27a0d5a0f,
but the default in Xcode 13 is still to build applications with bitcode,
leading to build issues when built against a non-bitcode-enabled Qt.

For qmake we already explicitly disable bitcode, so do the same for
CMake.

Pick-to: 6.2 6.3 6.4
Change-Id: I3fd542373c3e1326eb1088a173e70955e61ff608
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-14 10:49:47 +02:00
Eskil Abrahamsen Blomfeldt
9a45a01a2c Try re-enabling test on Wayland
Running this test on Wayland passes for me, so maybe something
has magically improved.

Change-Id: I161b697c5be96af48938228267cb405048c78852
Reviewed-by: Inho Lee <inho.lee@qt.io>
2022-07-14 07:35:33 +02:00
Yuhang Zhao
417bb46352 Windows QPA: Add MSWindowsNoRedirectionBitmap flag
This flag will be useful for windows that only use
3D graphics API to do the rendering, such as Qt Quick
applications.

As a drive-by, fix a typo in the above line.

Pick-to: 6.4
Change-Id: Ic6edcb7610055693734a5d5aff5e906991d4b911
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2022-07-14 13:00:11 +08:00
Laszlo Papp
331fa5e8d6 CustomStyle doc: fix code indentation
Change-Id: I8ef0ff5a499f796ebf76447caab27ff6b2556570
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-07-14 03:16:26 +01:00
Morten Johan Sørvig
5548b940fb wasm: add echo_client_mainthread example
This example connects an echo server running behind
WebSockify, on localhost.

For example, start websockify with

    websockify 1515 localhost:1516

to accept a webscoket connection on 1515 and forward
to echo_server at 1516.

Pick-to: 6.4
Change-Id: Id71364e4ab8c46d3482b515fcd1b991b61d7404b
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-07-14 01:10:56 +02:00
Volker Hilsheimer
d609b20842 QCompleter: make filesystem test robust against slow I/O
Use a signal spy to watch for the relevant signal from the file system
model and wait for that before checking whether the completer responded
to that signal by showing (or not showing) the popup.

If the file system model doesn't fire within the default timeout of 5
seconds, skip the rest of the test.

Fixes: QTBUG-46113
Pick-to: 6.4 6.3 6.2
Change-Id: I9becfe19a220bdb178ed8275c327d55ea19aa342
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-07-13 22:41:43 +02:00
Volker Hilsheimer
826a98cff1 QProcess: skip processesInMultipleThreads test on emulators
The test has timed out when run on ARM in qemu. We start more threads
than the ideal count, which is likely too much for the emulator when not
running the native architecture.

Pick-to: 6.4
Change-Id: I42e11945070646551e77c10618df762a4bffc8ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-13 21:02:01 +02:00
Ivan Solovev
4ae85ae441 QSystemTrayIcon: remove unused deprecated call to QAction::associatedWidgets()
This call was added in bcaff2b06f but
does not seem to be necessary. So just remove it.

Task-number: QTBUG-104857
Pick-to: 6.4 6.3 6.2
Change-Id: I2068bd10c6de211dd31f09ff978e8b8ba9cb70db
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-07-13 18:18:30 +02:00
Marc Mutz
12f8b583cf QOpenGLContext: de-inline virtual dtors of private classes
... pinning the vtables to a single TU instead of duplicating them for
every user.

Pick-to: 6.4
Task-number: QTBUG-45582
Change-Id: I728a5c47edaafe7ef4fdca1db8d0247ed4be9713
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-13 18:18:30 +02:00
Axel Spoerl
b36d7076e4 Fix wrong debug output upon creation of floating dockwidget tabs
When a floating dock is created, a qCDebug message is logged to
indicate the hovered dock widget. By mistake, the target pointer to
the floating tab is dumped, which is nullptr at that moment.
This patch corrects the debugging output.

Pick-to: 6.4 6.3 6.2
Change-Id: I317f057ef4b2d8fe508be687152bcede61c22f46
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-13 17:17:01 +02:00
Ivan Solovev
12262adeba Do not use QExposedEvent::region() in internal code
Task-number: QTBUG-104857
Pick-to: 6.4 6.3 6.2
Change-Id: I5ee41802ecc4d6291aaaa1f0efddd20027c1c1e4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-13 16:45:00 +02:00
Fabian Kosmale
00b46bf4f8 Unicode conversion: Skip superfluous check for QT_COMPILER_SUPPORTS_SSE2
We already check for __SSE2__, which gets undefined when __SSE2__ is not
set.
Moreover, we want to use the intrinsics without a runtime check there,
so checking for __SSE2__ is the correct thing to do.

Change-Id: I7f8610e2927650b439c3697585234b843e345e4c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-13 16:12:15 +02:00
Volker Hilsheimer
92e696b4ba Use debug stream in QTest::toString's default fallback if possible
For built-in types, this is a compile-time assert - we should not have
any types in Qt for which we have neither debug streaming nor a
QTest::toString specialization implemented. A build of most of Qt
submodules passes with this change, after minor modifications to some
tests. We cannot declare QSizeHint::Policy as a metatype after the
QMetaType has already been instantiated for it, and the QDebug stream
operator for QElaspedTimer needs to be correctly declared within the
namespace.

Add a self-test function for a custom type, and update reference files
of the self-test.

Task-number: QTBUG-104867
Pick-to: 6.4
Change-Id: I2936db5933f4589fce45f47cf2f3224ed614d8c9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-07-13 15:14:35 +02:00
Eskil Abrahamsen Blomfeldt
3fee97c4ab Skip test which depends on window activations on Wayland
Wayland does not support window activation, so rather than skipping
tests based on platform name, we can use the platform capability
(which will also cover future platforms with the same issue)

Pick-to: 6.4
Task-number: QTBUG-104241
Change-Id: Ibf5f8968f3979b789ef68f92768419bef4500fb3
Reviewed-by: Inho Lee <inho.lee@qt.io>
2022-07-13 14:35:03 +02:00
Shawn Rutledge
8d9301b413 Add QInputDevice::name() to output in device_information manual test
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-104878
Change-Id: I4299228c90777d71f01c3e2607f8ad4af6e081ed
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-13 14:35:02 +02:00
Shawn Rutledge
6749d69a15 QXcbConnection::xi2ReportTabletEvent(): get device, check capabilities
In Qt 5, RotationStylus was a device type; in Qt 6, we have the
Rotation capability flag instead. The event does not tell us whether
rotation is valid or not, so to distinguish a valid zero value from
a zero that means it's absent, we need to check device capabilities.
Anyway it's better to get the QPointingDevice instance earlier and
call the newer version of QWindowSystemInterface::handleTabletEvent().

Fixes: QTBUG-104877
Change-Id: I896c02727d586381489f79fd4ebea3451adfa403
Pick-to: 6.2 6.3 6.4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-13 14:35:02 +02:00
Shawn Rutledge
03a691cecb Change "delivering touch to same window" warnings to debug messages
When you touch-tap a QPushButton, and that opens a popup, it's normal
that the touch release is delivered to the main window rather than the
popup: in fact QWidgetWindow::handleMouseEvent() expects to see a
synth-mouse release. No warning is needed. Amends
efc02f9cc3

There may be other cases when it should have remained a warning (it's
been there since 2692237bb1), but that's
hypothetical at this point.

Pick-to: 6.2 6.3 6.4
Task-number: QTBUG-103706
Change-Id: Ie8cc62af4d173ada5138fd099d9f02bd41f4cff4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-13 14:35:02 +02:00
Ivan Solovev
593b0a01c5 Remove QStringView metatype declaration
It was required back in Qt 5 times, so that we could use
qvariant_cast<> or QVariant.value() on it. Not required in Qt 6
anymore.

As a drive-by: cleanup some unneeded includes in qstringview.cpp

Task-number: QTBUG-102350
Pick-to: 6.4
Change-Id: Idbcdc5cfe62cf4a55b86e227106d7a997997e0ba
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-07-13 12:52:00 +02:00
Joerg Bornemann
8b5cce6911 CMake: Fix prefix propagation for relocated Qt installations
Consider qtbase built with CMAKE_STAGING_PREFIX=/foo on Windows.
If /foo was moved to /bar, non-qtbase repositories did get a staging
prefix with drive letter assigned.  This is undesirable when DESTDIR is
used on installation.

Change the implementation of qt_internal_new_prefix to remove the drive
letter from the "new prefix" if the "old prefix" did not have a drive
letter.

Change-Id: I6fb17e690b264920b0dd4204e3b3c30794c7e76e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-07-13 12:52:00 +02:00
Kai Köhne
f71aeea932 Doc: Hide weak overload template magic from documentation
Hide the 'template magic' to implement Q_WEAK_OVERLOAD from the
documentation. So far Q_WEAK_OVERLOAD void foo() lead to

  template <typename> void foo()

in the generated documentation, which is arguably confusing to the
uninitiated. And people interested in implementation details & exact
overload resolution will arguably just read the .h files themselves.

Fixes: QTBUG-104851
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I5e0b1b337b28e621e6a627241aa8037da0a879a7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-07-13 10:51:59 +00:00
Fabian Kosmale
268ff00ef5 QThread: Initialize bindingStatus for adopted threads
If we create a QThread from QThread::current(), we want it to have a
correct value for its bindingStatus. Thus, initialize bindingStatus in
the ctor of QAdoptedThread.

Task-number: QTBUG-101177
Task-number: QTBUG-102403
Pick-to: 6.4 6.3
Change-Id: I3ef27ed62c5dc25eed05d551c72743a1b8528318
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-07-13 12:51:59 +02:00
Morten Johan Sørvig
7e0711e0c0 wasm: secondary thread blocking sockets example
Connects to echo_server via websockify, like the async version.

Pick-to: 6.4
Change-Id: I9ed560cd388cfddbd0d284d8d40fb7ddf964ba96
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-07-13 09:29:28 +02:00