Commit Graph

61819 Commits

Author SHA1 Message Date
Laszlo Agocs
6f956279f8 rhiwindow example: Make -g option (OpenGL) work on macOS
Of course we managed to rely on a GLSL feature that is only
in GLSL 130 and newer, not 120 which is what the default 2.1 OpenGL
contexts support on macOS.

Change-Id: Ib75e750ea15d59e51b2207669068fba7719a48b1
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 204c91c971)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-21 13:09:14 +00:00
Ulf Hermann
8529d537ac QMetaContainer: Allow retrieving the d pointer
This is in line with how QMetaType handles QMetaTypeInterface*. You can
retrieve a const pointer to it.

Task-number: QTBUG-113690
Change-Id: Iaf3c10603dc6049a5553987c90006807867abc0d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 937751f427)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-21 06:44:31 +00:00
Arno Rehn
f0765c556d QPromise: Propagate cancellation through failure handlers
Previously, failure handlers did not propagate cancellation. This would
lead to crashes when a QPromise was cancelled without having generated
any result. Subsequent continuations would be invoked and try to access
the result (which was nonexistent) and then crash.
This patch propagates cancellation through failure handlers to prevent
subsequent continuations from being called in the first place.

Fixes: QTBUG-114606
Change-Id: I23b28a8e70a76e1ba6416be4440360c6dbaef2a3
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 855c448469)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-21 06:43:48 +00:00
Marc Mutz
40b99f7fc6 RIP QBasicMutexLocker
This was used as a work-around for Q5MutexLocker's UB downcasting
QBasicMutex to QMutex, and for some unspecified performance
improvements.

Now that Q6MutexLocker is a template, the two are almost
token-by-token identical, so we can remove this work-around and use
QMutexLocker directly.

Partially reverts aea500d5d7.

Change-Id: I57ef5c53999869aa3454fbbaad884c1d18591b2a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8d39b21655)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-21 06:35:13 +00:00
Marc Mutz
c67f69ce29 tst_qmenu: fix -Wsuggest-override
... and fix placement of {.

Amends f0049873d2.

Change-Id: I2479087005d350a23e45eda126a89e0be91c0701
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c41e03008a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-21 06:35:08 +00:00
Marc Mutz
55fbb4c372 tst_QPixmapCache: check we leak QString keys of evicted pixmaps
Task-number: QTBUG-112200
Change-Id: Icf0a40b68a4ef3ec930a74b47e6ca88d9d0060ca
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b74ef9ee48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-21 06:35:02 +00:00
Marc Mutz
9d6543ea40 QPixmapCache: DRY insert()
Implement insert(QString, QPixmap) in terms of insert(QPixmap) to
avoid duplicating code and to separate concerns: insert(QString,
QPixmap) is now only dealing with the cacheKeys, insert(QPixmap) is
only concerned with the Key-based lookup.

Task-number: QTBUG-112200
Change-Id: I30394da43a5e93b7bd41ef9ce9c7aea044523c30
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit aa8e8e94b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-21 06:34:56 +00:00
Marc Mutz
8050a66a8d QPixmapCache: simplify remove(QString)
The previous code used `cacheKey` as the name of an iterator, which
made the code hard to understand.

Instead of renaming that to the more idiomatic `it`, use QHash::take()
to get an actual `cacheKey` back, and then delegate to
QPMCache::remove(QPixmapCache::Key) for the actual removal.

Task-number: QTBUG-112200
Change-Id: I9311c19f12a05cad694702672f17ae19ba339b04
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c2bcba93a6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-21 06:34:52 +00:00
Marc Mutz
ae04c6a16f QMac{,RootLevel}AutoReleasePool: mark ctors [[nodiscard]]
They're RAII classes, and QUIP-0019 says RAII class' constructors
should be marked [[nodiscard]].

Task-number: QTBUG-104164
Change-Id: I0080f5b6a3cea346c0860e00958a8c204849040e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit ffed431293)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-06-21 08:34:32 +02:00
Marc Mutz
ae41507317 QDebugStateSaver: mark ctors [[nodiscard]]
It's a RAII class, and RAII classes should have only [[nodiscard]]
constructors.

Task-number: QTBUG-104164
Change-Id: Ia83fa003677a839734208b12bde2c6287c1b79a3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 8cad4c2903)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-21 06:34:26 +00:00
Marc Mutz
b04a8a90f8 QMacAutoReleasePool: unexport
We should not export non-polymorphic classes wholesale. Only export
the non-inline functions instead.

There are no implicitly-declared special member functions in this
class that could cause problems, so we don't need to delay until Qt 7.

Task-number: QTBUG-104164
Change-Id: I2e98782160cccb9c0f59a68e67ffd29fec42b728
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 2a76cf8181)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-21 06:34:21 +00:00
Marc Mutz
c6f7b8aa46 QAppleRefCounted hierarchy: mark ctors [[nodiscard]]
They're RAII/smart pointer-like classes. QUIP-0019 says such classes'
ctors should be marked [[nodiscard]].

Task-number: QTBUG-104164
Change-Id: I830badfa56fbdfb5819866f67b84cd4fa93acbde
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 83a156cd11)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-21 06:34:15 +00:00
Marc Mutz
82005725c2 QDockAreaLayoutInfo: fix QDebug stream operator
The existing implementation as a member function QDALI::op<<(QDebug)
cannot possibly work, as the implicit `this` argument comes first in
this case, while for streaming operators, the QDebug object must come
first.

Rewrite as a hidden friend and apply QT_NO_DEBUG_STREAM protection as
a drive-by.

Amends faec937756.

Task-number: QTBUG-114542
Task-number: QTBUG-112491
Change-Id: Ida400d335491896ec49f2c0f9601a8430eebcd4d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 46aa713c34)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-06-21 08:34:01 +02:00
Axel Spoerl
22dc39a8d7 Implement debug operator for QDockAreaLayoutItem
QDockAreaLayout items can be widgets, gap or placeholder items.
They appear and disappear during hovering.

This adds a debug operator to make troubleshooting easier.

Task-number: QTBUG-114542
Task-number: QTBUG-112491
Change-Id: I0fa5d3c96ab91838f28ad7cec3c049fd39f47576
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit faec937756)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-21 06:33:56 +00:00
Ahmad Samir
8d82e24f95 Moc: fix narrowing conversion warnings with range-for loops
Change-Id: I6dee1a6ae82c33bd6523734ee32ab4c83835f9d8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit db9e206dee)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-20 19:51:03 +03:00
Alexey Edelev
87fc863c27 Fix CMP0099 impact - disallow propagating internal linker options
CMP0099 changes the way of LINK_ONLY genex works. With CMP0099 set to
OLD LINK_ONLY genex only links the exact library binary/archive without
propagating other interface options from the target. This feature was
exploited by PlatformXInternal targets to avoid propagating of their
linker options. Nowadays when CMP0099 is forced to NEW by Qt scripts,
including user-facing, we cannot rely on LINK_ONLY genex.

Introduce _qt_is_internal_target property that is set for all Qt
executables and explicitly limits the propagation of the linker
options from PlatformXInternal targets.

Fixes: QTBUG-113641
Change-Id: I3a0ecddb65886e435073feb24c1b47035130ba70
Reviewed-by: Alexandru Croitor (OOO) <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 28c9625d00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-20 12:31:51 +00:00
Marc Mutz
308d0b5f96 Q(Explicitly)SharedDataPointer: mark ctors [[nodiscard]]
They're RAII classes, and RAII class' constructors should be marked
[[nodiscard]].

Task-number: QTBUG-104164
Change-Id: If4265a431839a5d3c16dcc855b1ded2d2fc7408c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c823bc2fdb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-20 12:17:32 +00:00
Marc Mutz
c62e0ed703 QScoped(Array)Pointer: remove the class-level [[nodiscard]]
It was used as a work-around for constructor-level [[nodiscard]]
missing in C++17, but a) compilers are free to implement [[nodiscard]]
for constructors in C++17 (P1771 was not considered a normative
change, just a clarification of the existing wording), and b) prevents
useful code that returns such types from functions.

Task-number: QTBUG-104164
Change-Id: I440b418d58e86118e84689adb06d239ca598afcc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 21c344a221)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-20 12:17:25 +00:00
Marc Mutz
2c07d59092 Q(Read|Write)Locker: mark ctors [[nodiscard]]
They're RAII classes, and RAII class' constructors should be marked
[[nodiscard]].

Task-number: QTBUG-104164
Change-Id: I9b91c18e67e99bf84abdd12236a18a8c4ec39620
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6dba28419b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-20 12:16:43 +00:00
Marc Mutz
d082bf07a9 Mark all ctors of [[nodiscard]] classes as Q_NODISCARD_CTOR
This works around around the difference in class-level [[nodiscard]]
behavior between Clang and GCC. While Clang already warns about

    QClass(~~~args~~~);

when QClass is marked as [[nodiscard]] at the class level, GCC does
not, and requires the ctor to be marked as [[nodiscard]] instead.

Fixes: QTBUG-104164
Change-Id: Ifd7076ee422fb9472ae8bbba43d9bfeee1968a78
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 603d6351cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-20 12:16:36 +00:00
Fabian Kosmale
295ecd9b87 QBindable: Fix out-of-bound access in non-bindable property support code
QObjectPrivate::getPropertyAdaptorSlotObject called
connectionsForSignal.
Calling this function is only safe after it has been ensured beforehand that the vector has size > signalIndex. As getPropertyAdaptorSlotObject
is not supposed to modify the vector, it does not resize the vector and it could consequently end up with an out-of-bounds read.

To avoid that issue, we instead first check if the vector can
potentially contain an entry for the signal. If not, we simply return
nullptr, and avoid the call to connectionsForSignal.

The issue and its fix can be verified by running the modified
tst_qproperty test with ASAN enabled. The test is modified in the
following way:
- We first create a signal connection to a dummy slot. Otherwise,
  connections.loadRelaxed() would return a nullptr, and the problematic
  code would never be reached.
- We add enough signals to ensure that the fooChanged signal will
  actually be out of reach (which means >= 8 signals, as the initial
  capacity of the vector is 8)
Running the test without ASAN will most likely not result in a failure,
as then the out-of-bounds read will simply read garbage, and the most
likely result is that the cast below will fail.

Change-Id: I18a3c4f52769c2b6491a685abb84f6fcfb44e4d8
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 96e1381a0a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-20 12:08:37 +00:00
Volker Hilsheimer
bdeb45c2e2 QKeySequenceEdit: don't finish when opening a context menu
Right-clicking in a QKeySequenceEdit opens the usual context menu for a
line edit, which generates a focusOut event. QKeySequenceEdit finishes
the recording when it loses focus, which includes deselecting the text.

We should not finish or deselect if the focusOut event has focusReason
FocusReasonPopup, as otherwise users cannot copy the text (keyboard
shortcuts don't work for that, obviously).

Task-number: QTBUG-114624
Change-Id: I0b3c535c189151daa29cf17640493f3353e6394b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 89566bf749)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-20 11:53:57 +00:00
Volker Hilsheimer
848c017165 macOS: work around getting invalid result from NSAlert::runModal
It is possible for an application to trigger the unexpected result of
NSModalResponseContinue from our call to NSAlert::runModal, by showing
and hiding a modal dialog first, and processing events explicitly. This
at best only flashes the native message box, at worst it triggers an
assert from our processResponse function evaluating that response value
as impossible (via Q_UNREACHABLE).

We should never call processResponse with NSModalResponseContinue,
but instead keep the modal loop running and the dialog visible.
So introduce a wrapper to NSAlert::runModal that keeps calling that
method until we get a result other than NSModalResponseContinue.

Writing an auto test for this failed; a simple test didn't reproduce the
assert; trying to place the opening of the native message box into a
lambda that would be called by the event loop (simulating the button
press from the bug report's reproducer) resulted in the native message
box never closing and the test blocking (and still not triggering the
assert).

Fixes: QTBUG-114546
Change-Id: Iab25eff55c48b103287d1881ac355e6cdd190f7a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 2c458a8221)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-20 11:53:38 +00:00
Alexey Edelev
15de36f97b Fix typo in qt_internal_add_global_definition
Fix the argument prefix that is used in the cmake_parse_arguments call.

Change-Id: Ie02bdf7d2769ce084b0d173c1e8152ca6fc4fe53
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4e74fa8119)
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
2023-06-19 15:36:00 +00:00
Liang Qi
b2222ec0d3 Android: use logging category for im debug
Change-Id: I78e84313841f83416dee6b6b2970b402acce5060
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit b992aabd89)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-19 15:15:17 +00:00
Matthias Rauter
10950d87f7 Send LeaveEvent as reaction to WM_POINTERLEAVE to reset hover states
Currently items can get stuck in a hovered state when all fingers are
lifted from a touchscreen. This is because we don't react to the
WM_POINTERLEAVE event from Windows. With this patch we translate a
WM_POINTERLEAVE event to a LeaveEvent to remove the hover state from
QtQuick items.

Fixes: QTBUG-62912
Change-Id: I8a6fb6b7ec77457854a75e20277565d1eb89bab6
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit ef7d809eaf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-19 06:26:36 +00:00
Fabian Kosmale
838f66be51 moc: Handle attributes after meta-method tag
We so far only handled them if they came at the very start of the method
declaration.
This patch ensures that we also handle them after the meta-method tag
(but before the actual type).
Unifying parseFunction and parseMaybeFunction to avoid the need to
munally keep them in sync is left for another day.

Fixes: QTBUG-111330
Change-Id: Ic94edb69f04b9150aea2c8e6d004a8b9e5cf12ec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 44b5ad01f0)
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-06-19 08:14:53 +02:00
Thiago Macieira
c63a3a46be Q*ValueRef: suppress MSVC warning on deriving from non-exported base
Warning C4275 non dll-interface class 'QJsonValueConstRef' used as base for dll-interface class 'QJsonValueRef' UniRemoteAdapter C:\qt\Qt6.5.1\6.5.1\msvc2019_64\include\QtCore\qjsonvalue.h 219

Fixes: QTBUG-114629
Change-Id: I443cf0c8a76243eead33fffd176930f96c43eb47
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 674aa084c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-19 06:04:08 +00:00
Amir Masoud Abdol
c9630e3afa Disable TRY_RUN when cross compiling
Fixes: QTBUG-114625
Change-Id: Idec5ea438ebf3f88d63da7d956ab52e2a0fa1821
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
(cherry picked from commit 331f316b91)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-17 18:26:23 +00:00
Tor Arne Vestbø
456896aa6b Unify QIcon theme icon loading and cache invalidation
The logic for invalidating a theme QIcon when the platform theme
changed, or when the user set an explicit icon theme, was tied
to QIconLoaderEngine, so any platform theme implementing
QPlatformTheme::createIconEngine() with a custom icon engine
would not take part in this cache invalidation.

As we want users of QIcon::fromTheme to be agnostic to where the
icon is actually coming from, and have a consistent behavior for
the various QIcon APIs for setting explicit themes, the logic
for invalidating the themed icon has now been moved up one
layer, to a new QThemeIconEngine, that is responsible for
lazily creating the actual engine based on the name. The
engine proxies the actual icon loading through to the
real engine via a new QProxyIconEngine helper class.

Change-Id: I474589981f751d7467e3073533cba542182f2d36
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a452e22546)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-17 18:02:37 +00:00
Tor Arne Vestbø
bb08b96b29 Add missing QApplication include in streambookmarks example
Amends 3ccf2f8308.

Change-Id: Ib51777ef9af44aff7fbb813b58eb0fbb74761373
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 14f31bf16e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-17 15:41:49 +00:00
Friedemann Kleint
7de02e230c QMessageBox: Remove include of qdebug.h
Move the implementation qRequireVersion() to prevent having
to include qdebug.h which pulls in many other headers.

Amends b5d874e36f.

Fix missing include introduced by
3a553507a1.

Task-number: QTBUG-114214
Task-number: QTBUG-97601
Change-Id: Iba68ffca95061666d9458ffa5700d07c7669da5b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 408fbd3f2d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-17 13:28:27 +00:00
Thiago Macieira
0b8d30efec QProcess/FreeBSD: remove the workaround allowing undefined symbols
On FreeBSD, the environ variable doesn't come from libc, but is instead
inserted during linking. See ccf74b5928
(5.6) for more information.

But instead of allowing undefined symbols in QtCore, let's use a weakref
to environ so this one symbol is allowed to be undefined. It won't be,
but the linker doesn't know.

FreeBSD appears to be the only BSD to require this. We used to apply the
same linker option to OpenBSD in Qt 5, but neither the OpenBSD or nor
the NetBSD ports trees[1][2] carry a patch for this, so I don't think
it's necessary.

[1] https://github.com/openbsd/ports/tree/master/x11/qt6/qtbase/patches
[2] https://github.com/NetBSD/pkgsrc/tree/trunk/x11/qt6-qtbase/patches

Change-Id: I63b988479db546dabffcfffd17661c839014771a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 166e792269)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-17 02:50:54 +00:00
Amir Masoud Abdol
4feb6662dc Use QT_64BIT instead of checking CMAKE_SIZEOF_VOID_P
Change-Id: I7db7b8f6c354df264a467538fffffab726ea1b61
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c5b0fa6082)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-17 00:08:49 +00:00
Amir Masoud Abdol
f5bad37873 Silence a warning in EGL check
There is a chance that an unused variable warning will be treated as an
error, and in that case, this check will fail, and as a result FindEGL
will fail.

Fixes: QTBUG-114431
Change-Id: Iaac49589144dbe4172ec58c6705a9f899c25f01f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 14b01b0aad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-17 00:08:49 +00:00
Laszlo Agocs
d0973a46e6 rhi doc: Fix a repeating typo
Change-Id: I2025d559be357a6825cdcae4cb0f0931a89864ab
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 684070bc34)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-16 21:59:16 +00:00
Morten Sørvig
97c40bf5bf wasm: expose windows before delivering updates
Don't show a blank frame on app startup.

The wasm update request system supports two types of update
requests: Expose and UpdateRequest. It can happen that both
types of request are made for a single window, in which case
the current code prefers UpdateRequest, since those must be
delivered in order to keep QWindow in a consistent state.

However, if the window is visible but not yet exposed then
delivering the update request will not make the window paint
anything, and we end up with a blank frame.

Ideally this should be handled elsewhere and QWindow::requestUpdate()
should not be called for non-exposed windows, but in the
case does happen then sending an expose here allows us to
recover.

Change-Id: Ib53050c33ad1769ea9b9ad678896af15f87a7ecb
(cherry picked from commit 4c18ebbc1c)
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
2023-06-16 22:59:06 +02:00
Morten Sørvig
66414b36fd wasm: log stack traces for exceptions
This is very useful for debugging.

Change-Id: I4861afb9bd2b4e757a962d81583a8b12958f9f1c
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 9e0cb768cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-16 20:59:05 +00:00
Edward Welbourne
8b693cd135 There is no frank.xbel so don't tell qmake to find it
Both the DOM and XML stream versions of the XBEL bookmarks example had
a frank.xbel in their EXAMPLE_FILES, but there is no such file. So
asking qmake to include it is spurious.

Task-number: QTBUG-111228
Change-Id: Iec08042d181fc09c2c428685ce841a13161ab273
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 8e1b60b331)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-16 22:59:05 +02:00
Edward Welbourne
f2995dc15a XBEL example - modernize strings: use "..."_L1 for literals
The XML stream reader and writer accept QAnyStringView arguments these
days, so passing a QLatin1StringView is entirely sufficient. This
makes static functions to provide access to unique QString instances
redundant. Linkers are allowed to uniquify the literals the "..."_L1
reference.

Task-number: QTBUG-111228
Change-Id: I7f37e97631e11683b9ddd3842fc6233547bed5ff
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 202b1dca5d)
2023-06-16 22:59:05 +02:00
Edward Welbourne
33d7e170e6 XBEL example: minor simplifications
Pass one function's return as a parameter to another directly.
Use a ternary expression rather than conditional initialization.

Use initializer-list construction instead of appending to an empty
QStringList; and inline the result where it's used.

Task-number: QTBUG-111228
Change-Id: I781aedba8dcc4251193b55d82fe684c9b5da241a
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 5fd4a65d95)
2023-06-16 22:59:05 +02:00
Edward Welbourne
cd1ef4db4f XBEL example: Fix null dereference bug
As readXBEL() does call readSeparator(nullptr), the latter should cope
with being passed nullptr as item.

Task-number: QTBUG-111228
Change-Id: I786e4438b566438448b5d54ff6442c27f1255aa8
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 705e4e63c6)
2023-06-16 22:59:05 +02:00
Amir Masoud Abdol
14a7096bda Add TRY_RUN_FLAGS argument to customize the TRY_RUN command
Some of our tools don't have the `-h`, or `-v` flag, or it could be
that the `-v` flag also prints the entire `--help` as well, e.g.,
`androiddeployqt`. When running in Jenkins, this may lead to a message
box being shown and consequently stopping the build. By customizing the
flag per tool, and limiting the TRY_RUN to tools that support `-v` or
`--version`, we can avoid this.

Also removed TRY_RUN from `macdeployqt` which doesn't need it anyway.

Amend 41b32cd2c4

Fixes: QTBUG-114530
Change-Id: I78e3344d2553c0050c285ae86f2310bd373c6c57
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 69d74afd43)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-16 20:59:05 +00:00
Topi Reinio
2e55a34c1c Doc: Fix documentation issues
The Qt Widgets Application example was moved to manual tests,
and no longer contains the snippet identifiers. Fix \snippet
and \quotefile commands to quote similar code snippets from
other examples or snippet files.

Fix also the following documentation warnings:

* No such parameter 'parsingMode' in QUrl::fromEncoded()
* Missing image: rsslisting.cpp

Change-Id: Ibc989e83abc49837db08628facaf8e5f72b2f123
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 17ddf2a6a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-16 07:14:49 +00:00
Tor Arne Vestbø
4f9b22fd00 De-inline QIconLoader::themeName()
The method is more than a plain getter, so keep it with the other
logic of the class.

Change-Id: I34aa185a51f04e3db3c1918f9723e53f33e5e9e1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit f3c2cf47fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-15 23:56:00 +00:00
Ilya Fedin
5783a384f9 Update QIconLoader system theme names on QWSI ThemeChange
The GTK platform theme (and possibly others) emit theme change
when the named icon theme changes, but that was not propagated
to QIconLoader.

We now call QIconLoader::updateSystemTheme(), but note that
if a user theme has been set we ignore the system theme update
and will end up with a stale value, even if the user theme is
later cleared. This will be fixed in a follow up commit.

Change-Id: I40b537f3618f44d396db0c7ca67e515dfcdfba44
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 3025dc597f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-15 19:21:04 +00:00
Colin Snover
02f5f21fbf Fix typo in QCocoaWindow comment
Change-Id: Idea292bc2927ff9a534f06b054c26b4ab3ef1bea
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 03bbad68ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-15 17:30:43 +00:00
Topi Reinio
c75c987a64 Doc: Global configuration: Remove obsolete content
Configuration aliases are no longer supported.

Change-Id: I5bb4e1fe6a861f3824d9832f88d2b89c3f1498fd
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 727b6256c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-15 16:58:47 +00:00
Topi Reinio
8c71212bbd Doc: Require Qt module documentation to define qhp configuration
By setting 'qhp' to true, QDoc will warn if qhp configuration is not
provided.

Task-number: QTBUG-114181
Change-Id: I26bce80e888d0b0bd270ecdcc6c0774298076a4b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 4729e1e720)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-15 16:58:36 +00:00
Topi Reinio
60c9347253 Doc: Fix documentation for QProcess::UnixProcessFlag
Change-Id: I6001b8c4e73d9785df8338d4d14fcf15f09eae15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1797f7946d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-15 16:58:12 +00:00