Deduplicate some API docs.
Mention that it's a RAII class, to make it more appealing to users.
Copied the "RAII" note and link from QSemaphoreReleaser's API docs.
Change-Id: I53ced6eb7c2ab55ffc04e70c250b5f5639406911
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit e1fdfe9da8ccdeed9af602897232a513884b0515)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If the key doesn't exist yet in the map, we need to be able to create an
actual Key object. Consequently, we require that the type is actually
convertible.
This doesn't fix any broken code, but avoids compilation errors in QHash
internals bubbling up.
Note that the existence of a comomn_reference does not imply
convertibility (so the concept version wasn't strict enough either).
Done-with: Fabian Kosmale <fabian.kosmale@qt.io>
Change-Id: I4ed46f343817932063084642093cac193fd9554f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a338f67dceed61009375a4a90a7fe32a06b443a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When these iterators were originally added¹, their relational
operators, following the Lakos Rule, were not marked as noexcept
because they have preconditions (lhs and rhs must come from the same
QVersionNumber object).
d292648d0bbac50388dae035dc34782accb3807f then added the noexcept,
disregarding the Lakos Rule. Until the ongoing discussion regarding
the Lakos Rule on the project mailing-list² is concluded, don't add
noexcept. We can always add it in later, but we can't remove it once
released.
Requires manually working around the missing
Q_DECLARE_STRONGLY_ORDERED_LITERAL_TYPE_NON_NOEXCEPT macro that we
don't want to add if there's no other user.
¹ 2188ca2c5d
² thread starting at
https://lists.qt-project.org/pipermail/development/2024-August/045544.html
Change-Id: Ie88326519673166afe8cb44267c23944b27c68d2
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit a84b79df0fb8a92b17a39bbf706714e93de9d6fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
After the base and derived classes have been merged we can uniformize
the initialization as well.
Task-number: QTBUG-127539
Change-Id: I3828dc973fd7b3ccd06272e2e26eaae4edab8768
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit c3093b3d8f27fa3df14e04245dea9ed1e781f61e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
That allows the code to run in C++17 mode - at the expense of
significantly worse compile time error messages, potentially worse
compilation speed and harder to read code.
Adjust the test type to actually model
detail::is_equality_comparable_with (which requires all four
relational operators even in C++17).
As a drive-by, fix the return value of remove() from auto to bool.
Done-with: Marc Mutz <marc.mutz@qt.io>
Fixes: QTBUG-128470
Change-Id: I68df26db579c60812a18e09b76dd5712e73ccaa2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7fe3cee36352c74cbaaff52e863bd0da1170affa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Going from 40 seconds to 1.
The issue is that wait() doesn't care if there was
a signal emitted already, it will just wait 5 seconds for a new
one. But we don't care, we just want to know that there was 1.
Pick-to: 6.7 6.5
Change-Id: I96f1f00bc6171ccc6e5b2f033fa407de5cf0c0c3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 65494fbd3dff16d4476b5ac8c04df830d9fd61e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Our general strategy is to support the latest two iOS releases,
as most people upgrade their iOS devices quite aggressively.
But given that iOS 18 is not out yet, and that people still
spend some time upgrading once it's out, we don't want to be
in a situation where we effectively only support iOS 17.
Fixes: QTBUG-128678
Change-Id: I959794944807e5b6b5e56f22d3c57977bc4f2aee
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit e2c4a1669e5b6496d52e2f55a94bd7d4f4469b98)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Call sites of qt_mac_toQColor may not necessarily check the NSColor
for nil before passing it to qt_mac_toQColor, as seen for example
in the QCocoaColorPicker implementation.
Without an explicit nil check we ended up returning a valid QColor
with all color components set to 0.
Pick-to: 6.7
Change-Id: I0cc36049fca05a6b668c0c610bc40eedbc72df3a
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit 271bfe4a5405309dc8d48807d6f28d174efb2cc2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On some platforms, localhost resolves to both ipv4 and ipv6 addresses.
In that case we might get multiple emissions of the
socketStartedConnecting signal, for Happy Eyeballs.
Pick-to: 6.7 6.5
Change-Id: Ib39a167bdde2089106c89a3e297cbb0ad2f357d9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 13a0f294b5ef2ec8a2057d72365f989ddf6290de)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
You cannot direct-initialize a pointer variable with a comma
expression. Need to wrap it in an extra set of (). Instead of that,
wrap with {} on the outside, to make it look less like Lisp.
Amends 0ed039fd134fb8025236847295681f13f1775847. On dev, a follow-up
change has already removed the code in question, leaving only 6.8
affected.
Change-Id: I8d03093849d0bd7b868703218b48b5cb9d2a18f4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Now the caller of toJavaObject() is be able to get
an object of Void type when the input parameter is QVariant<void*>.
Fixes: QTBUG-128586
Change-Id: I6eea670788461e4eb0d8f38a4a872c2c4759bdd8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit e02813eeb5e3f3475541b50ba8d21a7bc724e698)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's customary to add such a comment when an inline function is not
defined in the same header it is declared.
As a drive-by, remove the pure attribute from lastIndexOf().
Q_DECL_PURE/CONST_FUNCTIONS are only useful for out-of-line functions.
For inline functions, the compiler sees the body and can determine
that they're pure or const (in the __attribute__((const)) sense)
itself.
Found in API-review.
Change-Id: I27aa5cfaf21b1015a6c8b9e4773a1c2c5134a226
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 3b812f0409c50c6a3fd1d66a9c18bc323e0a0ca3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Same result, but less templates to instantiate, so should be faster to
compile.
Found in API-review.
Change-Id: I43ebb94c73c6b4462441a7ae85a67909f6894ba3
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 13d2d55957c52c4f2270248be57dc18bea507236)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If a popup is visible, we're not supposed to send pointer events
to other windows than the popup. It doesn't matter if the popup
doesn't want it. But currently we end up doing so anyway, which
mean that we would trigger items elsewhere in the UI.
This patch will instead make sure that always return from
processMouseEvent() after sending, or forwarding, it to the
active popup.
Note: some styles in Controls (e.g macOS) has a menu window that
is actually substantially bigger than what it appears like on
screen (to make room for a drop-shadow). This means that a mouse
press can happen outside the visual borders of the menu, but still
inside the popup window that contains it. And this is also a
reason why some bugs related to forwarding of mouse events only
surfaced on some platforms (Ubuntu), but not on others (macOS).
E.g for a Menu in a MenuBar, the menu window on macOS would actually
be placed on top of the MenuBar and block pointer events from reaching
it (because of the menu shadow). While on Ubuntu, since the menu has no
shadow, the press would instead trigger the MenuItem in the MenuBar.
But by never forwarding pointer events to windows other than the
active popup, such differences will never happen.
Note: we should actually forward pointer events to the window under
the mouse if QPlatformIntegration::ReplayMousePressOutsidePopup is
set (and WA_NoMouseReplay is not set). But this API is currently not
reimplemented after QGuiApplication was refactored to support popup
windows also in Qt Quick. And ReplayMousePressOutsidePopup seems to
be false on all platforms other than Windows.
Change-Id: I55692cf2cae4c8f9e46976b105660bca96bd65e6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit fc9af570507bf067a182ab3f1c2f51a29f59e38c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... since no consensus has been reached about what to do in Qt7 (whether
to fold QChronoTimer back into QTimer or let QTimer be as-is to not
break any existing code and use QChronoTimer in new code).
Task-number: QTBUG-128426
Change-Id: I7d09b803b4f0df3ea7f48a5d900d0ae4be721d7b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 87030778969165a285af2d919d6d7293e8078b6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It effectively was, relational operators should be, and
comparesEqual(), which calls equals(), actually already was marked as
noexcept, so also mark the out-of-line function.
Found in API review.
Change-Id: I3fce2277f328284e098afeee40c319a7ba85fefe
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit e358f3158cc2d5c248b5626f15e556414fc0cd6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The inheritance is probably unnecessary.
As a drive-by, initialize all the members to silence the original
Axivion warning.
Task-number: QTBUG-127539
Change-Id: Iba9d8f2cba246616dbb6e8e9b7b21e8589af84d9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit de3dd3878c2305be81d539e768788e2713c81423)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of reading the PE header we can try to retrieve the stdout
handle, and if it's present, we have a console, or redirected output.
This amends commit 639437cf34783573e14d35ceb68ee8d9de495d7b.
Pick-to: 6.7
Task-number: QTBUG-127732
Change-Id: Ib6dd1a37552519fd867e7c39e588a085513f97e0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Zhao Yuhang <yuhangzhao@deepin.org>
(cherry picked from commit dfa52e3ae63432c1bfbb70b258ba96f7bfa5d3b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This probably wasn't triggering anything, because the class happens to
be a template, but don't let the poor guy that will de-templatize this
come Qt 7 run into this.
Also add the customary "defined in qstring.h" comment.
Found in API-review.
Amends 3d0eaf863e,
9b945b381a,
4c93115504 and
b977ae371a.
Change-Id: I45b2a808dca5ea335a1771df9cfeb4e67bd185f3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
(cherry picked from commit 183a775f80a029136416c75a66f74e4c099e0d32)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
tst_qfloat16::ordering tests that qfloat16 can be compared with a long
double. When on x86_64, conversion from qfloat16 to long double leads to
a linker error due to undefined reference to __extendhfxf2. This is a
bug in the VxWorks' toolchain. It has been acknowledged by WindRiver and
it's being tracked in ticket 00154117.
Since
- this is a platform problem and Qt has no control over it,
- the conversion won't work for any client code anyway, so not testing it
is not hiding any issues,
mitigate the problem for now by not compiling the problematic test code
on VxWorks.
Task-number: QTBUG-115777
Change-Id: Icf81da405d1392ae3bcacc61745a54d68b849b89
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6ef631c7992cc81ead158c5c5801f689b21fc378)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fixes a build problem on VxWorks because their runtime library isn't
libgcc.a and is thus missing the symbols that the Clang emits into the
test code when the intrinsic is used. This also better aligns the CPU
check with what QtCore does.
Drive-by add a comment explaining what this is and why Darwin is
excluded.
Drive-by clean up of the CMakeLists.txt, especially the no-ops.
Task-number: QTBUG-115777
Change-Id: Ib15e33ce157f7e6d99d0530076de6a1024733ed6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5f522947878690bf7b99ff4b39a6cbaa259b74b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Follow the dynamicCast/dynamic_pointer_cast implementation for
objectCast/object_pointer_cast since a qobject_cast can fail
just like a dynamic dast.
Also see: https://eel.is/c++draft/util.smartptr.shared.cast#6.2
See commit this commit from 2013 for more historical context:
a094bf5a89
Pick-to: 6.7 6.5
Change-Id: I9a54af55a7a1cf106cace52e9cf3bc103ae0bd42
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7a65abb50eb638de445e24c2746d7f90c1b89f06)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QDateTime::fromMSecsSinceEpoch(qint64) exists since Qt 4.7,
and Qt 5 had a fromSecsSinceEpoch(qint64 sec, Qt::TimeSpec spe = Qt::LocalTime, int offsetFromUtc = 0);
so writing fromSecsSinceEpoch(qint64) is backward compatible, "since 6.5" is confusing.
commit f46c18c627 erroneously added
\since 6.5 to these overload.
Change-Id: I91027dcc2e4f20bfc7af643c349131a7f53d8367
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 780d5a089c0fe1db8dc59d4c61d5bb86a4d97b5a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QWindowContainer forces a native window if it has a scroll area or an
MDI area as an ancestor. This breaks if WA_DontCreateNativeAncestors is
set, because the window container logic assumes that either there are no
native widgets in the parent chain, or all of them are native.
To avoid this problem, don't turn the window container native if it has
the WA_DontCreateNativeAncestors attribute set.
Task-number: QTBUG-128029
Change-Id: Ifca50c9abd7175a0af5b62b196a86a463a11be31
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit 14481614439a2fcb1f7f3d7820334f5af50be732)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a non-polymorphic class, so explicitly export only the
out-of-line methods.
Amends 4503dabfbd.
Found in 6.8 API review.
Change-Id: I600d355a3b3abd321841dfc33030de9e5707c38a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 81bcff5c78954eab091856d28eca69784c0889c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Small, trivially copyable and trivially destructible types should be
passed by value.
Found by an Axivion Scan.
Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I870b276a22dca55eac9afac8713cc81bf8ddcf32
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit f6e964d0f67b0f1324986fb63a23cbbac78dc503)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Be more precise in how to pass CMake variables to configure.
Task-number: QTBUG-128424
Change-Id: I0f3e7d049fa861631587a4fb79e93be54319bbee
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
(cherry picked from commit 0a4d023e5fd2bd166503a27591c456991f680823)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It is a small and trivially copyable type.
Found by an Axivion scan.
Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: If8efe667f8b7a40038d904386ef2fed15cd8f94d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 9e0c3e85b5d102442ad519a3454d7c63fddf920d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This patch updates the tika-mimetypes.xml MIME types definition file to
version 5101bc7fb090ed7deffe56837d7633c9485a1e5d, which is currently the
latest on upstream main.
The reason for the change is to include audio/flac as an alias for the
nonstandard audio/x-flac MIME type, which enables QtMultimedia to
automatically determine a suitable file-extension for FLAC audio files.
[ChangeLog][Third-Party Code] Updated TIKA MIME types definition file to
add the audio/flac MIME type as an alias for audio/x-flac MIME type.
Pick-to: 6.7 6.5
Change-Id: Id2596f5aea55041a1cbbdcbfbd7500b652444bad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 265187518d13571ff2b991a00ec0011df61f7ae5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For QRhi this has been done not so long ago, but it seems the individual
classes, for example, QRhiTexture suffer from the same: the genereated
docs list the forwarding header, that does not exist.
Fixes: QTBUG-128548
Change-Id: I6a58caf45fa9bbfdb5b91311d7484c0954ad63e1
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 35791751a21f709d00726fb495bebc707f90a166)
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The code implements parts of the event handling as lambdas in
the constructor. This makes it hard to see what the constructor
code itself does.
Instead, move the initial handling of the emscripten::val
event to event handler functions, which then call the existing
process event functions.
Change-Id: I3abc5be47b080c772c699c21f2fe1cc555ff8192
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 3117d88cdf2324a7833cdf9ceecc4cba30e1e090)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The private implementation already uses QByteArrayView, so the fix is
trivial.
Amends c6438054b9.
Found in 6.8 API review.
Change-Id: I41a62557ca82d31a814ceb3f5079a60ca8c437c4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 525bbfb5dfd1a5f3a6e4a5bc0126714232e20f9d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We do have an implicit constructor which allows construction of a
QLocale from the QLocale::Language enum values. It will be used when
doing the comparison.
However, do not rely on the implicit conversions, and provide the
operators that explicitly do the right thing. This also allows us to
save an extra allocation of QLocalePrivate.
Found in Qt 6.8 API review.
Amends 71bbc35a37.
As a drive-by: fix the order of the test slots in the unit test.
Change-Id: I37f8f5881469b7734705e06e471746814dd2ddf0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 403b1abcad5f437c51dfabd7095b814e99e197a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QLocaleData::c() simply returns a pointer to a static constexpr array,
so it can be noexcept. The Q_ASSERT there simply checks internal data
consistency.
QLocaleData::findLocaleIndex() uses a QVarLengthArray, but the size
is hardcoded at compile time, and the implementation does not add
more elements, so it will never allocate. The static
findLocaleIndexById() helper can be made noexcept, because we
already made most of the QLocaleId methods noexcept. This allows us to
make QLocaleData::findLocaleIndex() noexcept as well.
Resulted from 6.8 API review, so picking to 6.8.
Change-Id: Iaa9ccaa127f2ba13235b9c0f91a72048067266f5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 205c64bd112e074920557f34bef8a3807350f7e9)
All inline methods simply operate on ushort members, so they can be
noexcept.
The withLikelySubtagsAdded() method operates on static constexpr
array of locales. It does not allocate and cannot throw. The asserts
are there to check the internal consistency. So, it can also be made
noexcept.
Consequently, withLikelySubtagsRemoved() can be made noexcept, because
it only calls withLikelySubtagsAdded(), and does some trivial checks.
The only two methods that cannot be made noexept are:
* QLocaleId::name(), which obviously allocates a QByteArray
* QLocaleId::fromName(), because it end up calling a static
isScript() helper, which allocates a QString.
The isScript() helper possibly can be rewritten to avoid allocations,
but that's an exercise for another patch.
Resulted from 6.8 API review, so picking to 6.8.
Change-Id: I9e98df31f9c13171bc005250024aa4ffb0faedb8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 2485aae3ff3fa56833009f4766e53068667a7435)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Qt's foreign windows do not take (full) ownership of the native handle,
so our platform window implementations take care to not fully destroy
the native handle in their destructors.
But if the foreign window had a QWindow parent at the time of
destruction, and we fail to decouple the native handle from its
native handle parent, the destruction of the QWindow parent may
bring down the foreign window native handle as well, as part of
deleting the parent QWindow's native handle.
We take care to selectively do this decoupling on macOS, iOS, and
Android, but were failing to do so on XCB and Windows. This has now
been corrected, which allows us to remove the workaround in QWindow,
which was also in the wrong place (before setVisible(false) on the
foreign window child).
Note that we do not unconditionally reparent the foreign window, as
it might be a foreign window used for containing other QWindows, in
which case we don't want to mess with the native view hierarchy.
Change-Id: Ic526ca63fbf72dae5013ae9e44cb5cddf61c944b
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 8f8ce8d7a7e029e62a4f9b5b209dcc37f61410cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Strictly speaking, the problem has nothing to do with QRhi. What is
special with the eglfs' backingstore is that it creates a QRhiTexture
and then pulls out the OpenGL texture ID via nativeTexture() right
afterwards.
In this setup there is nothing that would ensure glTexParameteri is
called to override the silly default of OpenGL. Normally this cannot
happen because once the QRhiTexture is used for sampling purposes
together with a QRhiSampler, all necessary state gets updated.
Starting from Qt 6.4, with the QRhi-based backingstore composition
changes, the special case where we create QRhiTextures just to get the
underlying OpenGL texture got introduced.
Ideally the eglfs side should provide its in MIN/MAG filter state, but
in the meantime, to be more robust, always set a MIN filter already in
QRhiTexture::create(). For most textures this will get changed
afterwards.
Change-Id: I305cdbb5576b977887b85a15b72455bb3ae430c4
Pick-to: 6.7 6.6 6.5
Fixes: QTBUG-123551
Reviewed-by: Karim Pinter <karim.pinter@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 88aa5250d58900653192c45e41f182ec88474e38)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QListWidget/QTreeWidget::setItemWidget() take ownership of the widget.
This was documented for QTreeWidget but not for QListWidget. Unify the
wording with QAbstractItemView::setIndexWidget() (which gets called by
setItemWidget()).
Pick-to: 6.7 6.5
Change-Id: I272a20b7e7be13df1ddd9f2ba552dd9da68e2a3b
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 53c6c73c57d36796577a13fd4dd82a04ee9647ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Having the actual const_iterator::operator++() as an out-of-line
member function means that the implicit this pointer forces the object
onto the stack (registers don't have addresses that could be
passed). Since const_iterator is now merely a thinly-disguised
pointer, that would cause terrible codegen.
So, apply a technique originally developed for QStringView and make
the operator an inline function that re-sets the member dirEntry using
a call to a QDirListing static function that takes and returns by
value. Passing by value enables passing in registers, which means the
iterator object can now be a register value and doesn't require
spilling to the stack to call the function.
Found in API-review.
Change-Id: I9f4d5be5b72249b368ef3dea9d857178ca7e16aa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit aec8398d71d351e956683a695af51317fe65097e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The std::input_iterator concept does not require copyable, only
movable. This makes handling input_iterators safer, because copies of
input iterators since advanced zap into partially-formed state without
changing their bit pattern. If the iterator is, however, only movable,
no such zapping copies can exist.
Take advantage of this and make QDirListing::const_iterator
move-only. Its iterators are anyway no longer compatible with
classical STL algorithms, so we're not restricting their use further.
Found in API review.
Task-number: QTBUG-125512
Change-Id: Ic1dee22881893fdbf159bbfd335c10505eaffa9f
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 29dfcc240b3e29d5d6149c2996cfdb9d71b776bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
std::weakly_incrementable doesn't require a std::input_iterator's
post-increment operator to return anything¹, so don't.
¹ https://eel.is/c++draft/iterator.concepts#iterator.concept.winc-14
The return value of post-increment on objects that model
input_iterator is partially-formed (as a copy of an iterator since
advanced), so any attempts to use it, apart from assigning a new
iterator or destroying it, are undefined, anyway.
Found in API-review.
Change-Id: If0c07250cec4e48c6e5176cd23864651e8ec3d27
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit fd89fc8c27460e2c11d9e3decc38cf61c186f984)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There's no need to carry the same QDirListingPrivate* around
twice. Remove const_iterator's direct QDirListingPrivate* member and
re-use the one from its DirEntry member.
Requires adding a private const_iterator::atEnd() helper function,
because while const_iterator and its member functions are implicit
friends of DirEntry, friend functions of const_iterator are
not. Improves readability, too.
Found in API-review.
Change-Id: I82b9273950e174d7598ee531fbd5dfb472911b71
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 0ede7f541dfc6cba163e1452aee7239818a42c1b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This simplifies the implementation, and is more secure, because you no
longer can compare const_iterator with const_iterator and get a
non-sensical result (unequal, even though copies of each other).
Requires the STL algorithm test to be ported to C++20 ranges, because
classical STL algorithms can't deal with decltype(first) !=
decltype(last).
Found in API-review.
As a drive-by, make the reversed and inverted operators conditional on
!__cpp_impl_three_way_comparison.
Change-Id: Icd0e4dac277bd3b053f7b648f8c3f9d9f3753299
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 2569ca0f34fe15a2e5c828b708f1406be8d53836)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>