Safari on iOS now supports the Navigator.clipboard
API, but not the Navigator.permissions API.
Looks like we have not encountered this combination
Before. Add undefined check for permissions as well.
Fixes: QTBUG-84658
Pick-to: 5.15
Change-Id: I99ab08fd34bbb29a82661e24bf400c927f3604f6
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
It can be configured using the QFONTCACHE_MIN_COST
define when configuring Qt.
Change-Id: I41fb781099c4c0f03c378f10c8db4ea06ef4e9ff
Task-number: QTBUG-83127
Reviewed-by: Risto Avila <risto.avila@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
These methods are scheduled as a replacement for left/right/mid()
in Qt 6 with a consistent, narrow contract that does not allow
out of bounds indices, and therefore does permit faster
implementations.
Change-Id: Iabf22e8d4f3fef3c5e69a17f103e6cddebe420b1
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Apart from a more fitting, minimal, API, QDuplicateTracker also
transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or
at least reduce, memory allocations.
The code is the first user of the collected data, so make that
available by adding QDuplicateTracker::appendTo(Container&) methods.
Change-Id: Ibd8810c0070db7e6b3ead6d6a569facdab88b646
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The seemingly useless template parameters are needed to avoid a
(distinct) bug in MSVC 2019 < 16.6, and should be removed once we have a
newer version in the CI.
Task-number: QTBUG-82945
Fixes: QTBUG-83600
Change-Id: I5b22a2259aa16ae90eca7d4f3bd2e4fa1116a73b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This patch makes the 'accesiblebridge' plugin configurable.
Change-Id: I99f01fcd434be25bbbe5460bbc8cc1d76aa744b9
Task-number: QTBUG-83126
Pick-to: 5.15
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Pairs are easy to use, but they have no semantics attached: Two
QPair<QString, QString> compare equal, e.g., even though one is used
as a FontAndStyle and the other as, say, a type/subtype. It also
carries no information for the reader of the code.
So, write a minimal struct with equality and qHash() instead.
Change-Id: I9514c9b7d6c2cc6a4831f9ca83ca2ee466d91553
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This patch adds the missing documentation for the new QSslCertificate
PatternSyntax enum which replaces the one from QRegExp.
Fixes: QTBUG-84464
Pick-to: 5.15
Change-Id: Icf092f42ad4dff9207ca51dfd8b4fb8ed6443ff2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Remove setRoleNames() and all its now unneeded helper functions.
Change-Id: I0a83751aace35700655d4cc7c79278325994cbdd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Macros and the await helper function from qfunctions_winrt(_p).h are
needed in other Qt modules which use UWP APIs on desktop windows.
Task-number: QTBUG-84434
Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Port away from random-access of the returned sequences. That's
neither necessary nor does it make the code more readable than
the alternative single-pass implementation used here.
As a drive-by, make applying NRVO more likely by re-using the
`result` variable for all returns after its declaration.
Change-Id: I2c3bbaefa6b6f08ebf0b90fb7be62e3c6243f19d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
And not pure swap. As per policy, QVariant must leave the rhs empty.
Change-Id: I2d5e0f584c4d4fffd05a0a5bfae27ddcb72430e9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Any integer modulo 1 can never be anything else but 0, so the statement
could never be true. The intention is to abort in case of an odd number
of bytes, as this would indicate malformed input that can't be decoded
into a QString.
Note that QTranslator will then silently continue to search for valid
translations, and not print any error message at runtime, or otherwise
inform the user or developer that an input message file contains
malformed content.
Change-Id: I957b337ee035f3aca013e0859f8ee70553d9a97b
Coverity-Id: 11014
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Details of MSVC version became irrelevant some time ago; the code now
just tests for MSVC. In any case, the reader doesn't need to know how
the function is implemented, as long as it does what it claims to do.
We do not, in fact, use a random number source when generating the
return value for comparisons involving only one nullptr; we quite
consistently treat the nullptr as less than the other string. Make
explicit that this is true even if the other is empty.
Change-Id: Ifd9b00fdf8e814fcf933a05821201670fecfd646
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
It's a bit annoying that you have to include <QStringTokenizer> to use
the tokenize() methods. The separation is a historic artefact, just fix it.
Change-Id: Ied4cc0c8dd2bb6735bf29fbb26fdbf47d07db264
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Apart from a more fitting, minimal, API, QDuplicateTracker also
transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or
at least reduce, memory allocations.
Change-Id: I0a0d1e31fd35d483e0036045847a3759b593c71c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
In some places QByteArray does interpret bytes as characters and a
sequence of them as a text string; everywhere else, however, it now
refers to them as bytes.
Add a section to the class doc explaining how char* pointers are
interpreted; the handling of '\0'-termination is surely familiar to
most readers, but making it explicit provides contrast for the
explanation of there being no such special treatment of '\0' bytes
when a stard address and length are given.
Also mention in the class doc that interaction with QString is done
via UTF-8 encoding and can be avoided by defining a macro. Shorten, in
light of that, the description of that encoding where it appears in
affected methods.
In the process, clean up lots of phrasings.
Change-Id: Ic97dce4a20752e277eeab35a06737322b2074692
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This amends commit 9dd8e655cd to fix the
various references to section {8-bit Character Conversions}, which is
now renamed {Character Case}.
Change-Id: I1f777ab359c616a1b12f05a12b1cd7397f3ccb18
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The QByteArray code doesn't use QLocale or QString.
Change-Id: I60966ecad35fdaaef9930ba2746bf732fa9f3cd7
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
A check to prevent crash-on-exit if QLocale::setDefault() was called
after the default store was torn down had the side-effect of causing
setDefault() to not record data if it was called before the first
access to the default store caused it to come into being.
Change the check to test that the default store has been destroyed
and, if not, create it if it doesn't exist yet. This refines commit
4d6572aac0 (as modified by commit
11c5c078c7).
Fixes: QTBUG-83016
Fixes: QTBUG-83415
Pick-to: 5.15
Change-Id: Icbce9bd9c75d0258d403e2f90957561b5a18bdf3
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Replace the implementation of blockingMappedReduced():
after calling non-blocking version of mappedReduced() we are getting
the future object, so we may call in sequence result(), which
will block and return the result when the all tasks are done.
The same is done with blockigMapped(), which calls blockingMappedReduced()
with a custom reduce function.
Looks like with this pattern we can reuse the non-blocking version
for implementing blocking version of mapped / filtered methods.
Task-number: QTBUG-83918
Change-Id: I7f240cfbd04834d551ff79d717b72194a26996d7
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
The pipeline value is set by window property _q_platform_qnxPipeline.
Task-number: QSR-263
Change-Id: I13536936b2335a97a6eeb5a94c4e0f552308d15e
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
The headers are now C++ clean and can be used outside of Objective-C
code. All includes of Objective-C frameworks have been moved to the
implementation files.
Header guards have been added in the few places they were missing.
All includes are now done via #include, instead of sometimes using
the #import variant.
Change-Id: Ibb0a9c0bcfefbda4347737212e40e300a3184982
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This got forgotten when SQLite was upgraded to v3.32.1, so this amends
e10e989ce83027f2f620bb6948be4948f3c91e76
Change-Id: I75799b6c55bc39c4cc050b5eb18a99d9f197410c
Pick-to: 5.15 5.12.9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
C++20 will make this true for everyone, but as far as Qt goes,
this has to apply to all platforms even before that.
Just add another couple of checks to the list.
Change-Id: I0251ce431d4584380cfd3fc3e4b36f1dbdbf9df2
Pick-to: 5.15
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Deprecated the pause-related APIs of QFuture* classes and
added alternatives having "suspend" in the name instead.
With 2f15927f01 new
isSuspended()/suspended() APIs have been added to QFuture* classes for
checking if pause/suspension is still in progress or it already took
effect. To keep the naming more consistent, renamed:
- setPaused() -> setSuspended()
- pause() -> suspend()
- togglePaused() -> toggleSuspended()
- QFutureWatcher::paused() -> QFutureWatcher::suspending()
Note that QFuture*::isPaused() now corresponds to (isSuspending() ||
isSuspended()).
[ChangeLog][Deprecation Notice] Deprecated pause-related APIs of
QFuture and QFutureWatcher. Added alternatives having "suspend" in
the name instead.
Change-Id: Ibeb75017a118401d64d18b72fb95d78e28c4661c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Starting from Qt 5.11 QWindow::event is called after QDialog::closeEvent
which would cause a crash if "delete this" was called on closeEvent. The commit
that changed this was e0b5ff4ad5. Added
a check before QWindow::event call utilizing QPointer to prevent the
function call in case object is destroyed by a user in close event handler.
Change-Id: I64a4a0f3271714e55bf7e806177f0d8b39b67fa3
Fixes: QTBUG-84222
Pick-to: 5.15 5.12
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This amends 7bee4e9cb3, and makes sure
that the text control is created even if the attributes that define
whether it's needed are changed after a call to setText or
setTextInteractionFlags, where it is otherwise created.
Task-number: QTBUG-84080
Pick-to: 5.15
Change-Id: I3be27f35bc83944948027345535d1202a7b97163
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
QFileSystemModel is the documented replacement. It uses threads to
populate the model, which QDirModel doesn't.
Change-Id: I7818ecd8f849eb566ac176612f382e17a0471c47
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Override locale encoding to UTF-8 on supported platforms.
QNX has nl_langinfo, but the header is not using extern "C". Tests
show that it returns UTF-8 regardless of the locale, so let's assume
it's always UTF-8.
Change-Id: I0fe98f8441287df9f99c334e537a7b962df105f6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/plugins/platforms/qnx/qqnxscreeneventhandler.cpp:149:42: error: incomplete type 'QTouchDevice' used in nested name specifier
m_touchDevice->setType(QTouchDevice::TouchScreen);
^~~~~~~~~~~
Change-Id: I83fbecfb3b0745d2f8f30d946f3ee3bd5d6c7459
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Use matching ifdef's as is done for the declaration.
src/plugins/platforms/qnx/qqnxintegration.cpp:430:24: error: no declaration matches 'QPlatformInputContext* QQnxIntegration::inputContext() const'
QPlatformInputContext *QQnxIntegration::inputContext() const
^~~~~~~~~~~~~~~
Change-Id: I7afddba514833279fe560c1807da0cb060aead29
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Use 'errorOccurred' instead of 'error' and 'sslHandshakeErrors'
instead of 'sslErrors'.
Fixes: QTBUG-82605
Change-Id: I19d4845b16c7b636af7b0658d4fbbba4eef9d029
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Not quite "next commit" like I wrote originally, but better late than
never.
As the comment said (and the code shows) it only returns true now so
the extra function and if-check isn't needed anymore.
Change-Id: I9e8fb8891a116475ab78c3848d7cfcdb659ac521
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The dialog helpers don't depend on widgets themselves, and should be
built regardless of whether the widget dialogs are enabled, as these
helpers can (and should) be used by other layers, such as Qt Quick.
Change-Id: I1c66b474ab2f29748f1256aea90229c51c12a16f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Previously it handled Latin-1, which made it incompatible with UTF-8,
which is now our preferred 8-bit encoding. For Qt6 it is limited to
ASCII. Adjusted tests to match. QLatin1String::compare() turned out
to be relying on qstrnicmp()'s Latin-1 handling.
Removed some spurious Q_UNLIKELY()s and tidied up code a little in the
process.
[ChangeLog][QtCore][Important Behavior Changes] Encoding-dependent
features of QByteArrray are now limited to ASCII, where previously
they worked for the whole of Latin-1. This affects case-insensitive
comparison, notably including qstricmp() and qstrnicmp(), and
case-transforming functions.
Fixes: QTBUG-84323
Change-Id: I2925d9908f8654599195a2860847b17083911b41
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
A few pet peeves, a bunch of missing details and some phrasing I like
better.
Telling folk you're using "base 10" in fact communicates no
information; it *assumes* a base that folk shall read that text with
and tells them they are indeed using that. If they happen to be
reading with a different assumption than you, they'll duly see you
confirming their expectation. If you mean "base ten", say so.
Values "between 2 and 36" may nor may not include the bounds,
depending on weird cultural cues and contextual complications. Be
explicit about octal being base 8 and hexadecimal being base 16; most
readers shall know, but best to be clear. Be explicit about the digits
used for bases beyond ten.
Mention that QLocale is the way to do locale-sensitive conversions.
Change-Id: I4efcec6242644f37a48ff6391b96ed5b371d5be8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Make the set of spacing characters explicit (rather than "includes"
hinting that there might be more) and makes explicit that this is an
ASCII operation.
Change-Id: I61b543bcb450ee82bcce980ecb469901e287b46f
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This is a folllow-up to commits
548513a4bd and
a9aa206b7b, renaming the snippets files
referenced by the files moved out of corelib/tools/ to match the new
locations of the files using them.
Change-Id: I59f5d3c217ef835e9244387cc769e7212de9d8f5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This amends 36325f9d86 so that the
dontPrint attribute is set before incrementing i
Change-Id: I0be7386253d8607596489ce1025d2f3f8d468ab4
Pick-to: 5.15
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The patches applied are now removed as they are all included in v3.32.1
[ChangeLog][QtSQL][sqlite] Upgraded to v3.32.1
Pick-to: 5.15
Pick-to: 5.12
Change-Id: Ib5b26fb36d7ca49c1108a96097a48fe5b797f291
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This class is designed as C++20-style generator / lazy sequence, and
the new return value of QString{,View}::tokenize().
It thus is more similar to a hand-coded loop around indexOf() than
QString::split(), which returns a container (the filling of which
allocates memory).
The template arguments of QStringTokenizer intricately depend on the
arguments with which it is constructed, so QStringTokenizer cannot be used
directly without C++17 CTAD. To work around this issue, add a factory
function, qTokenize().
LATER:
- ~Optimize QLatin1String needles (avoid repeated L1->UTF16 conversion)~
(out of scope for QStringTokenizer, should be solved in the respective
indexOf())
- Keep per-instantiation state:
* Boyer-Moore table
[ChangeLog][QtCore][QStringTokenizer] New class.
[ChangeLog][QtCore][qTokenize] New function.
Change-Id: I7a7a02e9175cdd3887778f29f2f91933329be759
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Since the variable names in QShaderDescription are later compared to
QByteArrays we can gain some performance from not having to convert them
to QByteArrays later.
Task-Id: QTBUG-83706
Change-Id: Iaf80d0966f45cbb09e7c1000b7854bc488e57bb3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Expose flagBits via a public function marked as internal.
Task-number: QTBUG-82670
Change-Id: Ia64d934d3dda3e718357cf4e3c32866a613a4722
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
The static observer can live in a union with the inline observers. We
only need to take care of calling the ctors and dtors manually then.
In order for any observers to be called in the presence of a static
observer, the static observer has to be called after the other
observers.
Change-Id: I2f56fa64f3fe6fcd7f06cc403929362da7d86f65
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This can lead to a deadlock if we block all the worker threads, waiting
for the worker threads to finish.
Pick-to: 5.15
Fixes: QTBUG-84619
Change-Id: I92b7f96007897d86ece0c34223bab0df4ccbed9a
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Map Latin-1 characters to the Winding unicode entries for symbol fonts
to render those fonts like Windows does.
Pick-to: 5.15
Fixes: QTBUG-84409
Change-Id: I60b81d93412d970d25a98606545773db6c8ab723
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Windows unexpectedly passes PM_NOYIELD flag in wParam parameter to the
hook procedure, if ::PeekMessage(..., PM_REMOVE | PM_NOYIELD) is called
from the event loop. So, to ignore undocumented flag, we should
interpret wParam as a bit field.
Thanks to Robin Lobel for research.
Pick-to: 5.15
Fixes: QTBUG-84562
Change-Id: Ib16d7d747aebc9a3628e4ee67478c4d3edeb96f1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Unexport the classes, plaster noexcept, and port to constexpr.
Change-Id: I5cc7928fb08e8e32c67cff2d84c1b0ed9d46a2fa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
On a plain X11 desktop, it otherwise ends up empty.
Pick-to: 5.15
Task-number: QTBUG-25351
Task-number: QTBUG-25718
Task-number: QTBUG-74252
Change-Id: I50a522a3e1761e422d5949d5338869ceb9e5e89d
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
The FreeType engine has moved out of the fontdatabases library,
so the .a file would be empty. This caused the error
"attempt to map 60 bytes at offset 72 exceeds size of file" when
building for Android on macOS.
Change-Id: I9d9afca67e7626d3b5c6a62fcde33fed029fe04c
Reviewed-by: Liang Qi <liang.qi@qt.io>
When adding the default AndroidManifest.xml to a project, Qt Creator
edits some pieces because of autoformat and shows that something is
changed, but the user changed nothing, and this can be confusing. Let's
make them on the same page.
Pick-to: 5.15
Task-number: QTCREATORBUG-23768
Change-Id: I76088358dc31be45adb766bed29e2c9d889a8f09
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
libraryList is modified in a code section that was not yet properly locked.
This was overlooked by 7ca66b1e66.
Task-number: QTBUG-42855
Change-Id: I028ad21a7df314133931f860ad49453bb2db9da0
Pick-to: 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This can be used to guard WebOS specific patches.
Change-Id: Ia770562b92c59fc3410d6254acd1313776d15a28
Pick-to: 5.15
Fixes: QTPM-1826
Reviewed-by: Johannes Oikarinen <johannes.oikarinen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Some fonts, like Segoe UI, have empty glyphs defined for
characters such as space. When there is a margin on the glyphs,
we would previously render them as 4x4 completely transparent
images. This is a waste of time, and in the case of DirectWrite,
we fixed it in bb67c3b68b so that
it will always return an invalid image when the glyph does not
have dimensions.
But since we did not account for this in alphaMapBoundingBox(),
the texture glyph cache did not detect this case and would
request the empty image and try to add it to the cache.
Fixes: QTBUG-84629
Pick-to: 5.15
Change-Id: I470a4a55577c5e9239bf77de81c2b381bf8e6a49
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
The request/reply pair is created out of QNetworkRequest, we set
autoDecompress data-member on the request, but not reply. As a result,
reply in its destructor fails to release memory, allocated by z-lib
(by failing to call inflateEnd). Since with H1 requests it does not
seem to be a problem (no leaks detected), I'm limiting this change
to H2 handler only. Later it will be retired by the stream decompression
change in Qt 6, but will be picked to 5.15.
Fixes: QTBUG-84560
Pick-to: 5.15
Change-Id: I82e19d2b0a83624b730edd20d7d45721e7001731
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The QTranslator owns its QResource and its sub-translators, so hold
them in unique_ptr to show what's going on.
Change-Id: I65dfa8c3b6dd774066a01de23ae6cff7449b363a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We need this because without this patch you get bugs both
if you call QIcon::setFallbackThemeName before creating the QGuiApplication and
if you call QIcon::setFallbackThemeName after creating QGuiApplication
Why do you get a bug if you call QIconLoader::setFallbackThemeName
before creating the QGuiApplication:
* QIcon::setFallbackThemeName calls QIconLoader::instance
* QIconLoader::instance calls QIconLoader::ensureInitialized
* QIconLoader::ensureInitialized calls systemThemeName
* systemThemeName asks the current QPlatformTheme for its
QPlatformTheme::SystemIconThemeName
* But since we're calling this before creating the QGuiApplication
there is no current QPlatformTheme yet, so systemThemeName
is set to empty, which is obviously not what we want
Why do you get a bug if you call QIconLoader::setFallbackThemeName
after creating the QGuiApplication:
* QGuiApplicationPrivate::init calls
QGuiApplicationPrivate::createPlatformIntegration
* QGuiApplicationPrivate::createPlatformIntegration sets the
current QPlatformTheme and at the end of the very same function
uses QIcon::fromTheme
* Since we haven't called QIconLoader::setFallbackThemeName yet
there is at least one icon lookup that doesn't take
the fallback theme we would like to have into account
This patch makes it so calling QIconLoader::setFallbackThemeName
before creating the QGuiApplication works.
The only thing we want to do from QIcon::setFallbackThemeName is set
the internal m_userFallbackTheme, it doesn't care about doing
further initialization of QIconLoader, if it's done, great it's done,
if it is not initialized yet, great it will be initialized later
when someone actually tries to use the QIconloader.
So it's OK for ensureInitialized() to return early if there is no
platform theme yet, because it will be called again later.
Pick-to: 5.12
Pick-to: 5.15
Fixes: QTBUG-74252
Change-Id: I65268fc3d3d0bd282d76c76cf75e495bcc9d1a30
Done-with: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This patch allows tools to be built for the target platform when the
QT_BUILD_TOOLS_WHEN_CROSSCOMPILING parameter is set at configuration
time.
To avoid naming conflicts, the target tools are suffixed with "_native".
The qt_get_tool_target_name() function can be used to get the tool name
for both scenarios (cross and non-cross compilation).
Extend pro2cmake to refer to the right target name for tools.
The relevant write_XXX functions have a new target_ref parameter that
will be "${target_name}" for tools and literally the target name for
everything else.
Fixes: QTBUG-81901
Change-Id: If4efbc1fae07a4a3a044dd09c9c06be6d517825e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Create a QMetaTypeInterface for void. This allows us differentiate
QMetaType::Unknown from QMetaType::Void. In addition, this will enable
the usage of QMetaMethod::metaReturnType in QMetaMethod::returnType,
and will facilitate using metaReturnType in declarative, which needs to
distinguish between Unknown and Void.
Change-Id: I83296b49587f3deb7ec73e25a33f0d8c98cf8da0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This does the analog of 46f407126e for the
methods we care about (signals, slots, Q_INVOKABLEs). In addition to the
actual QMetaType, we store an array with offsets so that we later can do
a mapping from methodIndex to metatype.
The newly added QMetaMethod::{return,parameter}MetaType methods can then
be used to retrieve the metatypes.
This does however require that all involved types are complete. This is
unfortunately not a feasible requirement. Thus, we only populate the
metatype array on a best effort basis. For any incomplete type, we store
QMetaType::Unknown. Then, when accessing the metatype, we fall back to
the old string based code base if it's Unknown.
Squashes "moc: support incomplete types" and "Fix compile failures
after QMetaMethod change"
Fixes: QTBUG-82932
Change-Id: I6b7a587cc364b7cad0c158d6de54e8a204289ad4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Remove '/' as an example directory. We do not want to retrieve the
directory tree of the entire system.
Change-Id: I911f8eea12b4960319a9a4cbea820b910a35aede
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
In QWindowsXPStylePrivate::drawBackgroundThruNativeBuffer(),
pass the correct rectangle (reflecting the correction factor)
to the function fixAlphaChannel().
Amends e56b8e1e59.
Pick-to: 5.15
Fixes: QTBUG-84613
Task-number: QTBUG-75927
Change-Id: I5357bb8c55ed26a50cc322ea7a05df4487212fb8
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This is now possible because of the earlier commit that changed the
const arrays in qurltlds_p.h to constexpr arrays.
Change-Id: I37a6a64e250bbe33f7d34b5916595bf6a37aed4a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
long and ulong where missing. Generalize the code so that it'll work
for all integral types.
Change-Id: I74591e9c8b375e0ecdcfdd856970ce355eb2d4ce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Since QString::split() is not going away in Qt 6, we should aim
to provide API symmetry here, and ease porting existing code from
QString(Ref) to use QStringView.
This is easier than having to port everything to use tokenize() at
the same time. tokenize() will however lead to better performance
and thus should be preferred.
Change-Id: I1eb43300a90167c6e9389ab56f416f2bf7edf506
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It was returning a lowercased suffix because it was extracting it from
the pattern (*.txt) rather than from the filename ("README.TXT").
This broke expectations on the application side, since this method is
documented to return a suffix from the given filename.
Ref: https://bugs.kde.org/show_bug.cgi?id=402388
Change-Id: I7dae13db31280249d3f592fa9592c4067804e22d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The idea is pretty simple -- add QRegularExpression matching over
QStringView. When matching over a QString, keep the string
alive (by taking a copy), and set the view onto that string.
Otherwise, just use the view provided by the user (who is then
responsible for ensuring the data stays valid while matching).
Do just minor refactorings to support this use case in a cleaner
fashion.
In QRegularExpressionMatch drop the QStringRef-returning methods, as
they cannot work any more -- in the general case there won't be a
QString to build a QStringRef from.
[ChangeLog][QtCore][QRegularExpression] All the APIs dealing
with QStringRef have been ported to QStringView, following
QStringRef deprecation in Qt 6.0.
Change-Id: Ic367991d9583cc108c045e4387c9b7288c8f1ffd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
advances and glyphIndices can be nullptr's as long as numGlyphs
is zero.
Change-Id: I29c3764792c1a0ffaafd3393c82a26af65699ab3
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This is doing the same as data(), but the method is widely being used in
Qt (e.g. in QString), so this will make it easier to change the type of a
variable from QString(Ref) to QStringView in a source compatible way.
Change-Id: Ic49bef688d3ce3c550336edf90130aa5cac8b497
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Make the API more symmetric with regards to both QString and QStringRef.
Change-Id: Ia67c53ba708f6c33874d1a127de8e2857ad9b5b8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Make the decoder fail early to avoid spending time and memory on
attempting to decode a corrupt image file.
Pick-to: 5.15 5.12 5.9
Change-Id: Ic556d4fbcb6b542fc110d10e48dac1a880e60697
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
From API 28 it is possible to clear the clipboard so we should ensure
that this is done if API 28 or later is being used. Otherwise it is not
removed, but that is due to limitations on the Android side.
Pick-to: 5.15
Change-Id: I1fe504d0e566c6923b39b2adf4540619c6b1daf7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
All the normal bit depths are supported, so no point in trying to go
through the decoding code path for others. Avoids wide bitshift
warning for claimed depths > 32.
Pick-to: 5.15 5.12
Change-Id: I61b72dbbf9558ca28db46f8168339f8174e56997
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
The gif standard allocates 3 bits for the disposal method, but values
4-7 are unused.
Pick-to: 5.15 5.12
Change-Id: I0f70b3f87b4cd8e98140c3da476702a22ebe93a9
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
If the assembler code cannot be used to retrieve the threadId, always
use pthread_self() for it. QObject uses QThread::currentThreadId() and
QThreadData::threadId to match threads, which makes address of the
currentThreadData unsuitable as the thread id.
Reading the threadId from currentThreadData is slower than calling
pthread_self(), as tested on Aarch64 linux and x86_64 QNX.
Change-Id: If9afc8ed2810ad1e04bd42ead8f40b43ef3bac30
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The ANGLE removal's manual configure.cmake changes are now replaced
by updating the conversion script's special cases instead.
Change-Id: I06317fe0202b25bd9f9524da14e1bb0ccbb30cc1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Remove the manual modifications, and let the script do its work
and use the .pro file as the source of truth.
Change-Id: I510d5487a326d72a9c19e8148ec1daac9a23394b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
operator--() would iterate before begin() if the
list was empty. This is UB, and will crash in Qt 6,
where begin()/end() can return an iterator pointing
to a nullptr if the list is empty.
Change-Id: I39c3a8ebb09fcad75d42019b02426ac5ac05eed9
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Make the API more symmetric with regards to both QString and QStringRef.
Having this available helps making QStringView more of a drop-in
replacement for QStringRef. QStringRef is planned to get removed in Qt 6.
Change-Id: Ife036c0b55970078f42e1335442ff9ee5f4a2f0d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Allows them to not depend on QtOpenGL just to provide the default
backing store OpenGL support backend.
Change-Id: I90d6d9247ce76848d9d03e2d512fb736c81488d3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Otherwise when configuring a standalone example without specifying a
CMAKE_BUILD_TYPE (so it's empty), building fails because
qt6_generate_meta_types_json_file thinks it's being called with
a multi-config generator.
Change-Id: I360c7dbb19522155d8e72f98836fb663916715a0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Previously configuring a standalone example that had no explicit
INSTALL_DIR option for qt6_generate_meta_types_json_file would fail.
When no explicit location is specified to
qt6_generate_meta_types_json_file via INSTALL_DIR option, default
to installing into a lib/metatypes location relative to the install
prefix.
This is required for supporting calling
qt6_generate_meta_types_json_file when building standalone applications
or libraries (not part of the Qt build).
Make sure not to install the metatypes.json file for executables.
Install it only for libraries (aka modules).
Task-number: QTBUG-84403
Change-Id: Ie0dd75fca0cde71ccb4eb48030871e72d31d1725
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Split long signature into multiple lines, and indent some existing
misaligned signatures.
Change-Id: Icaed7b703c3f0b20472400b186ac2a28f1ff1dd1
Pick-to: 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Because setting QFutureInterface to paused state does not mean that
the computations that are already in progress will stop immediately,
it may be useful to get notified when pause actually takes effect.
Introduced the QFutureWatcher::suspended() signal, to be emitted when
there are no more computations in progress, and no more result ready
or progress reporting signals will be emitted, i.e. when pause took
effect. Added {QFuture, QFutureWatcher}::isSuspended() methods for
checking if pause took effect.
QtConcurrent will now to send QFutureCallOutEvent::Suspended event
when the state is paused and there are no more active threads.
[ChangeLog][QtCore][QFutureWatcher] Added a new QFutureWatcher::suspended()
signal, to be emitted when pause took effect, meaning that there are no
more computations in progress. Added {QFuture, QFutureWatcher}::isSuspended()
methods for checking if pause took effect.
Fixes: QTBUG-12152
Change-Id: I88f2ad24d800cd6293dec63977d45bd35f9a09f0
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
CMake sets "lib" as default prefix for Windows-GNU platforms.
Change-Id: I49e3123c385610307c84c584a21f5f3827a6fafd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
That allows us to remove the copy of that function in QtSvgWidgets.
Change-Id: I99d54408781c99b877c4df8fc9fc5f4139dcebb2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
One initializes data "byte by byte" not "byte per byte", at least in
any dialect I'm familiar with.
A byte array can be "created from raw data" but if it was "from a"
thing it'd have to be a datum of some sort.
Change-Id: Id9706b191f08f03418b9ea6f481797d93a278dff
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
In case a certificate chain is missing an intermediate,
for a certificate having "Authority Information Access"
extension it's possible to fetch this intermediate and
build the chain up to the trusted root. Unfortunately,
it's not always possible to install the root certificate
in the system "ROOT" store and then an application
wants to set it in the socket's configuration,
using setCaCertificates(). But this call also
disables CA fetcher ('no on demand root loading').
It makes sense to relax this logic for such
certificates and try to fetch the intermediate CA
and then have the complete chain verified.
Pick-to: 5.15
Fixes: QTBUG-84173
Change-Id: I5b9b4271767eba6f5fd2b5cf05e942360c6aa245
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
A common pattern in Qt Quick will be QProperty members that are
connected to a callback that needs to perform something when the value
changes, for example emitting a compatibility signal or marking scene
graph node data dirty.
To make such a pattern more efficient, a new QNotifiedProperty type is
introduced that offers the same API as QProperty<T>, with two changes:
(1) The template instantiation not only takes the property type as
parameter but also a callback pointer-to-member.
(2) Since that member itself cannot be called without an instance
and to avoid storing an instance pointer permanently, the API for
setBinding and setValue are adjusted to also take the instance
pointer. For the former it gets stored in the binding, for the
latter it is used to invoke the callback after setting the new
value.
Change-Id: I85cc1d1d1c0472164c4ae87808cfdc0d0b1475e1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
QString has the overloads taking a long/ulong. QByteArray also has
toLong/ULong(), so add these to make the API symmetric.
Change-Id: I6d1f98ca95fabd32b012f1c3df603dc54e187ec3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
ExtendedRgb should be treated as Rgb as it can be an automatic upgrade.
Pick-to: 5.15
Change-Id: I2942a1067ed5cacb2f60f303f467887cb44c36dd
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Just opened some files with spell checker turned on,
and corrected what was underlined.
Also, see QTBUG-84427.
Change-Id: I702b5bf2cfe1f23c928a6a57f117a2f571ad86ea
Pick-to: 5.15
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
For historical reasons we use build and release instead of create and
destroy. This becomes confusing now that more modules in Qt start taking
QRhi into use. Migrate to the more familiar naming, so those who have
used QWindow or QOpenGLContext before will find it natural.
Change-Id: I05eb2243ce274c59b03a5f8bcbb2792a4f37120f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Switch strncpy to qstrncpy, which internally uses strncpy_s with MSVC.
This way we will not get the following warning:
qrhid3d11.cpp(933): warning C4996: 'strncpy': This function or variable
may be unsafe. Consider using strncpy_s instead. To disable deprecation,
use _CRT_SECURE_NO_WARNINGS. See online help for details.
Change-Id: Iaed86033b0fc182e68804f311ac382c93c72abda
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Remove '/' as an example directory. We do not want to retrieve the
directory tree of the entire system.
Change-Id: I1caa7ef659dfe326515a4d81193682dacb373856
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
C&P mistake dropped $$ from qmake variables, my fault.
Will squash manually in 5.15 to avoid introducing a bug there.
Amends fa98adbd04.
Change-Id: I3ce33dba16f512cd20c8d3c6adc4c1a09506c1ea
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Needed to avoid linker warnings transformed into errors, when linking
QtWebEngine with qmake mixing.
ld: warning: linking against a dylib which is not safe for use in
application extensions:
The flag is added to libraries and plugins, unless opted out.
CMake equivalent of 944110089d
Task-number: QTBUG-83929
Task-number: QTBUG-75666
Change-Id: I3e9acca4712c9a266bf54c6e35e2fd2c0096692b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Record the device and inode numbers when found and assume we can
safely re-use the name if those have not changed.
Tidy up some preprocessor trivia in the process and moved
zone-availability check functions to before the system name lookup.
Pick-to: 5.15
Task-number: QTBUG-75585
Change-Id: I3660922ef3c94b553a20f887a676e8921693b30f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This was overlooked when enabling setting a custom thread pool
for various concurrent methods.
Fixes: QTBUG-53465
Change-Id: I189a7776fa02bbc3e995538cc154a7246ad1ad7a
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
This was overlooked when enabling setting a custom thread pool
for various concurrent methods.
Fixes: QTBUG-53465
Change-Id: I8b0a0086e46639639051fe99cf52d049f7bb3bb2
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Coverity warned that chunk could be >= tldChunkCount (2), and
tldData[chunk] (array of length 2) would be accessed out of bounds.
This can not happen, but it was unclear.
Clarify logic with comments and asserts, that Coverity will hopefully
understand now.
Change-Id: I2a38c685cfcbc69ed123918e8cbed360b20b1035
Coverity-Id: 178254
Pick-to: 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
With the recent changes in the utility that generates it, it now has
improved readability and constexpr arrays, usable in static asserts.
It also has an updated list of TLDs.
Change-Id: Ibdc986d667feebeb141ff81f6fddbc05b6be8488
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Simplify QTableWidgetSelectionRange by removing the unneeded
user-defined functions - the compiler can generate them by it's own.
Change-Id: Ia96ea29f595851e58c5b714bb316174406d42b8e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Ubuntu 20.04 enables -fcf-protection by default.
PCRE2 10.35 sees this but complains that -mshstk is also necessary
to build its JIT. Detect whether the compiler is enabling Intel CET
automatically, and if so, build PCRE2 with the right options.
Pick-to: 5.15
Change-Id: I3440e689b81f4f07055f211a4fa7331a43eb410d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QMake's windows.prf expects the WinMain library to be named
'qtmain[d].lib' and not 'Qt6WinMain[d].lib'. We're renaming the
library to 'qtmain[d].lib' in the CMake build now to avoid adjusting
the qmake build of Qt.
Also, we have to add the private library shell32.lib to WinMain to
make it appear in qtmain.prl and having it linked to Windows GUI
applications.
Fixes: QTBUG-84425
Change-Id: Ia94090b89e037b17ebfded359b293c8586371d59
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Causes emission to not happen and prints a warning
Pick-to: 5.15
Change-Id: Ie80cc89549741079c243e6fd4269f793bccca9fd
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
A property alias is the equivalent of the "alias" keyword in QML. It
provides the same API as QProperty, but redirects any access to the
QProperty it was initialized with. When the original property is
destroyed the binding becomes invalid and ignores any further acccess.
Task-number: QTBUG-84370
Change-Id: I0aef8d50e73a2aa9e7703d51194d4c5480573578
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>