Aside from moving the code to reduce duplication, the only changes in
the code are the replacement of @target@ to ${target}, using IN LISTS
with variable names to avoid macro expansion issues and replacing
the if(var) conditions with double variable evaluation
+ NOT STREQUAL "".
The function implementations are now in the same order as they
are used in the Dependencies.cmake files.
Pick-to: 6.4
Task-number: QTBUG-104998
Change-Id: Iaae926414fd2a7cc09c2f5716376caaa0aade74b
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
It was accidentally left when changes were made from patchset 1
to patchset 2 in 825cb50c27
Amends 825cb50c27
Pick-to: 6.4
Task-number: QTBUG-104998
Change-Id: I04dd50cfb93655f0c224bb226695e7771e9bc5d1
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
And update the default version number to 1.0, which more closely matches
the Xcode default.
Pick-to: 6.4
Change-Id: I2cd785fffe8b960e5fa5db4803eaeee10791b7aa
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This provides a better user-experience, as the two settings have
dedicated fields in the project UI, and matches how new projects
are generated by Xcode itself.
Pick-to: 6.4
Change-Id: I23acc7c6506f1818ef4a90f6f595bc449f83c57b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Make the target purpose more understandable from its name.
Change-Id: I4f4a56fd3ef338b728d4a81edc2df32cada97f6c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
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/-mfpuhttps://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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
... 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>
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>
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>
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>
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>
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>
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>
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>