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>
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>
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>
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>
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>
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>
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>
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>
...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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
otherwise there is no way to synthesize a "click" through the a11y API.
toggleAction only leads to a toggled() signal but the user may be more
discerning and only listen to clicked() (or QAction::triggered) to react
to **user** events not all toggle events. as such pressAction is always
superior to toggleAction when user input is meant to be synthesized
through a11y tooling.
Change-Id: I7f024d57087b545d3cfd1805026ea538b0b3e166
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
From the review, timespecS are trivial and small, so they get passed in
registers anyway.
Change-Id: Iedf1f17af1fd58643a0c103230b1fea3c2fe1e49
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Having the Prealloc > 0 assertion only in the QVLA(qsizetype) ctor
makes no sense. Prealloc > 0 is mandated by the class as a whole, not
that particular ctor, so we shouldn't delay the assertion to the
instantiation of this ctor.
Move it to class scope instead, alongside the assertion for
nothrow-destructible.
Pick-to: 6.5
Change-Id: I0225a4533841e5b433a3d9781b2642c084f775ab
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Use a template alias instead of C++98-style inheritance.
Saves one template instantiation.
Pick-to: 6.5
Change-Id: I95ee9cf1e5eac1db5fc8e05cd95f5e745134214d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>