Commit Graph

62053 Commits

Author SHA1 Message Date
Laszlo Agocs
1d9bf6ea38 rhi: vulkan: Implement multiview support
Fixes: QTBUG-114771
Change-Id: I8408b84c5ce01df94d68167d557393af919864d3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-22 15:20:26 +02:00
Laszlo Agocs
f9d90c6fba rhi: Introduce multiview starting with OpenGL (ES)
Fixes: QTBUG-114770
Change-Id: Ibb1ced7f19d15a5116c60e95fd3e6b86ace63155
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-22 15:20:26 +02:00
Volker Hilsheimer
2b9ef2eb44 Pacify MSVC compiler incorrectly warning about unused variable
Under some circumstances, MSVC seems to complain about SlotArgumentCount
being unused

  qobject.h(210): warning C4189: 'SlotArgumentCount': local variable is
  initialized but not referenced
  note: see reference to function template instantiation
  'QMetaObject::Connection QObject::connect<void(__cdecl QAction::* )(bool),
  main::<lambda_1>>(const QAction *,Func1,
    const QtPrivate::ContextTypeForFunctor<main::<lambda_1>,void>::ContextType *,
    Func2 &&,Qt::ConnectionType)' being compiled

This is nonsense, as SlotArgumentCount is used in the next line, to
construct the list of signal arguments, but the workaround to declare
the variable as [[maybe_unused]] is trivial.

Add a connect statement to the test case that creates such a connection.
This does not produce any warning with or without the attribute (and if
it did, the build would fail for CI configuratinos setting -Werror).

Pick-to: 6.6
Fixes: QTBUG-114781
Change-Id: I4ee6f7d57c2836ef3dd9741d037d48181af2cdec
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-06-22 13:20:26 +00:00
Pranta Dastider
c33fd574c9 QtDoc Global: Add macros for Qt Design Studio in qtdoc
Adding some Qt Design Studio macros for global
qtdoc use. This would ensure flexibility for
the documentation writing.

Pick-to: 5.15 6.5 6.6
Task-number: QDS-10142
Change-Id: Id61a68d124aad1b8c8f9e17358fb5990efbab5de
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-06-22 11:09:18 +02:00
Yuhang Zhao
33a9cbef65 WASM: don't ignore custom QSurfaceFormat settings
Previously, Qt would always ignore user's custom QSurfaceFormat
settings and this behavior makes user have no way to control
the preferred OpenGL version when running on WASM. And after reading
the wasm platform plugin code, I don't see any reason why we should
limit ourself to the default OpenGL version. And I've tested this
patch locally, Qt still work normally if I set a newer OpenGL version.

Pick-to: 6.6 6.5
Change-Id: I0cfb831d6a722fe61cc85808a6d9e3098c73d82e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-06-22 09:15:03 +08:00
Martin Jansa
3e801b5477 tinycbor: fix build with gcc-13
* fixes:
  http://errors.yoctoproject.org/Errors/Details/701753/

qtbase/6.5.0-r0/git/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp:242:90: error: invalid user-defined conversion from 'float' to 'const qfloat16&' [-fpermissive]
  242 |     QTest::newRow("nan_f16") << raw("\xf9\x7e\0") << QVariant::fromValue<qfloat16>(myNaNf());
      |                                                                                    ~~~~~~^~
n file included from TOPDIR/tmp-glibc/work/core2-64-oe-linux/qtbase/6.5.0-r0/image/usr/include/QtCore/qmetatype.h:14,
                 from TOPDIR/tmp-glibc/work/core2-64-oe-linux/qtbase/6.5.0-r0/image/usr/include/QtTest/qtestcase.h:11,
                 from TOPDIR/tmp-glibc/work/core2-64-oe-linux/qtbase/6.5.0-r0/image/usr/include/QtTest/qtest.h:13,
                 from TOPDIR/tmp-glibc/work/core2-64-oe-linux/qtbase/6.5.0-r0/image/usr/include/QtTest/QTest:1,
                 from TOPDIR/tmp-glibc/work/core2-64-oe-linux/qtbase/6.5.0-r0/git/tests/auto/corelib/serialization/qcborstreamwriter/tst_qcborstreamwriter.cpp:4:
TOPDIR/tmp-glibc/work/core2-64-oe-linux/qtbase/6.5.0-r0/image/usr/include/QtCore/qfloat16.h:81:22: note: candidate is: 'constexpr qfloat16::qfloat16(NativeType)' (near match)
   81 |     constexpr inline qfloat16(NativeType f) : f(f) {}
      |                      ^~~~~~~~
TOPDIR/tmp-glibc/work/core2-64-oe-linux/qtbase/6.5.0-r0/image/usr/include/QtCore/qfloat16.h:81:22: note:   conversion of argument 1 would be ill-formed:
TOPDIR/tmp-glibc/work/core2-64-oe-linux/qtbase/6.5.0-r0/git/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp:242:90: warning: converting to 'qfloat16::NativeType' {aka '_Float16'} from 'float' with greater conversion rank
  242 |     QTest::newRow("nan_f16") << raw("\xf9\x7e\0") << QVariant::fromValue<qfloat16>(myNaNf());
      |                                                                                    ~~~~~~^~
TOPDIR/tmp-glibc/work/core2-64-oe-linux/qtbase/6.5.0-r0/git/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp:242:90: warning: converting to 'qfloat16::NativeType' {aka '_Float16'} from 'float' with greater conversion rank
TOPDIR/tmp-glibc/work/core2-64-oe-linux/qtbase/6.5.0-r0/image/usr/include/QtCore/qfloat16.h:81:42: note:   initializing argument 1 of 'constexpr qfloat16::qfloat16(NativeType)'
   81 |     constexpr inline qfloat16(NativeType f) : f(f) {}
      |                               ~~~~~~~~~~~^
In file included from TOPDIR/tmp-glibc/work/core2-64-oe-linux/qtbase/6.5.0-r0/image/usr/include/QtCore/qmetaobject.h:9,
                 from TOPDIR/tmp-glibc/work/core2-64-oe-linux/qtbase/6.5.0-r0/image/usr/include/QtTest/qtestcase.h:12:
TOPDIR/tmp-glibc/work/core2-64-oe-linux/qtbase/6.5.0-r0/image/usr/include/QtCore/qvariant.h:435:43: note:   initializing argument 1 of 'static std::enable_if_t<(is_copy_constructible_v<T> && is_destructible_v<T>), QVariant> QVariant::fromValue(const T&) [with T = qfloat16; std::enable_if_t<(is_copy_constructible_v<T> && is_destructible_v<T>), QVariant> = QVariant]'
  435 |     static inline auto fromValue(const T &value)
      |                                  ~~~~~~~~~^~~~~

Fixes: QTBUG-114785
Pick-to: 6.6 6.5
Change-Id: I4876ebd8890eee883a0d1a2bef8cb7aec4fd0f2f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-21 23:20:30 +00:00
Ahmad Samir
8bc1049ad7 Moc: simplify code
The concatenated byte array is already the "size" we want.

Drive-by change: use QByteArray::sliced()

Change-Id: Id0afb45ae1daf08bd125230eef0734770c645e1a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-22 02:20:30 +03:00
Ahmad Samir
475d5266e4 Moc: prevent potential unnecessary detach
Change Generator::generateSignal() to take by const FunctionDef*, so
that it can be called with the return of QList::at().

Change-Id: I5ffb0726a5ded6561e0000a2bea1973ada675152
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-22 02:20:30 +03:00
Ahmad Samir
17df4bf528 Moc: use a std::initializer_list<QList *> instead of copying
No need to copy the 3 QLists to iterate over them.

Change-Id: Id0fc7d39012bdaa78e51b1153565df77c7fb889a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-06-22 02:20:29 +03:00
Ahmad Samir
cfc098253a Moc: simplify the logic of a for-loop
By handling the special case before entering the loop, then it can
become a range-for, which fixes a narrowing conversion warning, and it
becomes more readable.

Change-Id: I6ce0181c95eae01a4f2bb7cd12fb5cbeba378586
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-06-22 02:20:29 +03:00
Ahmad Samir
0344332c76 MOC: use methods from QtMiscUtils
Change-Id: I20600357841aff36f68bcc9a81bfb3e96bf6e264
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-22 02:20:29 +03:00
Ahmad Samir
8726b6a35a Moc: use QList::removeIf
Yes, the code now uses two loops, but it's slightly better than
erasing-during-iteration; the alternative is using e.g. a while loop and
advancing an iterator manually with operator++() (in two separate
locations, since there would be a `continue` statement) or with the
return value of QList::erase (in one location).

Change-Id: I119d0e61bc06396f2158ecf9f4ae84a76d9bce7b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-06-22 02:20:29 +03:00
Ahmad Samir
a993510c9e Moc: simplify showing a warning
Instead of changing the "index" member then restoring it, add a
symbolAt() method to get the Symbol in question, and pass it to
new warning() overload.

Change-Id: Ie84a6cf4d837f4ed694f617100e9556c2fc2eea3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-06-22 02:20:29 +03:00
Santhosh Kumar
39882a1354 Set color scheme after handling theme change in windows
Setting color scheme before handling theme change provides incorrect
palette color when user switches from light to dark or dark to light.
This is visible when using Fusion style (or other style that supports
dark mode) in Windows. The change has been made as part of patchset
787038bb1d.

It also has to be noted that handling palette changes to make further changes to the palette (or the style sheet), is less likely than
Handling the colorScheme change signal and in this sense, this patch set
can also be considered as an improvement.

This patchset reverts that change and updates color scheme after palette change in the application.

[ChangeLog][QtGui][ColorScheme] Update colorScheme property after
palette change.

Fixes: QTBUG-112653
Pick-to: 6.5 6.6
Change-Id: I71bc413c56663fefdf9fe5871bbb19b7e6c3d9ff
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-06-21 22:13:49 +00:00
Laszlo Agocs
fc3ee08737 rhi: vulkan: Shuffle post-1.0 phys.dev.feature queries
Make it so that what we query with regards to 1.1, 1.2, and 1.3 features
are stored for later use. This will be relevant for e.g. multiview where
the multiview field will need to be checked when deciding if the feature
is supported at run time.

All this is only really compatible with Vulkan 1.2 and newer. Vulkan 1.1
does not have the 1.2 approach, i.e. there is no
VkPhysicalDeviceVulkan11Features
in Vulkan 1.1 (!). That is a struct added in Vulkan 1.2. In 1.1 one had
the feature (extension) specific structs, such as
VkPhysicalDeviceMultiviewFeatures
in case of multiview. That we do not bother with at the moment.

Then again that's nothing new. The existing code to enable all features
with a few exceptions, that's already tied to the 1.2+ way of working
with physical device features, and not quite compatible with a pure
1.1 (not 1.0, not 1.2+) implementation (which should be hopefully rare
out there).

Pick-to: 6.6
Change-Id: I661f2634651d28edd9b5feec66a423220920f894
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-21 22:54:19 +02:00
Laszlo Agocs
300da03e3a rhi: d3d: Skip MakeWindowAssoc. when using dcomp
It has no purpose (like Alt+Enter is not functional anyway when we
created the swapchain for composition), and with D3D12 there is a
warning printed (with the debug layer enabled?) about this. So move
the call to the appropriate branch.

Pick-to: 6.6
Change-Id: I266ae6835bcc49b3ba8d84e5d08ab9115c6401e0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-06-21 22:54:19 +02:00
Marc Mutz
51b9762685 QSharedPointer: mark create() [[nodiscard]]
It's a named constructor of a smart pointer class. QUIP-0019 says
constructors of such classes should be marked as [[noexcept]]. It
doesn't (yet) say anything about _named_ constructors, but it makes
sense to include them, too.

Pick-to: 6.6 6.5
Task-number: QTBUG-104164
Change-Id: Ia4b43e4f819ce45d71274019c919fd98cc97878b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-06-21 22:46:40 +02:00
Marc Mutz
81d357ff8a QWeakPointer: mark lock() [[nodiscard]]
The lock() function, added for std::weak_ptr compatibility, sounds
like QMutex::lock(), but is, in fact, a const function. QUIP-0019 says
such functions must be marked [[nodiscard]]. For symmetry, also mark
toStrongRef() and toWeakRef() as [[nodiscard]].

Pick-to: 6.6 6.5
Change-Id: Ifb6e447d2cd96fedd9a78decdfac6bc57c1d282a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-21 22:46:39 +02:00
Marc Mutz
45ffb1790c Q(Shared|Weak|)Pointer: mark ctors [[nodiscard]]
They're smart pointer classes, and QUIP-0019 says smart pointer class'
constructors should be marked [[nodiscard]].

Pick-to: 6.6
Task-number: QTBUG-104164
Change-Id: I86b62571e64c2579b4151ffcb03d5bb32e0ac274
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-06-21 22:46:39 +02:00
Marc Mutz
25e20d5537 Div. private RAII/smart ptr classes: mark ctors [[nodiscard]]
The following private APIs are either RAII or smart pointer classes:

- QAutoPointer
- QBoolBlocker
- QFdContainer

QUIP-0019 says to mark RAII and smart pointer class ctors
[[nodiscard]], so do that.

Pick-to: 6.6
Task-number: QTBUG-104164
Change-Id: Ibc77e6603fadf18ea28428a49635f46a5680b777
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-06-21 21:53:10 +02:00
Marc Mutz
58352e7f9a qcompilerdetection.h: move Q_NODISCARD_CTOR def near Q_REQUIRED_RESULT
They both check __has_cpp_attribute(nodiscard), so keep them together.

Move the fall-back (empty) definition to the block that does the same
for all other such macros.

Mention that both P1771 ([[nodiscard]] for ctors) and P1301
([[nodiscard("reason")]]) use the same numerical value.

Amends 959800f6de.

Pick-to: 6.6
Change-Id: I0ef913b6076ffa4058220b542303591de6fefde7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-21 21:53:10 +02:00
Morten Sørvig
70f5d396be wasm: enable asyncify for batched tests only
It should be possible to build a test in any configuration
by building Qt in that configuration, and then building
the test with qt-standalone-test.

Not all Qt configurations will be able to run all tests,
(due to exec() calls and similar) but that's OK - some
tests don't have exec() calls, and we want to be able
to run tests for a given configuration to figure out
how well it works.

On CI we want to use batching and asyncify, so it makes
sense to tie usage of asyncify to batching.

Pick-to: 6.6
Change-Id: I05553d250a45c1831f43dc71a43ef02d01d70535
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
2023-06-21 20:12:42 +02:00
Thiago Macieira
bf67518b53 QProcess/Unix: don't set the SIGPIPE signal handler twice
If the user is asking us to ignore it, don't set to the default
behavior.

Change-Id: Ib5ce7a497e034ebabb2cfffd17628562f745358d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-21 11:12:42 -07:00
Thiago Macieira
52ed6af527 QProcess/Unix: merge some code from startProcess() and startDetached()
... into a new local class called QChildProcess. This groups all the
information that the child process will need between the fork()/vfork()
call and the eventual execve(). That currently includes:
- the argv array, including resolving the program name to a path
- the envp array, possibly a null
- the working directory file descriptor
- the disabled thread cancellation state

We also move the fork() and vfork() calls to inside of this class,
eliminating the the nested lambda was passed to vforkfd(). This
duplicates the trick of calling a lambda in the child side of vfork()
now for the non-file descriptor version too.

None of this should have a side effect for the application. You may be
able to tell apart only in system-call tracing tools like strace(1) or
truss(1).

Change-Id: Ib5ce7a497e034ebabb2cfffd176284edfdd71b32
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2023-06-21 11:12:42 -07:00
Thiago Macieira
94ec17436c QProcess/Unix: disable vfork() under ASan
Pick-to: 6.5 6.6
Change-Id: I443cf0c8a76243eead33fffd1768ee771eca2d56
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2023-06-21 11:12:42 -07:00
Thiago Macieira
c4a0a76dec QProcess/Unix: fix setting SIGPIPE to SIG_IGN where SIG_DFL was intended
And take the opportunity to clarify what the QtVforkSafe namespace is
doing. Amends commit e71c226d6f.

Pick-to: 6.6
Change-Id: I443cf0c8a76243eead33fffd1767f3fa390a7cdd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2023-06-21 11:12:42 -07:00
Marc Mutz
4968f8418f Document Q_NODISCARD_CTOR
Found in API review.

Amends 959800f6de.

Pick-to: 6.6
Change-Id: I00877ce7030c638765b495089899c022deb31a27
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-06-21 16:22:02 +02:00
Marc Mutz
f403ef428e QFutureSynchronizer: mark ctors [[nodiscard]]
QFutureSynchronizer is a RAII class. QUIP-0019 says that RAII class
ctors should be marked as [[nodiscard]].

Pick-to: 6.6
Task-number: QTBUG-104164
Change-Id: I0b6710f2b9a14d67f64150f240f819b8336e0929
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-06-21 16:20:56 +02:00
Marc Mutz
e8dcbaaaf6 QFutureSynchronizer: fix aliasing problem in setFuture()
When setFuture() was handed an element of m_futures, it would hold the
reference to past the clear(), which invalidates said reference.

Fix by taking the future by value instead of by cref.

While append() is not affected, as QList::append() already guards
against aliasing, do the same change there, both for consistency as
well as to optimize the common case of passing rvalues. It also means
we can use the rvalue overload of QList::append(), skipping the alias
analysis in the lvalue QList::append().

[ChangeLog][QtConcurrent][QFutureSynchronizer] Fixed a crash in
setFuture() if the argument was already a member of
QFutureSynchronizer::futures().

Pick-to: 6.6 6.5 6.2
Change-Id: Ic0b212b9f265a746df9a6beb6272a5415d131442
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-21 14:20:42 +00:00
Topi Reinio
77f7c3a45d Doc: Mark QThemeIconEngine, QIconLoaderEngine classes as \internal
Fixes QDoc warning: 'Documentation for class has no \inmodule command'
for both classes.

Pick-to: 6.6
Change-Id: I59eb5f5b935ea30f756d655158a06f390d2ebc54
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-06-21 13:19:51 +00:00
Topi Reinio
4aac1ca91f Doc: Remove \target commands from the qmake manual
A \target defines a global doc linking target across all Qt modules,
and they may interfere with link targets local to module documentation.

As we no longer link as heavily to qmake manual after moving to CMake,
remove the \target commands. The section titles remain as valid link
targets; arguably, duplicating a \section1 title with an identical
\target name was unnecessary in any case.

Replace all \l command arguments that used the \target for linking
with the actual section title.

Pick-to: 6.6 6.5
Fixes: QTBUG-114073
Change-Id: I6e595a77268cbd6ddb5d004501bc6df178c3883d
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-06-21 13:19:51 +00:00
Jan Arve Sæther
2c9732250b Move imagine/musicplayer to tests/manual/imagine/musicplayer
imagine/automotive already demonstrate the imagine style

Pick-to: 6.5 6.6
Task-number: QTBUG-108751
Change-Id: I8ed52242e3a522f934cef7bcb299ce8fbcbdb601
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-06-21 15:19:02 +02:00
Laszlo Agocs
204c91c971 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
Pick-to: 6.6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-06-21 15:09:03 +02:00
Laszlo Agocs
5328fdd8ba rhi: Adjust some HDR-related docs and notes
Pick-to: 6.6
Change-Id: I3b5709358fc572ad2214527b19d027c93a0af745
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-06-21 15:09:03 +02:00
Marc Mutz
7fa3267fda QPixmapCache: Move qHash(Key) from _p.h to public header
... and make it a hidden friend.

This avoids ODR violations when, because they can't use ours (private,
and not exported), users try to produce their own version of
qHash(Key).

[ChangeLog][QtGui][QPixmapCache] Made the qHash() overload for
QPixmapCache::Key public (was: private) API.

Pick-to: 6.6
Change-Id: I324ed001c0ae0a251ac2e1d04713013452ffff9c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-06-21 11:58:03 +00:00
Marc Mutz
91efd61166 QMessageBox: cut out the _q_requireVersion() middle-man
Just de-inline the original function instead of merely moving its
implementation into an out-of-line function.

Amends 408fbd3f2d.

Pick-to: 6.6
Change-Id: I6860a10e0a7d876ce1837f196b1fb4165779540a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-06-21 13:58:02 +02:00
Marc Mutz
2389b93b79 QMessageBox: use optional<> instead of unique_ptr
... to hold the optional QApplication.

Saves a memory allocation, and is more readable.

Amends 408fbd3f2d.

Pick-to: 6.6
Change-Id: I390b9cfa367d01feb59bb5deadc5383c8e678749
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-06-21 13:58:02 +02:00
Marc Mutz
1e626c135b QMessageBox: use %ls and qUtf6Printable()
... instead of %s and qPrintable()

Less operations, less code expansion.

Amends 408fbd3f2d.

Pick-to: 6.6
Change-Id: I5a3d2e79623bd32c348a2d655e3a2c8d98eca1e3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-06-21 13:58:02 +02:00
Laszlo Agocs
497c0f1b0d Do away with qrhivulkanext_p.h
This is not scalable. Instead of putting parts of post-1.0 vulkan_core.h
into this header, apply the appropriate ifdefs instead.

Pick-to: 6.6
Change-Id: I21a9d6f7c51169efa7b66705545bae192ed30c14
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2023-06-21 08:05:17 +02:00
Laszlo Agocs
952f6f2e91 rhi: Follow gles2_p private header fix for d3d11/12
Just in case someone includes the private headers outside of Qt.

Pick-to: 6.6
Change-Id: I79232d2bab7604c71c31226a67ec3ef40210d161
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-06-21 08:05:03 +02:00
Laszlo Agocs
b2bfd757f7 rhi: D3D-related doc cleanups
Pick-to: 6.6
Change-Id: I46f1b10c49841719bf54e52b58ee565b963ca21c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-06-21 08:04:52 +02:00
Yuhang Zhao
055bc81bd1 rhi: fix compilation error when using rhi headers
Without this patch, the compiler will complain about can't find
"qshaderdescription.h" when using "qrhigles2_p.h" from outside of
Qt, which breaks user project compilation.

Pick-to: 6.6
Change-Id: I9e201d82890c92ddd2f6aad48eef0edc9a7c46ef
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-06-21 04:53:22 +00:00
Marc Mutz
46aa713c34 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
Pick-to: 6.6 6.5
Change-Id: Ida400d335491896ec49f2c0f9601a8430eebcd4d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-21 01:06:39 +02:00
Marc Mutz
83a156cd11 QAppleRefCounted hierarchy: mark ctors [[nodiscard]]
They're RAII/smart pointer-like classes. QUIP-0019 says such classes'
ctors should be marked [[nodiscard]].

Pick-to: 6.6
Task-number: QTBUG-104164
Change-Id: I830badfa56fbdfb5819866f67b84cd4fa93acbde
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-06-21 01:06:35 +02:00
Axel Spoerl
f83ea89622 Implement QWidgetPrivate::focusObject()
QWidgetPrivate::focusObject() always returns nullptr. That has lead to
mismatches between QGuiApplication::focusObject() and
QApplication::focusWidget(), when a widget got focus by the window
system (e.g. mouse click).

This patch implements QWidgetPrivate::focusObject.
It returns the current widget, if it doesn't have a focus proxy.
If it has a focus proxy, it resolves the proxy chain and returns the
deepest focus proxy.
(Note: It does not return QWidget::focusWidget(), because the focus
widget might not yet have been set, when the method is called).

Fixes: QTBUG-92464
Fixes: QTBUG-108522
Pick-to: 6.6 6.5 6.2
Done-With: Liang Qi <liang.qi@qt.io>
Change-Id: Icf01e8ac4fc5f722fbf8e0ca5a562617ae9ae8f2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-06-21 00:30:41 +02:00
Volker Hilsheimer
3f72b0d5fc QSqlResult: remove bad API returning non-const reference
QSqlResult::boundValues is a const member function, but returned a non-
const reference to a QList<QVariant>. This is a bad and potentially
dangerous API, as callers can modify the list stored in QSqlResult.

Move that API into the removed_api translation unit, remove it from
Qt 6.6 on and replace it with two suitable overloads where the const
version returns a QVariantList by value, and the non-const overload
returns a mutable reference.

Driver implementations that used to call the const overload to get a
mutable reference are now calling the non-const overload instead
(those calls are all made in the non-const exec() or equivalent driver
implementations).

As a drive-by, replace "vector" with "list" in the documentation.

Pick-to: 6.6
Change-Id: I6e4fd8f5749b939cdb609bf5876735e9b30b2b5a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-06-21 00:30:41 +02:00
Mårten Nordheim
054a64ce67 QStringView: size is encoded with code units not code points
Code points is what you get when surrogate pairs have been joined

Pick-to: 6.6 6.5 6.2
Change-Id: I86c4131de5782ce1e6342217947a603ca16bb521
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-20 22:04:04 +00:00
Assam Boudjelthia
f667445006 Android: explicitly bundle the OpenSSL libs for tests
Use the new argument to bundle the OpenSSL prebuilt libararies so that
ssl operations are actually tested at runtime.

Task-number: QTBUG-110025
Pick-to: 6.6 6.5
Change-Id: I0d73fed463a1724a9e0ee84ba603aa2ff1bc649b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-06-21 01:04:04 +03:00
Assam Boudjelthia
9d5a8162a5 Android:CMake: Add argument to bundle OpenSSL libs for internal tests
The new argument would allow bundling the prebuilt OpenSSL libs
into the test apk so that SSL can actually run. It expects the CMake
argument OPENSSL_ROOT_DIR to be set ( we set that in Coin configs).

Task-number: QTBUG-110025
Pick-to: 6.6 6.5
Change-Id: I4c82796635ca89f5511255ae26182f41a504b026
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-06-21 01:04:04 +03:00
Ulf Hermann
937751f427 QMetaContainer: Allow retrieving the d pointer
This is in line with how QMetaType handles QMetaTypeInterface*. You can
retrieve a const pointer to it.

Pick-to: 6.6
Task-number: QTBUG-113690
Change-Id: Iaf3c10603dc6049a5553987c90006807867abc0d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-06-21 00:04:04 +02:00