Commit Graph

64889 Commits (04a327f00a84b0c13cb4a4a6715b2ce86ea9f61a)

Author SHA1 Message Date
Alexandru Croitor 04a327f00a CMake: Don't recurse with qt-cmake-standalone-test in-source dirs
When the qt-cmake-standalone-test root project is configured in-source
in the source directory of a test A, where test A ends up being added
via add_subdirectory(A), this causes the SUBDIRECTORIES property of A
to contain itself for some reason.
Recursively iterating over the root project's subdirectories thus
causes an endless recursion.

Make sure to remove the currently processed directory from the
retrieved SUBDIRECTORIES property when the function is called
during qt-cmake-standalone-test configuration.

We limit it just for that script, so that we don't accidentally
increase the configure time when building all standalone tests, and
call list(REMOVE_ITEM) too many times.

Upstream issue filed at
https://gitlab.kitware.com/cmake/cmake/-/issues/25489

In a way, amends d08fa86e63 because it
exposed the issue.
Amends 1c82e92202

Pick-to: 6.5 6.6 6.7
Task-number: QTBUG-119998
Change-Id: I6f92a07be105cde74ac4946523967791db7bf301
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-12-14 22:59:33 +01:00
Volker Hilsheimer 0441526448 QAIV: reset state if removing index while editing or committing
If the commit of data to a model index result in that index getting
filtered out, then the editor will be removed as part of committing the
data, and the index that the editor is associated with becomes invalid.
The subsequent call to closeEditor() will find that the index for the
editor is no longer valid.

This should not warn, and it should also not abort the clean-up process
early. Instead, identify that the editor that we want to closed is
already hidden. In that case, skip the warning and most of the cleanup
process, and proceed directly to the EndEditHint handling further down.

Add a test that simulates the two scenarios where this can happen:
either the committing of data results in the index being filtered out
by the existing filter; or the filter changes while editing, and the
index being edited gets removed. In both cases, we don't want to see a
warning, and the state of the item view should be reset correctly.

Pick-to: 6.7 6.6 6.5
Fixes: QTBUG-115765
Change-Id: If247172fdac9a1a9279dae96c078d32553d4ee5d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: 🌴 Alexey Edelev 🌴 <alexey.edelev@qt.io>
2023-12-14 22:59:33 +01:00
Volker Hilsheimer 1b71e2d894 QMessageBox: don't use a native dialog if a style sheet is active
With 6.5 we try to use the native message dialog if we can, but we
didn't account for the style sheet. This restores pre-6.5 behavior for
QMessageBox.

Other dialogs will continue to be native, even if a style sheet is in
use. While this is inconsistent, the other dialogs are substantially
more functional, so switching to the Qt version because of a style sheet
being active would be a significant change of behavior.

Pick-to: 6.7 6.6 6.5
Fixes: QTBUG-120054
Change-Id: I07eae609bc360140e096c5eb7ad004ffa4422123
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-12-14 20:49:48 +01:00
Thiago Macieira f894f04c9d QObject: remove the operator comma hack
It was the easiest way to implement this back in the day without an
explosion of combinatorics.

Change-Id: Ia930b1a2ed1e465a826ffffd179c5bb4657d0562
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-12-14 20:49:47 +01:00
Thiago Macieira a337b8360f Suppress clang-tidy mem leak warning on QMetaObject::invokeMethod
We don't leak, but clang-tidy is printing this warning. Possibly because
it sees a new with no matched delete in the same context, ignoring the
fact that the pointer was gifted to the called function.

Fixes: QTBUG-119972
Pick-to: 6.7 6.6 6.5
Change-Id: I6e2677aad2ab45759db2fffd17a06c57c3a463ba
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-12-14 19:49:47 +00:00
Tor Arne Vestbø c90ee82789 Remove qDeleteInEventHandler
It's equivalent to delete these days, and has been for a long time,
since 2011 in fact, when the last remnants of QT_JAMBI_BUILD were
removed.

Change-Id: I7703e41c04204844da4ee75fa251b361e0db4ead
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-12-14 20:49:47 +01:00
Marc Mutz 400426acb2 QtDBus: port away from QPair
Pick-to: 6.7
Task-number: QTBUG-115841
Change-Id: I1eaba630f003df695412dbb2353ce4870f9b9782
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2023-12-14 20:29:45 +01:00
Marc Mutz 2a0b9f0b90 tools: port away from QPair
Pick-to: 6.7
Task-number: QTBUG-115841
Change-Id: If122a1c17b1b4092b115521cec814ce3b508cd80
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2023-12-14 20:29:45 +01:00
Marc Mutz 31f437e658 Add QT_NO_QPAIR
...and mark QtCore as free of QPair.

Task-number: QTBUG-115841
Pick-to: 6.7
Change-Id: Ic6009d3cabbf72b3b3fe966e47d48a80a328b499
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2023-12-14 20:29:45 +01:00
Marc Mutz 0d09b4f6b9 Q*Animation: s/QPair/std::pair/
Also port from qMakePair() to just braced initialization and CTAD.

As a drive-by, de-duplicate some code around a lower_bound(), and port
from `typedef` to `using`.

Pick-to: 6.7
Task-number: QTBUG-115841
Change-Id: I3e907ad3bb10b5ca169422ad90d3a65b1b33f926
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2023-12-14 20:29:45 +01:00
Marc Mutz 1a1735a7cf QMetaType: s/QPair/std::pair/
Also port from qMakePair() to just braced initialization and CTAD.

As a drive-by, use auto instead of various const QMetaType::*Function*
so statements fit on one line again, and port from `typedef` to `using`.

Pick-to: 6.7
Task-number: QTBUG-115841
Change-Id: I6bd9747fb9eb34da08053927507f2008d9bbfb86
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2023-12-14 20:29:45 +01:00
Johannes Grunenberg 1d953b2fbc QLineEdit: Use existing selection when deleting a word
When using QKeySequence::DeleteEndOfWord or
QKeySequence::DeleteStartOfWord in a QLineEdit with an existing
selection, the selection was ignored which resulted in unexpected
behavior (see bugreport). This is fixed by only setting the selection
if none exists yet.
To prevent an entry in the history when the input is empty, the
selection is checked before calling del().

Fixes: QTBUG-120006
Pick-to: 6.7 6.6 6.5
Change-Id: I2e803c5eff1f0e289e93a77c58ecd78299241da7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-12-14 19:25:16 +00:00
Axel Spoerl 7835f9e601 QSplashScreen: Enforce visibility by processing events
A splash screen is usually shown during initialization, before the main
window is shown. At that point, an application might not spin an event
loop. The documentation therefore recommends to run processEvents()
periodically, in order to ensure that the splash screen is actually
shown. Async window managers (e.g. XCB) might require more than one call
to processEvents() for the splash screen to be shown. It can't be
guaranteed, that a specific number of calls to processEvents() make the
splash screen visible. Calls to processEvents() are not considered
good practice in application code.

QSplashScreen::finish() uses a copy of QTest::qWaitForWindowExposed(),
to automatically close the splash screen, when the main window is
shown.

=> Re-write the static inline waitForWindowExposed to wait for the
widget's windowHandle()->isVisible(). That ensures visibility to the
window system.
The previous version waited for isExposed() to become true. That
ensured exposure to the application, but not visibility.

=> Intercept QEvent::Show and process events, until the splash screen
becomes visible.

=> Remove references to processEvents() as a requirement to show the
splash screen from the documentation. It remains a requirement for
processing mouse and keyboard events.

=> Re-activate tst_QSplashScreen and test visibility in the constructor
test function.

Drive by:
- implement switch in event override
- factor out paint event handling in a function
- update documentation about calling processEvents() to enable mouse
handling.

Fixes: QTBUG-119225
Pick-to: 6.7 6.6 6.5
Change-Id: I07910705246b4e3234e01cc4896f5bc4b2c56772
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-12-14 20:25:16 +01:00
Christian Ehrlicher f5d192818d Doc: Update image in QSystemTray example
The old image was from windows xp so a new one from windows 10 should
not hurt.

Pick-to: 6.7 6.6 6.5
Change-Id: Ia78f556e8603517d9e7339f0af2330bc2d4182d3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-12-14 20:06:33 +01:00
Ed Cooke 76b2852b7c Update the books example
Remove the .ui file and write the equivalent implementation.

Replace the outdated star icons with new star icons. 5 empty stars
are now provided and filled in depending on the rating. The new stars
are SVG, however, we do not use an SvgRenderer as we cannot use the
QtSvg API from QtBase directly. It is safe to assume the SVG image
loading plugin is present, the worst case scenario would be empty icons,
but it would still build. We instead use QIcon.

For the rating, draw the star icons in a combobox, replacing the old spinbox.

Update the layout by moving the table view to the bottom, and
arranging the input fields at the top.

The scrollbar policies have been set to Qt::ScrollBarAsNeeded for the table view.

Fixes: QTBUG-118476
Pick-to: 6.7 6.6 6.5
Change-Id: I27c13534ab06e17531d155469a1cc6e7e05197af
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-12-14 20:06:32 +01:00
Volker Hilsheimer 33254fb41f Turn the "concentriccircles" example into snippets, update screenshot
The example has a lot of code and documentation, but in essence shows
how to use float-based QPainter APIs and how to set a render hint. That
is two lines of code, which we can show as snippets.

Update the screenshot of the example with a higher-resolution version.

Pick-to: 6.7 6.6
Fixes: QTBUG-119983
Change-Id: Iafcb813dff6ab8c269176f7994c95947ebf5e559
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2023-12-14 20:06:32 +01:00
Axel Spoerl 92b5992a29 QDockWidget: Clarify documentation of floating property
QDockWidget::isFloating() returns true for single, floating dock
widgets. It returns false, if the dock widget is part of a floating
tab (i.e. it is a QDockWidgetGroupWindow child).

=> Clarify documentation.

Pick-to: 6.7 6.6 6.5
Change-Id: I3c5a4a86b89dcb001e7561de7dcc604bae0d9cee
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-12-14 18:05:22 +00:00
Assam Boudjelthia c697e19c16 AndroidTestRunner: few minor fixes for loging and printing
* Don't add \n when using qDebug()
* Trim testAppArgs of extra space at the end.
* Don't print get-current-user command by default, that value
is not that useful to be always printed.
* Update outdated bit of the help printout to reflect what the
test runner does.

Pick-to: 6.7
Change-Id: I998bafc3aef524b368654f7b35a2a8e084d17542
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-12-14 20:05:22 +02:00
Inkamari Harjula 26ac6bd4a4 Doc: Review and improve QFileDialog documentation
Grammar improvements made. A screenshot added.

Task-number: QTBUG-119551
Change-Id: Ia14c654e92eede5a32bba18cd4d05a74d289f64b
Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
2023-12-14 20:05:22 +02:00
Amir Masoud Abdol 8646010223 Use the correct CMake argument name for -libpng and -libjpeg
The qt_feature calls are for "jpeg" and "png".

Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-120036
Change-Id: I43e69d9fd1e08383b5ddfbfe194eaa2f2ae52f50
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-12-14 19:05:21 +01:00
Christian Ehrlicher 51e682d5af QStyleSheetStyle: misc cleanup
Avoid some calls to detach() and use std::array instead raw c arrays.

Pick-to: 6.7
Change-Id: I95cbfb130b6fe2509e5d87184c6612718b90dd63
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-12-14 08:28:24 +00:00
Christian Ehrlicher af0edfbc7c QWindowsCursor: create correct DDB in createBitmapCursor()
CreateCursor() expects a ddb and according the docs a ddb must be
word-aligned but we created a byte-aligned ddb which results in a
wrongly rendered cursor later on.

Pick-to: 6.7 6.6
Task-number: QTBUG-82434
Change-Id: Ie847865a0d868043571faf4b7f4fdf6a92fce448
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2023-12-14 04:39:06 +01:00
Marc Mutz 91d341e560 Itemmodels: s/QPair/std::pair/
Also port from qMakePair() to just braced initialization and CTAD.

As a drive-by, use emplacement instead of appending pairs explicitly,
rewrite typedef into `using`, and remove the qpair.h include from the
.cpp file (cannot affect other TUs and <utility> is considered
included in qcompilerdetection.h).

Pick-to: 6.7
Task-number: QTBUG-115841
Change-Id: Ia985520dfce6b77b1c0fe7669fc92d2df97e1b06
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2023-12-14 04:16:16 +01:00
Santhosh Kumar 6ef62f7dc4 Fix hang issue during drag and drop in windows
During drag and drop operation, we used to get window under mouse and
process events for that window after the patch set
9ff5b886fade489b7cc268626f518145650f6b2c. But this sometimes cause hang
issue in GetMessage() when the respective window doesn't capture mouse
event and we are required to process mouse events.

This patch fixes this issue by considering whether the window under
mouse has capture.

Fixes: QTBUG-115260
Pick-to: 6.7 6.6 6.5 6.2
Change-Id: I748936e4ce23e60abce51d34c1326cfb105b06cb
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-12-14 02:25:33 +01:00
Amir Masoud Abdol 0c3892bb26 Fix an issue where it was not possible to build iOS tests in tree
Before this, when trying to build iOS tests, CMake could not find the
`LaunchScreen.storyboard` in the source directory, and therefore the
configuration was failing.

In addition, QtPublicFinalizerHelpers module was missing in QtBuild,
resulting in another configuration failure when configuring iOS tests.

Pick-to: 6.7
Change-Id: I592121892a2716973a92ec044414fa729fd3b15f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-12-14 01:36:12 +01:00
Amir Masoud Abdol 6b09b51536 Allow space in emsdk path
Changing from Native path, to CMake path resolves the broken
execute_process call.

Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-120050
Change-Id: I6725d0efc215e4866677bf6a64e315752c3f2a1d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-12-14 01:36:12 +01:00
Oliver Wolff 3f680c1479 Remove mentioning of UWP from windeployqt's configure summary
Qt's UWP port has been dropped for Qt 6.0.

Pick-to: 6.7 6.6 6.5 6.2
Change-Id: I72f2cfbd1234110a0bd0c15669fa326328d4d08c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-12-13 23:26:55 +01:00
Tinja Paavoseppä 5ba91c9dec Android: Add support for foreign window acting as embedding container
In the case when our foreign window is created to act as a parent for
embedding Qt content into a native Android app, we need a more "hands
off"
approach. If the foreign window represents an Android view which the
user
has created outside of Qt, we should not try to reparent it since it
already has a parent in the view hierarchy. Neither should we try to
remove it from the hierarchy, or set its visibility.

Pick-to: 6.7
Change-Id: Iea496578a40f45ebdd73947a1bb0e46a7131108c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-12-14 00:26:55 +02:00
Tinja Paavoseppä c1a79b442c Android: Differentiate between standalone Qt app and embedded view
Add a helper method to tell whether the app is a standalone Qt for
Android app, where also the Context is created by Qt, or whether Qt
content is embedded as a View into a Context created by the user, i.e.
a "native" Android app.

Pick-to: 6.7
Change-Id: I618ba1c8cb40c9b132fc12a7ee6d54c071efa983
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-12-14 00:26:55 +02:00
Tinja Paavoseppä cca81a6636 Android: Use TextureView when multiple windows present
The SurfaceView class is not the best option for when we
have multiple windows, as the created Surface can only
either be below the window or on top of it, it is not a
part of the view hierarchy.

Replace the SurfaceView with TextureView when there are
more than one window. This way the surface will be a part
of the view hierarchy, and will respect z-ordering.

When there is only one window, keep using the SurfaceView
approach to limit the effect on existing apps, as well
as enable some of the benefits SurfaceView has for e.g.
game and multimedia apps, such as HDR ability.

Move touch handling from QtSurface to QtWindow, so
touches are handled also when using TextureView instead
of QtSurface aka SurfaceView.

Pick-to: 6.7
Task-number: QTBUG-118142
Change-Id: I37dcaf0fb656cfc1ff2eca0a3bfe7259f607411c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-12-14 00:26:55 +02:00
Tinja Paavoseppä b2e44a2d1d Android: Fix touch events for child windows
In the touch dispatcher methods, all events were routed for the
top level window at the position, which lead to all the events
being delivered for the parent window.

Since the JNI methods already have a parameter for window ID, take
that into use and determine the window to deliver the events to
by ID.

Pick-to: 6.7
Change-Id: I07ad7851c32a3e633ee748036d6818b6d0fa5588
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-12-14 00:26:55 +02:00
Tinja Paavoseppä 4376467169 Android: Make winId() return the underlying QtWindow jobject
Previously, winId() returned a simple integer ID, incremented by one
for each window, instead of a handle to the underlying window.

Note, if constructing a QWindow with fromWinId(), the passed jobject
will not be the same one returned by winId(), as the passed jobject,
assumed to be a View, will be wrapped inside a QtWindow to ensure
child windows can be added to it if needed.

Pick-to: 6.7
Change-Id: I9d5d977eeb08d4cc3594f7339660fe94c3a55864
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-12-13 22:26:55 +00:00
Marc Mutz 0a5a9c134e QVariantPair: cut the QPair middle-man
Use std::pair directly.

Task-number: QTBUG-115841
Pick-to: 6.7
Change-Id: I4ca63c7b7f46f2b66f6f4f4ef4eba54537d5dc7a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-12-13 21:54:01 +01:00
Marc Mutz 4be8755151 QCbor/QJson: s/QPair/std::pair/
Also port qMakePair() to just braced initialization and CTAD.

Pick-to: 6.7
Task-number: QTBUG-115841
Change-Id: I9eafb20ebc63bd33eb52661f4f14ad2db9fc0f00
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2023-12-13 21:54:01 +01:00
Marc Mutz b6fdef44e4 QSortFilterProxyModel: scope a variable tighter
The clear() will not preserve capacity, since the QList has been
copied into proxy_intervals already, so is shared. But then creating a
new QList is just as efficient, or more so.

Pick-to: 6.7
Change-Id: I7ffd91bae8ded5ac28d58bcc545c479f6edc7c90
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-12-13 21:54:01 +01:00
Marc Mutz 95c7f88132 QArrayData/Pointer: s/QPair/std::pair/
Also port from qMakePair to just braced initialization and CTAD.

Task-number: QTBUG-115841
Pick-to: 6.7
Change-Id: Ifd7220ae88b101351e91d1488ce18715eb4880e5
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-12-13 21:54:01 +01:00
Marc Mutz cbb4aea213 moc: port from pair<> to a struct SuperClass
... with properly-named members.

This is in preparation of adding a new member in order to fix
QTBUG-101141 (namespaced base classes).

Pick-to: 6.7 6.6 6.5
Task-number: QTBUG-101141
Change-Id: I2309e425ac94ad275b54a898fd33a2891e5d1453
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-12-13 21:54:01 +01:00
Marc Mutz ee5da1f2ea HPack: fix incorrect integer overflow check
This code never worked:

For the comparison with max() - 32 to trigger, on 32-bit platforms (or
Qt 5) signed interger overflow would have had to happen in the
addition of the two sizes. The compiler can therefore remove the
overflow check as dead code.

On Qt 6 and 64-bit platforms, the signed integer addition would be
very unlikely to overflow, but the following truncation to uint32
would yield the correct result only in a narrow 32-value window just
below UINT_MAX, if even that.

Fix by using the proper tool, qAddOverflow.

Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: I7599f2e75ff7f488077b0c60b81022591005661c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2023-12-13 21:54:00 +01:00
Marc Mutz 658607a34e HPack: fix a Yoda Condition
Putting the variable on the LHS of a relational operation makes the
expression easier to read. In this case, we find that the whole
expression is nonsensical as an overflow protection, because if
name.size() + value.size() overflows, the result will exactly _not_
be > max() - 32, because UB will have happened.

To be fixed in a follow-up commit.

As a drive-by, add parentheses around the RHS.

Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: I35ce598884c37c51b74756b3bd2734b9aad63c09
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2023-12-13 21:54:00 +01:00
Mårten Nordheim 46923f2648 Fix the qopenssl_symbols.h copy in the autotest
It was forgotten when we originally fixed the hardcoded 1_1 version.

Pick-to: 6.7 6.6 6.5
Change-Id: Iff3148d79466dac2830fe9a63d954aead96fb0ac
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-12-13 20:54:00 +00:00
Tor Arne Vestbø f16f31ba30 macOS: Use CALayer backingstore when widgets request non-raster surface
When a non-raster widget is inserted into the widget hierarchy, widgets
switches into using RHI for flushing its backingstore, matching the
window's surface type with the non-raster widget that was inserted.

This happens for example when inserting an QOpenGLWidget, which switches
the surface type to QWindow::OpenGLSurface, or a QQuickWidget, which
switches the surface type to that used for Qt Quick.

In these cases, there might still be child widgets with their own
window handle, and as long as these child windows have the same
surface type as the window owning the backing store these child
windows are flushed through the same rhiFlush() code path as the
top level window.

For child windows with a different surface type, QWidgetRepaintManager
chooses the pain QPlatformBackingStore::flush(). Unfortunately, the
implementation of QRhiBackingStore::flush() bails out when flushing
child windows, so when we were using QRhiBackingStore on macOS for
non-raster surfaces we would end up not flushing these child windows.

The way to fix this is to use QCALayerBackingStore for the case
where we know the client of the backing store (QWidgetWindow) is
going to call rhiFlush() explicitly for non-raster surfaces. That
will lead us into QCALayerBackingStore::flush() for the child windows
with a non-matching surface type, typically QWindow::RasterSurface,
and we'll flush those child windows by setting the layer's contents
property.

Fixes: QTBUG-119309
Pick-to: 6.7 6.6 6.5
Change-Id: Ia7052b9e651d575d8e34942a25e17ab5a1f5ce05
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-12-13 20:54:00 +00:00
Arno Rehn 59e21a536f QFuture: Don't use QFutureCallOutInterface for continuations
This patch replaces the QBasicFutureWatcher that was used for
continuations with context objects with a smaller QObject-based wrapper
that works directly from the actual continuation.
The idea stays the same: In order to run continuations in the thread of
a context object, we offload the continuation invocation to the
signal-slot mechanism.
Previously, we've hooked into QFuture with QFutureCallOutInterface to
emit a signal and trigger continuation invocation. However, it is much
easier and robust to emit that signal from the continuation itself.

This sidesteps the locking issues that QFutureCallOutInterface handling
presents. QFutureCallOutInterface basically requires any consumer to
only access the QFuture after all events have been posted and the
internal mutex unlocked, i.e. on the next cycle of the event loop.

Continuations do not impose this restriction; runContinuation()
explicitly unlocks the internal mutex before calling the continuation.

This fixes a deadlock when using QFuture::then(context, ...) where
the paren future is resolved from the same thread that the context
object lives in.

Fixes: QTBUG-119406
Fixes: QTBUG-119103
Fixes: QTBUG-117918
Fixes: QTBUG-119579
Fixes: QTBUG-119810
Pick-to: 6.7 6.6
Change-Id: I112b16024cde6b6ee0e4d8127392864b813df5bc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-12-13 21:54:00 +01:00
Luca Di Sera 8d008b2cf4 Doc: Fix fn commands for QSpan
Added a return type where it was missing as Clang would otherwise fail
to parse the command.

Qualified certain non-type template parameter that were based on a using
declaration inside the QSpan class.
An `\fn` command is parsed as a fake out-of-line definition. In that
context, the unqualified name will not be able to be solved by Clang,
resulting in an inability to match the element.

Pick-to: 6.7
Change-Id: I929ab5e8df4f7a6ef5d913266b584cd0393074e3
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-12-13 18:52:17 +00:00
Topi Reinio 3861b92ed9 Doc: QRestAccessManager: Qualify template arguments in \fn commands
Since version 6.7, QDoc requires accurate definition of template
arguments in signatures passed to the \fn command.

Qualify the 'if_compatible_callback' template with the class it's
declared in.

Pick-to: 6.7
Change-Id: Ifd4618071c950e812c4df9a2e4e212317a6c9118
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
2023-12-13 18:52:17 +00:00
Tor Arne Vestbø 3472aa6e28 Use Qt::WindowNoState for child windows/widgets shown via show()
The Qt::WindowState enum is documented to specify the current state of
top-level windows, and does not make sense for child windows. It's up to
the client code to ensure any sizing of child windows/widgets, e.g. via
layouts.

Many of our QPA backends bail out on QPlatformWindow::setWindowState()
for a child window. Ideally we would do this at a higher level, in
QWindow, but that's a bigger task, and the semantics of what happens
when a window is moved from being top level to child or back are not
fully clear.

As a first step, we ensure that the default window state when showing
the window via show() is Qt::WindowNoState.

Unfortunately, the QPlatformIntegration::defaultWindowState() API only
takes into account the window flags, which sadly do not have a way to
reflect whether the window is a child window or not (Qt::SubWindow is
not a child window, see QTBUG-115729).

We don't want to pass a QWindow to this API, as it would mean QWidget
would need to create a window when requesting the default window state.

Instead we hard-code the opt-out for child windows/widgets.

[ChangeLog][Gui/Widgets] Child windows and widgets are now always shown
in their normal state by show().

Pick-to: 6.7
Change-Id: Ie8caf2df2d854194b9985c9427a9eac1312aba65
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-12-13 18:52:17 +00:00
Assam Boudjelthia c0b0cdcb61 AndroidTestRunner: replace fprintf() with Qt logging calls
To make the code more uniform.

Pick-to: 6.7
Change-Id: I84cc9c6169e9eb5a4ba4909b6a7178206eb57c4d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-12-13 20:52:16 +02:00
Assam Boudjelthia 4b0f774e3b AndroidTestRunner: add new TestInfo struct
This contains test specific variables like pid, sdkversion,
isPackageInstalled and isTestRunnerInterrupted which don't strictly
fall under 'Options'.

Pick-to: 6.7
Change-Id: I7c4a3422813f464b407d9b2be98c5b4a807c4f1e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-12-13 20:52:16 +02:00
Assam Boudjelthia 3ee2ecd6bf CMake:Android:Coin: prioritize timeout from COIN_COMMAND_OUTPUT_TIMEOUT
... from CMake so that Coin doesn't end up killing the whole VM if aRows
test gets stuck and instead allow androidtestrunner to cleanup and fetch
the logs so we know what happened, and even potentially ending up re-run
the test and succeeding if it was flaky.

Also, since CMake sets the timeout during configuration time, coin needs
to set COIN_COMMAND_OUTPUT_TIMEOUT under the build target where tests
are configured, so this moves the setting of that env var from the test
target to the build target.

Pick-to: 6.7 6.6 6.5
Change-Id: I9883ea1e98c93f79a088067518d09ca8acd5fdfd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-12-13 20:52:16 +02:00
Assam Boudjelthia 53f3013b9e CMake: add spaces between sentences of BUNDLE_ANDROID_OPENSSL_LIBS
Pick-to: 6.7
Change-Id: I7c3603577805426eb1cd46ff9317b7a6f3ca7f93
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-12-13 20:52:16 +02:00
Assam Boudjelthia f8724b9b7e AndroidTestRunner: log when timing out waiting for the test to finish
Leave a log message to know when the test runner timed out or the test
finished.

Pick-to: 6.7 6.6 6.5
Change-Id: If56ecaa5b0e3af22b3e26480a584e2d52ac97553
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-12-13 20:52:16 +02:00