Commit Graph

60464 Commits

Author SHA1 Message Date
Ahmad Samir
6f9ace5685 QSignalSpy: add wait(std::chrono::milliseconds) overload
Make the wait(int) overload call the new one.

Task-number: QTBUG-110059
Fixes: QTBUG-100041
Change-Id: Ia085453c05e09e219ba56010b2504113bbc1dd34
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-03 21:36:55 +02:00
Ahmad Samir
2a495c2596 QTestEventLoop: add enterLoop(std::chrono::milliseconds) overload
Task-number: QTBUG-110059
Change-Id: Ibf1d76afd313e390103be4a22e44af7fb41ace1b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-03 21:36:48 +02:00
Ahmad Samir
855a6cb676 Use utimensat instead of utimes
From the manual page:
Note: modern applications may prefer to use the interfaces
described in utimensat(2).

Change-Id: Ib20d8b9b50626233852ca351452ce90841a39603
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-03 21:36:01 +02:00
Volker Hilsheimer
d48dbafeb2 Doc: fix qdoc warning, explicitly qualify enum type
Pick-to: 6.5 6.5.0
Change-Id: Ie289f2468a3a71d35696907691586a31f70d5b1e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-03-03 20:05:27 +01:00
Volker Hilsheimer
c1cbb12e57 Doc: fix links to qFuzzyIsNull
The function is in the QtNumeric documentation context.

Pick-to: 6.5 6.5.0
Change-Id: Ibc6a8961bc04efd4ab1eb50bb371e6a169d513dc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-03-03 20:05:27 +01:00
Marc Mutz
fd17eaca83 tst_QVariant: check fromValue() with a non-default-constructible type
... by just using fromValue() instead of the QVariant(QMetaType,
void*) ctor.

Code coverage isn't reduced, because fromValue() will, of course, call
that exact ctor itself.

Amends df0085d3a2.

Pick-to: 6.5 6.4 6.2
Task-number: QTBUG-105140
Task-number: QTBUG-111598
Change-Id: I02464803090fa7078947625616e6fc20e623ef31
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-03 20:05:27 +01:00
Marc Mutz
cbb484b713 qstrncpy(): document that we don't implement strncpy() fill-all-[dst,len)
The Windows version didn't, ever since we started using strncpy_s(),
and we might change the non-Windows version, too.

Pick-to: 6.5 6.4 6.2 5.15
Change-Id: Iee1c09674d296be806d4be42b1891940120b4a01
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-03-03 18:16:22 +00:00
Ievgenii Meshcheriakov
eea83bac26 dbus examples: Remove listnames example
Task-number: QTBUG-111366
Pick-to: 6.5
Change-Id: I5c483cbfec4072dae610c6d98b97d10057ba9ddc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-03 12:46:29 +01:00
Liang Qi
2b94453cbd xcb: ignore the xscreens which don't belong to current connection
This amends 9a4c98e556.

When a X server has multiple xscreens, for example, ":0.0" and ":0.1",
a Qt application, which uses ":0.1" as display, can't use the randr
monitor from other connection(":0.0") to show contents there. Then
we don't need to generate QXcbScreen for them.

Pick-to: 6.4 6.5
Fixes: QTBUG-110898
Change-Id: I04c1512664b763ffabb55b75db4411d100536255
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: JiDe Zhang <zhangjide@uniontech.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-03-03 07:42:21 +00:00
Marc Mutz
a53429c1ec [docs] Fix typo in QMessageAuthenticationCode::reset() documentation
Pefer → Prefer

Pick-to: 6.5
Change-Id: Ie9fd09452f5d99d799a045ee59fc11a2b9c5a599
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-02 21:37:10 +01:00
Marc Mutz
50389d4973 Mark QMessageAuthenticationCodePrivate::initMessageHash() as noexcept
It only calls other noexcept functions:
- QCryptographicHash::addData(QByteArrayView)
- xored()

Pick-to: 6.5
Task-number: QTBUG-111688
Change-Id: Idd8c485a48b8243b359638086c373288c1c6f96d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-02 21:37:03 +01:00
Marc Mutz
590172ccc5 QMessageAuthenticationCode: port Private::setKey() to QByteArrayView
The only change is the signature of the function.

Also mark it as noexcept. It calls all functions in-contract and
doesn't allocate memory.

Task-number: QTBUG-111676
Pick-to: 6.5
Change-Id: I505c1f51da704fd46e538a68d6d8703f7cdefbc8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-02 21:36:50 +01:00
Volker Hilsheimer
76c63936d3 macOS: Send a filename QFileOpenEvent if invalid URL, deprecate openFile
When the string we receive from the system doesn't parse into a valid
QUrl (because QUrl requires a valid IDN), then we shouldn't send the
QFileOpenEvent based on that invalid QUrl, but instead pass the string
through as the file name.

The file name is anyway not guaranteed to be path to a file that can be
opened, as per the existence of QFileOpenEvent::open and the repective
documentation stating:
"some files cannot be opened by name, but require specific information
stored in this event."

However, that API is not useful at all, the implementation just opens
the passed-in QFile, using the stored file name. There's no way
to override this, and QFileOpenEvent is a locked class with all data
stored inline. So we can't even redirect to a platform-implementation.
Deprecate that function. Applications should interpret the string
returned by file(), which might not be a path to a local file.

Fixes: QTBUG-98384
Change-Id: Iff75489de9d7c5fc034f44c0bda4963b2efb1925
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-03-02 18:58:03 +00:00
Edward Welbourne
ac6c7aa12f Simplify and relax UTF-8 locale override machinery for Darwin
There's no need to try the various permutations of the language
and region specific locales, as they all point back to the same
CTYPE in /usr/share/locale/UTF-8/LC_CTYPE

In addition, processes started from launchd come with an empty
locale environment (LC_ALL/LC_*/LANG), and hence will default
to the "C"/POSIX locale, even after picking up the environment.
This primarily applies to applications launched from Finder,
but also affects processes launched as background services.
And since a child process will inherit its parent's environment
the empty locale environment is propagated when running apps
from IDEs such as Qt Creator or Xcode, or commands in an SSH
login session (as sshd is a background service), unless the
environment has been explicitly set up by the shell (Zsh).

Since neither of these situations is the result of user
misconfiguration, it makes little sense to spit our a
warning.

We however still warn if we detect that the character
encoding has changed from the default "C" encoding, or
if the encoding is "C", but we detect that the user has
modified any of the relevant locale environment variables,
as this indicates either a change in the system default
behavior, or that the user has explicitly requested a
"C" locale, which is wrong.

Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Fixes: QTBUG-111443
Pick-to: 6.5.0 6.5 6.4 6.2
Change-Id: I6fd14d1f8adddc2914d6ff4d3b5ad34a3871ef82
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-03-02 18:39:10 +01:00
Edward Welbourne
fff9395c28 QCoreApplication::initLocale(): Improve warning on failure
If we fail to set a UTF-8 locale, the warning claims Qt shall use a
UTF-8 locale, for which it reports an empty string, when in fact it
isn't using a UTF-8 locale, although it'll interact with the system as
if it were.

Also, the user is liable to understand "system locale encoding" as
referring to the underlying system rather than whatever they may have
configured in a local shell; and a non-native speaker assures me the
use of "shall" is also apt to confuse; so reword the messages.

As the old locale is only needed for the code path prints the
warning we can defer resolving it until we know we're going to
use it, by querying the locale at that point.

Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Pick-to: 6.5.0 6.5 6.4 6.2
Change-Id: Ie6a6e7a707200e58335fcb64cb1584f0c307895a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-03-02 18:39:10 +01:00
Edward Welbourne
91bea4470e Tidy up QCoreApplicationPrivate::initLocale()'s #if-ery
Explain each exception cleanly and as itself, thereby avoiding the
need for long and tangled #if-ery conditions.

Make sure to setlocale(LC_ALL, "") everywhere we think we have
initialized the locale, including Integrity - it plainly has
setlocale(), since we call it for LC_CTYPE - since we should at least
give it the chance to set its implementation-defined default locale,
instead of the standard-defined POSIX locale in use on entry to
main().

Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Pick-to: 6.5.0 6.5 6.4 6.2
Change-Id: Iab00984ba45dfc9a324b6a3c12e3d330b655a5a9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-03-02 18:39:10 +01:00
Laszlo Agocs
7cf6c57648 Avoid incomplete textures in GL paint engine
...which can happen if the OpenGL implementation reuses IDs
so that a glGenTextures results in the same ID that was used
by a texture destroyed by glDeleteTextures just before.

In this case the lastTextureUsed tracking needs to be aware
and invalidate, otherwise the newly created texture is
assumed to be already existing (the ID is the same as before
after all), and so operations such as setting the minification
filter is skipped (which is fatal with OpenGL given that we
do not use mipmaps).

This is exercised in practice by the drawPixmapFragments test
introduced in the previous patch. On Intel graphics it would
work, but it does not render correctly with NVIDIA due to how
the driver's internal ID handling works.

Pick-to: 6.5.0 6.5 6.4 6.2
Change-Id: Ic2771fe9a2dec7da4aa3804d8498dd89e3c18415
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2023-03-02 17:39:10 +00:00
Laszlo Agocs
d6c5a2f917 GL paint engine: Fix drawPixmapFragments when using buffer objects
Until recently the buffer object-based code path (so not client-side
pointers) was only hit with a core profile context. This changed at
some point in 6.4 and later to support WebGL (that has no client-side
pointers, unlike OpenGL ES 2.0 it is based on). Now buffer objects
are preferred over client-side pointers, always. Problem is,
drawPixmapFragment() was never functional on this code path, it seems.

Expecting that transferMode() does all the uploadData() needed is wrong.
transferMode() bails out if the mode is the same as before, and that's
exactly what happens when an application calls drawPixmapFragments()
on the painter twice, after each other.

How exactly this works with client-side pointers is not fully clear, but
presumably the data buffer address stays the same so all pointers passed
in to the glVertexAttribPointer calls are valid, and it sources the data
for each draw call (probably), thus the rendering is all correct even
though only the first, not the second, drawPixmapFragment() led to
calling uploadData() internally.

Amends e487b07e18 although this patch on
its own is just as applicable pre-6.4 as well (to fix drawPixmapFragments
when using a core profile context).

Pick-to: 6.5.0 6.5 6.4 6.2
Fixes: QTBUG-111416
Change-Id: I2ad358424e613192a51b99b937aef7660f5dbe08
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2023-03-02 17:39:09 +00:00
Laszlo Agocs
6f35d81bd0 rhi: Remove unused getters
Change-Id: Ifb1e42b75a7f9ae51929c56809454d9207fa0d1c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2023-03-02 18:39:09 +01:00
Mårten Nordheim
bdcb0a32fa HTTP example: update screenshot
Fixes: QTBUG-108874
Pick-to: 6.5
Change-Id: Ib87895c6512abb967734ce4c1ed0be76c698feb4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-03-02 18:39:09 +01:00
Volker Hilsheimer
c9dc3d7427 Doc: fix link to XML Streaming page
Pick-to: 6.5 6.5.0
Change-Id: Ibc8e869e140e25d7f90bd8ff922918afb3935e42
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-03-02 18:30:22 +01:00
Jan Arve Sæther
5773c3ac28 Move anchor layout example to manual tests
Pick-to: 6.5 6.5.0
Change-Id: I9c9a9dbcdaf705a31208b80b71e978938a492142
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2023-03-02 17:24:53 +00:00
Liang Qi
cd0301a78e tests: skip tst_QScreen::grabWindow() on XWayland
Pick-to: 6.5
Task-number: QTBUG-104595
Change-Id: Icb56a587dfbad84533616160817a3d43411146f1
Reviewed-by: Kalle Viironen <kalle.viironen@qt.io>
Reviewed-by: Simo Fält <simo.falt@qt.io>
2023-03-02 15:58:37 +01:00
Christian Ehrlicher
2adb22fba5 tst_QSqlDatabase: avoid some runtime warnings
Make sure to properly close the cloned database connections and allow
one test for sqlite

Change-Id: Ia4eb4a684a3c432844e4b2a77bff69655b53f9b2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-03-02 15:02:02 +01:00
Marc Mutz
189444d8c4 De-pessimize QCryptographicHash::reset() in OpenSSL3 mode
Instead of going through the whole dance with provider loading,
context creation etc, just call EVP_MD_CTX_reset() to reuse the
already-setup context, if any.

This makes QCryptographicHash::reset() adhere to its noexcept
specification again (assuming EVP_MD_CTX_reset() doesn't allocate
state, and, despite its non-void return type, cannot fail on a valid
context), and should greatly improve the speed of reset(), addData(),
resultView() cycles.

Pick-to: 6.5
Change-Id: I7c35b61cbeab1ffd6dd258e8389ea614d49e2e1e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jan Grulich <jgrulich@redhat.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-02 14:54:09 +01:00
Tor Arne Vestbø
3b08cbff69 Remove redundant information in QString::toLocal8Bit() docs
Pick-to: 6.5
Change-Id: I794621a599bfab85c6a19300225d0e1ad4948362
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-03-02 12:51:15 +01:00
Tor Arne Vestbø
349bd4db22 Document that to/FromLocal8Bit() does not consider CFStringGetSystemEncoding
The CFStringGetSystemEncoding() defaults to Mac Roman, unless overridden
via ~/.CFUserTextEncoding, which very few users do or even know about.

Make a note in the to/FromLocal8Bit() that we don't consult this function,
or its NSString wrapper, when determining what the local 8 bit encoding is.

Task-number: QTBUG-111443
Change-Id: I89b6040c62d42de0daea9df908d97d9a23e7b160
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-03-02 12:51:14 +01:00
Tor Arne Vestbø
e7d038c027 iOS: Respect QSurfaceFormat::colorSpace() when using Metal
Unlike on macOS, there's no colorSpace property on UIWindow or UIView,
but CAMetalLayer has one, which allows us to tell Core Animation that
the layer targets a specific color space, and Core Animation will then
do the rest of the color matching to the target display.

Now that we use Metal to flush raster content, this is even more useful.

Task-number: QTBUG-108094
Pick-to: 6.5
Change-Id: Ib04b42d9baa296b608983db38faf0398430db093
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-03-02 12:51:14 +01:00
Laszlo Agocs
d57ff481fc Lancelot: add drawPixmapFragment test
Task-number: QTBUG-111416
Pick-to: 6.5
Change-Id: Ife91bbc0bf09e3fcc5c4d8dc06e352eadee1b810
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2023-03-02 12:51:14 +01:00
Øystein Heskestad
e13b57d06a Move xmlstreamlint example into tests/manual
This example is useful but not a typical starting point for an
application.

Task-number: QTBUG-110647
Pick-to: 6.5
Change-Id: Ic4af8ed648c587b91110a7403fa80c619549289d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-03-02 12:20:18 +01:00
Øystein Heskestad
56b3123689 Remove htmlinfo example
This example is removed because what it does is already covered by the
other XML examples.

Task-number: QTBUG-110647
Pick-to: 6.5
Change-Id: If33e3fc55dcd9c7c10cfdfa86405f8bcf5cb6187
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-03-02 12:20:17 +01:00
Volker Hilsheimer
3c104c2799 Remove the 'sdi' example
It is essentially the same as the other mainwindow examples, showing
how to create a text editor. The only special code here is the tiling of
the different main windows, which - without any documentation or
explanation - is neither very helpful, nor relevant in 2023.

Pick-to: 6.5
Change-Id: I48b92b1cf057f586e0d2842d1c0a3312154e9a13
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-03-02 12:08:11 +01:00
Mårten Nordheim
277d809ba4 DNS Lookup: Use ideomatic cstdio include
Task-number: QTBUG-108873
Pick-to: 6.5
Change-Id: I646f0c985adc45a17103b5f98394f3def4b6ada2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-03-02 12:08:10 +01:00
Mårten Nordheim
af95f97466 DNS Lookup: Change local function to return struct instead of enum
This let's us get rid of an out-parameter.

Task-number: QTBUG-108873
Pick-to: 6.5
Change-Id: Ifc08d3905932f28ecdfdf3a7de1499700cc7e606
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-03-02 12:08:10 +01:00
Mårten Nordheim
83dac21813 DNS Lookup: Use standard functions to print version/help
showHelp was already in use, but not showVersion.
Return 0 in both cases, even if it's unreachable.

Task-number: QTBUG-108873
Pick-to: 6.5
Change-Id: Iba820e89d7de066130163e7829f75bbfcfa3f7dd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-03-02 12:08:10 +01:00
Mårten Nordheim
a6dc860915 DNS Lookup: reflow some code to avoid exceeding column limit
Task-number: QTBUG-108873
Pick-to: 6.5
Change-Id: Ic17ded256152f7d89bd200ea0e163f2b8f1ea70a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-03-02 12:08:10 +01:00
Mårten Nordheim
b300c6b777 DNS Lookup: Use std::optional instead of casting enum to int
Task-number: QTBUG-108873
Pick-to: 6.5
Change-Id: I0bd5dc004154c1c4026be2feb6187c53e5e77801
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-03-02 12:08:10 +01:00
Mårten Nordheim
5e16397a2c DNS Lookup: Avoid unneeded allocations in parsing function
By using .compare(~~~, Qt::CaseInsensitive) instead of .toLower()

Task-number: QTBUG-108873
Pick-to: 6.5
Change-Id: I60e1fdc0a54450e7385e90f84fd509e62b82d2c9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-03-02 12:08:09 +01:00
Mårten Nordheim
eb61d49ab3 Delete the Network Download (Manager)? examples
Their use of QtNetwork is already covered by the HTTP example.
While showcasing that QNAM easily deals with multiple simultaneous
requests, waiting until finished() is emitted to write anything is not
exactly idiomatic.
And managing your own queue to only have one request running at a time
is a weird example for an asynchronous framework.

In this regard, having an example for a complete download manager
(with a GUI) would be interesting, but may ultimately be very
time-consuming to make for limited gain.

Task-number: QTBUG-110643
Pick-to: 6.5
Change-Id: I6b2c1546b85fa89ab7ce1ff5565b0293b5710b74
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
2023-03-02 12:08:09 +01:00
Thiago Macieira
8dbceaa398 QRegion: upgrade Q_ASSUME to Q_ASSERT
This is to fix the warning

qregion.cpp:3582:12: error: ‘ET.EdgeTable::ymax’ may be used uninitialized [-Werror=maybe-uninitialized]

Because the previous code in PolygonRegion() was:
    Q_ASSUME(Count > 1);

But Q_ASSUME is becoming a no-op with GCC 12, so when this disappears,
compiler rightly considered Count < 2 as a valid input. Therefore, when
CreateETandAET() was called and had

   if (count < 2)
       return;

The compiler again rightly concluded that it was a valid condition
(after all, you're checking it!), leading to ET.ymax being used
uninitialized.

Since that Q_ASSUME really meant the condition of Count < 2 was not
permitted, we may as well upgrade to Q_ASSERT in both places.

Change-Id: I7f354474adce419ca6c2fffd1748119ef0092fa4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-03-02 01:45:09 -08:00
Marc Mutz
52c7f699ac QDebug: fix std::string/view stream operators; add u8 versions
Make them templates, for two reasons:

- so they can accept std::pmr types and, in general, any basic_string
  with custom allocators and char_traits

- to break overload ambiguities with the Qt string view types

Also, add the missing C++20 char8_t overloads.

Also, avoid creation of a QString in the sizeof(wchar_t) == 2 case
(Windows). Add a comment to optimize for the sizeof(wchar_t) != 2 case
later.

Found in API review.

Pick-to: 6.5
Change-Id: I30139520f582a38863a0936f8eca4b1ed33e37c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-02 06:33:35 +01:00
Jan Arve Sæther
a84b2e5973 Move Weather Anchor Layout example to manual tests
Pick-to: 6.5
Change-Id: I8782a83b5c12b4f57bf9ef9063818cb124bddd56
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2023-03-02 05:55:57 +01:00
Marc Mutz
c6dbae9550 qobjectdefs.h: properly disable rvalue qReturnArg()
template <typename T> qReturnArg(T&&) is an unconstrained perfect
forwarder, and will "win" for everything for which `T&` is not an
equal match. e.g. a volatile T.

Restrict the deleted overload to actual rvalues. We don't need to use
`const volatile T&&`, because rvalues never bind to `T&`, we just need
to get off using a universal reference, and adding const does that.

As a drive-by, change the deleted overload's return type to void, to
mimic std::as_const(), the prototype for rvalue-deleted function
overloads.

Pick-to: 6.5
Change-Id: If4fbc311677b993488859b2c4e226b94daed71fe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-03-02 04:49:48 +00:00
Marc Mutz
5573e2d6ac QBasicTimer: replace new qint64 overloads with chrono ones
Found in API review.

As per "chrono first" initiative[1], implement the int overload via the
chrono one, not vice versa

[1] https://lists.qt-project.org/pipermail/development/2023-January/043563.html

Pick-to: 6.5
Change-Id: I65fe7039ad8ae5f9eb21d9c59a46b9c5c152fac3
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-03-02 03:56:33 +01:00
Marc Mutz
38664dabed Don't mark non-copyable QFontEngineFT::QGlyphSet as Q_RELOCATABLE_TYPE
QGlyphSet is Q_DISABLE_COPY()'d.

Marking it also as Q_RELOCATABLE_TYPE incorrectly allows Qt containers
to use realloc() or memcpy() to relocate a type that was explicitly
designed not to be copied (or moved).

Amends 2c47d53249.

Pick-to: 6.5
Change-Id: I053f6bb25d4d6e2359f43f0dbf9c19667dfff170
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-03-01 22:53:22 +00:00
Volker Hilsheimer
a776aea7aa Doc: fix link to Widgets Tutorial
It's been a while since we had a single Tutorial for all of Qt.

Pick-to: 6.5
Change-Id: I7317291c445c09b0bf728513670b6a575dd536bc
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-03-01 22:22:26 +01:00
Volker Hilsheimer
b7b712181b Doc: point at tetrix example for QBasicTimer usage
The wiggly example is gone, but tetrix shows how to use QBasicTimer
as well.

Pick-to: 6.5
Change-Id: Iaad78b0d7e2136ef41d98f634d0680e6f7f3c4e1
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-03-01 22:22:26 +01:00
Volker Hilsheimer
721b4a4b5a Doc: move snippet for implicit translation context
The 'sdi' example is a candidate for removal, so point at the
spreadsheet example instead, which is not.

Pick-to: 6.5
Change-Id: I4405f2421db8be79898a38ca4f3fa1ea5fe0280b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-03-01 22:22:26 +01:00
Volker Hilsheimer
e27766c5e2 Doc: fix qdoc warning
The \brief of a class documentation needs to end with a full stop.

Change-Id: Ia609d7bc6695e785207c0bf4e570a5edeaeaf460
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: <safiyyah.moosa@qt.io>
2023-03-01 22:22:26 +01:00
Tor Arne Vestbø
3154aec540 doc: Fix spelling of 'equivalent' in QString documentation
Pick-to: 6.5
Change-Id: I1d39bee80fbaf3e3e6eb5e383fd845bb0f9071e5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-03-01 22:22:26 +01:00