I must have broken this in the 6.5 work I did for QMetaType and
QVariant, but I haven't searched which commit exactly did it. Our
QVariant tests are old and thus only checked the type ID, which meant
that they caused the registration by the act of asking for the ID in the
first place; this commit adds a couple of explicit checks for the type
registered by name before the ID.
Fixes: QTBUG-112205
Change-Id: Idd5e1bb52be047d7b4fffffd174f1b14d90fd7a3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 8570e86fff183ffa4c1dff577c7fa14e3342daee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When we fixed the callers of toSQLTCHAR() to use the result's size()
instead of the input's (which differ, if sizeof(SQLTCHAR) != 2), we
exposed callers to the append(0), which changes the size() of the
result QVLA. Callers that don't rely on NUL-termination (all?) now saw
an additional training NUL.
Fix by not NUL-terminating, and changing the only user of SQL_NTS to
use an explicit length.
Amends 4c445ef0bae8b36ec4a742552f0ebd81a1a90723 and
46af1fe49f7f419dc1b3231de9860e2da0ea48f8.
Done-with: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Change-Id: I6210b77e9417f46294df94cb32ab4134af8dc4c2
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 9020034b3b6a3a8118e5959beed699bb8aaa3f95)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Focus the canvas on window activation to make the screen receive
key events.
Fixes: QTBUG-111848
Change-Id: Iad3474681653b176eebd901aaf59e84538681351
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
The previous example finished way too quickly and provided no real
value in regards to API understanding. Previously, QtConcurrent::map
was used, which was also used in other examples. We are now using
QtConcurrent::filterReduce to demonstrate other functionality.
Task-number: QTBUG-111165
Change-Id: Ibd6eb119d0711cddfe8b211d460e9d67d6ce95c3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 8352756d27e5657390b6e87f45e0c0bae6b7784e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Added a QFileDialog to let the user select a path. Before, the path
was statically assigned with "../../" , which is not optimal.
I also modified the findFiles function to check for text files in
general and not only *.cpp and *.h files. Lastly the result of the
word counting is now displayed on the console, as I think this is an
informative output from this example.
Task-number: QTBUG-111165
Change-Id: Ie27c6acb4f79a78e3bef141edb92de08901fde71
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d795dfaee7093a30b278e6e8b9dea30c2e7a2106)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Updated the example to align with the Qt6 Example-Guideline.
https://wiki.qt.io/Qt6/Example-Guideline
Task-number: QTBUG-111165
Change-Id: Ibd9e7ce0d4dee90f6a693b81516d2f5b86345b1d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit b5e9d418959a9d427c14468886470791527e157f)
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
There was a possibility of infinite loop and eventually crash when
androiddeployqt was used for the second time. Everything because of
deleteMissingFiles function for clean up previous build.
When we find the same names and those are directories, we call
recursively deleteMissingFiles. The parameters we use are absoluteDir,
not absoluteFilePath. As we use parent of found dir, deleteMissingFiles
is called with the same values as before.
This commit removes possibility of infinite loop by using
absoluteFilePath. That allows to avoid calling deleteMissingFiles with
the same parameters.
There is still a possibility, that directory that was found is not the
same as we were looking for. That will cause not needed files removing,
but those file will be copied again later.
This regression was created by 7dc05252a0df829bb5ea3994160d425bb0da26cb
commit
Fixes: QTBUG-111027
Change-Id: I195b4c407068b14e2ef94800ad1945adc66408cb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit f4d897f04eee6386382096945f872ae9f306a5de)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b0553d15a06c9a842e82caf8ce62530bd45d888c)
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
This example was moved to manual tests in 6.5, which broke the link.
Now that it's in manual tests, I guess we can stop promoting it.
Change-Id: I1aa4a7de5123e96bf9ff56eeae49104acdce9645
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 9f93f96394fd4ab209ba45cd99753b9c7edcf373)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* The DownloadDialog was never destroyed properly. Pass 'this' to its
constructor to fix it.
* When re-creating an image grid layout, properly clean up old image
labels in Images::initLayout()
Task-number: QTBUG-103514
Change-Id: Ief52774002632d4ad3a6cca85bb0c0aa1a1d4bc0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 0ac234f9e256949cbacb77f94d39fff90caba7b4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Code initially compiled against Qt <= 6.2 does not have a qfloat16
metatype that unconditionally gets registeret from QtBase.
Therefore, any preexisting metatype instance for qfloat16 will hit the
custom type registry code path. As builtin metatypes are not part of the
custom registry, we will create a new type-id, and the type will thus
not compare equal to new code using the builtin type-id.
Avoid this issue by inserting an alias to the type in
QMetaTypeCustomRegistry's constructor.
Pick-to: 6.5 dev
Change-Id: I825265ad16e274c08b2c4a3a4814475b6c6c6187
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
JSON allows duplicated fields, but the last one will prevail. Therefore
move the new "comment" before the actual list of files.
Amends fa4b7495b741c3e7943860c5ff15212afceda710.
Change-Id: I06874745c8c51e55d79d7a373236cc8d9151079d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit d4dba80863324302f9d5d26b184352845263adc3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
250ca8d5f8bb3771695ae8eccb8d9b469003d840 changed the qConvertToNumber
to have a std::optional return instead of a boolean out-argument.
In doing so a code path that was supposed to report a failure (string
could not be converted to an integer) accidentally starting reporting
success (and converting the string to 0).
The problem is that the `ok` check from QString::toLongLong was
accidentally dropped in the refactoring; previously the function set
`ok` to false and returned 0, now the function just returns 0.
Instead, amend that return to return nullopt (because the conversion has
failed).
Change-Id: Iaedef5463f3ec500a97bd4c9bbddf977f66df61a
Fixes: QTBUG-111867
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit a25644aecf056b9b021189de5384519b6f06c1e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In most QObjectPrivate-subclasses, the Q_DECLARE_PUBLIC macro is used in
the private segment of the class declaration. In that case, the q_ptr
becomes a private member of the private class, and then the
QObjectPrivate::connect function can no longer be used, as it needs to
access the d_ptr.
Fix this by declaring QObjectPrivate, and the static-assert-helper, as
friends of the class using the Q_DECLARE_PUBLIC macro.
Adapt the QObject test by moving the Q_DECLARE_PUBLIC macro into
the private section of the test-private, and add a compile test.
Change-Id: Ifc04be3b305221e138b1e08bb3a3838d871f4fcb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 4f02973e2f447dfc92234ec247d7157ea0e1e807)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
state->rate is always larger than or equal to state->bitsInQueue;
when bitsInQueue == rate the queue is consumed and bitsInQueue is set to
0 again.
Done-with: Marc Mutz <marc.mutz@qt.io>
Change-Id: I56d268a19fb3cd542cc027edc962253f09d97a14
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit fa4b7495b741c3e7943860c5ff15212afceda710)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use qt6_ consistently as the link target, and qt_ when referring to the
function.
Change-Id: I9bb903cd2c32dcded1ee7a2804aa36074e8a5c38
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit 454dafb0e1a36ef6bbe9eafc240c22f6cd14e312)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qIsRelocatable and qIsValueInitializationBitwiseZero are not public API,
hide them away.
Change-Id: Ib4eeaab46d01759098e96091b700e9a28fd50962
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0ca803a5d325f26f5e4e0fcab8b9c9a02f154336)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
... to make large data usable from other test functions.
Change-Id: I302070121a8bb49f373c7711bc3ab9e6418874ef
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit f7ea9b36b7c56bb288f3ea55f587d2ccb8a9b7fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This example only demonstrates the use of blockingMapped. Considering
that the QtConcurrent::mapped~ functions are already included in the
wordcount example, and have very similar APIs to the
QtConcurrent::filter~ functions, which are included in the
progressdialog example, this no longer serves a useful purpose.
Task-number: QTBUG-111165
Change-Id: Ibc526e1a9fb17070e376e45151e9c2bdbc69bd32
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit fbb470b40b2c86a55751bf3099cc0424f66c7274)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Templates have different overload characteristics from normal
functions, and treating q_no_char8_t and q_has_char8_t::QUtf8StingView
separately is never necessary, as one implicitly converts into the
other.
Add docs for the new UTF-8 compare() functions.
Amends b977ae371a753a82e1d0bb32c5b62099da663721.
Found in API review.
Change-Id: I58b4b28a3eccde1976d71cfa3412b734d46f314d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit bbb9cf225fd030a87818cb867c24ab651f797100)
This example shows how to use QtConcurrent::run by calling a global
function and printing the thread ID. As the documentation already
explains the functionality very well, I don't think this example is
necessary.
https://doc.qt.io/qt-6/qtconcurrentrun.html
Task-number: QTBUG-111165
Change-Id: I42a718cdaabdaeeab39b933d12c67d11978c95da
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit de5e0422ca14ad1bc042889fa68772bf6912a215)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The new method has been renamed from markDirty to notify.
Fixes: QTBUG-111267
Change-Id: Ib7926a315cfd11ca6930c785290089b7031d34ff
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 12c62dd243dd139023fa1fc5c3a7c0fd8e3ee0ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Without this plumbing we have no way of knowing if the QMessageBox
has a checkbox set, and can't decide to skip the native dialog,
leaving the user without the expected checkbox.
As the suppression checkbox on macOS can be customized, we can use
this plumbing to actually provide native dialog support for generic
check boxes.
This mechanism can also be used by QErrorMessage, which now matches
behavior between native and non-native dialogs in terms of the label
of the checkbox and its initial state. We might want to tweak this
in the future, since user's might expect the suppression label and
state to match the system default, but that's something we can
expose from the platform theme if so, and should apply equally
to the non-native dialog.
Fixes: QTBUG-111803
Change-Id: Ied9fc34383fe79fbd8437592ad1c1993b9396178
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a0313c85a9b8ab6ba0ec273f0c8638e2f7b8cc18)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The choice of whether to show a message again is per message,
so when showing a new message we need to reset the check box
back to its default checked state, otherwise the user might
mistakenly dismiss more than the indented message.
[ChangeLog][Widgets] QErrorMessage will now reset the check
box for showing a message again for each new message shown,
as each individual message has its own suppression state.
Change-Id: I86d4bb5eabdb5b7a478c03516108a5edf87fcbe3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f2fc2013defc2f346fa1936dcf357d34bae3dbba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Removed side panel and swipe to remove examples as part of patchset
3bc6f344a8f10699313c3e0c9236dd6945edd895 and updated docs to reflect
that change.
Fixes: QTBUG-110989
Change-Id: I6241dd9842b1584e3dd25057591fe29eaa34d579
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 87567f3a46885bcc110fbf041d5b1b6b8bd0e28d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The pages are supposed to use the \keyword command to provide a target
for the versioned command name.
Change-Id: Ic91f5becc80985622a691aba96ce2c4e2984078e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 565e43fc704919923e53103911a72b3fec5c9d16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The NSAlert does not stay open when ran from a nested event loop,
so we need to fall back to the cross platform dialog. The window
modal dialog does not have this issue.
Fixes: QTBUG-111524
Change-Id: I63fba0a092018bb19edeef78c06587455d752235
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 4e59a5252c11738ce4849032a5aa2a23f97a18ed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix the link to QSurfaceFormat::StereoBuffers, and clean the text up
a bit. If everything is a \note, then we might just as well not have
notes, so move the statement about when this function is useful out
of a note, and combine the statements elaborating on ownership and
lifetime of framebuffer and contexts into a single note.
Change-Id: I7cb1f9ff78ba760e99d639550130f5c833ad684a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 47df0eb5131a5fc0decd049bd3f9eefeb26276df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
And for good measure, I'm also removing BMI2. The one we really care
about ensuring gets enabled instead of -mavx2 is FMA anyway.
Complements commit 29d3938aa56663f09666a0ac58b33e70e00abff2 (which in
turn complemented commit a98cf15ed1b57aee695de01b04a974637b2cd44a),
which removed BMI1 because AMD introduced it before AVX2. Looks like
they also introduced LZCNT in some earlier processor too (family 10h) or
GCC 12 began emitting __LZCNT__ for that family -- IIRC the AMD feature
list was bigger than just the lzcnt instruction.
Fixes: QTBUG-111698
Change-Id: I7f354474adce419ca6c2fffd1748f5b24f69a692
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 8413824ca00188fa36b6adf46d4a5bddb9515ec7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The qtPlatformTargetSuffix() function is used in various places to
determine the suffix of targets based on the config, which for macOS
will result in a _debug suffix in debug mode.
This becomes tricky when one project built in debug mode tries to depend
on the libraries/plugins of another project (Qt) built in release, as
the qtPlatformTargetSuffix() function uses the current CONFIG as input,
which may be different than the QT_CONFIG (or CONFIG of whatever project
is being depended on).
For libraries this was fixed in 50e664835bc2130e8693364641f9aaa7133b6998
by iterating all known library paths, and trying the CONFIG suffix before
falling back to release version.
For plugins this was never solved, which becomes an issue when linking
to static plugins, either in a fully static build of Qt, or when some
of the plugins are static (permission plugins e.g.).
In this situation, the user project has to have the same configuration
as Qt was built with, to avoid errors like:
error: no such file or directory: '~/6.x-static/qtbase/plugins/platforms/libqcocoa_debug.a'
To work around this, we assume that a plugin installed into the Qt
tree has the same build configuration as Qt itself, then then use
QT_CONFIG as the determining factor when linking to the plugin.
This still ties the build config of the plugin to the config of Qt,
but relaxes the relationship to the application, allowing it to be
built in either debug or release, which is an improvement to the
current state.
Task-number: QTBUG-110356
Change-Id: Icee67fc01313a6c6f34178a6345ccae1b57429d7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit e2446afaa10ddd365d8de834d3fb1d00fd661355)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The function is in the QtNumeric documentation context.
Change-Id: Ibc6a8961bc04efd4ab1eb50bb371e6a169d513dc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit c1cbb12e57e24b977b1a5c5be711793d6e67c113)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Introduce a new feature for password dialog in cups that needs several widgets
Change-Id: I93799b814ac06e661c19cffcd7d3c9bfa56ff814
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 45df0ed2462beefce1aa51abf3cda7bc18e52118)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The doc said positive values for a negative range were intermediate
but the code actually rejects them if the value has an overt plus
sign, so make clear that intermediate is only for the case without a
sign. Incidentally comment on a test where it might not have been
obvious to the reader that a space is the locale's digit-grouping
chracter.
Change-Id: I3edab74fe8c2cbe8448c0e523676f1fd0d0d8a9f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 58f5ec35f108bca01489124e74e96018fd937ed4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
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
Change-Id: I6fd14d1f8adddc2914d6ff4d3b5ad34a3871ef82
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit ac6c7aa12fb6203855a745b2c1b4a1e07149b4af)
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>
Change-Id: Ie6a6e7a707200e58335fcb64cb1584f0c307895a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit fff9395c2899841bdca07f400392595963d9ff93)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
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 e487b07e18f1cb7ff126744be57b2ae1b9839c6c although this patch on
its own is just as applicable pre-6.4 as well (to fix drawPixmapFragments
when using a core profile context).
Fixes: QTBUG-111416
Change-Id: I2ad358424e613192a51b99b937aef7660f5dbe08
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit d6c5a2f9177f427d14aae64d111c172d1bf28b6c)
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This example is useful but not a typical starting point for an
application.
Task-number: QTBUG-110647
Change-Id: Ic4af8ed648c587b91110a7403fa80c619549289d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit e13b57d06ab6e81cf04c090cc46dd23b4f8daccf)
Reviewed-by: Jani Heikkinen <jani.heikkinen@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.
Change-Id: I48b92b1cf057f586e0d2842d1c0a3312154e9a13
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 3c104c279911419f3d0a9e6f3ac050e6f3968e7e)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This example is removed because what it does is already covered by the
other XML examples.
Task-number: QTBUG-110647
Change-Id: If33e3fc55dcd9c7c10cfdfa86405f8bcf5cb6187
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 56b3123689be7c408d9b6c8c48648a15f0e46658)
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.
Change-Id: I30139520f582a38863a0936f8eca4b1ed33e37c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 52c7f699ac3124889b9c01fbc1fd542e30da6753)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@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>
Change-Id: Iab00984ba45dfc9a324b6a3c12e3d330b655a5a9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 91bea4470ea25c1e6fe7e46559a37bdd7b703b63)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_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.
Change-Id: If4fbc311677b993488859b2c4e226b94daed71fe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit c6dbae9550e3819a3e1ade1bf06f5d9cb030d561)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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
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>
(cherry picked from commit 5573e2d6ac09ff8b8f23edca93f601ff7679fa3c)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The wiggly example is gone, but tetrix shows how to use QBasicTimer
as well.
Change-Id: Iaad78b0d7e2136ef41d98f634d0680e6f7f3c4e1
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b7b712181bd47a84640a655100661c4aa008c6e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The 'sdi' example is a candidate for removal, so point at the
spreadsheet example instead, which is not.
Change-Id: I4405f2421db8be79898a38ca4f3fa1ea5fe0280b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 721b4a4b5a8b4e16d50690e0d9ca62725c3ddafb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's been a while since we had a single Tutorial for all of Qt.
Change-Id: I7317291c445c09b0bf728513670b6a575dd536bc
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a776aea7aacfcb11a14afcb4fe8cd3edfbf86b37)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use a template alias instead of C++98-style inheritance.
Saves one template instantiation.
Change-Id: I95ee9cf1e5eac1db5fc8e05cd95f5e745134214d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit b37b820ce8801613139241036d15baa581a6a403)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Found in API review. It's not BC-critical, but let's get this into 6.5
to minimize the diff to our future LTS.
Change-Id: Iaa63afad1d31f6edef29e1185897d925f47a094d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit ebb833d7f70465844e474583571770ad14adcebf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Partially revert e1440dd7bc1a5da9a536f88b9733d04ec8fa6e61 for Android
versions below 11 which could take advantage of the manifest
flag android:requestLegacyExternalStorage. And for other newer versions
avoid returning them while adding a note to the docs about this
behavior.
Fixes: QTBUG-108013
Fixes: QTBUG-104892
Task-number: QTBUG-81860
Change-Id: I10851c20e2831bddaa329164c941e2ae71f0a497
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
(cherry picked from commit 81a748efb742092f5a0a1c33b8340478e52cc79f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
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.
Change-Id: I0225a4533841e5b433a3d9781b2642c084f775ab
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 0f447e875da42f62cf8533e78435b7b24ca41ae0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Also add one for types that are neither copy- nor move-constructible.
In contrast to resize(n), the QVLA(n) ctor worked for such types, so
make sure it stays that way.
Change-Id: If54fbc9dd6a4808175c4bcb0ffb492b33c879746
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit e7c792ba7179c4c81fb2e26f66031ec81234b0d7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
C++20 doesn't like arithmetic with enums anymore. While this hasn't
caused immediate pain, yet, fix it pro-actively for an imminent patch.
As a drive-by, fix the missing space at start of comment.
Change-Id: Id08bb227c587bc7b900c593a7b6d2655ca32eefd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b8966021ffb2cfddc77aee6dbe145eb74ef22f9d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Remove the claim from the QKeySequence documentation, fixing the
respective qdoc warning.
Amends f10ae4b887f6652dcad95516ded43f2e2994e88f.
Change-Id: If234cfb0a6b7dc20fb10e623cc3ee2ec167f22c9
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 1e50420354fc717b665cb8398658e97b89a7f953)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The Find Files example is gone.
Change-Id: I63bc33c3b9db7c8bfcf07fbcee0182a492c01dbd
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit b6fae509aae9145019fce344a2aa11cde8d1249e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Document that the operation is not supported.
Task-number: QTBUG-98974
Change-Id: I1faacb7af7e11943d6da62313ed104fda063d30d
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit 7af39be05295c5743d04ef83468a0d250141b145)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As pointed out in review, somewhat contradictory advise.
Rewrite the section to be more active, focus on the user and
their application, and a bit more consistent.
Change-Id: Idbbf29d3033d32ade553290a2e89bd778876224c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7273a0eacc235c5b28394c064cdfc3fa72f0ef5a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's possible since Windows 10 1903 to set the active code page
to UTF-8 using the manifest. In that mode, QString::toLocal8Bit
converts to UTF-8 and the legacy programs not using UTF-8 codepage
can't interpret the value.
We can detect whether the UTF-8 code page is used, and in that case
only provide data as CF_UNICODETEXT. Windows will then synthesize the
CF_TEXT format when the clipboard data is consumed, using the right code
page for the target application.
https://learn.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page
Change-Id: Ie024a618556d9bb5b5c7ac70507d279b959ff6db
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 481771a331b904810ce3da459d4b6293a83fcec0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use qWarning()/std::cout instead of C IO functions.
Use default parameters for QDBusInterface's constructor.
Remove useless Q_SCRIPTABLE.
Use type-safe invokeMethod().
Extract a local variable for the used D-Bus connection.
Task-number: QTBUG-111366
Change-Id: Idc38a7c1dd97d71308d9491193039744c759d6f2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 07b8a5a4093ecb69ced47b67cbcac5121064fe5e)
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Instead of overwriting the CMAKE_AUTOMOC_MACRO_NAMES, we try to append
our desired moc names to it, and don't get rid of what's there.
Thanks for Friedrich W. H. Kossebau for filling a descriptive bug report
and offering a solution as well.
Fixes: QTBUG-110497
Change-Id: I582af431151cacfe24085b890ae9dba0a0e53f3f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 38ee9ee8497291c899c2a72e0ed24bfffe9ced4e)
Also adds a file to patches which is a required modification
to the update in order to make it compile.
Fixes: QTBUG-111536
Change-Id: Iaabc1b7736cfd98217a8aff2b7f9bc65402d0451
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 18aa3309a4e4b5a874298af1243095db9aa207d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Note: 6.4.x update has to be done in a separate commit
because it did not get the update to 6.0.0, so the
cherry-pick will not apply.
Task-number: QTBUG-111535
Change-Id: I9d4aae98f8267827ec983ca89b1310006c6aee78
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a6edf9cbe5bd1d1c6bc08733f97fc07812126bde)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Both QTimer's and QObjectPrivate's destructors print a warning if the
current object lives on another thread and has an active timer:
QWARN : tst_QTimer::moveToThread() QObject::killTimer: Timers cannot be stopped from another thread
QWARN : tst_QTimer::moveToThread() QObject::~QObject: Timers cannot be stopped from another thread
This timer is used to ask the thread to quit, which in turn allows us to
destroy this QObject without a cross-thread warning. Because it's
already fired once and done its duty, we can make sure it's not active
by simply making it single-shot.
Change-Id: Ieec322d73c1e40ad95c8fffd17465067b27c044b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 5f32c9edce208125f642c86a4bc9e73564386243)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's the only place that uses it.
Change-Id: Ieec322d73c1e40ad95c8fffd17465370ac209c2f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit cf059ac9ece88a70eb4f582f3f9cf80186cc69a1)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
GetFocus will return the window that currently has keyboard focus. This
is not what we want for drag and drop handling though. Use the window
under mouse and process events for that window when doing the touch/pen
input workaround. If no window is found we fall back to the focus
window. Followup to 31e7790102b260344893eaa8bf8b7b1a0f95e3b7
Fixes: QTBUG-111149
Change-Id: Ib8233debc267df0cc19b21c1dc5c6881d018d84a
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit c912bde52a1b85a782db6aed8d6f9917d597f58b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use QDateTime::toString("ttt") which is available since Qt6.5 instead
own implementation
Fixes: QTBUG-111275
Change-Id: I41676d3a327c5aaabdeb4f54b9d169e228c482e1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 79b22bb1f3ba51f37de03faefc7ddcd712e8e385)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The window uses default palette (QPalette()) to determine frame
color (either light or dark). This doesn't work for quickcontrols
as they depend quicktheme palettes and they don't overwrite default
palettes.
This patch add API in QWindowPrivate to provide palette for window
and this can be overridden by quickcontrol windows to provide
their corresponding palette.
Fixes: QTBUG-111491
Change-Id: I39eea20ee7c61ecf0279143c9784da35be15edd3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 170fadadd67fa97621a7782ea845c314bd9ee09d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A click on the selected item should deselect all other items before
editing starts.
Remove the part of the test case that assumes that we can have multiple
items selected in ExtendedSelection mode, and click on an item to start
editing while maintaining selection. That can never happen.
Fixes: QTBUG-111131
Change-Id: I0312eed4614502cfb77eca26d3f7615427493d7d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 3f2d02e2f4436ace5f0fbbf432878a963f5ee969)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
tst_QListView::moveLastRow asserts now and again, unless only that test
function is running. We repeat failing test functions individually, so
this never blocked CI.
The reason seems to be that we get a paint event only for the viewport,
after the item model's structure has been changed by the test. Moving
rows does trigger a delayed layout, and in some circumstances the
entire view is updated, rather than just the viewport. But if only the
viewport is updated, then layout execution in QAbstractItemView::event
never happens, and the data structure that the paintEvent implementation
relies on is outdated and contains invalid item pointers, resulting in
an assert.
If we need to execute delayed layouts when the entire view gets painted,
then we also need to execute them when only the viewport gets painted.
Change-Id: Ibb46c2315825d99c82b884226817c494a3d95975
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 85ab3f26656b2b51eaa5b5247cc0d90d401fd8df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Currently images that does not fit in the cache will be destroyed, which
is unfortunate. 256 MB cache is too small for todays standards, so
increasing it to 1 GB. Also adding an environment variable so that it is
changeable if required.
Fixes: QTBUG-111498
Change-Id: I70c65cad6219a59102b16abc50f098aa0b017314
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 55568b8c626576726c6c9138c8044ea52bc3a355)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
They now share their implementation. Manual tests can be created by
passing the MANUAL arguments to the qt_internal_add_test as well.
Fixes: QTBUG-111382
Change-Id: I1c207b7e4a67526554df1ee43fe032bb20fc92fa
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit b6bc4199ec866a326f94ae86f3a35b73bc3eb30e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When ICU is not available, QTimeZone::displayName() does not return a
valid timezone offset string so the OCI driver will get a wrong utc
offset string and inserting a QDateTime will go wrong.
Fix it by creating the utc offset string by ourself (toOffsetString()
inside qdatetime.cpp is static and therefore not accessible for us).
Fixes: QTBUG-111275
Change-Id: Ib724d760688614e162246e1e028ee5e004cc9477
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6b9977c4adfa0ffd9cb87b4aec288c7a335aef6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It is neither documented nor very useful, and it has
platform-specific issues as reported over the years.
Remove it now as part of the example revamp initiative.
Task-number: QTBUG-50278
Task-number: QTBUG-110093
Task-number: QTBUG-76054
Task-number: QTBUG-43209
Change-Id: I6dadaf4162b4c19411c544b9f204c19e37aa740d
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 6462a454e3d53c3711817b510cff59c136711b9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QGuiApplication::lastCursorPosition is a QPointF, and (at least on macOS)
compares always different from the QPointF stored in the event. This
might be due to the translation from system coordinates to QPointF
introducing noise.
The result is that even a simple button press causes mouseMove events
to be delivered.
To prevent this event noise, overload equality operators for the special
QLastCursorPosition type when comparing with QPointF to explicitly use
single precision comparison.
Fixes: QTBUG-111170
Change-Id: I82ea23ac9f4fa80c55c9c5c742527dd7ee74fd99
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 519e3963fad0761bac5629b1f6eabc58060265c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends 0242be90606b377864c6fd02d5a8e0afaf635acf, and removes unwanted
side effect of having a modified style behavior for later functions.
Change-Id: If3dff0d7ab9e6c6c10e7a92d0a3eaff98fa1457f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f75b29fbbde79d66ee539162441a007a90035b96)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
OpenSSL doesn't support some Blake2s and Blake2b hashes and querying
these would automatically report that they are unsupported, while we are
actually using non-OpenSSL implementataion for these and therefore they
are always supported.
Change-Id: I300694459891c3103502705d6c8271caa47d8d01
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 86a517ac786c90b9ce8deb502c413287e31058c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... basically inlining static QCH::hash(), which, however, accepts
only one piece of data, while we have two.
Avoids the memory allocation of the QCH d-pointer. The toByteArray()
is now the only memory allocation left in finalizeUnchecked(), and
will be removed in a subsequent commit.
Change-Id: I7549d6e1c116a4cdc29dac74b867dfa6647022a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d235953a82bf8df5a6011dcf55331e287f0e6e65)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
... it conflicts with rfc6234/sha.h's SHA{1,224,256,384,512} symbols.
We can't drop the rfc6234/sha.h header, as openssl/sha.h doesn't give
us the algorithm's block sizes, necessary for HMAC
(QMessageAuthenticationCode).
But we can drop openssl/sha.h. The only reason we included the header
was to get access to SHA<N>_DIGEST_LENGTH, but this is a well-known
value and easily obtained from rfc6234/sha.h as SHA<N>HashSize, so use
that.
Even reduces #ifdef'ery.
Amends d9f9d03fd34d951eb587fe082a0dbda33b8df248.
Fixes: QTBUG-111467
Change-Id: Ice19ad8c788fb2828666647cc40abb894cd7af2b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit e388d219a4a29e7a5a81ff1a6dcf995662177b43)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
They share so many things, and QMAC is lacking so many of the changes
QCH has received over the last few months, that it seems QMAC is
better off being implemented in the QCH TU.
Among other things, this will allow QMAC to use QCHPrivate for its
implementation, drastically reducing the number of memory allocations
required to perform HMAC operations.
Change-Id: I3c81a52e3a9ad57c14c91c16bc347f215fd407ba
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d9f9d03fd34d951eb587fe082a0dbda33b8df248)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
All QtQuickControls examples are marked for android by default.
However, the To Do List example is iOS specific so don't include it.
Add it to the list of iOS tags instead.
Fixes: QTBUG-111426
Change-Id: Ic89d6b40d263f81ed402a2064f2e44b2fa826940
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 276bf8cb239a678e9c9b4b5b36cfa7015780b292)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Repeating the body of the reported bug, "Building Qt modules with qmake
is unsupported in Qt6 and since 6.5's switch to syncqt.cpp broken."
[ChangeLog][qmake] Support for building Qt modules with qmake was
removed.
Fixes: QTBUG-110134
Change-Id: Iee5aa5c85f7106bce742df448ec502e6cc039454
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 863eb576c879e0284e794b60ff8450c468f6ae3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If a style sheet is applied to a scrollbar, then we cannot treat it as
transient, as the QStyleSheetStyle doesn't implement any fade-in/out
animation logic. And we also need to set the overlap to 0 (in both
the style sheet and the macOS style) if the scrollbars are not
transient; otherwise the opaque scrollbar will be placed on top of the
content.
Since a style sheet might only apply to a scrollbar based on its
orientation, we also have to pass the style option through to all calls
of the styleHint function.
And since that function is also called from other QStyle implementations
in the macOS style, we have to make sure that we call styleHint() on the
widget's style to get the correct value based on the style sheet.
Fixes: QTBUG-63381
Change-Id: Ic67ce3a7cb5089f885dabfd5a1951e3029915446
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f5105ea89a76d6051f058834d99385582cc61f85)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use lambdas instead of slots where practical.
Consistently use signals to transmit D-Bus messages.
Extract a local variable for the used D-Bus connection.
Task-number: QTBUG-111366
Change-Id: Icc6667e1392ada1b7d3b33c4e4b32917dd648390
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 742e79312fc98711f68749937d0db433d961f546)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This gets rid of a custom form. Also quit the application if user
closes the input dialog without entering a nickname.
Task-number: QTBUG-111366
Change-Id: I56ed99d69d031e7ef06711fc7ec112311c974ca6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 8b4865759029250d0f75c84ca0b1312429d24086)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I don't think any of these make a difference because the Duration is an
implied parameter because of the time_point arguments, but this makes
the code match QDeadlineTimer::deadline<T>.
Change-Id: Ieec322d73c1e40ad95c8fffd17468a41182944ab
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit ec2c27d59635e123a3c159fd30d90ec30a6d63cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To avoid gui slowdowns due to global pool being blocked.
Fixes: QTBUG-109511
Change-Id: I4e8d91e8fb0bd2e395072a082e992a3c5d3464ad
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 93047c71e8e6dd4ac28e1e59dcb561df11c759eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead document the meta-data and let the user set it.
Change-Id: I13c9cd0129ffeef7b72635f46f53cf3dbfcf6684
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit eb85a5eee7632b0f798abbb9b9428ad27f53bec1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The QtConcurrent examples were only discoverable from the
"All Qt Examples" page, which was very inconvenient.
This patch adds a separate page for all Qt Concurrent examples, and
links to it from the module's main page.
Change-Id: Iecabd9e21033605c1ec74232ce4f3d68b0c78d82
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
(cherry picked from commit 2a4c64cbedad0db25c057456491df6ce86beeee7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The qdoc file now quotes from that main.cpp file, so this
means the help information only needs to be maintained in
main.cpp.
Fixes: QTBUG-109178
Change-Id: I5bb633f66d92c36593ec6b0aaf9cacd57d4ce352
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 32ad980014484819ec33d2eaa97c096077e4c49a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
Change-Id: I08558d23230ec162928fea2c413ae8e2498617d7
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit 1ebf8c529d6894afca156d7e27863d2582c4cab2)
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Windeployqt now reads modules/*.json and translations/catalogs.json to
determine the available Qt modules, Qt plugins and their corresponding
translation catalogs.
This patch removes the hard-coded information that was used before. Now,
we don't have to update windeployqt anymore to teach it a new Qt module.
Fixes: QTBUG-109841
Task-number: QTBUG-106342
Change-Id: Ib7b7f44ca7d40d0c73d717d8494367af412ebdbe
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3c66def23fd8069835c8aba7710ec7f7cad68aa7)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
In the same vein as e24df8bc726d12e80f3f1d14834f9305586fcc98 for
emplace(it, v) and insert(it, rv), this patch addresses the identical
issues in insert(it, n, v). The solution is unsurprisingly the same:
q_rotate() after a resize(size() + n, v).
The 6.2- code will need to look different, because resize(n, v) didn't
exist there.
Change-Id: I1ce91969abc20f2a1e5d05a8545b009a2e0994f6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit fed5f2445480f7cf045e93761dc902f771cbf3da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It seems like we'll need this in lots of other places, too.
Change-Id: I767495c2eb02a2fc85b6f835ad9003fa89315c7f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 147dd6e82f41778060bdadf9b2a792bd11e1bc1e)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This fixes a use-after-free in QPropertyDelayedNotifications::notify.
Before this patch, evaluateBindings or a notify from a property index
might have caused the originalBindingData to become reallocated.
However, at that point, we've already restored the original bindingData
in evaluateBindings, so we won't track updates, and thus won't adjust
originalBindingStatus, which will then point to already freed data.
To remedy this, we no longer do the notification with data fetched from
originalBindingData, but instead use the information we have in the
proxyData.
We also need to enure that referenced bindings do not get deleted; for
that we keep the PendingBindingObserverList alive for the whole duration
of the endPropertyUpdateGroup.
As we now have the PendingBindingObserverList, we use it for the
notification logic, and only notify change handlers in
QPropertyDelayedNotifications::notify. That will allow a follow-up
cleanup of QPropertyObserverPointer::notify, and aligns the logic for
grouped updates with the logic for "nornal", non-grouped updates.
Amends f1b1773d0ae636fa9afa36224ba17566484af3cc.
Task-number: QTBUG-110899
Change-Id: Iae826e620d9614b7df39d86d8a28c48c8a5c4881
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 7a415a051a464ee3145c11b4ff44dbb16010323e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We have no reliable way of cutting the text shorter without side-
effects, so leave that to the users.
Task-number: QTBUG-109838
Change-Id: I280d2dec9d6e0cd6b4d57edac231ae99420d8569
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit bea15cdfa4de5fb9fa1614ef93b54df7139423fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Adjust the callers to use the non-deprecated APIs.
Change-Id: I8e96f25684a2d613bc400a8626dc9e3af2bb8dcf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f7fd5eaf95c964956b2b353784105c89950ffff2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We set CMAKE_POSITION_INDEPENDENT_CODE to ON and require CMake 3.16.
This sets CMP0083 to NEW and should pass -fPIE to linker calls as well.
However, the PIE-enabling flag is not passed to the linker unless we
call check_pie_supported(). This behavior is documented in CMake's
CMP0083 documentation page.
[ChangeLog][CMake] Qt tools are now built with position independent code
even with Unix toolchains where this is not the default, for example
clang.
Change-Id: I1d98e0ea7063a76e3fddc94d6555c6eaf14c7885
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 4183768d9bc6f80ac7b86c3dbf93e6b251369ae4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It was confusing entry capacity with the bucket capacity. The value
maxNumBuckets() returned was the maximum number of entries. This issue
was harmless: we would just fail to cap the maximum to an allocatable
size. But the array new[] in the Data constructors would have capped the
maximum anyway (by way of throwing std::bad_alloc).
So instead of trying to calculate what the maximum bucket count is so we
can cap at that, simplify the calculation of the next power of 2 while
preventing it from overflowing in our calculations. We continue to rely
on new[] throwing when we return count that is larger than the maximum
allocatable.
This commit changes the load factor for QHashes containing exactly a
number of elements that is exactly a power of two. Previously, it would
be loaded at 50%, now it's at 25%. For this reason, tst_QSet::squeeze
needed to be fixed to depend less on the implementation details.
Change-Id: I9671dee8ceb64aa9b9cafffd17415f3856c358a0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 1d167b515ef81ba71f3f47863e66d36ed6d06c1c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Saw this on my FreeBSD VM. The backtrace() function thought the nearest
symbol to something was "_ZTSNSt3__110__function6__baseIFbPvS2_EEE",
which decoded to
typeinfo name for std::__1::__function::__base<bool (void*, void*)>
The function pointer type inside parameter threw the decoder for a loop
and caused it to crash with the failed assertion in qbytearray.h:
inline char QByteArray::at(qsizetype i) const
{ Q_ASSERT(size_t(i) < size_t(size())); return d.data()[i]; }
I noticed this
- because tst_qtimer hung
- because qFormatLogMessage deadlocked acquiring QMessagePattern::mutex
- because the logging recursed
- because qCleanupFuncinfo failed an assertion while formatting the
backtrace (my QT_MESSAGE_PATTERN has %{backtrace})
- because QTimer::~QTimer -> QObject::killTimer printed a warning
- because tst_QTimer::moveToThread produces warnings
Change-Id: Ieec322d73c1e40ad95c8fffd17464f86e9725991
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 644c06b48f45aeabcd594df4dcf25a44ea02f132)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Rename it to QSmallByteArray, and make the maximum size a template
argument. Initialize m_size to 0, to avoid a partially-formed
default-constructed objects (default-constructed containers should
always be in the empty state).
As a drive-by, fix placement of some {'s.
Don't move it into a header of its own, yet, as it lacks a lot of
features expected of a generally-reusable class. Maybe one day.
This is in preparation of re-using the class to hold the key in
QMessageAuthenticationCode.
Change-Id: Iee77e03e50afdf2ebc5889feeead344bef8ab3e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 29050fa65b7c755ec3238ff0cc238c626832bc8c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... from the end().
It was lonely down there, and prone to be overlooked when performing
early returns in the #ifdef'ery above, as witnessed by the early
returns in the OpenSSL3 code.
Amends 1fe74c3bd3f727551b8168ee9f3e642d42233d55, itself amending
633c1365966eda89fc883c039683a727d0a0813e.
Change-Id: I8c941ecb5c4755d8823b2161544cf6f7fe75a239
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9a18ca59ffc93b6e4b18a64c624ab396e3976f60)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's completely unnecessary, since QFileInfo will query the file system
anyway and that has a much better view of what is normalized and what
isn't. More importantly, this fixes the mistake in failing to normalize
properly in removePaths(), which removed the ending slash of a root
directory such as "C:\\". That caused the path to become "C:", which
QFileInfo interprets as "current path on drive C:".
[ChangeLog][QtCore][QFileSystemWatcher] Fixed a bug that prevented
removePaths() from removing the root of a drive on Windows.
Fixes: QTBUG-110986
Change-Id: I9671dee8ceb64aa9b9cafffd17419b6d69670876
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 6d1769791348e9387e0c5f29d970131895888814)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This completes the triad uint/ulong/qulonglong, ensuring that one of
them will be size_t and one of them will be uintptr_t (size_t and
uintptr_t don't have to be the same type). The signeds ensure one of
them will be ptrdiff_t too.
Change-Id: I9671dee8ceb64aa9b9cafffd17415a0bfcbd68b7
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 85c69f023fe281b7f16e1a93e61be4432f7fef9b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QIODevice::read(ptr, n) returns qint64, not int. The returned values
are, however, confined to the interval [-1,1024], so no harm
done. Make the narrowing explicit, though.
Change-Id: I5f95292ca6e05f0f402e7258e590593eff361255
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 303caa40da6cee296ffcee3ae13b88d788a2e225)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This brings the code in line with the sibling code in
QMessageAuthenticationCode, which now has a simiar split between
finalize() and finalizeUnchecked().
Change-Id: I10701d59d56617ab32fae0df47371f0464e9cc77
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit a77e9d671d3ff056a7989f31305c9351d89f111c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... of creating a Private instead of the public class on the stack.
This avoids its memory-allocation, as well as the overhead of the mutex
in finalize().
Task-number: QTBUG-111347
Change-Id: I4d144fcfadc0b8c9ba78d395ff7279b2d5d7b050
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d32d2137b7d513f38450d3a5e07a997c3bc90aa1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
While QMessageAuthenticationCode is not copyable, result() is
nevertheless const, so a user could prepare a
QMessageAuthenticationCode object with setKey() and addData(), pass it
by const reference to two threads, which each just call result() on
it. This should be safe, but because result() performed lazy
evaluation without being internally synchronized, this would cause
data races.
Fix in the same was as b904de43a5acfc4067fc9e4146babd45c6ac1138 did
for QCryptographicHash. See there for a detailed discussion of the
solution.
Fixes: QTBUG-111347
Change-Id: I1feb380973c480ad6268349a0a46ac471b9ca0f7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 2449af142fa3d8ccb114262e994f308043ef6d70)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
`QStatusBar::removeWidget` was hiding the wrong widget (the next one),
since the `removeAt` call changed the item that the `item` variable
is referencing.
This fixes a regression in Qt 6.3.0 (7166a82844500238a4dad91857384479c7).
Change-Id: I9977b47e6208f8d451ff1037bcb9f4e8414cb431
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
(cherry picked from commit 3e7226f10702828eaaf2fa939efc2ac476e8a2b4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The class claims to be thread safe, however, when e.g.
one thread is calling setMaxThreadCount() and the second
is calling maxThreadCount() at the same time for the same thread pool
instance, the latter may receive rubbish data.
Protect all public setters/getters with a mutex.
Change-Id: Ief29d017d4f80443fa1ae06f6b20872f07588768
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 0627ab17277ad5fa83fe6fcab5af5cd2748162a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Found in API review: from/toUintArray() is too generic a name, make
sure its name gives enough context.
Change-Id: Ie10ff06ae11a5e168c4c91b60a9698a41d0429fc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7db28fb4bd4f328cef3c722e4e9c00305f830858)
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
When calculating the position offset of QGlyphRuns, either
when fetching substrings or when applying fallback fonts,
we would include the advances of non-printable glyphs,
such as the soft hyphen. This was an oversight, and the
other code which calculates the advance (like in
QFontEngine::getGlyphPositions()) does this correctly. We
apply the same logic as there and only include the advance
if the dontPrint flag is unset.
[ChangeLog][QtGui][Text] Fixed an issue where spaces would
sometimes be shown in soft hyphen positions in a string.
Fixes: QTBUG-46990
Fixes: QTBUG-62620
Fixes: QTBUG-67038
Fixes: QTBUG-102483
Change-Id: I4e583fb74f7a51424f14917d7cc0894beefec48b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 0fe6f818d23495f07100f82c12e4232b8e56daf4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix the statement when the tablename is a synonym by not appending the
where clause for the table name to the initial statement used for
tables and synonyms later on.
Fixes: QTBUG-111339
Change-Id: Ie18a858427d124e80462048b1a9c5e2afa327546
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 78f7a8c418bc887ebb5bd75f63e35a2b8108f107)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
<bit> exists in C++20 and is properly both constexpr and optimized. But
in C++17 mode, we don't have constexpr bitops and instead elect to have
performance at runtime instead. But somewhere along the line, either
when they were added, when C++20 <bit> support was, or in any of the
bugfixes for other compilers, the nesting of #ifdef got messed up and we
declared that we had constexpr builtins for MSVC in C++17 too.
The macro QT_HAS_CONSTEXPR_BUILTINS isn't supposed to be used by anyone
else... but we ended up not being able to use it ourselves either. So
I'm renaming it to a more precise label.
Change-Id: I9671dee8ceb64aa9b9cafffd1741b9b4060c9753
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit e69d80e14d24001f93442ab59b8babb7e9df0092)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The goal of this function is to ensure that dst is _always_
NUL-terminated. The only exception is if there's no space to write
even one NUL byte, of course, but not when src is nullptr but dst
would have space.
Update the docs to the new behavior and make them more precise.
Fix a test that assumed qstrncpy() would not write to dst for
(dst, nullptr, 10).
[ChangeLog][QtCore][qstrncpy()] Now NUL-terminates the target
buffer even when the source pointer is nullptr, provided the
target buffer has space for at least one byte.
Change-Id: I7806d8c71e260f8f02b79af7b6ce94f23599dd69
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 05f913d57d6557d1c540894651cc83a5b1ec7cf7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When Qt is configured to return nullptr from isNull() QStrings
(QT5_NULL_STRINGS != 1), then we'd be feeding a nullptr src into
strncpy(), which is UB. I couldn't rule the case of a null QString
lexeme out with local reasoning, seeing as the code is in the else
branch of an if (lexeme.startsWith(~~~) && lexeme.endsWith(~~~)), so
it might be null.
Instead of porting to qstrncpy(), which can deal with a nullptr src
(albeit up to recently, badly), note that the strncpy + the char[]
allocation is a qstrdup(), so use that instead. This also does away
with the queasiness of taking the size() of a UTF-16 string to limit
strncpy() for the L1-recoded version (which, in this instance is safe,
as toLatin1().constData() is NUL-terminated, but in some other
instances was not).
As a drive-by, make sure we don't leak the strdup()'ed string if the
emplace_back() fails.
Amends be98fa32c7d56ea91359b647a329356fa44eca04.
Qt 5 is not affected, as constData() never returns nullptr there.
Change-Id: I178d356e560d2749cd6ce0b9364c710a2d117304
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4a9e918d4ebdd9f7ea641e2b0f12a48c5f619acb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The only user of the function, QCollatorPrivate::init(), passes
QLocalePrivate::bcp47Name().constData(). bcp47Name() may return a
default-constructed QByteArray (e.g. for QLocale::AnyLanguage), so
constData() may be nullptr (QT5_NULL_STRINGS != 1). Passing nullptr to
strncmp() or strncpy() is UB, though.
Instead of using the nullptr-hardened q... versions of these
functions, check name for nullptr once, at the top of the function,
and avoid all the lookup code that follows and is known to fail
(because windows_to_iso_list does not contain empty entries).
This way, we take advantage of the std functions' UB for performance
reasons (fewer repeated nullptr checks), instead of being taken
advantage of.
Qt 5 is not affected, as constData() never returns nullptr there.
Change-Id: I980dace2bca1e983ac526e89fadeb92239ab5f11
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9f5a687ffebbc93ce5f8f25c544aa9129c6366c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This brings the code in line with its sibling code in
QCryptographicHash and prepares for a static hash() optimization and
the fixing of the result() re-entrancy issue (QTBUG-111347).
Task-number: QTBUG-111347
Change-Id: I3d0c0cd2a37c2bbeb60974307ff138e26b82bf69
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit ac9d25340aec5c165db5e58a3d8b869967c5ff97)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Don't return duplicate path entries from calling
QStandardPaths::standardLocations() and as a pass by no empty entries
either.
Task-number: QTBUG-104892
Change-Id: If05b20d2c07d75428cb572d9549a39cf21bdef99
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 30014ed850bbe62005b4aa789586b01c1281cab4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This switch should help switch off some time consuming operations
that make sense only whe configuring Qt project from IDE.
The switch is INTERNAL and depends on environment variables defined
by IDE application when running cmake:
- Qt Creator, detected by QTC_RUN environment variable
- CLion, detected by CLION_IDE environment variable
- Visual Studio Code, detected by VSCODE_CLI environment variable
Change-Id: I44086376109a8af8ebb7ecd8bf64dc34f0631527
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit d1d80d7be5a6c08cbbb1c86af2ad22d22ba95864)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qdoc does ignore image directories if no file with 'known' suffix
is found.
[ChangeLog][qdoc] *.webp has been added to the list of default image
suffixes.
Change-Id: I49524ea13d14dd7e246401dec7deb2ba4e66cb07
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit bb2ff8a69f8bec057c944610f8c4c97009e27ed1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Similar to the Windows QPA plugin.
Task-number: QTBUG-109394
Change-Id: I8e094e4ec49574441d3fd73e7ac2cc6fe3b5fd5f
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 269f44aebc4adf938405b9c08c5c043bad392448)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit 3715cc356153bd8bc384ce4badfe6baece3d3768.
Reason for revert: Adding NO_CMAKE_PACKAGE_REGISTRY doesn't resolve the initial issue. So reverting this change as redundant.
Change-Id: Ifdb6e1b68e112f727a7e83bfa0d2665c49b5e20e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The crash would sometimes happen shortly after removing a torrent
since the RateController would still try to use it even though
it had been deallocated.
Task-number: QTBUG-110622
Change-Id: Icad1531ea58560a3a3157a3ed8c0e6b283573196
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
(cherry picked from commit 32098963f2af064cce42fd5477f2a3137a315aba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Because of the .size() used as part of the expression it
ends up copying sizeof(qsizetype) bytes to the array,
instead of the (rationally) expected 4 bytes.
Amends 69c31f6f68a1399c1fc1e545e318eaa40966fe85
Task-number: QTBUG-110622
Change-Id: I732e3f4bb5934ff3860087baa91f9bebbf044a7f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
(cherry picked from commit f3de92cdad7642e6c3425712823e1491768f2e56)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There is specific API for counting number of 0-bits
Task-number: QTBUG-110622
Change-Id: Ifa33862ff7b98a59f362bc52c492e8a037799835
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit d3c14454198d126a8d92c51a917fff556bdd596c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Removed `_DEFAULT_SOURCE` as it was not consistent, and possible didn't
work in the first place, and was masked by the exclusion of
`io/qfilesystemengine_unix.cpp`.
Amends fc3a9ee60159b2391cba2320cfdeeddb94d781f8.
Task-number: QTBUG-109394
Change-Id: I8036e66d29d5ec88608d284436b4e8719144f06d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3c1bea178c3e23719dd98d931c056e34a680ff3c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add export to be consistent with the declaration in
qdbusxmlgenerator.cpp.
Task-number: QTBUG-109394
Change-Id: I08c915a7ee737617388db4c0d1a3d116cb8bc3a1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 465438e1b1476864c1e952c3bff69fe8252d835c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This collides with a similarly name struct/object in qmutex.cpp.
Task-number: QTBUG-109394
Change-Id: I29404f092db523e21f310b4e5b3cd8cc35170e4a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 950e9dad0e7f1fafb45b7cbb6aa6673af613cd07)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It now generates its valgrind.h from a valgrind.h.in, but there were
only two @...@ tokens to substitute, so that was easy enough.
From reading the diff, important changes:
* Added x86 support on FreeBSD (32- and 64-bit)
* Added nanoMIPS support on Linux
* Inline assembly fixes for S390
* Added VALGRIND_CLO_CHANGE request
Task-number: QTBUG-110999
Change-Id: I66990c958cf40c34e7d58dd60b1e11984303fb64
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit daceee6a9004565cee6ccd50c6a96216066b4f29)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We so far refetched the first observer after evaluating bindings, as
binding evaluating might change the list of observers.
However, that approach did not take into account that the 'this' pointer
might no longer be valid after binding evaluation: In case of a
QObjectBindableProperty (or a QObjectCompatProperty), binding evaluation
might cause a reallocation of the binding storage, and consequently the
invalidation of the QPropertyBindingData.
Fix this by refetching the QPropertyBindingData from the storage (if a
storage has been provided, which is always the case for the affected
classes).
Fixes: QTBUG-111268
Change-Id: Ie7e143a0bbb18f1c3f88a81dd9b31e6af463584f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit b124171309b259d429bd064fe3bfdec148869ef4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Drive-by change: use UTF-16 instead of UTF-8 for Eastern Arabic
Numerals, both are not human-readable but UTF-16 is one code point
instead of the two for UTF-8, less \x.
Change-Id: I721f3989b7d776ddc4f9d337b21dca9d398fcc0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 360f69b74b5e28ea1cfb0ed1ead624d0323dfe09)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Increase to 16GB from 3.5GB. Increase to 6GB was not enough.
Increase to 16GB fixed tst_QByteArrayLarge cases failures.
Task-number: QTQAINFRA-5391
Task-number: QTBUG-108832
Change-Id: I97e263fbc2caa7908c706d1c683a4fa868afa7b6
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
(cherry picked from commit cd197104d8028828176191c4ec01940ae63cbc6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Constructing from const char* etc is already covered by
constructorQByteArray.
I took a guess that the "// b(10)" comment is about testing constructing
a QString from a QChar[] that has an explicit \0 charcater. I tried
finding what the initial intent was but the trail went cold at the
"Initial import from the monolithic Qt" commit.
Change-Id: I15bcdb24e55286eb6cd3056af0714a1eed581635
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ff7848318f565a55b914cd4ac79651f3650efaad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Make QLibraryPrivate::load_sys() return false on static
wasm builds.
Emscripten does not support dlopen() in this configuration;
calling it will abort the program. By returning false
we give QLibrary users an opportunity to handle the
error.
Task-number: QTBUG-109076
Change-Id: I32d1fde04cc54d1622e0743712b6372b023aa006
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
(cherry picked from commit 490c4558f79ff4ca95a1ff1ccbe5a3d956786e77)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Adding the toolbar to the main window leaves it up to the main window
how to handle ownership and placement of the toolbar.
Change-Id: Id429cbad9d5973931a86fcb899684e3651694fbb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f99df426466c048c16c3af0a89e7923c0db23818)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There is concern about string-based connect() source compatibility in
the case that a signal argument has a different type name.
Amends bc857f466d297e5656fadad4987f218900d6b1a6
Change-Id: I2618b8c5f62b39717e4f7043d07168e808390b1d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a3b90360884dd11d896c43c74d64ff8d8f047052)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Some platforms do not work with forward declarations, mainly android.
Change-Id: Ie34a30ecb8554d77c1bea4b65a752d63ba819af9
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit e3fdd9715fa220d909689def10e9b72c14083e09)
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Change-Id: Ie19523b84026312c3d5a597914abc2622dba3f68
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit 0510307ea1bfe2a1788738acb61890587e75dd5e)
Aggregate the names of the same value enumerators. The values can also
be hexadecimal so handle them also.
Change-Id: I89693d7e3b8f6c051b298401dcbe8a9f5c0a38aa
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit 83effb3a3f6bf73e682f7a9ccedebf4073ade776)
Remove the deprecated timeStamp argument from the parseHeader function.
Fix signed/unsigned comparison between file size and buffer size.
User the correct oder when initializing variables.
Change-Id: I483cc175c9aaf42917053b6731833e1b4f5cad3a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 2a69f96e162544686d7c2a31439b3ea69095162f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If the application executable was built against a pre-macOS 11 SDK, macOS
will report its version as 10.16 on every OS from macOS 11 and up, for
compatibility reasons.
From Qt 6.2 and up, we require at least Xcode 12 with the macOS 11 SDK
to build Qt applications, so normally this should not be an issue, but
in the case where the Qt 'app' is a plugin library hosted by a third
party host application, the host application determines the behavior,
and we might end up in the compatibility situation after all.
However, since the Qt app was built against at least the macOS 11 SDK,
we know that it can/should handle the new version number scheme, and
we can resolve the real version number for QOperatingSystemVersion.
We do that by launching the sysctl binary with the SYSTEM_VERSION_COMPAT
environment variable set to 0, which is the supported way of disabling
the compatibility mode.
Now that we have the real version number we can use that for the
deployment target check via qt_apple_check_os_version(), but we
still need to account for possible failures in reading the plist
file.
We can also simplify the QOperatingSystemVersion::MacOSBigSur
definition, now that we always know the app the should be able
to handle major versions above 10.
Task-number: QTBUG-111114
Change-Id: I2a2756381c31b195f7b8800c5008a87b37114080
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d05f2fb2d567617730d7d4757fff39ddc3e903ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Otherwise, double-click recognition will fail.
Use QEvent::clone when possible, or set the timestamp explicitly when
not.
As a drive-by, remove some long-dead code in affected code lines.
Fixes: QTBUG-102010
Change-Id: I882bf6e8090bf6f182b7a0a3c62aa3a4c8db2e14
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit fb09c82a2c7c44d41a0a36d8fe6d6d22e792668a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replace local built-time enabled macro with a logging category.
As a drive-by, move QDebug streaming operator into the anonymous
namespace to prevent external linkage, break some excessively long
lines, and remove dead code.
Task-number: QTBUG-102010
Change-Id: I49d212ee4a66a3eabfa5567f6c8d9674ffbb8880
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 5edb1bed3fc360276aec3e678f8b46cb40dd5d26)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I.e. the second arg to QCOMPARE isn't what's being tested.
Drive-by changes:
- More _L1 usage, less blocky and easier to read
- QCOMPARE's second arg can be a View, it is smart enough and can
compare them just fine
- Replace a "//15 chars" comment with a QCOMPARE check
Change-Id: I4f4b84b16b543df37b0ba2f9dd781b045b2ed397
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit eb4641210c9132e736d666bd39408a5e5ead8c61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As of macOS 10.14 the keyboard assistant background is shipped as part
of the compiled asset catalog of the app, so looking it up via a URL
will fail.
Instead we look it up via NSBundle's dedicated image lookup function,
which handles both cases.
The logic has also been moved to qwizard.cpp, since the additional
plumbing via QPlatformNativeInterface was unnecessary.
The keyboard assistant itself no longer shows the background image
as of macOS 12, so we might consider doing the same, but the design
of the assistant has also changed significantly, so as long as our
QWizard layout looks like the old keyboard assistant we keep the
background as well.
Change-Id: I7d42dd79b285f3518837458864bca6bc353b3b6d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit c26c91b2088a05bbe1ed3b529a4b0fc0ea9d3a92)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Document the potential issue caused by using QT_ANDROID_EXTRA_LIBS from
the project build tree.
Inspired by QTBUG-111173.
Change-Id: I39fcda6e19b15eb13a390978230944dad41ec8d1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit c4d177897c74fa657e57df51f335a0a621b9c081)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Application delivered via the macOS or iOS App Store might have their
libraries encrypted, in which case we can not read any of the sections
of the binary until it has been dlopened.
This was causing issues for our plugin loading code, which assumed we
could read the .qtmetadata section of a yet to be loaded plugin to
determine its suitability, before loading it.
We now detect whether a library is encrypted during the Mach-O parsing,
and propagate this back to QLibraryPrivate::updatePluginState(),
which can handle the case by explicitly loading the library before
continuing with metadata validation. We still ensure that the library
has a .qtmetadata section, so that we don't need to dlopen any random
library in our path.
This does mean that we will potentially load more plugins than we
need, and since the Qt version validation happens as part of meta
data validation, we might dlopen() incompatible plugins, but it's
expected that in an App Store deployment scenario you control both
the versioning and set of shipped plugins, so this should not be
an issue in practice.
As encrypted libraries are only produced for apps that are fully
published to the App Store, and then deployed via MDM, VPP, or
Apple Configurator 2, we don't have an easy way to test this,
but the existing code paths should be unaffected, and hopefully
this patch improves the situation for the encrypted library case.
Change-Id: Iff733505f7067ce5571854ea978bc95e8376e347
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 667aec810f71ac378a618032846df4bb6d76c647)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If -unity-build-batch-size is not given, we default to CMake's default
which is 8. In QtSetup.cmake, we explicitly set the default to avoid
having it set to OFF in case it is missing, just to make sure that we
don't get any unintended behavior.
Task-number: QTBUG-109394
Change-Id: I19849e9baa507b64fb23847c740e20a7adc61b8f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit ed26352a1009ce37fe792c023af9e5d6259ea6d4)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
- Port macros to QTest data rows in separate unittests
- Move DOUBLE_TEST-related data to toDouble() unittest
- Drop one redundant unittest:
QTest::newRow("const-charstar") << (const char*)0;
Change-Id: Ie809895e9f5d58c2d3ec419689f409b55e24fcf7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4499600fc78fb7226388db554f9fa95bd59161c4)
The QSslCertificate ctor is somewhat expensive, especially when we are
shutting down. By using optional<> we simply reset() it and no longer
need to create a new, valid, certificate.
Task-number: QTBUG-102474
Change-Id: I514433b0d380dd3ceabbed3a6164f7e3efc490c7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
(cherry picked from commit 61bfe87a64ca322de0ebf9bf61a0a0a81ee5bf7d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
And switch to using test data rows (rooting out two macros in the
process).
Change-Id: Ib31e6b59f90f0983c0efc4bef7cb246aedfcab5b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fcb9ef50622a40bf35f24e833a9d135a65ee3f10)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Change test data to compile with NO_CAST_FROM_ASCII uncoditionally where
casting from ASCII isn't what's being tested by a unittest.
The goal is to add a variant of tst_qstring that is compiled with
QT_NO_CAST_FROM_ASCII so that the unittests cover that code path too.
The commits are split into smaller chunks (where there is a common
link between changed code, that code is put in a commit, otherwise I
kept the number of changed lines below ~150) to make reviewing them
easier.
Change-Id: I14256f1bde7749a3023753dbb7ed8be72cb6bc14
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6e5c6ef739565829039b4de7845e4b71b11b4c10)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It was only used by QMacToolBar in QtMacExtras, which no longer exists
in Qt 6. Attaching a toolbar can be done manually via the NSWindow of
the NSView retrieved from winId(). There are no public uses of the native
interface in GitHub outside of Qt.
Improvements we want to make to toolbars in QtWidgets and QtQuick in the
future, possibly backed by native toolbars, would be done behind the
scenes and would not need this API.
This effectively reverts e8fd6b9604bac334404dc52daa63b9e6d9cd71d8.
Change-Id: I33b090fa19f9f3af029ae8c269efcf739a4b1b22
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 5d13e05651af04d471f110c782cbce85f54d1cb7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add exclusions for issues that are likely not fixable
(3rd party code, X11 define clashes, etc) in 3rd party,
tools and plugins.
Task-number: QTBUG-109394
Done-with: Amir Masoud Abdol <amir.abdol@qt.io>
Change-Id: I698c004201a76a48389271c130e44fba20f5adf7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 64dc6fe87d05aaad3ce516747ad6dbd048f388cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends 17c1ebf8bfd254ff75cc55e335d1c1fb01da547f, after which dragEnabled
item views toggled selection on click rather than on press. If the edit
trigger included SelectedClicked at the same time, then Ctrl-Clicking a
selected item would start editing the item, instead of toggling
selection.
Fix this by ignoring clicks with modifier when evaluating whether
editing should start.
Extend the mouseSelection test case by including a column for the
editTrigger, and cover the respective combinations.
Fixes: QTBUG-111131
Change-Id: I9605f9b3d5a49e292551a34c3c4c7a5f9ecb2a89
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 557dcd8a87c6c6c77ccc71a85b1ec349c69eb4c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The bearer code hasn't been in Qt for some years.
Change-Id: Id69ad1ce5035a0970f3507d4b6ba4a5549bf1d6c
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit d5e98cde1a1da17df1c82e697ce786878e71511c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There are two problems in emplace_impl() (the same code exists as
rvalue insert() since 5.10):
First, the old code updated size() at the end of the function.
However, if, after constructing the new end element, one of the
subsequent move-assignments fail (throws), then the class invariant
that size() be the number of alive elements in the container is
broken, with the immediate consequence that the QVLA dtor would not
destroy this element, but surely other unpleasantness (UB) that the
C++ lifetime rules decide to throw our way.
Similarly, in the trivially-relocatable case, the memmove() starts the
life-time of the new end object, so if the following placement new
fails, we're in the same situation.
The latter case is worse, though, since here we leave *b in some weird
zombie state: the memmove() effectively ended its lifetime in the
sense that one mustn't call the destructor on the source object after
trivial relocation, but C++ doesn't agree and QVLA's dtor will happily
call b->~T() as part of its cleanup.
The other ugly thing is that we're using placement new into an object
that C++ says is still alive. QString is trivially relocatable, but
not trivially copyable, so we can't end a QString's lifetime by
placement-new'ing a new QString instance into it without first having
ended the old object's lifetime.
The fix for both of these is, fortunately, the same: It's a rotate!™
By using emplace_back() + std::rotate(), we always place the new
object in a spot that didn't contain an alive object (in the C++
sense) before, we always update the size() right after doing so,
maintaining that invariant, and we then rotate() it into place, which
doesn't leave zombie objects around.
std::rotate() is such a fundamental algorithm that we should trust the
STL implementors to have optimized it well:
https://stackoverflow.com/questions/21160875/why-is-stdrotate-so-fast
We know we can do better only for trivially-relocatable, but
non-trivially-copyable types (ex: QString), so in order to not lose
the memmove() optimization, we now fall back to std::rotate on raw
memory for that case.
Amends dd58ddd5d97f0663d5fafb7e81bff4fc7db13ba7.
Change-Id: Iacce4488ca649502861e0ed4e084c9fad38cab47
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit e24df8bc726d12e80f3f1d14834f9305586fcc98)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The former is much safer to use in the presence of overloaded operator
new, and forms a tiny step towards a fully C++20-constexpr QVLA in the
future.
Change-Id: If1b31c06296a60c39f1c9f9da523e208ecb1248b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 230bc059ae50a16346700a47090dcb97d239e8c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
using fileName is more correct in this case.
Task-number: QTBUG-98974
Change-Id: I7c547bfc1c2321d4817dc087d3e962dbc2a0b7fd
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit df47d7d1ff2ac45ab5c6cdade89e5e1857f12479)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Its only client was QMainWindow, but that use was removed in
3b8b47db6aaeb333f106cff57cc712b01d828302 and replaced with a
call to setContentBorderEnabled.
This effectively reverts 0caaf9966a8e4ea1e83de866020e61fd5ffaec1a.
Change-Id: Iaba4d5fd9256632b4a3b935e3fb30d7f5c39851e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 19fc78e9672f4350a06790a9a0f0edba75244875)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qmainwindowlayout.cpp:(.text+0x2976): undefined reference to
`_q_tb_tabBarShapeFrom(QTabWidget::TabShape, QTabWidget::TabPosition)'
_q_tb_tabBarShapeFrom is implemented in qmdiarea.cpp which is not
compiled when the feature mdiarea is disabled.
Change-Id: Ib0c6447b9381b8ce01542fabf831a9db7f5e6675
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7346de649195d7fed39fa31ab1b11f42cd62f3a9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Allow forwarding the NO_CMAKE_PACKAGE_REGISTRY option to the
find_package call from qt_find_package.
When we look for host tool packages the package dependencies are
recorded in the cmake package registry. This leads to the situation
when the lookup retry will use the package that is already found in
host path instead of looking the right one in target paths.
Adding the 'NO_CMAKE_PACKAGE_REGISTRY' to the qt_find_package calls
suppresses records in cmake package registry and starts a clean search
using target paths.
Task-number: QTBUG-111140
Change-Id: I97ce1755b2f8e3413f1b0276fe26568b2f5efe33
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 545400addd7935c87ec79596ac3010b4f9016a84)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit 854986836a581da694d169744e5487c5ce5f44bf.
This reverts commit 392d9a54194d06e96bfebdaf081aa6c9787e33ab.
Turns out that enabling this option is now breaking the Qt build,
because tools that are called by the Qt build cannot run anymore due to
the lack of rpaths.
Before, QT_DISABLE_RPATH was simply turning off Qt's additional rpaths
but left CMake's rpath defaults intact.
To implement a working -no-rpath switch we must add Linux and macOS code
paths to _qt_internal_generate_tool_command_wrapper and set
LD_LIBRARY_PATH/DYLD_LIBRARY_PATH and friends.
Fixes: QTBUG-110816
Change-Id: I021d5e6cd775cbe5b2411d6771ab2545cb04f799
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 2af494c93076cd2acf4493501e472147422a7670)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Not clearing the continuationData could lead to use-after-free when
there is an attempt to cancel an already finished future, which belongs
to an already-destroyed promise.
This patch fixes it be explicitly resetting continuationData to nullptr
in the clearContinuation() method, which is called from the QPromise
destructor.
Task-number: QTBUG-103514
Change-Id: I6418b3f5ad04f2fdc13a196ae208009eaa5de367
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit b34bea5e96370986ea5dfc499fc2ec6366fda627)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A recent update moved handleScreenChange out of being a private slot.
Porting to the new syntax fixes the warning and moves to a compile-time
check.
Change-Id: Ibd85c6caf7dca051d669250a94a82fbddbd3435d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ec8e6ed20034a5ea7d32bdc62b3b9dc91ce68d36)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Based on discussions in the 6.5 API review, where we concluded that
'appearance' is too general. Instead, we follow the CSS standard
and use the term 'color scheme'.
Change-Id: I8ceaf4138ecadff5ccd962480e8e5beb39b556ec
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Jonas Kvinge <jonas@jkvinge.net>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 32749c913b32e89e2027227233794f2296166cc6)
For QT_PLATFORM_UIKIT 'PicturesLocation' manually appended by "assets-library://".
When converted to QUrl, such a path becomes a valid url, having empty path
and scheme "assets-library". Later in QIOSFileDialog we convert this
path (options()->initialDirectory()) calling QUrl::toLocalPath, which
gives us an empty string and thus we erroneusly select document picker
dialog, not an image picker. So let's also check a scheme, not path
only.
Fixes: QTBUG-107844
Change-Id: If4dd453549b37933cba07b5d7af6e45f2504dd29
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 402a526b2a87cbf6b7466bacb9dd3d8b7c71d9b2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
1. Remove unused include.
2. Replace unnecessary null checks with asserts.
3. Remove dead code after the cleanup.
Change-Id: Ia3c01ae8a1fb491d513071c09f8095c93e35c292
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 09141ebad7109b90e5dfdbf3b065543b8be14641)
The code for the QMetaMethod queuedConnectionTypes overload relied on
QMetaMethod::parameterMetaType and QMetaType::flags() to detect whether
we're dealing with a pointer (and then use the VoidStar metatype instead).
However, if the type was incomplete when the slot was defined, and the
type was not registered when connect was called, we would not find a
metatype for the argument.
However, in that case we might still be able to handle the method, by
checking whether the type name of the arguments ends with a "*".
This patch does that, fixing a regression from 5.15.
Fixes: QTBUG-108537
Change-Id: I54cc48a3343444480ab9094fe1ebaaa5aa75cee0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9483fcd68aef250c56a74556258dc80d9cc58220)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Using seconds because then they all have the same type, even if
all-but-one could use minutes.
Delete one unused interval value.
Task-number: QTBUG-110622
Change-Id: I66b456de8a4b867859e9e2b13ce72e8ec691c79a
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 3fc26dbb2cfe07d1ae0acf4e18b6c94b64e56662)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
That's not fit for an example...
Task-number: QTBUG-110622
Change-Id: Ib196d61867f95f3ff2e45841509d49df9360ad25
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 22fc1d08bb666bb91470ad3759b91256a56ef4fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... and use QtEndian instead.
The conversion would be done even on a big-endian system, so the
example would not work correctly on such machines.
Task-number: QTBUG-110622
Change-Id: I6a660ff68fa5a8d9b4c1faf9e264d937c605c47e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 69c31f6f68a1399c1fc1e545e318eaa40966fe85)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... rather than the other way round. This ensures that the latter's
check for value-in-range is correctly handled.
Task-number: QTBUG-109580
Change-Id: I21c2e7c1787c8f57e6893353e42261c013b648f6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit ff7d5809f1c8b27d62201c77fd1ea556a4fe3cc8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Return the file engine impl of QFileInfo::completeBaseName() and
QDir::absolutePath() and QFileInfo::fileName() (based on
QAbstractFileEngine::BaseName) if the file engine impl is valid.
Amends f77668ffec48d8aaad7c74069c6f3e770a305ae1.
Task-number: QTBUG-98974
Change-Id: I28a8c75a6f25e30012b0791c12dbde51bfe8f62c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 249d613a60aa6a1347ebc1c29902049247b93324)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
As a networking example it doesn't contribute much. But it has some
interesting uses of widget/events
Change-Id: I194d32e6a304ae41819c20751e9f1ee1d9b5abdb
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
(cherry picked from commit 21453410713650a97a074a8f3d78afbb4c70e6b3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Once tessellation and geometry shader support is added, the check
makes no sense when there are additional stages between the vertex
and fragment stages.
Change-Id: I3d3c0a5b338f5fe191c072a13a8699924f7a6a1b
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 5476973325288e399f99af004e53184e41892282)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Functions generally don't have a \brief section. The
Uint8Array conversion functions were introduced in 6.5.
Change-Id: I1d366d7506327128f7eedd71310e570ade6fc66c
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
(cherry picked from commit 062b919047a97f20499785cedbf8acc98548efa2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
1. Use Q_D and Q_Q instead of d_func() and q_func().
2. Use early return.
3. Remove unnecessary semicon.
4. Add one new line to separate two unrelated functions.
Change-Id: Ie6171c857f00ca171e97723a0d517d2295bbbbd1
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 528f28f380e3f0c55b9a305f6b208dc1a2db73d6)
When pressing the copy key the view tried to access the model's data for
the currentIndex() without checking whether the index is valid. This
resulted in debug output to the console, and might break models that
didn't check incoming indexes for validity (or asserted validity).
Fix this by checking whether the currentIndex() is valid before reading
the model's data for that index.
Fixes: QTBUG-106569
Change-Id: Ide75fbdfdbd1451ab6d48f07b22136553c5b2468
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 3a0c33da3d913431391c5b7f4f0e93ea9d2221dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QPlatformTheme::removeMnemonics() removes any match to /\s*\(&[^&]\)/
from the text it is given (a menu entry). It transpires that
translators are apt to use the full-width parentheses (compatible with
some far-eastern scripts) instead of the plain ASCII ones. This leads
to their translated mnemonics don't match the same pattern unless we
treat the full-width parentheses as a match for the ASCII ones;
consequently, they don't get removed, which this function exists to
do. So teach it to recognize the full-width versions, too.
In the process, break out the pattern-matching (aside from the leading
space) to a lambda to make it easier to read and document.
Fixes: QTBUG-110829
Change-Id: I7335d0bd8dbba66e1fe58fc3eec93caaaf6ec140
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 86b930f073b6b75790a6af8d021f4daa00f80aae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If a slot connected to a QMenu-action destroys the QMenu, then
we must not touch data members in subsequent code, and instead return
immediately.
We cannot use QBoolBlocker here, as that would reset the data
member of QMenuPrivate even when trying to return early.
Fixes: QTBUG-106718
Change-Id: I6b5ea471b1bf1f9864e1384382100f8f6c01346f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 52ce4d2d29db8a44fa2fa817cab9ebe969db082e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Added the qml-deploy-dir option, which deploys imported qml files to
the directory passed as an argument. If no option is given, a "qml"
directory is created, and files are deployed there.
[ChangeLog][QtTools][Windeployqt] Windeployqt's default behavior is
now to deploy qml imports to a "qml" directory inside the deploy
directory, rather than directly to the deploy directory.
Task-number: QTBUG-99516
Change-Id: I49262a38c4a42ef20b05b603f5eb5393fe9cc218
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 0b4286ff28748ae1e47d8750f1899df2eb85357e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Child windows can't be e.g. fullscreen independently
of their parent window. They should probably be allowed
to take the WindowActive state though, so let that
one trough.
Change-Id: I857029f680d2fb274ba38705f6b687be45f46761
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit b7046ec2ac74e92a37b40e162108e78119b0a3b0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Few tweaks:
- Remove extra closing parenthesis
- Use absolute paths as the exists() checks & other plist path
uses are relative to the permissions.prf location
- Use the plist path with PlistBuddy instead of the variable
from .pro file
Change-Id: I27c7f1e7044a55ff7fbd78ef1dd79c92b17e8018
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 7c186422444458f30ec7f7e59060c900e845536b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The latter needs the value_type to be default-constructible, which
shouldn't be required to clear() a container.
Use std::destroy_n() instead.
[ChangeLog][QtCore][QVarLengthArray] clear() no longer requires the
value_type to be default-constructible.
Change-Id: I806de8f3826b50c0bd38156892c3afeb15f13ac9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fbfee2d7c59a7c6cd17ae7a3f63f983b9f3316f5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix several issues in 72c2cdbc572f8b8b45a57a451e2bc19bb1c53b0c,
which I was too slow to review before it went in:
- use the correct feature macro, not __cplusplus
- use the correct signature (return T*, not void)
- don't make the function static
- add a comment mentioning the material difference to std::construct_at
- drop unneeded <qxptype_traits.h> include
Task-number: QTBUG-109394
Change-Id: I39d1908f565b1c1a31d5741924ac173447ec9057
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 67ed712235375fa1d1b9ea0e5c71755886f65f83)
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
MYSQL_TYPE_JSON was introduced in MySQL 5.7.9 but our documentation
states that we still support 5.6 so we have to define this value by
ourself for the older versions.
Fixes: QTBUG-109832
Change-Id: I935edb14495d162ed58109610946b2805d37bbc4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5bc61ec5d028d57640b9c4cd515ed7dfebac945c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On macOS, key combinations with the Return key do not get delivered
through NSView::keyDown, but they are seen by the
QCocoaNSMenu::menuHasKeyEquivalent override. We already use that
override to check whether any menu item uses a matching shortcut, and
give Qt's focus object a chance to override the shortcut. The key
mapper used the NSNewlineCharacter '\n' for Qt::Key_Return.
However, the character we get from macOS for the return key is the
NSCarriageReturnCharacter character, '\r'. This makes the lookup
fail, and shortcut overrides are not delivered for shortcuts using
Qt::Key_Return.
To fix this, map Qt::Key_Return to NSCarriageReturnCharacter. The
inverse mapping maps both NSCarriageReturnCharacter and
NSNewlineCharacter to Qt::Key_Return, and there are no other users
of this function in Qt.
Fixes: QTBUG-107526
Change-Id: I716190adf3cd94697e2b3ad1afc25b95d8ebde25
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 0835537c3c3a8b7991b7a6e4a877a13f165a66e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
dfb4697e4a4828acd47292a89207b3975ec6766e made a change to selection
behavior that resulted in a regression where clicking on an item view
but not on an item would cause the current item to get unselected.
Changes the behavior to not update in this case.
Added a new test that specifially checks for this scenario and ensures
that the current item is still selected, even after the user clicks on
empty area.
Fixes: QTBUG-105870
Change-Id: I191c3878819b99897083039fba0ab43908da5429
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f11e5435c776deddf27f7759180c1d41f64b8cce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Painting wide lines and filling would be clipped to cliprect (by
default, the device rect) only if the bounding rect coordinates
exceeded QT_RASTER_COORD_LIMIT. In Qt 6, that limit was raised from
2^15 to 2^23, so a lot of time could be spent on rasterizing elements
that would anyway be outside the rendering area.
Fix by instead clipping whenever the path to be painted overshoots the
cliprect by a significant margin. At this point, the path is already
flattened to straight lines, so clipping is quick and precise. Testing
indicates that this solution improves performance a lot when large
portions of the elements to be painted fall outside the cliprect,
while not causing significant performance hits otherwise.
As a side effect, it is then no longer necessary to test the bounding
rect explicitly against QT_RASTER_COORD_LIMIT, since we already make
sure that the clip rect we check against is within that limit.
Fixes: QTBUG-110595
Change-Id: Iaf1afbb481c2d7059405f334278796ad46f5bcb6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit ce7b4c734b78d24b75ecb389cf799ce85d0cc3bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I don't begin to understand the semantics of the trackers here, but
whatever they are, they break with the fallback std::swap() 3-moves
implementation and lose track of alive objects, so provide an ADL swap
that does the right thing.
Amends dd58ddd5d97f0663d5fafb7e81bff4fc7db13ba7 (I think).
Change-Id: I1cd49c95dca2d103a26c2c7ac0a896929135a6c8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 49fca96d88c308bc22cd898a8d202228d185654e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Cleanup the generated message regarding the configuration summary. Also
moved the flushing into the helper function.
Change-Id: I45728ac5b43613f002b6d5b07b9ad037416c4fff
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit bb42e8e2c66cb4bd2b56c2e1df2e7e77cf98e501)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- Check if trace location is writable
- Call fclose only if file is opened
- Convert metadata to QByteArray in one place.
- Add constraint to array operator.
Change-Id: Id01998fe8e754dab7a4b7d8ce1361ac822d01390
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
(cherry picked from commit 1d0da1d683cc71ea14cfd85f5e9aa227d7f75762)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
isHexDigit, isOctalDigit, isAsciiDigit, isAsciiLower, isAsciiUpper,
isAsciiLetterOrNumber.
This de-duplicates some code through out.
Rename two local lambdas that were called "isAsciiLetterOrNumber" to not
conflict with the method in QtMiscUtils.
Change-Id: I5b631f95b9f109136d19515f7e20b8e2fbca3d43
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 498f3452285aa44580e1d03baeec126d475f8401)
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Somewhere between libmysql 8.0.18 and 8.0.27, the MYSQL_TIME structure
gained an additional member which increased the struct size by 4 bytes.
This makes an internal check for the correct size of the structi go fail.
Since it can now happen that the plugin is linked against a new libmysql
and used with an old and the other way round, duplicate the old
MYSQL_TIME struct to use this in our code
Fixes: QTBUG-110967
Change-Id: I5bc631179a0a1be47a5966954e757f27a72f1592
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c67cc6d5706fa732ee78e286e0142f97f5b9d61f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
MSSql Server sometimes returns SQL_SS_TIME2 instead SQL_TIME. Since this
value is non-standard, we have to define it by ourself.
Fixes: QTBUG-109206
Change-Id: I40a4b32590d877ebfdc4b2f1d9080d8cdb2ae7a5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7ebac2081244bc1f075bc16da6ce59cbd5122c7d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Change-Id: I300ecb9d25f0ecb7208c643704adf66bdf0a4b56
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit c6ba34c7f82653fffbc43bc9b4a93442c75359ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These can be removed now that the modules use tracepointgen tool.
Change-Id: I265e019f99e1ccc557a284ff53b110073066e530
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit 48f0d458a941574ebb6b1ca6fd2ef5c8676726ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This fixes the metadata generation when cross compiling. The metadata
needs to be generated based on the type info of the target. Currently
the metadata is generated in the tool based on the host type info.
Task-number: QTBUG-110270
Change-Id: Ibcdcbd690620afc532d6007cf036229342bdcc31
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c5d4c9345bc5a8d146592a7b933242fcf22358ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Handle cleanup of the CTF plugin correctly. The cleanup causes recursive
trace event so the plugin needs to handle this.
Change-Id: Id6f4c6efe95e51332a8be97fecdf7886ba173e43
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
(cherry picked from commit b652d9753bb474b3bc6c881dcb4b40a5a01ddcff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qtbase/src/widgets/styles/qstylesheetstyle.cpp: In function ‘quint64 extendedPseudoClass(const QWidget*)’:
qtbase/src/widgets/styles/qstylesheetstyle.cpp:2577:1: warning: control reaches end of non-void function [-Wreturn-type]
2577 | }
Change-Id: Id53d637d43a8d530a7bdfbd7d5b823162d1399b5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 29e739f93852dcf3d431bd944b3ec7ac5c7bf3fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Disable xcb touchpad gesture when gestures is not available
Change-Id: Idd2fec38646fad4cbda20ab1e560949c8e8844ff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 79b8bf983dc86bc423ec8016d9e3fd5588a3cbed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The "Private Use Area" are subsets of Unicode which are not
considered regular characters, but reserved for fonts to provide
custom glyphs.
If these were used and the main font did not have support for them,
we would look them up in other fonts and sometimes display an
arbitrary selection of glyphs, based on whatever existed on the
platform. This is unexpected and different from how native apps
work on Windows, for instance.
[ChangeLog][QtGui][Text] Font merging (automatic assignment of
alternative fonts) is no longer applied for characters in the
Private Use Areas of Unicode.
Fixes: QTBUG-110502
Change-Id: Id2c63786aafda59bf170e0d7263eb78a391fe46d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit fc33fea999365c36ed446eee0db0d59d94be306b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The tracepointgen tool needs to know the enumeration/flag names
and values in order to generate metadata for the tracepoints
in order to pass this information when tracing.
Currently the metadata needs to be provided to the tracepointgen by
hand. This implements metadata parsing from header files.
Task-number: QTBUG-110598
Change-Id: Ibb2cc6e724fd2defca4e301af2285b0fdbe8e7f7
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
(cherry picked from commit 59aa9e86c6424234d1898c216dcd9c03ea4ac0d8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Based on discussions in the 6.5 API review, where we concluded that
'appearance' is too general. Instead, we follow the CSS standard
and use the term 'color scheme'.
This patch is a first step, only introducing the new API, so that
submodules can port over. The next step will be to remove the old
API and transition the docs and platform themes.
Change-Id: I43cdb6bb1ccb49c535c06b1897821467fd83ca60
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 92f5836fe8611d6f7a70efcc3b0dd5db262ba175)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
gethostname is in no way labeled deprecated, but it _tries_ to query
some deprecated functionality, thus some warning like this is printed:
""
LogHr(1) tid(6e14) 8007277C No such service is known.
The service cannot be found in the specified name space.
""
By using GetComputerNameEx we work around that. Bonus side effect is
that it gives us UTF-16 right away so we save a conversion.
Fixes: QTBUG-110468
Change-Id: I3a370354d9cce50e3d89d125ce61fc9b619294cc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 0f50145e433d2ac4ad2f4371ce627d2e0c2e0efd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
"GLOB_RECURSE" files in the QT_ANDROID_PACKAGE_SOURCE_DIR directory
if it's specified and expose them to IDE.
Fixes: QTBUG-110810
Change-Id: I3c4d4fdf0dff8965fd277672ef9d77453839b4cb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 478a5248f329172a9c371947ca4b24cfe60e8c82)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In developer builds we don't install tools, so syncqt executable is
located in its RUNTIME_OUTPUT_DIRECTORY but not by install path. This
works fine in general case, but in multi-config builds the
RUNTIME_OUTPUT_DIRECTORY path doesn't match the install path. So syncqt
target points to wrong location in this case. It makes sense to use the
existing IMPORTED_LOCATION of syncqt executable directly if Qt is not
supposed to be installed. Also check if the syncqt executable exists at
the expected location before creating the imported target.
Fixes: QTBUG-109864
Change-Id: I0de647b2a73169a0d48bd88edeb7ff00975fa774
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 2bf54da75ae77ca4f660dc23ef9c917e5eb86a9d)
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Set the RUNTIME_OUTPUT_DIRECTORY for configure-time executables so
executable will be located inside the QT_BUILD_DIR. This allows to
re-build syncqt and make sure ithat ts binary is replaced and located
in the libexec directory.
Comment on how to rebuild syncqt. Configure-time tools reserve the
original tool name for the imported executable. To re-build syncqt use
'syncqt_build' target.
Task-number: QTBUG-109792
Change-Id: Id7d912b1d75d18d82cb2a69fbd62b89440120d78
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 6f7d09677a0759328bd27388c320ff60b45c6aff)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The extra quote enforces the arguments to be string, and stops the
COMMAND_EXPAND_LISTS within
QtDbusHelpers.cmake::qt_create_qdbusxml2cpp_command from expanding it
as a list.
Fixes: QTBUG-110459
Fixes: QTBUG-110450
Task-number: QTBUG-99238
Change-Id: Ifddd6570c7bf8f2d1757f275d9445ce2924a93f1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 897579edabfadd8309581659b578752b3c3bca0f)
As we are now processing the arguments with
cmake_parse_arguments(PARSE_ARGV, we don't need to pass the escape
characters anymore.
Task-number: QTBUG-99238
Change-Id: Iea9cda4fe0ae56043cc4d7db29ce53d9d737d645
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 90aafa0470570d873292633ef7072fb02783cc06)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This replaces the qt_parse_all_arguments macro with the built-in
`cmake_parse_arguments(PARSE_ARGV`. In addition, a new function,
_qt_internal_validate_all_args_are_parsed, can be used to check whether
any _UNPARSED_ARGUMENTS have been passed to the function.
Fixes: QTBUG-99238
Change-Id: I8cee83dc92dc6acdaaf747ea6ff9084c11dc649b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7e82577680fb20413cdcfd93a982c52e9d9d095e)
The new version uses PARSE_ARGV which deals with semicolons better.
Task-number: QTBUG-99238
Change-Id: Ie9276219400326a67ffa9cf5fc456ae7de0bbcd2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit dc00369c56f5768bcbed06d6179ddb3f68fdfaf8)
Consider a Qt target created in a subdirectory and a call to
qt6_generate_deploy_app_script(target) in the parent directory.
Once qt6_generate_deploy_script (called by
qt6_generate_deploy_app_script) is run, the target has already been
finalized. However, qt6_generate_deploy_script needs to run before
finalization, because:
- qt6_generate_deploy_script marks the target as to be deployed
- the finalizer generates plugins information only if the target was
marked to be deployed
Fix this in qt6_generate_deploy_script by checking whether the target
was already finalized. In that case, generate the plugin deployment
information right away.
Fixes: QTBUG-109741
Change-Id: Idf60f9e21f038c1a33843177d9299230857ee70b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 6c28528e40bc0e730ef3828595b4ef83a373a697)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is needed for tracing android devices.
Change-Id: Ic04e15b43b426bdb1232e671acb4163165eab666
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
(cherry picked from commit 5ae8417c4f6348ab9f78a93fbb83e0c27c57d288)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Not all touch points are changed as per emscripten event, so we
do not need to remove or add them to the touch event
Fixes: QTBUG-110941
Change-Id: I4799ef0c05750a36361836698eb83e5bf844ece8
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
(cherry picked from commit 56068f3a36a2f8e23a2a5e43a28e463a5aa6b400)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The example follows bad and outdated practices:
- running time consuming and I/O heavy workload in the GUI thread
- calling processEvents to keep the UI responsive
- showing results only at the end of a search rather than continuously
Perhaps this example can be rewritten at some point to apply modern
practices (at least use a thread and emit signals), but it seems
to have low overall educational value.
Moving it to be a manual test for now.
Fixes: QTBUG-111002
Change-Id: Id630fd4599096448ea4f96bcbf977b11a039796f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 3fe0bf6e1bd3713543a5b763d3bfcee0c03faf4c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's not a very well written example, using (largely unneed) hacks to
implement what it does. It's also misleading - the syntaxhighlighter
example is a better showcase for building a useful code editor.
Move it to manual tests.
Fixes: QTBUG-111025
Change-Id: I405d41688235bf3e9a08373e716769f26d02fec6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 48a1a5564f89e1e8f0b6f4a28398e4ae0b3f751c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The example is 90% boiler plate for subclassing QFrame and providing
a bit of GUI to change the size of the label using sliders. The
interesting bit is a block of 25 lines of code, so turn those into a
snippet and add that to the QTextLayout overview documentation.
Fixes: QTBUG-111011
Change-Id: I6e97b2ea47b553c8d998ad185cfac006721ef7ee
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 55f2b448b0aec4e9a8fd3896b2a40f37e939ecb3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- The following commands accepts NO_UNITY_BUILD, and
NO_UNITY_BUILD_SOURCES arguments to opt out of the unity build, and
to exclude some source files from unity build, respectively.
- qt_internal_add_executable
- qt_internal_add_module
- qt_internal_add_plugin
- qt_internal_add_tool
- qt_internal_extend_target
- qt_internal_add_common_qt_library_helper
- qt_internal_add_cmake_library
- qt_internal_add_simd_part
- Unity build is disabled by default in these:
- qt_internal_add_test
- qt_internal_add_test_helper
- qt_internal_add_benchmark
- qt_internal_add_3rdparty_library
- qt_update_ignore_pch_source also excludes the files from unity_build
Task-number: QTBUG-109394
Change-Id: I5d0e7df633738310a015142a6c73fbb78b6c3467
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 31518f1a4e3c4a7c77ae2e008e903a849ba75dd6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A QVariant(QString) was not convertible to an enum not registered with
Q_ENUM() which worked fine in Qt5.
The same problem exists for QVariant(enum) to QString.
Fix it by not bailing out when no metatype for the enum was found and
try to convert it to a qlonglong instead (which is then correctly
converted to the enum type).
Fixes: QTBUG-109744
Change-Id: Ie7bb016a860455b69508f0f46b36474c9c294f3a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 66a1a71f1f92156548da487739129fb0f494c895)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Based on header review comments, make the internal constructor private
and declare classes that need it as friends.
QFlag-ify the HandlerScope enum, as it is a list of flags, and adjust
code accordingly.
Change-Id: I1d8843265e49e696d463e9eea8306f4dbae75c78
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 1dc5e20c16353476ee4b449343a8fbe78a9ac7d8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The declarations with default parameters cause
conflicts in CMake Unity (Jumbo) builds.
Task-number: QTBUG-109394
Change-Id: Icf48193498d70dfacadf1b2499cb3359169f72c0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 65cda1f06aa24d9b75e81b37a5c23dcedbc53b92)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
\internal needs to be on its own line, otherwise qdoc doesn't know what
\a means.
Change-Id: Ie7bd2fd779540b8d7ea92f9d1dd94e73a771d2b6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit d3dfe5a3b7e657b088f4e77e36b8d57229a13733)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Includes should be ordered from most specific to most general. This
means that project-specific includes always come before Qt includes.
This example didn't follow that guideline. Fix.
Amends 88e8094f18e6581f2b652eb3d82f514ecf687046.
Task-number: QTBUG-108857
Change-Id: Iafdae9dd8e70ff99882c4344a023a21d15fa3c54
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit ac6e8b3b21c2ae25e7a4fe483b604ea6ddecd3ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A QString is not a full representation of a Level, so the
Level(QString) ctor should be explicit.
Task-number: QTBUG-108857
Change-Id: I24b705139e61c4aaf59cb0aad3b536013e0d07df
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit fa55d46e1f09ddf45dbe5700d4637b003363c559)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit ce955d1907ac57d25571e82f57cd94f5abe883e1.
Reason for revert: There is no qnetworkproxy_darwin.cpp in 6.5. This
shouldn't have been picked back.
Fixes: QTBUG-111010
Change-Id: Ic58b3e1a2893cc1e42cba806701f4db7b98302f7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Includes should be ordered from most specific to most general. This
means that project-specific includes always come before Qt includes.
This example didn't follow that guideline. Fix.
Task-number: QTBUG-108857
Change-Id: I42727ff8bdef5336368cde349cbcb8d10bb6289f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 88e8094f18e6581f2b652eb3d82f514ecf687046)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The compiler does that for us. This makes the enum look like an enum
again. A non-flags enum shouldn't have intializers of the form 0xNNNN,
as that makes it looks like flags.
Found in API review.
Change-Id: If49e94cdad719b7dc9e8a7b17f6883dc789e62d6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit ee1bd7decd2c3e55245f89afb710543c95424221)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Commit 93dad2bf91d414a41c6e2c7db6c75171b4917d4d (6.0) changed
Q_DECL_DEPRECATED to use the [[deprecated]] attribute, which must appear
before inline and other keywords.
To keep it next to Q_NOREPLY, I also moved the "inline" into the next
string.
Added missing tests for both.
Fixes: QTBUG-110979
Change-Id: I9671dee8ceb64aa9b9cafffd1741656e86f40453
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit f67b32e735cbbed6848b5d40a61329f71f54a14d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When the main executable is built with a pre-macOS 11 SDK, the macOS
kernel and system libraries will enable a compatibility mode for
reporting the system version, reporting 10.16 instead of 11/12/13 etc.
This happens at at such a low level that even manually reading the
version from /System/Library/CoreServices/SystemVersion.plist is
intercepted.
Working around this by temporarily setting the SYSTEM_VERSION_COMPAT
environment variable is unfortunately not possible, as it's only read
on process creation/initialization.
The same goes for the kern.system_version_compat sysctl, as once it's
set it can not be changed back to its original value, and it's not
clear whether this sysctl should even be touched.
As long as we have no reliable way of reading the actual current
operating system version, we need to bail out of the deployment
target verification, to avoid false negatives where a plugin or
library, built with a deployment target of say 11.0, is loaded
into an application built with a pre-11.0 SDK, but running on
macOS 11+.
Change-Id: I9c757a276726175c5dda694ffc1b88f1681d00fb
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit bac93ce5eba10ae1e5d165b464a7a9e3b4dd6561)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
And add the macOS specific key.
Change-Id: I1e0446a1927ef530322388417b9300ae287752c3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit a3697f2b84e87590a451664c3fe9328a8e2087bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a continuation of commit 5c9d671bfb5b511106.
[ChangeLog][QtCore][QStandardPaths] Improved conformance to the
Freedesktop basedir spec by ignoring any relative paths in XDG_*
environment variables.
Fixes: QTBUG-58043
Pick-to: 6.4 6.2
Change-Id: I7c34143ced97d6d3de6ecbf13bccf9e935462d1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d4f72b4de63fe0622908c7657f9724bad359574e)
This addresses two different issues:
- Firstly, we were casting the resolved binding data pointer to
QPropertyProxyBindingData, instead of the d_ptr of
QPropertyBindingData. Fix this by introducing a helper function,
and consistently using it to access the proxy data.
- Secondly, we were not resetting the originalBindingData when the
pointed to object was destoyed. Fix that, too.
Task-number: QTBUG-110899
Change-Id: I7691c9df5cc26e761f6b0e5f16d152f7f2183208
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 55ca636180db2b7870b5b519c4163487b672a9f1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We decided to go with REQUIRES/SUPPORTS_UP_TO.
Task-number: QTBUG-96233
Change-Id: Ia82d22618d31c06b5260a632ba079eeba7a506e0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 04a3e411ec0b961f2561a749f9e8f27a498c954c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
New languages (and one local for each) added with v42
- Haryanvi
- Moksha
- Northern Frisian
- Obolo
- Pijin
- Rajasthani
- Toki Pona
It also appears that Canada has changed its date format. Modify the
relevant test case to reflect this change.
Task-number: QTBUG-110333
Change-Id: Ia8975c2866cd54c9e565543d05bacd52f4987909
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 9a8b9473d5f0fd4639193481ba9b344d91f3f00a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- uncomment the Alpha detection defining Q_PROCESSOR_ALPHA, which is
already used/documented in few places
- set the right machine type in QElfParser for Alpha ELF files
Change-Id: I072bdee8b73ad3c86591c764aa7075c114967fd9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
(cherry picked from commit eeb66b99df521c4a32b8eda1d889f615319355a6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Any identifier starting with underscore followed by a capital letter is
reserved for the implementation in C++, so don't use them. Rename the
entries in the Atom enumeration by adding an "Atom" prefix to them.
Change-Id: I059e2093149f39cc9324cd1159c0d9e076eda93a
Reviewed-by: JiDe Zhang <zhangjide@uniontech.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 3d72e8829fb9ebcd3b1179b54ad4053de05368ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This patch addresses the following issues:
(1) some places are still using the original workaround, replace
them with the new qt_winrtbase_p.h workaround.
(2) add more comment to let people know how to workaround other
cppwinrt issues (it was a common issue for many years and may be
fixed upstream recently, but let's at least document it in case
the user is still using old version cppwinrt).
Amends commit b2c1237b4512480a17009afe1981af02c2a9869e
Change-Id: Ife676f41739bbe69d9fb23bf5758be4b1fab4855
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit ad7227ada177dec4e61e8bbc51dd70f00a6e3d15)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Macro Q_FIXED_POINT_SCALE in qpathssimplifier.cpp clashes with
the macro with similar name in qtriangulator
Task-number: QTBUG-109394
Change-Id: I02732ae62238e8b7fae0630764fdd33b6203afe3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 34519d44ffd0327a676f6af41f63191912b583e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We don't want them in Qt 7.0.0, either.
As a drive-by, also guard the implementation with the same check.
Change-Id: I21b181e5563ebc2b247d6c5ad005bb76224f0daf
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 115a38613c0ed0ea1d6c82d927809074cb69f385)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is almost exactly the same as the "Analog Clock" (widget) example.
"Analog Clock Window Example" demonstrates:
* How to render to a QWindow (covered by RasterWindow example)
* QPainter and transformations (covered by Analog Clock example)
* How to use QTimer (covered by Analog Clock example)
Change-Id: I7f20a29798830ed6345eca250e4139cb314cab84
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit f7db1cfa92896135534f6ab140d1470e56a5d677)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This somewhat indicates the progress of configuring a specific
repo and the slower period of time when configuring examples
in-tree.
Change-Id: I643536c4ebc865933730b7af2a1d0c56bbbf2912
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 4a4c3296870ef5fbeefddd1022a0eefa8bb6f5e8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In all the cases below, the parameters are defined in the
qtestsupport_gui.h as well.
Task-number: QTBUG-109394
Change-Id: I3311d6c23b3a811dbe20286bd4534ca1ed7cd7f3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit edc62595f27ad820b2edfe2d6158925676131590)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This method correctly ignores relative paths (as per the XDG basedir
spec), but checking the list of dirs is empty should be moved to after
splitting the env var, because even if the env var is not empty, if the
paths in it are all relative the resulting list will be empty.
Drive-by change: Split some code to a static helper, which will be
used in xdgConfigDirs() too.
Pick-to: 6.4 6.2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: If894751ba68b24ccc214f9a4bb2099be3f0e4349
(cherry picked from commit ee515dd842d79fa4543568ed82bd7c949923e438)
- Better readability by returning early
- Make a QRegularExpression static const so that the regex pattern is
compiled only once
Pick-to: 6.4 6.2
Change-Id: Ic0d6bd4b068624c4ff60c6e71d09f20393adaa64
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 482a75fef9643220366029862dbf636a88bccb82)
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
There's no way to upgrade an Approximate accuracy permission to Precise,
so once we have a known status we report the lacking accuracy as Denied.
Change-Id: Id49af825335ff09669aa7f2285caaa744a5a4d24
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit e2030e366b73f5af9e60c987e498f21f9c985f68)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qt6_finalize_target warned about double invocations on executables
already. For libraries and plugins this situation wasn't detected.
Make the warning consistent for qt6_add_executable, qt6_add_library and
qt6_add_plugin. The internal property _qt_executable_is_finalized has
been renamed to _qt_is_finalized and applies to all targets that can be
finalized.
Change-Id: I06821d08042e1453f3e058ed90a13e90a4f06640
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 19c32e7ee70bd6ad291fb76f7db015b712fe8981)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is technically possible on iOS, but the system doesn't give us
a callback unless the user accepts the upgraded permission level,
and we need a deterministic callback in both cases so that we can
report the result back to the permission request callback.
https://tinyurl.com/requestalwaysauthorization
Change-Id: Id006dbbb2f6fad4b831742e4d3e904525aaa8a2a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 8dc3ee03a42ccb1b047c2a8f34b5bce4e663c9d9)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Include the creation of the QDir inside QBENCHMARK, otherwise
the it can hit the cached code path where subsequent runs return
results much faster.
* Same for the opendir()/readdir() test: if opendir() isn't called
again, readdir() will just return null right away.
These two issues led to nonsense results like 0.00025 msecs per
iteration, doing nothing is really quick.
While at it, port the cleanup code to QDir::removeRecursively()
Change-Id: Ic1bdd92d41efe1f6d0eaaa33eca066cb7d19fc93
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit eae031d5c3b02ad1d0ffe3377b252acae9294877)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The painter saves existing paint engine state in the stack and restore
back to the previous state after performing required paint operation.
The clip path stored as part of paint engine state is getting
translated more than once during save and restore operation. This
multiple transformation of the same clip path causes incorrect
translation within the plane.
To fix this issue, during restore, remove translation of clip path
with redirection matrix.
Fixes: QTBUG-109518
Change-Id: I1509bc7fa4965f2802bce62c1ed27cdb90da617a
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 4e4d37f0472c58ff6c98e9852691b1ccda8beffb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If AUTOGEN_BUILD_DIR is set, _qt_internal_get_target_autogen_build_dir
returns that; otherwise, the default builddir/${target}_autogen will be
returned.
Task-number: QTBUG-110696
Change-Id: I028058bd0176c25bc4bc66be8abcae4f7e43a0f2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 86295c8d89d738b8cb2acffe2dbf5dc050cc1beb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qwasmclipboard.cpp and qwasmdrag.cpp had the same logic that read
the js DataTransfer object implemented twice with small differences.
Use a single implementation in both.
This also introduces a clearer memory ownership model in the reader
code, and fixes a potential race condition by introducing a cancellation
flag.
Removed the useless QWasmDrag type which was in essence a SimpleDrag
and made the m_drag in QWasmIntegration a smart pointer.
Fixes: QTBUG-109626
Change-Id: I5b76dd3b70ab2e5a8364d9a136c970ee8d4fae9c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 16bf899557febb8c0762e64ce88acf21bc84e334)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
There are still ambiguous overloads of display(), which cause PMF-syntax
to fail.
Task-number: QTBUG-110952
Change-Id: I0887a5a06b026e4d5a20ef732d5892c8ac7fb6db
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 94c16517b3f8f01309a89598e698931ef77d60db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
decltype(QPropertyDelayedNotifications::used) is qsizetype, not int,
so don't use int to count from 0...used. The notify() and
evaluateBinding() functions use their int argument only for pointer
arithmetic, so this is completely self-contained.
Amends fdedcb6ec650236bef4a8c8f005b5dd24ef7d77a.
Task-number: QTBUG-103532
Task-number: QTBUG-110710
Change-Id: I765a06628d330fbb57a2fbecc96d66690bb62f13
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit d257a56c93e58028031c41daf90d3d4e8f317846)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This ensures the tst_QSqlQuery::record() test passes when checking the
tablename.
Change-Id: I146f9f627ea366c6813af61ce48b930ca1041b15
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9ea00c70fbbe61d4c2da98c3d9390bfbada157bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QSettings was included but not needed.
This patch removes the include.
Change-Id: I9da146312f26f87eb863d6409b90988603cf46d3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 4804dc9fc7b22e6e103f68c602c55e876892d5c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The problem is `PropertyNotify` event generated by
`xcb_delete_property()` at return could be reported as an actual
timestamp at next call due to a missing `state` filter.
Because `PropertyNotify` is generated even if an unchanged property
value is set we can get rid of this delete event easily.
This issue causes observable problems in kwin_x11 (KDE project)
too.
Fixes: QTBUG-56595
Change-Id: Ice6cfa934e3769d86e9f7264e369dc5918c8542a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: JiDe Zhang <zhangjide@uniontech.com>
(cherry picked from commit 03ac8c7397b9f070a8ef5f33b4675411293b0723)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Failing test functions fastMove, moveAccross, moveInOutOverlapped seem
to be stable in the meanwhile. This patch removes the blacklisting.
Task-number: QTBUG-109036
Change-Id: I9a2b015572e4d8a4eac196d3985c052030fd84e2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b464119dd497771d5c1fb0e4a35faae45641bf79)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The html accessibility elements are positioned relative
to the window a11y container. Convert the global (screen)
coordinates we get from QAccessibleIntreface::rect() to
window coordinates.
Change-Id: Ifd4eb671def296b1eb418789b7ca85afa365e546
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
(cherry picked from commit bf5dbc61b357e0897cafaca04f78ee4c093d5606)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The code was a assuming that an a11y interface always
has a parent, which is not the case for the root interface.
Also factor out to a getWindow() function, to prepare
for re-use later on.
Change-Id: I52a841bf94c712deb9603e8b9c2c878820c5f117
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
(cherry picked from commit 34c36821578f39e9c7f99e1dd0e7887a52418b9d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We don't want to make the top-level screen contenteditable,
since that interferes with accessibility. Instead, make
the canvas contenteditable and install clipboard event
handlers there.
Also move follow-up settings which counters some of the
effects contenteditable (outline: none and inputmode: none),
and move aria-hidden.
Change-Id: Ibe73d8d097acd948ba8920c781a2003db0a14f3d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 2443f2be07607e44ec483278873702eb0f57ab26)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Experiment reveals that we needs to, despite hints in localtime_s()'s
docs that seem to indicate it shouldn't be needed.
In the process document that POSIX mandates that plain localtime()
behaves as if it did call tzset(), since its branch of the #if-ery is
now the odd one out.
Fixes: QTBUG-109974
Change-Id: Ic57753f246f14e183d2a56f131e8bed7347d2e20
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 9d1a3582f33a0820a4f0f5b7fe84a22a8c8d967b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Remove clashing enumeration value ColumnCount and exclude
file in snippets.
Task-number: QTBUG-109394
Change-Id: Ibd8a72d9d87e3dcbbb221c364d6b4c4f59b315df
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e73389874d6f8dbfc4743c51eb3d3889dd2da7fb)
They cause clashes in CMake Unity (Jumbo) builds.
Task-number: QTBUG-109394
Change-Id: I5f1fbee07872a742a78adc9864fe00c710ca24d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d3f8d7fd4140b269532e2daca8eb5cbfe28ed465)
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The group page for Qt core classes related to I/O include classes from
other modules. Remove these classes from the group; it may confuse
the reader.
Fixes: QTBUG-110020
Change-Id: If7df85523ce6b3aa09605bd89d9899ce308d2671
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 76ecff6aebb35f4e39439aab8d18d828c3c8a1fd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Unlike Q_GLOBAL_STATIC, a Q_APPLICATION_STATIC can be destroyed and
re-created multiple times (if QCoreApplication is, too). This means
we're basically in the std::optional case and require std::launder()
to avoid UB when the payload type has either of the following:
- a const member
- a reference member
- a vtable and different derived classes might be occupying the same
space at different times
While we can probably exclude the latter, because we always construct
the same type, PlainType, in the storage, the first two can easily
happen.
Fix by adding the missing std::launder().
As a drive-by, remove the uneeded casting (and now launder()ing) of
&storage when passing to innerFunction(), which anyway takes its
argument as void*.
Amends 81a31beeb25eaf14d5c5f42fe26aa49d6ef29bf8, which changed
Q_APPLICATION_STATIC to use inline aligned_union storage instead of
the original implementation's unique_ptr.
Change-Id: I065bd33812a40195109bf11d5bc79975f2f87cd5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c53fdcb5ee15c309ba68717fa6564dc1ff4b8618)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We must check that the path is an actual file on the filesystem before
using native APIs. This regression was introduced by commit
047d8f36de45ebb318726167f941b0dbc64754ba.
[ChangeLog][QtCore][QMimeDatabase] Fixed a regression from 6.4.0 that
made certain QMimeDatabase functions that inspected file contents to fail
on Unix systems, if the file was not a native file (e.g., a Qt resource).
Fixes: QTBUG-110707
Change-Id: I570832c9ac8b4e03bde8fffd173f7b4c6b164192
Reviewed-by: Igor Kushnir <igorkuo@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 40dd38813cba4bc8425e846f220e358ffb0d19ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The location permissions database in /var/db/locationd/clients.plist
ties the location permission to the bundle identifier (among other
things), so a missing bundle identifier will result in the app asking
repeatedly for the location permission, as the permission is never
saved.
Change-Id: I64ab5b8f8762804869c0f97debd97da817787808
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit ad42833d3373604eec885702f1bc4719593d7dcf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It gets hard to read like that.
And update mentions of 'SSL' to 'TLS' in the message while we're there.
Task-number: QTBUG-108874
Change-Id: Ia7b27bfb3d99391b14ed396ca9a6400621022bf6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 7df8ef0a107ebd0f7394784366ea02b0b3956669)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
...as suggested by review comments.
Switching to std::function implies that we cannot easily
do the install-remove pattern anymore as there is no way to
compare an std::function to something other than null. Instead
of making it more complicated by returning a key or something
like that, change the remove function to a clear (that now clears
both the legacy VK_EXT_debug_report and the new VK_EXT_debug_utils
callback lists).
Also add a missing call that registers the new-style callbacks that
are installed before create().
Change-Id: I66c1dd8e8dcc8eee0f5eb9671f94c2c80319dcaf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
(cherry picked from commit 0b20f243f7efbd612d41bab8c2000e6c9fcb13e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Windows theme in dark mode set dark palettes for checkbox,
radiobutton, menu, menubar explicitly. The fix added as part of
a2518b4140ed88a674bf4a4fcf4576e35c698bb9 (to use light palette for
windows style) overrides only system palette and widget specific
palettes are still with dark palettes.
In this patch, the windows style overwrite dark with light palette
for widgets that are explicitly set with dark palette in windows
theme.
Fixes: QTBUG-110432
Change-Id: I2af0e517d62981f062244eeab8f1b5e5442cc451
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9a1b7c7fa59a5033344dd0b67b28de3531c92d69)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The previous fix attempt at 8ba8d1346a562347c398bdd0529d34f94f2ac698
does not work when C++20 mode is enabled.
MSVC optimizes away the "else" block but triggers warning C4702 on
"return true". Moving the return line into the "else" block ensures that
it is optimized away too.
Change-Id: I9ef02cd3631ff78091530b6fb2b91c2eddcbab5d
Fixes: QTBUG-104836
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Yuhang Zhao <yuhangzhao@deepin.org>
(cherry picked from commit 4bfdf6a3d156184579e9fc66224754a6e66159dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The fact that read-access is always included makes a bool readWrite
property a little awkward to document and explain. An AccessMode enum
with values ReadOnly and ReadWrite is much easier, and will also lend
itself more easily as a constructor argument than a boolean.
Found in API review.
Change-Id: I4f20dbe9f19c7bdb52248a6e544e36d731d5a2ee
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3f33ed249bd1ae9d7c8b161792328a6696603076)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Ensure that the classes using ShortData have the same size (already
done) and alignment (this patch) as classes that just have a
d-pointer.
Change-Id: If30352a0bc4beb4b505d6e0eab5077c9c16456ba
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 2d254afead50ab0d323f562ac820f876474f3961)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old function,
bool AlphaCode::operator==(AlphaCode code) const noexcept
is not symmetric: the LHS argument is passed by cref and the RHS one
by (non-const) value. I didn't test, but this asymmetry might actually
make the operator ambiguous with its reversed version in C++20.
Fix by making a hidden friend. Even if it doesn't fix anything, hidden
friend relational operators are still where we want our code base to
migrate to, eventually (QTBUG-87973).
Change-Id: Icb74c24802a3fe6c2987c1db86880c0d72a7abdf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7b9f4aa0fc85e8c1950f0bdc2d3802f935e25f30)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The previous attempt at fixing QTBUG-110058,
ccad719d2e935306e601b0f6af5ff2acb7cd272e, was incomplete:
- the if (result.isEmpty()) check at the beginning of finalize() was
not protected, so it raced against the assignment at the end of
finalize(), which was protected
- because the mutex was not locked during the finalization of the hash
algorithm, two threads could perform this operation simultaneously,
which isn't such a bad idea in principle, as it can reduce latency,
but for that to work, the losing thread needs to throw away its own
work and adopt the work of the other thread, but that wasn't done:
both threads would write their result to 'result', just one after
the other, but that's still a data race, since the eventual _reader_
of the result cannot be protected (is outside the class). Besides,
we don't even know whether the algorithm-specific finalization
functions are ok with being called from separate threads on the same
context object
- in addition, the mutex wasn't necessary when finalize() was called
from the static hash() function, as no sharing could possibly take
place there (the state is function-local)
Fix all of the above by largely reverting the first attempt, dragging
the result.isEmpty() check out of finalize() and into resultView() and
instead simply holding the mutex over these two calls in
resultView(). To see why this is sufficient, consider that
resultView() is now idempotent again: the result is written once, the
next thread waits and then finds the work done. All following accesses
to the result are then reads, which happen-after the write at the end
of finalize().
The accesses to 'result' from reset() need no protection, as reset()
is a mutable function, and calling a mutable function on a shared
QCryptographicHash object is already UB. Only two const functions may
be called that way.
Fixes: QTBUG-110058
Change-Id: Ia8ac095b785519682090801c1012e9dded6d60b2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b904de43a5acfc4067fc9e4146babd45c6ac1138)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Compared to std::shared_ptr, QSharedPointer requires 2x the atomic
operations per copy, and does not support QSharedPointer<void>.
Port to std::shared_ptr, and drop the Pinnable kludge.
Add an optimistic std::move() when we insert into QMultiHash.
Change-Id: I2ab004b7e8fa36d9e777cd787ffded4076d2880f
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 5ba25903882222a556a3e7558e6455e2a203569d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
While PURE_SWAP is the correct one today, this is inline code, so when
we activate the d-pointer, we may have fields that hold non-memory
resources, but it would be too late change existing binary users to
MOVE_AND_SWAP, so do it already now.
Change-Id: I18976cffe30eb4e37aa6d471cc6e75015e9b1ee7
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit c2cdd7c371d7b9405728c1a30046ab3f257ee235)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We can always add it back later, but for now, it's pointless overhead
(no Q_PROPERTYs, no Q_INVOCABLEs).
Found in API review.
Change-Id: I1e30fbda997e6576a3e94cbae0387a3188c27728
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c307cbea90a885b3981d0d7d661e19084c6134d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The aim is to have fewer files including <windows.h>.
Task-number: QTBUG-109394
Change-Id: Id9cc08f54b5daf6d7e317fad27036dc2efaacbb8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 441c152d85e3576d109e99ad30c43003a673532e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The application height calculation relied on the Display.getMetrics to
obtain the size of the current app window. It works properly on stock
android and Samsung devices, but not on some Huawei and it's unknown on
other vendors. This patch changes the way the height and weight are
calculated by using the provided values.
Task-number: QTBUG-107604
Task-number: QTBUG-109268
Task-number: QTBUG-97503
Task-number: QTBUG-107923
Task-number: QTBUG-109351
Task-number: QTBUG-110501
Change-Id: I0b0d1a0e4688f10530054afd26e34f55a92ea2da
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 48ebd4e318d5fb2d7ffe4b8215cd16cf5638215e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We already fixed the implementation of toSQLTCHAR() in
66767eea46bea0f19f8ae5ad6ebc641d86867701 to not assume that a UTF-8 or
UTF-32-encoded string has the same number of code points as the
equivalent UTF-16 string, but it turns out that users of the function,
as well as other code, also failed to account for this.
This patch fixes callers of toSQLTCHAR() to use
const auto encoded = toSQLTCHAR(s);
~~~ use encoded.data(), encoded.size() ~~~
(except we can't make `encoded` const, because the SQL API isn't
const-correct and takes void* instead of const void*) instead of the
anti-pattern
~~~ use toSQLTCHAR(s).data(), s.size() ~~~
As a drive-by:
- Extract Method qt_string_SQLSetConnectAttr()
- skipping an unneeded .utf16() call (a NUL-terminated string is not
required for calling toSQLTCHAR())
- de-duplicate some code in exec()
- and make a comment there slightly more informative
- replace
- NULL with nullptr
- size() == 0 with isEmpty()
- C-style with constructor-style casts
Change-Id: I3696381d0a93af8861ce2b7915f212d9e5e9a243
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 46af1fe49f7f419dc1b3231de9860e2da0ea48f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It demonstrates timerEvent() and some QFontMetrics
There are other examples that demonstrates this
Change-Id: I4ad6f30c8ef93c995f980545ed88ab13b9aa9c7d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e08575a18ace251161cc813cfe48db68b8b15eee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When the match finds a surrogate pair as the first true Unicode character,
then we need to skip both code units of the pair in order to restart the
search. PCRE2 does not allow us to search for individual UTF-16 code
units.
That actually means that counting "." gives us the count of Unicode
characters.
Fixes: QTBUG-110586
Change-Id: I194d0a32c94148f398e6fffd173d5b5be8137e19
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b22ae069ac193cfa0479d0bc258a860ef00816b4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The QByteArray is assumed to contain an SQLTCHAR string (so, either
UTF-8, UTF-16 or UTF-32-encoded). Only in the UTF-8 case would the
size of the byte array be the same as the size of the SQLTCHAR string
in codepoints, yet the size in bytes is what the code passed to the
QVLA<SQLTCHAR> append() call, causing it to read past the QByteArray
buffer in the UTF-16 and UTF-32 cases.
Fix by properly calculating the string size from the size-in-bytes and
then memcpy()ing into the QVLA. We use memcpy() and not
QVLA::append(T*, n) because the QByteArray buffer need not be aligned
on an alignof(SQLTCHAR) boundary (certainly not since it gained the
prepend "optimization").
Change-Id: If3838c3dee89e6aca65541242642315b8e1fa6b4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4c445ef0bae8b36ec4a742552f0ebd81a1a90723)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As discussed in API review, the default-constructed T() returned from
a mismatched data<T>() call is indistinguishable from a real T with
default state.
To make them distinguishable, return optional<T>. Call the new
function value<T>(), mimicking QVariant::value<T>(), and suggested in
API review, because data() is usually used to return raw pointers, not
values.
Remove the qWarning() on requestedType and actualType mismatch, as the
new function can be used in std::get_if/dynamic_cast-like if-then-else
chains, in which failure is part of the normal operation, and a
warning message misplaced:
if (auto loc = perm.value<QLocationPermission>())
~~~ use *loc ~~~
else if (auto con = perm.value<QContactsPermission>())
~~~ use *con ~~~
~~~ etc ~~~
Change-Id: I799a58e930307323ebce8f9ac50a42455e9c017f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit ce104cac500096734a94e6d132e342d07d7e8af0)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Flag values can have mask values, which have multiple bits set.
Give warning instead of panic if a flag value is not power of two.
Change-Id: Ie67a5d820203219ce2eb91faf5dea8d6051a5e08
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit 3bffd2e01b9b2a7114e66830f49f7f0bd7752a34)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test function used only the left button to test mouse event
propagation.
This patch adds the right and middle buttons to the test data.
Task-number: QTBUG-110055
Change-Id: I02683168216843919e889987a8b0e8a0f1592d3a
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit 593ffd3859b2c80c498baf5323906a348de22b80)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The [NSString stringWithUTF8String:] function returns an autoreleased
object, so we don't need to manually release it. Doing so results in
a crash when the surrounding autorelease pool is drained.
Change-Id: I3dca01e2771d4010e582c2bf770f3d2281343dc3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 780813d9b6bfc58aa45571c367071c3a44fb2b44)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The delta (drag distance) for dragging a tool button with in a tool
bar was calculated by subtracting the global mouse press position from
the drag event's global position.
This has lead to a miscalculation when dragging the button across
screens with different resolutions. The new relative position within
the tool bar became negative, which eventually has lead to resizing of
other tool buttons in the same tool bar.
This patch calculates the delta based on native pixels, which ensures
a correct value in all cases. It falls back to the existing calculation
if no window handle can be established from the tool bar.
Fixes: QTBUG-103720
Change-Id: I09168b597f6c43a119041d00f5b07e1895fdf4b3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit ff83fc75901527c0c14c481dbe9929129942c5b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The Mac style uses focus in/out events (sent by QApplication) in order
to update the focus frame. If a proxy style is installed, these events
never reach the Mac style object.
Amends 5d8a7652b995124495ef4f4a43fd8cf461367d62 , by making the
forwarding limited to the events for which we want it to happen, and not
just *any* event.
Fixes: QTBUG-109375
Change-Id: I6df49aa81d6ebb8dbaf00b9ba99e2a7c006e1181
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3bb055d8ab045def265bb9b3eb4e7dff1874a093)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Do not call first on it. A regression was introduced by
56f0ebfe860e440dcbba8997f44836debc901119.
Fixes: QTBUG-110070
Change-Id: I7c969da889b6c7ad3a67149fe99ca47830683073
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 0cd153b2681437b91f07315a27238446cc24363f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There's no point in using the full implicit sharing machinery when the
type's state consists of two enums, a bool or, indeed, if the type has
no state at all. QRect has more state and isn't implicitly shared.
To remain extensible in the future, all that is required is that the
type contains space for an eventual d-pointer and that all access to
members (except swapping, and, as a consequence, the move SFMs, but
including the copy SMFs, ctors and dtor) is confined to out-of-line
functions.
So define a ShortData (name stolen from QDateTime) nested struct in
each of the stateful Q<Typed>Permission classes, of the same size as a
pointer, holding the trivially-relocatable fields we currently have.
If, in the future, fields are added such that the reserved[] space in
any given class' ShortData no longer suffices to hold them, or said
fields are not of Q_RELOCATABLE_TYPE, then the full d-pointer pattern
(with an actually defined Private, and detach()ing) can be implemented
_for that one class_.
The new-style classes are externally indistinguishable from the
implicitly-shared old-style ones, just a lot more efficient.
Inline the move-ctor, now that we can. This doesn't break
encapsulation, even when we eventually activate the d-pointer.
As a drive-by, drop the noexcept on the dtors - dtors are implicitly
noexcept, anyway.
Change-Id: Id90a39227277c6554ddd5895e8205485da1e39ca
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit cde904b38ab6ef1ddcc9a0cbcae766cf42d58d81)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Also, adjust line length to be < 80 columns and make link
parenthetical.
Fixes: QTBUG-107026
Change-Id: I5f7efa5d572103a6fb432d79a52a57363efd9dd7
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
(cherry picked from commit b556d6227f848d42a10d4f0fc5424bd094e56288)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Note: This requires an update to the tst_qtextlayout test, because
the test assumed that the Arabic string would always yield a run
of two glyphs. This was a side effect of how Harfbuzz handled
Qt's test font, which has zero font tables and cannot be used for
shaping. With the Harfbuzz update, the Arabic text here yields a
single cluster instead, which actually makes more sense, so the
test has been made a bit more robust to support both cases.
Task-number: QTBUG-110338
Change-Id: I93d4cf8e3046dc93224e144d4c81d86bef4918d1
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit bfe080debbe764d341babfa37b471efb07575847)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These classes are polymorphic, so shouldn't be copyable.
Change-Id: I80b6b3de5f5594e00c4011f64846841e3344c152
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 80cb1426aa325a440993741ba48dd3275f90b2e8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Due to a bug in earlier Windows SDKs developers have copy paste
a workaround whenever they are including winrt/base.h. In addition to
that our usage winrt API also forces them to include
qfactorycacheregistration_p.h whenever they include that file. To make
things easier all that magic can now be done with one single include of
qt_winrtbase_p.h.
Change-Id: Ic6a80d6d3723af381cf0ecc0f0ab43c2e6839a7d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit b2c1237b4512480a17009afe1981af02c2a9869e)
Move types to QtPrivate, fixing errors like:
error: QCalendarWidgetPrivate’ has a field
QCalendarWidgetPrivate::m_model whose type uses the anonymous namespace [-Werror=subobject-linkage]
The error appears in CMake Unity (Jumbo) builds apparently
due to multiple anonymous namespaces per file.
Task-number: QTBUG-109394
Change-Id: Id678af4db5633b1b2267425c7751f1312935d5d5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit bd5589de658a91676b0cf36e154c19985fb7be88)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It causes clashes in CMake Unity (Jumbo) builds.
Change the function to be Q_AUTOTEST_EXPORT'ed helpers.
Task-number: QTBUG-109394
Initial-patch-by: Amir Masoud Abdol <amir.abdol@qt.io>
Change-Id: I2e4032e07e1c39432cae1eb2dfff94be33846c09
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 1fad7aa73ef371bb15bf929c161e542aac687101)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add some details about the support of Qt apis (QFile, QDir, QFileInfo)
for Android content uris.
Fixes: QTBUG-99664
Task-number: QTBUG-98974
Change-Id: I4b884623702ccad116d47049e34ccddfe21f83ca
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit a0ca5f433fdc45e97e461ece2d9839eebd3c7ea0)
Add option that generates an absolute Python import.
import resources.rc_resources
from a path like
../resources/resources.qrc
assuming the project root is .. .
Add an additional option to specify the import paths, from which
the project root can be determined.
Task-number: PYSIDE-2191
Change-Id: Ib444eb666217b8c010dba0079b0ffe9ddbaa3414
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
(cherry picked from commit 814d66d55860a1eb204b804871d579da95eabd8f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit 0b94530a310f3d5224dbee61b5774e0eb1500f27.
Reason for revert: Intended fix didn't work
Change-Id: Ib7b3caf4130ac92acce4d12b2ed0004c06cdacc4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We already have the necessary machinery in qnetworkproxy_darwin.cpp
Change-Id: I01d99c825ed794f1ff5ba229e64f9963b819228c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit ffd6a4264b43b651cf8038b94b849086645ed8c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The "interface" define in windows.h causes clashes with
variables named "interface". It cannot be undef'ed
since the winsock headers also uses it.
Task-number: QTBUG-109394
Change-Id: Id2daedfd6c57aae39a1fdfe92482f17884b68ef5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 0fc1f8174f3a899d3c3ee969596a0ad260a7bb8e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Original libjpeg's handler has output_message call.
As Qt doesn't have it, it logs non-fatal error, but skips the fatal ones
which are likely more important to be logged than the non-fatal ones.
Change-Id: Iebb94db4d56705322e7569445d240ca4a7ed8f4a
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit fe90f8aa45e792c386b1cba7121e58e3402a9a5d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We only support Qt 5.15 since a while, so the detailed information in
which Qt 5 version a particular class, function, or enum was introduced
is becoming less and less relevant.
Change-Id: I39bd579f23abc0ac84879e9bd22e6a97651ef7c3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit d53607225a2560e419043794d87e4710e9c7475b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The macro decode() in qurlquery.cpp clashes with the static helper
function decode() in qurlrecode.cpp. The macro encode() in
qurlquery.cpp clashes with QStringEncoder::encode().
Macro CBOR_ENCODER_WRITER_CONTROL is defined with various values
in 3rdparty/tinycbor and qcborstreamwriter.cpp.
Task-number: QTBUG-109394
Change-Id: I8fdf696863e5b1e6fb0c5607b2dd5b46427b9104
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit dc678299c8d38c11d1aa3f531e5d62dc2685bfa7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qdbusxml2cpp takes a filename to use for generated output. It may be in
the form 'name.cpp' or just 'name'.
For the moc file we need to convert this from a path to a name of a file
in the same relative folder. It's not uncommon for this name to contain
dots as sometimes a dbus interface name is used directly. For the cases
where a suffix is not provided the whole name should be used.
Fixes: QTBUG-110744
Change-Id: I3bf4ae8b2b9121184c2786009e8b5abcc5e3e410
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit c7425aa2950bfd47fdf390478616d1a383528886)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Mention addRow() as well as newRow(), even though the example only
uses the latter. Link the best-practice section to the fuller story.
Fixed a minor grammar glitch in the manual while I was about it.
Change-Id: Ib1c52cd8d2b6a04ea944d24d9d26c901b6cdf4e7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 24f3e0f21cd3971939945c18c6b9895609a01875)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It previously only covered ignoring them; we can now turn them into
errors. Expand the section to include some motivation for why it is
best practice to purge warnings from test output. That prepares the
scene for how to suppress what's expected and make errors of the rest.
Change-Id: Ieb4b14b2b048d1db2fead004ee7471b82507722f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 2d73cc2b1df03df716e6a76f9dca7761c1363368)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Tero Heikkinen caught tst_QQuaternion() using a duplicated test data
tag and was surprised that testlib let it get away with that. That
seems like a reasonable thing to discourage. While I'm at it,
duplicate columns should be discouraged.
[ChangeLog][QtTest] Duplicate data tags are now warned about. Every
call to QTest::newRow() or QTest::addRow() should result in a distinct
data tag. If they do not, a warning is produced. Likewise, duplicate
column names are forbidden; each call to QTest::addColumn() should use
a distinct name.
Fixes: QTBUG-107185
Change-Id: Idfdb7cdfdd71e1fe3db5cadb243eeecc83032922
Reviewed-by: Jason McDonald <macadder1@gmail.com>
(cherry picked from commit 2d1fd400fc34843690e889d0cae7e75c12abd1e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The "undo" example didn't show anything that the "undoframework"
example doesn't, and the latter is more comprehensive and properly
documented. "undoframework" also uses QGraphicsView instead of
inventing its own diagram widget.
However, the "undo" example created a nicer UI with toolbuttons,
icons, and the undo view in a dock widget, so reuse those elements
in the "undoframework" example instead.
Update the documentation quoting tags accordingly, and clean up
a bit.
Change-Id: I3c91feecbd5fe3e5900838b0b51f9fe7bd190280
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit cb0bf5ad683b72d4ecb0d21dafde3a5acdaac800)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's a new public API, so don't document it as internal. Fix the \since
to 6.5 - it's an old class under a new name, and make a small language
improvement in related documentation.
Change-Id: I57bfa868f19aa293c01d6a1f8bbbff1bebe7541a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit b36f126668f5d7c0ac58f2d058861680df176ca2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
MSVC is complaining about inconsistent linkage in CMake Unity (Jumbo)
builds since the export is not declared.
Since it is neither used nor declared in any header, remove the export.
Task-number: QTBUG-109394
Change-Id: Ie6dbad0188b7fa42c0abd40c48cb50129badb38e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a14dcc7ad12cd5d0bfdca2b9134cf6a5642799ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It causes a warning in CMake Unity (Jumbo) builds:
src/corelib/time/qcalendar.cpp:46: warning:
QtPrivate::QCalendarRegistry has a field QtPrivate::QCalendarRegistry::byName whose type uses the anonymous namespace [-Wsubobject-linkage]
Task-number: QTBUG-109394
Change-Id: Ie9598c3e87dd835b06cafe5392766bddc258b5ec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e63278bb38fc518e1dd7db8a86f689abb8a11b20)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It appears to be unused in qpaintengine_raster.cpp and causes
clashes in CMake Unity (Jumbo) builds.
Task-number: QTBUG-109394
Initial-patch-by: Amir Masoud Abdol <amir.abdol@qt.io>
Change-Id: I51585153ff99812b6539b6268e337e410f2ecc76
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 6c5939b1677a896a5abecd80bbecd2f70051d9e5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We must explicitly set the GENERATED property on source files we
generate.
This amends commit f0a7d74e1dd2c1d802aa09d7b8c144599f4a54ce.
Change-Id: Ifab405cd98deece49a1566ae04220e2b5d576429
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a707ae094def527d06d23878fa578591d632d738)
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The enums are QOpenGLWidget::UpdateBehavior and
QOpenGLWidget::TargetBuffer. The latter is a new addition to 6.5.
Change-Id: I9e73413a944bf4b55e8e308055d79e560ac8668d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit ce9d708d514011db1ab45630c95222d2a30c7550)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of parsing from a QString, which actually recurses back into
QSystemLocale.
Change-Id: I3c79b7e08fa346988dfefffd171f9b78e1d8d6ce
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 05e7d09eb373454c67219cc8f7e4b7226ec7f52e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Given that the two candidate "counts as UTF 8" values for codec differ
in case, it seems prudent to use a case-insensitive comparison, in
case we hit UTF8 or utf-8.
Change-Id: I279f83eafa90dd2685c306144c99ec97177d1d3b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 75ae8869fb171493e4d5163910ef3a2034902c7d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The printer drivers of some pdf printers allows the user to set a
global scaling factor, scaling up or down the number of device pixels
available for the same paper size and dpi. Make sure to update the Qt
print device metrics accordingly so that QPainter will see the entire
page, and not more than the page.
Fixes: QTBUG-106659
Change-Id: Icb90c1aa742f56b2a2043ef7070530beebe541d5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit b44f222dbe7886b9504a4af9f09521132d2262b2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit cebcb7991a26fdb583d216b9c18b8b51d1cabf5f.
Reason for revert: We need to enable BIC tests again
Change-Id: Ibabe2c50547972d040d933a1027833426b018e81
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 2fa21f482182608508a5f937ea0be3f1c7cc38eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- If no version specified, policy version is set to 6.0.0, therefore
warnings will be shown, encouraging users to set a policy.
- Update qt_policy() documentation
- Update qt_standard_project_setup() documentation
- Update the policy warning message
- Added the missing comment to clarify the extra_code region
Task-number: QTBUG-96233
Change-Id: I8358fdeb880a34c96f13fc2a6cbef6afe048c4d6
(cherry picked from commit 95ba368806dc46f9e9efd5381c593f02dfc8da95)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Mitch helpfully pointed out, in review of my change to the "Data
Driven Testing" doc that the two functions didn't \sa each other, so I
added that. Which naturally prompted a review of their language.
Also, split a long line in the code.
Change-Id: I5f3e973052e0107bd5bdaeecaebe218e043380ff
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
(cherry picked from commit 9a756e3e0186a254ad27111874facdf8e825e285)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Follow-up of b2a282d7c7b8f49819bbc86ed705980438ecb04b - elide the text
also when the QToolButton has no icon (=text only)
Fixes: QTBUG-64132
Change-Id: If4d3758452f37df411931a6628846988a3418d8e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 021906f6c985b838461d28c7f121d4c3bc7e6499)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The means to add entries to this QStringList were deprecated in 5.13
and removed in Qt 6, so the list is always empty and the one place
that still references it only needs to check the empty path it adds to
the list.
Change-Id: Ie1b3f13b33c04458bd03a4a1e3db0e33a76e89f6
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 21cb05bef7e852480975b92026e196c3fbf24228)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The hand-rolled loop produced incorrect output and was subsequently
rejected by trackers.
The torrent example doesn't support modern features though, so it's
still a bit hit-or-miss whether a torrent will work. E.g. downloading an
Arch iso does not work since it relies on DHT, PeX and HTTP seeds.
Fixes: QTBUG-109798
Task-number: QTBUG-110622
Change-Id: Ica40fb9205f09d135407a160a28a45d06a418176
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 39daa368d47bc676efb19a8e7478ef1c270ae959)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since context sharing is not currently supported with WebGL, offscreen
contexts have a limited usability on Qt for WASM.
If a context is shared, use the same underlaying WebGL context so that
the two can actually share resources. This is not full-blown context
sharing by any means but it makes e.g. the Open GL widget work as the
readback texture for it is 'shared' between the virtual Qt contexts.
If no sharing is desired, we use an OffscreenCanvas and actually create
a separate WebGL context.
Fixes: QTBUG-107558
Change-Id: If57e44739ddb57c167d5f8881a74d8dee52531f6
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
(cherry picked from commit 0eea2238f37a5eaa83ada6cd262eceaed20e415c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
TIME_NOSECONDS doesn't really switches to short time format,
just removes the seconds from long time format
Fixes: QTBUG-110627
Change-Id: Ie799958f3942c657f00bc8196588258661ddc1d9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 763884cfb7be0cadd353cfa3b9b760d521851718)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Destroy native file dialog on Windows as soon as it closes.
Currently the instance of native file dialog on Windows may stay live
even when a FileDialog control was closed and won't be opened anymore
in the app session. At the same time, when the FileDialog is opened
again, the instance of native file dialog is recreated so we don't
need to keep previous instance, because this may lead to situation
when QQuickFileDialog configures old instance of the native dialog,
which is causing problems.
Fixes: QTBUG-61042
Fixes: QTBUG-77211
Change-Id: Ia537264e8494b83dec7d5139744838242b281f1f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit de704b633d4f9469a868e86fc22b8d99ef61eacb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Right now, "multi abi builds" of android projects works only if the
android-build installation doesn't use custom install dirs
(INSTALL_PREFIX, INSTALL_BINDIR...)
At the same time, it fixes QTBUG-106533. The patches are the same as the
ones in that bugreport.
Add new items to android-*-deployment-settings.json:
qtDataDirectory
qtLibsDirectory
qtLibExecsDirectory
qtPluginsDirectory
qtQmlDirectory
Update androiddeployqt to be able to get files from their install location
BTW (fixes QTBUG-106533):
Install src/android/templates into INSTALL_DATADIR
Install src/3rdparty/gradle into INSTALL_DATADIR
Install src/android/java files into INSTALL_DATADIR
Install all jars into INSTALL_DATADIR
Add missing path to target_qt.conf
Update target_qt.conf to have all path. Otherwise qmake wouldn't have
the path when installing the android-build with custom install dirs
like INSTALL_LIBDIR & friends
Add support for a new cmake variable that can be set at build time of the
android projects: QT_ANDROID_PATH_CMAKE_DIR_${abi} (Name chosen as
brother of QT_HOST_PATH_CMAKE_DIR)
Fixes: QTBUG-106533
Fixes: QTBUG-107207
Change-Id: Ia3751362ab1b5f877ecafbe02f263feac167119c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 979a21dc4ee0c6f483c6b55e9242a153d659ab6f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It seems that on macOS 13.2 and newer, it requires explicit activation,
just as on the offscreen and minimal platforms.
Task-number: QTBUG-110703
Change-Id: I519eec872505ea3673111ae300c2494113f85c36
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 78ba5056e63c4fc6f61346807197920fb5049924)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
\target will let the browser jump right below the title. Instead,
open the page from the start.
Change-Id: Ia58664aa2696aca4f299d57b8dbaa9b6cda90f27
Reviewed-by: Pranta Ghosh Dastider <pranta.dastider@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 958dc5c1cd314358d6af3d7184c01ad62847b82d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QXcbCursor is created for each screen in a multiscreen setup. Make sure
xcb cursor context is created for all QXcbCursor instances otherwise
xcb can't load cursor for non-primary screens.
Amends commit 012132c60d625b2de0039bdda3c22a0a8fe2dfe5
Fixes: QTBUG-110434
Change-Id: I85da73a1069b681437b29c3e272d85f5d2dde130
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit a61d537f0535308fe30494e7a8fa283dba13d72d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Remove comment about lttng not relevant to ctf backend.
Change-Id: I4d4432b1075a27d024db38a3cdd7807a1e94e7ec
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit 86398b477bd38d35a411b4439f9da59c10f30eef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Neither the UTF-32, nor the UTF-8 recoding of a UTF-16 string is
necessarily of the same length as the input. The UTF-32 version may
be shorter, if surrogate pairs were encountered. The UTF-8 version
will be longer whenever the string contains non-US-ASCII characters.
Split toSQLTCHAR() into three functions, templated on sizeof(SQLTCHAR),
and use QVLA's range-append instead of manual memcpy()s.
This patch specifically doesn't use constexpr-if, as that's not
available until C++17, which Qt 5 doesn't require.
Change-Id: I0bfcb66eb321598908ef00ac34c888fdbccf9316
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 66767eea46bea0f19f8ae5ad6ebc641d86867701)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If a proxy is configured on the system then we will request credentials
if needed.
Task-number: QTBUG-108874
Fixes: QTBUG-106245
Change-Id: Icbea491492cde4634421b1a1e722a3768d56dec8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 5006fddd33c32eb972f1bdc6b72acc43a3741e23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In Qt 6 it is unset by default.
Task-number: QTBUG-108874
Change-Id: I35af9d7c1517fd393710b7b1b978d3f39c61acf0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit d18b5195c1b0442f7fb6c01c3e9a8fb499da3d48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It can do more than HTTP but let's keep the naming simple. Most people
likely aren't looking to do file: or data: or qrc: in this example.
Task-number: QTBUG-108874
Change-Id: I8a822640f4a8015ebf6c56cb6a614d6426e8a912
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 7c90881a8e0402c6d6970539087c7b9632e51e23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QCoreApplicationPrivate::initLocale()'s check that the selected locale
is UTF-8-based was added with an initial work-around for Android,
specific to NDK <= 15, which Qt 5.15 did not support.
Later the Android-specific #if-ery was changed to test for Qt taking
UTF-8 for granted, for a given reason having to do with QNX; and later
the #if-ery for that was removed. However, we still support versions
of Android that lack nl_langinfo(), so restore the Android #if-ery.
It presently seems that NDK 26 (Android 8) does contain nl_langinfo(),
so we should be able to drop the nl_langinfo() kludge for this and
later versions. That way we'll at least use the real nl_langinfo()
where we have it.
In the process, fix the indentation of #if-ery.
Change-Id: Ie9e83c3397955c24cea1e9a9ff6bb0187e47dda2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 10117f78d72498e19683e69b439ca7c931532261)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We must not set rpath-related properties on INTERFACE libraries. Move
the code that sets the properties below the bail out for INTERFACE
libraries.
This amends commit 392d9a54194d06e96bfebdaf081aa6c9787e33ab.
Fixes: QTBUG-110513
Change-Id: Ie395f1482245c4522917f982d2f3bc745c0b2abc
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 854986836a581da694d169744e5487c5ce5f44bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
While probably not common, it is not unthinkable that one does
a destroy() - create() on a QOpenGLContext while relying on the
versioned function wrappers. This is likely broken at the moment
since the internal data is not released on destroy(), only when
the QOpenGLContext is deleted. This differs from any other similar
data (the portable function resolvers, QOpenGLTexture backing data,
etc.) which are all dropped and nulled out in destroy().
Also remove the bizarre comment in the dtor which must be something
from Qt 4 / QGLWidget times.
Note that this does not fix the associated problem since that only
relies on the standard mechanism that leads to fully destroying
and then recreating the QOpenGLContext when the window changes.
Task-number: QTBUG-109171
Change-Id: Id265a1d208ffae3792a0608c29324e840ce690dc
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
(cherry picked from commit 3bad6d597071186be51d537d2cda786caf879a6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Those files/dirs are only build time generated by IDEs like Android
Studio or gradle builds, so ignore them.
Change-Id: Ib4785f9cc75412825d5be4cb5fe206587f37d193
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b49e2bb0849ed423e68398d5a10a3cc079bff589)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends e08fe78b2335046934abae970e59fe0156178b95 (in a way).
While touching this function in the other patch, it becomes
obvious that the order in which things are cleaned up and
invalidated is somewhat odd: the native context is in fact
gone _before_ invoking helper callbacks or tearing down the
OpenGL API wrappers. This only works because likely nothing
relies on the context still being usable when destroying
those objects and when the texture/vao helper callbacks
run.
Reorder this to: 1. emit the about-to signal 2. invoke
callbacks and null out helpers 3. destroy the function
resolvers 4. only then start tearing down the platform
(and so the underlying native) context objects.
Change-Id: I9067463b8f6ce1f656129594c347c1428439ca5e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
(cherry picked from commit f045ef4ab6f72b2024119d15da8476a26e3b2242)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- Convert defines to static const
- Use camel case in the constants
- Use size_t as type in sizes.
Change-Id: I06d2588bfa5211a7825f068b2c4f33bbbd2065c4
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit f766e6051904f6755753d7d604fa8f19dbebb81b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is similar to Q_COMPILER_MANGLES_RETURN_TYPE, except that the
other such compiler, SunPro CC, at least by my cursory reading of
https://archive.org/download/SunWorkshopVol5No1/Sun%20WorkShop%E2%84%A2%20for%20Solaris%202.x%20Volume%205%20Number%201.iso/SPROmrcpl%2Freloc%2FSUNWspro%2FSC4.2%2FREADMEs%2Fmangling.ps
doesn't appear to mangle the access specifier. So it's only MSVC. It's
still better to have a properly-named macro for this than to work with
Q_CC_MSVC and, hopefully, an explanatory code comment.
May come in handy to maintain BC when we find the need to change an
access specifier in the future. The original use-case, in QtPositioning,
was fixed differently. If nothing else, let's have it to raise awareness
of the issue.
Change-Id: Ia8b789d2713ec19487a21c6bb0a12cf285e6ba83
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c155216917ff583bcab3d0ec5b59099af3fbea0d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Says Clang 15:
tst_qurlquery.cpp:193:11: warning: explicitly moving variable of type 'QUrlQuery' to itself [-Wself-move]
moved = std::move(moved);
~~~~~ ^ ~~~~~
It's amazing how little it takes to throw this warning off guards:
just use an alising reference instead of the same variable. Makes you
wonder whether the time spent on detecting such trivialities in the
compiler is really well spent.
Amends fc8dad2f10e7976cfa778ca7d75e651012629b21.
Task-number: QTBUG-109842
Change-Id: I165af2a786aa0ba28b8dcd039a500f3494bc29a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 577276d12c7b40d97a113a9daadcbd1f321b686f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Break the long sentence to improve the logic readability a bit.
Change-Id: I3d0227e616a3c47e14ae7b5cfe4b47a39d778e5e
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 21baa7623025308a39577e7582c023b1d3ae11d6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's possible that the window has the WS_THICKFRAME flag but the
Qt::FramelessWindowHint is enabled at the same time. That usually
indicates the user is customizing the window, but it will also
confuse QPA's current logic. We can make the logic more roboust
by reading the Qt window flags as well.
Change-Id: I9894e312a92ef7f5fc0aa93974f216b67fe2cf29
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 17ab11ce493477f891916351b6ac0f0a8ad28ca6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- Use modern string literals and initializer lists
- Move the Python-specific parts into if block
Task-number: PYSIDE-2191
Change-Id: I529f461b330de72dba465ece2c03fa55819a575e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Yuhang Zhao <yuhangzhao@deepin.org>
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 97a7e7b2d024f024c02003a2002ab0bb0a99b103)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since Qt 6.3.x, qBound() has started asserting that max > min.
This caused a crash in the QTextDocumentLayout code for assigning
widths to table columns that were sized using percentages, which
depended on previous qBound() behavior of just snapping to the
minimum size if max < min.
There are some specific conditions for this to happen: First
of all, the available width in the table must be too small to
fit all minimum widths (which is calculated based on content).
In addition, the requested widths have to be given as
percentages of the table width, and these have to add to
something lower than 100%. With these conditions, you may get
a case where the calculated percentage width of a column is
larger than the minimum width, but lower than the remaining
width in the table, causing the assert in qBound().
We simply accept the minimum width as the rule in these cases,
which matches behavior without the assert and which looks
correct when resizing the window to be smaller than the table.
Fixes: QTBUG-108183
Change-Id: I16d18dd9b2e7a77fe86d1a353b426075b5050b8e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 84a68ef75ce8a8e5b90d799c90905cc998c7c2f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QWidgetTextControlPrivate::mouseReleaseEvent() has early returns
implemented, e.g. when link has been right clicked or no selection
anchor has been found. These early returns, however, still consume
the event.
This leads to events getting lost instead of getting propagated:
As an example, a QLabel with rich text uses QWidgetTextControl. While
it propagates mouse press events back to its parent, mouse release
events get lost. A QLabel with plain text propagates both events
back correctly.
This patch adds QEvent::ignore() to the early return.
Since no test class exists for QWidgetTextControl, it adds a test in
tst_QLabel.
Fixes: QTBUG-110055
Change-Id: I950f8c3f135793b01c59832835bb429db2282169
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7689d4ad2f673317af432aae498da74d13703126)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The 'WITH OIDS' was deprecated some time ago and removed with
PostgreSQL 12 so we have to adjust our test table creations. Don't know
why it was used in the first place at all.
Change-Id: I6e18ac01e64368b1dd64e02bcb75fa70e05467a3
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 87662bcf107e65c04f933f212f4c8cad6692f948)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This makes the exceptions prints tagged with the app's name/tag,
and also can allow QTest::ignoreMessage() to handle exceptions as now
it cannot filter messages out because they're printed by the Android
system.
Change-Id: I9f5132b9ec5b5cd8fb35707eaaf68aa517f417ec
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit dbb622a38d6ce4fbd7fba010aea238e5f9552c67)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The growBy() function takes the _increment_ of the size(), so needs to
add size() to increment for the call to realloc().
Add a test which hangs (vanilla build) or explodes (valgrind build)
without the fix.
Amends 26b227e128475da3f88a6b34921a08994bf71cf4.
Done-with: Eirik Aavitsland <eirik.aavitsland@qt.io>
Fixes: QTBUG-110412
Change-Id: I7ea91342fdcb779825c88013a3f86ba6d90ef530
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 51e5a2376a8a2956665ff4c3a0e86c8cd9d0847d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It wasn't added when this class was created in 5.0 because we couldn't
add move constructors and still keep the ability to compile Qt with
C++98 compilers. We've forgot to correct this shortcoming since 5.6.
Fixes: QTBUG-109842
Change-Id: I69ecc04064514f939896fffd17376b8243b73c52
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit fc8dad2f10e7976cfa778ca7d75e651012629b21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If an object had elements and then was emptied, it will have a non-null
d pointer, which wasn't taken into account in the comparison.
Fixes: QTBUG-109840
Change-Id: I69ecc04064514f939896fffd17376aa18184653c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3d584b1093cdb6245b02eda996db2927ffaf09ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
range_access.h:274:5: error: inlining failed in call to ‘always_inline’
‘constexpr std::size_t std::size(const _Tp (&)[_Nm]) noexcept [with _Tp
= short unsigned int; long unsigned int _Nm = 34]’: target specific
option mismatch
qsimd.cpp:367:35: note: called from here
Change-Id: Ide4dbd0777a44ed0870efffd1739097c71991822
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit d298ec3a6f4634254c6685398d49b1ba4dfa8e6b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use a stack buffer, and perform the recoding from L1 to U8 in chunks.
Solves the L1 case of
Task-number: QTBUG-109284
Change-Id: Ia9ac7d8b27fd452d24d9e27f0575f9fc83b6dcbc
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit e3f230e7be445b9cabaf1c8556bb97994813e205)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qt_ntfs_permission_lookup is a non-atomic global variable that is prone
to data races. Make a remark about this in the documentation.
Task-number: QTBUG-105804
Change-Id: If7c64f3ab7d2c3b1487fe56204a4e66c420b0604
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 696ad54e5d76dd063cbb02d0c288fdece6ee75d0)
Found in API review.
Change-Id: I347ae3cc6a51095dddaba617adc2f63612578ef3
Reviewed-by: Sona Kurazyan <kurazyan.sona@gmail.com>
(cherry picked from commit 7ca8cb89e618faf01481187af848b5c3856d295e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Any QHttp1Configuration object created has 'ShortData data' as active
member. std::exchange()ing or qt_ptr_swap()ping 'Private *d', then, is
accessing the inactive member of the union, and that's UB.
Fix by swapping and copying the whole union, as opposed to any of its
members, and, in the move constructor, activating Private *d.
This is now safe, as assigning to 'd' ends 'data's life-time and
starts 'd's. Even if we assign a well-formed object to a moved-from
object, we either swap or copy the whole union, so SEP. For
self-move-assignment in the moved-from state (Hinnant Criterion),
we're using std::swap() on the whole union, so SEP.
In addition, activating `Private *d` in moved-from objects means that
a future ~Public's use of unconditional 'delete d' won't invoke UB,
either.
Thanks to Peppe for insisting on fixing this.
Change-Id: Ic1323b8416d6b17ae21768c625de1daba0944133
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 47abdabe2cfd20715b0186b9c257bc32db9315bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The move-constructors for QTimeZone and QTimeZone::Data are trivial so
can be inlined. Requested by Marc Mutz in 6.5 API review.
Change-Id: Id59dc95e0da061187d9db8cf0a5ab82fcece1694
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f805db7c61c646024bfec7cc0de3a1e9bb800792)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The {CF,NS}TimeZone declarations are only used when backends are in play.
Change-Id: I17fd3fc90ce96f35bcb8f81b862cc5d3752e37e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c2b0287a4439aaab4c434330ce1744635c29f3fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It doesn't seem like that it is being used anymore, except an instance
in pro2cmake which I replaced by NO_GENERATE_METATYPES.
Change-Id: I135cf47e6041e98b354fb684f0079dad30689dea
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b171abe69533a83c5b6fea51807da3ad45a1d3f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QMake and qtpaths used qVersion() to report Qt's version number. This is
problematic if those tools are run in an environment where a different
Qt version is loaded (e.g. by setting LD_LIBRARY_PATH).
This reverts commit a783c3d574a1400c4dfdd32975fc511f095df8b2, which
changed the use of the QT_VERSION define to a qVersion() call in qmake.
Additionally, we use QT_VERSION in qtpaths too for consistency.
Change-Id: I6c8a1aa6ee6169becd7c685a98ce23c22c3864c7
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 98a3634299e29104dee391145728dbad9797d7b3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
They can be smaller than an int, so use quint8. In a world of BC
guarantees, pinning the underlying type of enums is best practice.
Found during API review.
Change-Id: I0c31fe4565329982c81173e3a265f73758aad257
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3b0439379f31aa80bb7a08b2cb17c11311122759)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These docs are for Q_Calendar_Permission, not for QContactsPermission.
Change-Id: Ifbffa568b510ef035270082d1926e35d8d5cf241
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 7a1bf4c628e4b90d1b5f96b6018c80070222088c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The new test:
- checks the properties of stateful Q<Typed>Permissions work
- ensures that piping a Q<Typed>Permission through QPermission
maintains state
- also ensures that assignment of a Q<Typed>Permission to a
QPermission works (via QPermission(Type) + move ctor)
Change-Id: I340e49b1ecc665702ccab26d9050ca158b0e7885
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 8f8d8f71dd5d24d2d6f6075bd05ef2e5955d5678)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Main purpose is to limit the number of keys a user can enter, so
let's be explicit about this. 'Truncation' seems to happen only if
the program programmatically sets a longer sequence to the edit,
which is arguably a programming error and also shows up as a
warning in the logging API.
Change-Id: I7b2b74e8dab44c5ad16ffefc25c5610708139353
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Laszlo Papp <lpapp@kde.org>
(cherry picked from commit a4579121ca97522db18904cc46f520d263b3bd0d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This got lost during the QStringView port that happend in Qt 6.0
(commit 548dcef08976649c820054f3db1ad108c72439cd) because
QString::operator+=(QStringView) does not copy the nullness of the right
side, whereas QString::operator+=(const QString &) does.
Fixes: QTBUG-84315
Change-Id: Ide4dbd0777a44ed0870efffd17399b772d34fd55
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit a14a3a5487675a231b912e9a5ae575357d1c2cf8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Allow setting the initial directory where the file dialog
will be opened.
Change-Id: I1395b367c74d28fb2890ac53a90456c3ac4c1b05
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 609e14724edfd8d8cef23c5f30ad7812a359ed8d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QT_FEATURE_ltcg is TRUE if either of
CMAKE_INTERPROCEDURAL_OPTIMIZATION=ON or
CMAKE_INTERPROCEDURAL_OPTIMIZATION_<CONFIG>=ON are passed to the
configure, or the cmake command.
Change-Id: Ibaece67de6cc6f89e505038fd02fb50008c47d48
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9c90cd7fb969f8907a68ec330a3dbd27842a928a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The -no-rpath configure switch had no effect.
Change-Id: I306ec33249a219066ce94d18da5f1ca3d92905e1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 392d9a54194d06e96bfebdaf081aa6c9787e33ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
__GlobalConfig_install_dir translates to lib/cmake/Qt6/ and 3rdparty
modules will be in lib/cmake/Qt6/3rdparty which seems to be a logical
place for them.
Change-Id: I90c715b9502b0dfc666bb3202a838f20ba6110cf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 20821877bba5c2a685098fcf42c9ee48d7b285a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This replaces an ad-hoc solution.
As a drive-by, remove a check that was always true.
Change-Id: I72166ee75a2c474dc91bc699c790f256b78b3b7a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 42f555f861bbc7daaf211bc83fd57795f45f7a86)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
initializer_list is supposed to be cheap to copy, and passing by value
will avoid one further indirection (though the compiler can probably see
through it, anyway).
Change-Id: I8ffbf5de4d8cf2c85f4cff76ef63d6cdeac4db5a
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 1d43cbfede7d39fefecb39a8a5dbb74a23d7383a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qTopLevelDomain() is misleading in the configure summary. The function
has been removed by commit 50b3097683
Also clean up the topleveldomain files.
Change-Id: Ib577962909a83f4f41d1660a26fd80b37803ae18
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 56d72d36bf7df8f9c87177e364096f0120876810)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Otherwise we might conclude that we found a usage description when
PlistBuddy outputs "Error Reading File: /tmp/Info.plist" to stdout.
For CMake this is not an issue as we pipe stderr to a separate variable,
that contains "Cannot parse a NULL or zero-length data" in this case.
Fixes: QTBUG-109967
Change-Id: I9d819b6de405b88bb7d1d75c22b6f5187f26e553
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit ada434e417568457df252b6069ec51f6ba8335c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
One of the examples were using a different version than the others.
Though QString's formatting probably didn't change since then so
it was no problem.
Anyway, pretend like we're releasing it now for the first time and
set 6.5 on all of them
Task-number: QTBUG-108875
Change-Id: I28b496ab3d8ff54c503a032ba15882cdf3d5eccf
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 71cd3bc074b4eea3158ba037ae2fe1c5b922ff3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Ends up shortening the loop, making it easier to read at a glance.
Task-number: QTBUG-108875
Change-Id: Ia12a994259b00e9b57f2de48124be9cb38553bf5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 605eec7b55516291fe0fc92401947e80b2d8e425)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There was a plan to invert the API, but since the TODO, we are settled
on the non-inverted name, ie., GENERATE_CPP_EXPORTS.
Change-Id: I84f531d870965e0b7d0d821d1ff08606ab8054ab
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 1b4aba0a59abeb27e3ef21391a39ca2093e4ca46)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
ICU 50.1 was released May 11th, 2012. Despite of the restriction, all
currently supported operating systems will continue to be supported.
All mismatches described in QTBUG-99715 are fixed in this version.
Restricting to 72.1 (latest version as per January 2023) or 63.1 (2018)
would still exclude e.g. RHEL 9.0, which ships version 56.1.
Task-number: QTBUG-109505
Change-Id: Ic5cd7927d6f5fb60a89423c305796a9ed311bfa2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3002816d77d2ee5adfc040176582f3b95116ccfb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- QPermission_s_ -> QPermission
- add a comma to make a text piece clearer
Change-Id: I08469cca9a05b08772d101fdab4eccd6b9cfcab8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit cc236d5e0c38d01ce8b24ba9ac161886b60a6ed9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QString and QStringView have the same size_type these days.
Change-Id: I59ffe78f51e06ccc130562b1682fb4a672c3ec22
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 8ef22183d67e0e7a8ad00bc0ea48c41510eb84ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As a consequence, also had to add some suppressions:
-Wno-padded (this warning should almost never be responded to)
-Wno-c++98-compat (we want to use c++17 features)
-Wno-weak-vtables (IMO not worth fixing for an example)
Change-Id: I28ae4456c0221ad2370879a691f6343affff138b
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 1e790fb4dbd82c9a4e668c630e21a27eb23d3a37)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Noted in API review: Improves formatting and readability.
Change-Id: I3a8f769899031410d00397a885f115adcca82f3b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 02effb2c37c8439baf2aaabe24fa635326fb6399)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Noted in API review.
Change-Id: I98ec47f4c934156990d67363b69ccd33617661de
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 6975dd38c14a2473d7997dd65c3789b843078409)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As discussed in the latest CMake API Review, we are deprecating the
FILENAME_VARIABLE variable name everywhere, and replacing it with
OUTPUT_SCRIPT.
[ChangeLog][CMake] The FILENAME_VARIABLE option of
qt_generate_deploy_script and qt_generate_deploy_app_script is now
deprecated, use OUTPUT_SCRIPT option instead.
Change-Id: Ic8be33eefbc48540166ea0fcf1d1948b052d4b8a
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 2b2065bf35768cfbef833c588c8d93d5a09a76ba)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Consistently use int (instead of uint) type for alignment/text
formatting flags passed to QStyle::drawItemText (and overrides).
Clean variables in QCommonStyle::sizeFromContents
- use self-explaining variable names
- rename misleading variables
- define one variable per line
- use consts whereever possible
- insert new lines to make code easier to read
- correct wrong indentations
- use auto in qstyleoption_castis to respect maximum of 100
characters per line
Change-Id: Ie145c089606436213c813227154fac29962825d0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit c84f3fd370ef7b4d532e5bf6db7b4be819d676ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The example didn't show anything useful, and seemed more like a
manual test case.
Change-Id: Ia71f39b26943aab04b6895e63b6eed50dd084bfd
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 2951f72584e70ddf31c1ef644f7eb8643da0084b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
.../qabstractbutton.cpp: In member function ‘virtual void
QAbstractButton::keyPressEvent(QKeyEvent*)’:
.../qabstractbutton.cpp:1010:58: error: incomplete type
‘QGuiApplicationPrivate’ used in nested name specifier
Change-Id: Ia71bb481d125087aa813c891f9508755f435f4d2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ca772a8ffa2fdde4238ff0af325997dd78dbfe83)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Move all libthai symbol resolution and state management into a single
class. Create a single global static instance of this class. This allows
freeing of the state on program exit.
Task-number: QTBUG-105544
Change-Id: I2610863f85f49f88e83f1fdaa200ea277c88c0ef
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 5679f9f82c0dc19963edafe86d181dd9241fda2e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Despite being move-only, std::vector<unique_ptr> advertizes
is_copyable:
https://quuxplusone.github.io/blog/2020/02/05/vector-is-copyable-except-when-its-not/
Our combined reallocation and resizing function, reallocate_impl(),
runs afoul of this when it uses std::is_copyable in a constexpr-if to
implement resize(n, v) without running into problems with move-only
types: the trait is true, but actual instantation runs into a
static_assert in the STL implementation.
To fix, move the problematic resize functionality out of
reallocate_impl() and into the resp. resize_impl overloads. The shrink
functionality remains in reallocate_impl(), because there are many
more users, and it only requires destructible<T>, which isn't
constraining at all.
Amends a00a1d8806cfbf17e04b88d1b4ff4a9cf5b6294a.
Fixes: QTBUG-109745
Change-Id: Ibc5b9cf5375108eb3d8f6c8a16d4fd02dadd73b1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 800ebd84f57092ccba24984f3888f97bb5433d8e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The method is not meant be a slot.
warning: getter QApplication::autoSipEnabled possibly mismarked as a
slot [clazy-const-signal-or-slot]
[ChangeLog][QtWidgets][Potentially Source-Incompatible Changes]
bool QApplication::autoSipEnabled() is no longer a slot. Code such as
using QObject::connect() to connect to it as a slot or accessing it
through meta object system will have to be rewritten.
Change-Id: I892a51120478f3c90e5834c8e3e00bc836b84c52
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 03ed57afa0c5af5076583dd4e415e54983e7e0a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On small screen devices such as iPhone targets, the save file dialog is
using a non-native dialog, and it doesn't fit the screen real estate to
the extent that the [Ok] button is clipped away.
In addition, the open file dialog and the save file dialog doesn't
cooperate very well on platforms such as iOS without more plumbing.
Since using the file dialog is out of the scope for this example we
remove all usages of it.
Change-Id: Ie165355ed0b671d93e44d2d55791156367b0ea5c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 4dbb07f614c914e78437aacf7a1716f632da5e8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This will be read by windeployqt.
Change-Id: I8dfebae755ef61967e924db3c5631af5cc4e2440
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 0b92502de28f5ecfd9622a222c92211b6325ae84)
_qt_internal_expose_deferred_files_to_ide must add the source files to
the target exactly as they were passed to
_qt_internal_expose_source_file_to_ide. Otherwise, CMake might be fooled
into thinking that we're adding a new file here, and source file
properties would not be readable.
Instead of back-calculating the relative paths from the absolute paths,
we use the already existing list of relative paths.
Fixes: QTBUG-109678
Change-Id: I81510f37eacb409eb5c03e3ff032926c3ca25a1f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c146d25a87bcb94ed4eefae749a96ed3550b7af2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Also remove reference to QTestCaseEvent loop class, which
is not documented.
Change-Id: Ic09b3b102db535dfb090b9a4072ad29515a911ae
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
(cherry picked from commit 9ae91ac318009cd424465236c4f276df625c52ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There is no benefit from storing return value from some OpenSSL calls as
the only thing we do is to ignore them. There is also no difference when
we would be returning earlier.
Change-Id: I76c742016a2532c65ffdcd913aafc74a2d1a9623
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit a48bbbaa50860507d7b738d2095adf794eb552d5)
Its symbol changed once it was changed to protected, so even if
it's unlikely to have been imported in any application let's just
change it back to private.
Change-Id: I21b4a471caedb8edc8e1a04f706eae541b3c12fd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 36619181fb0e507d4a092d74d7ad31c513ddaead)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use th_brk_new()/th_brk_find_breaks() instead of non-thread-safe
th_brk(). The new API is available in libthai since version
0.1.25 released on 2016-06-28.
[ChangeLog][QtCore] Correct line wrapping of Thai text now requires
libthai version 0.1.25 or above.
Fixes: QTBUG-105544
Change-Id: I723050bef9f4e6445c946125c74c99e50addadef
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 19ca03c21c2cf69fdec4dd8d6a03b92eb96314ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Patching inconsistent path separator in Batch file. This at some point
may lead to something similar to the mentioned task.
Task-number: QTBUG-109857
Change-Id: I36c05dc7a0b7daf3dc5dced61f3c3f7d90eb59e3
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 07a978c756cba6953bf81497fa3a386793652242)
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
It is now not the screen that handles all of the events and relays
them to individual windows, but the window elements themselves.
This allows us to get rid of manual window targeting logic and let
the browser do its job.
Fixes: QTBUG-107217
Change-Id: I4dc5a74b1343f027f72c1da4623b99cd28bfbb38
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit c15a8750bcce3d4dabeebcc8bb4c15db31c7f637)
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Implement platform independent tracing backend in Common trace format.
This allows tracing in platforms without own/existing backend and
analysing all platforms with the same tooling. The backend is the basis
for further work in application level profiling area.
The backend is implemented as a plugin that is loaded immediately when
the application starts in order to process all trace events. The backend
avoids using Qt classes so that it doesn't generate trace events
itself. Adds plumbing to configure the new backend.
Modifies the tracegen and tracepointgen tools to support the new
backend.
Task-number: QTBUG-106399
Change-Id: I80711be52d4d48e1acbc72edffbdf3f379fce52a
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit e3458aac6406e5b624cd54e28b5784fb09f07bc3)
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Modify qtcore and qtwidgets to use the new tracing metadata features.
This allows showing the event types and image formats used in traces
as text instead of just numbers.
Task-number: QTBUG-106399
Change-Id: I267d03a696dc95e8b1d36657d7339dd09d92de3b
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit a37a59eea8b010c45da1722a005946a2450363b3)
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Adds ability to add textual metadata for enumerations and flags
to the traces so that they provide more information to the user
instead of just numbers. Implement these for both existing backends.
Task-number: QTBUG-106399
Change-Id: Ibab00dd370d019891cf9ad6e65e6f9d868e32dce
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit a2bcb7d8adb7bb59087cd2df2396539e2baf5b7d)
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
They cause clashes in CMake Unity (Jumbo) builds.
Properly prefixing the childWidgets() function also prevents
it from cluttering static builds.
Task-number: QTBUG-109394
Change-Id: Idd2b1ec748f33cfae8f3213847c43b3fb0550377
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit f5b1dbb8f6966bea54799480e3c16e23f0d06d42)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Like done elsewhere (e.g. in QStringView), formulate the constaint in
if_x<T> = true from, and let qdoc see it. Then document the constraint
in prose, too.
As a drive-by, use C++17 variable templates instead of
std::bool_value, and document that data() returns a
default-constructed T on failure (which is indistinguishable from a
successful call that happens to return a default-constructed T, so we
should probably return an optional<T> here, but that's orthogonal to
the change at hand).
Change-Id: I0584ce3f4febd619d3966afeb6244b11b167cd42
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 6ac9d46a36f1b6b921efdcb47d7b7241d2396897)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When rows are hidden (implicitly or explicitly), then their layout data
does not get fully updated. If rows get hidden after the layout data has
been calculated once, then we must make sure that their indices are
reset. Otherwise we might access array indices that are out of bounds
when the layout data structure gets resized to fit only visible rows.
For good measure, skip entirely over hidden rows when accessing the
layout data when arranging the widget.
Fixes: QTBUG-109237
Change-Id: I4d6943b6a110edb61f60ce78d31f0fc64b5cc03d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c3a5fe2fd7a1b8a6b6133c938ffe6b3f30181bf0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Extract the type-independent code into an out-of-line data_impl()
private method, leaving data() containing only the
QMetaType::fromType<T>() call as well as T copy- and
default-constructor calls.
As a drive-by, use categorized logging (consistency with the rest of
the permissions code) and printf-style qWarning() (expands to less
code).
Change-Id: Ie23b83cb3fc537c9cff15f853ceee2888bf63124
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 66235481043d85e4f51a216cf2ad3bb895ea7842)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The flag avoids overriding of the default CMake build config when
building syncqt.
Add extra checks to the make sure that configure-time tools use the
correct build type.
Fixes: QTBUG-109792
Change-Id: I572fed60c58e59297fa559aea6eb86af94b979b7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4e4cd7416af3f84e6a7c7dee03a2e50864e9cacc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If the command line option contains /DEBUG without the following
argument, GenerateDebugInformation remained 'false' because the
DebugInfoOption contained the initial value.
Set GenerateDebugInformation to 'true' if the /DEBUG option is found and
reset to 'false' only if option is set to 'none'.
Amends commit 6a6b27940d497b29672ff65ff242fe0211603f22.
Fixes: QTBUG-110068
Change-Id: I792d7335d8b9536d4beed54cabfd70dcf54f09ac
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 0e3ef4111271761ede6cbbeb3b0fa075a483085e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To be extended as neeeded.
Change-Id: I57d2f55f67de073fe3e4916b7ba655342cf661dc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit a478d730f896e89fce83483c8b056b47ae973736)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Setting a negative line width does not make much sense, but in
earlier Qt versions, this work the same as if the line width was 0
(just give you the minimal layout given wrapping constraints).
But since 991c056438b311566bc4ea543af0f33dfd5dffbb, we check if
current width > line width at an earlier point, and because 0 > -1,
we would exit immediately before adding any characters to the text
line.
To restore the behavior in earlier versions, we set the minimum
possible line width to 0.
Fixes: QTBUG-109474
Change-Id: Iceadd5135681f61b30de8221853834983941c5a4
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: hjk <hjk@qt.io>
(cherry picked from commit 49a63d375972079ae3000c8b7d512d58d4de32bb)
The two-step destruction we used to employ is needed as destroying
a screen which contains a window crashes.
Change-Id: I722828be5408a7f079d66e845eeee34ed19cbf34
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 644036b597137306959d875127cc819612ee9217)
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The compositor is redundant in the process of moving the window.
Have the title bar react to move all by itself.
Additionally, a clearer structure in the window was introduced.
The non-client area has been extracted into a separate class, as
was the icon store and free DOM functions used across files.
Since it was now easy, made the window maximize/restore on double click
on the title element.
Fixes: QTBUG-107626
Change-Id: Iba7f207e46806ae7162656965892ae5a48ac5ebe
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 32666691c21cc91a3d7c7585dad711dc9743fdce)
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Add it globally so that each module using tracepoints don't have to
add it themselves to each modules configure.cmake.
Change-Id: Id58cfaff5cd715b2667da2470001d646117f9f28
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit bab65d70dcaf08e85113d5203056a4b8dd2c1fa7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Allows automatically generating tracepoint files by scanning source
files for instrumentation macros.
This makes it easier to add tracepoint support to modules and also
ensures that the tracepoint files do not get out of sync with the
functions they are tracing.
Q_TRACE_INSTRUMENT generates entry/exit tracespoints for a function
it is set. Q_TRACE_PARAM_REPLACE is used to change a function parameter
for these functions to convert it to supported parameter type.
Q_TRACE_POINT can be used to create a standalone tracepoint.
Q_TRACE_PREFIX can be used to add prefix for generated tracing backend
for example to add includes for types used in the trace points..
Task-number: QTBUG-107238
Change-Id: Ib395b80838434ceb72683dac0545ca20c4d09455
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit 9bdf74a4f23d009777f1cbdb0078aa70060a3da5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Remove the array field type. We need to know the basic datatype as well
for future backends. Use the arrayLen instead. Add the missing array
handling for etw backend.
Task-number: QTBUG-106399
Change-Id: I97c38240bd1c79c0e61d268a7d780016b341f110
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit f488c657216115d33753429e8500b99b6e8e7c4c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Having the declaration of a function depend on compiler flags is a
fundamentally bad idea since you can compile different compilation units
that all include the header with different flags. This leads to
undefined symbols.
Fixes: QTBUG-109159
Change-Id: I0aede280988e4f10c42d5b1824ad9c96a1e10854
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9615e7f9e538af4ad212f4f71d1364c64b18542d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The original is defined in <type_traits>, not <functional>.
Change-Id: I596e56f64d2eed609ad2f7e6f03ae006afaa2fa9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit def2a3de3741410bbf7ab31b59afc27b0777e09b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Separates the actual reallocation use-cases from the resizing ones
when calling reallocate_impl, in preparation for fixing QTBUG-109745.
Task-number: QTBUG-109745
Change-Id: Iee0c3e56569ec7877beda8db3a645e2bbb6b4d4a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 26b227e128475da3f88a6b34921a08994bf71cf4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QEGLContext::invalidateContext will mark that egl context is invalide
and trigger SceneGraph to destroy it, create a new one and re-create
and re-upload all resources (e.g. textures) associated with the current
state of the SceneGraph
In addition this change also improves
QEglFSWindow::invalidateSurface() and
QEglFSContext::eglSurfaceForPlatformSurface(..)
Where QEglFSWindow::invalidateSurface() will now destroy the
corresponding EGLSurface via eglDestroySurface, including "unbinding"
it from the current thread via eglMakeCurrent and
un-setting the screen's EGLSurface in case it's the same resource.
QEglFSContext::eglSurfaceForPlatformSurface(..) will now call
QEglFSWindow::resetSurface() in case of getting a EGL_NO_SURFACE
from the QEglFSWindow (which happens if above invalidateSurface()
was called before) - therefor re-creating the resource if
it was destoyed via QEglFSWindow::invalidateSurface()
Change-Id: I37badd1fc11e993c395fb1502e9bd27ebe18b821
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 17a59f661398bf56aeaba4187f55d07eea09c578)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The typed permission classes' properties, insofar as they have any,
should default to the least-intrusive capabilities.
QLocationPermission implements it that way, but these two typed
permissions defaulted to read-write access instead of read-only. This
was fixed in an earlier commit. However, default values of properties
are most natural when they're equal to the default-constructed value
of the property's type, and this was no longer the case for
isReadOnly.
By renaming the property to isReadWrite, defaulting to false, this
relationship is restored, and code using the classes looks more
natural:
- p.setReadOnly(false);
+ p.setReadWrite(true);
Found in API review.
Change-Id: I4efa4c0326b5a54181c96f477709b0686c963e90
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 1b6883146d4a3b022434fac1a4bda579a6767986)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Non-polymorphic classes should not be exported wholesale, because MSVC
exports inline API in such classes, too, which has caused numerous
problems over the years.
Only export individual functions.
Change-Id: I8be55c1fcdb21d143a02bb62498caeea6ebca068
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit ceb4140b59428a805d11c036ef223f46d83653ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The Q<Typed>Permission classes get their \since via \include
permissions.qdocinc permission-metadata, but using that for
QPermission will break the \annotatedlist permissions trick used all
over the permission docs, because QPermission would then be included
in the list. The use of this mechanism needs more thought; QPermission
shouldn't really be excluded from being \ingroup permissions.
Change-Id: I33207ffb39c04c23fb479c173e97dc0adb60691f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 49cdfb0c61521f843046e473d759149ab4878ce3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
OpenSSL doesn't allow to add additional data when the hash has been
finalized. To fix that, we just make a copy of the current context
and call EVP_DigestFinal_ex() on the copy so we can still later add
additional data.
Change-Id: If76d4ec56f8846d6ef55ed7ec7cbab440d43edd0
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 698c7696ebff4868c695bb6d7ca66ed17b5c2f3b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Consider a cross build of Qt with qtbase, qtshadertools and
qtdeclarative. If a user projects only links against QtQml without
creating an actual QtQuick module, no host tools from qtdeclarative are
needed.
Normally, find_package(Qt6Qml) pulls in Qt6QmlTools and errors out if
it's not found. By setting QT_ALLOW_MISSING_TOOLS_PACKAGES when
configuring Qt, one can disable the error and build a user project such
as the one outlined above.
Fixes: QTBUG-109547
Change-Id: I45e727713912d19e6007a7fbf3d61533f82b71d9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jaeyoon Jung <jaeyoon.jung@lge.com>
(cherry picked from commit 94e474b48e9d3c6434339afe166c2329f8c36ea2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add accessibility (a11y) container QWasmWindow. This
container should underlap the canvas with identical
geometry but ordered below.
Change-Id: I7b91e3e69e3b1afa1b03ef7f7b7336e48f1a1594
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit f4dd67461d9873cdbfe7bef970477366047924d7)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This is needed to transfer focus to the receiving application if that
is already running
It uses the new native interface for QWaylandWindow to access the
existing xdg-activation support of QtWayland.
The received token is passed in the options map for portal calls
(as defined in the portal spec) or passed via env variable when
launching the relevant helpers
Change-Id: I524bc58d88033af914e8af2c6db26b1a86afb863
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit fbfaf5d38b3455bb561e739271986be91a7c7169)
Based on existing code, it appears that it's always
preferred in wasm to use synchronous delivery
(<QWindowSystemInterface::SynchronousDelivery>),
however, we can simply define this as the default mode
of operation, which will make these unnecessary.
Change-Id: Ia4c78593333e314f91efb266268917317794e2f5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 4b1229e5235412062a5240410ec49e358019507c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Implement a11y support by adding html elements (Checkbox, Radio Button,
TabView,Spinbox, ScrollBar, Slider, Event for Button) and events of
the appropriate type and/or with the appropriate ARIA attribute
behind the canvas.
Change-Id: I52902eae2bd4ac7a125815e1d2dd3077211fc118
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 040b4a4b21b325995c49772a86a061249f16851c)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Implement a11y support by adding html elements (Toolbar, Menu,
DialogBox) and events of the appropriate type and/or with the
appropriate ARIA attribute behind the canvas.
Change-Id: If9c9fbff9a451b44e57de5d8834f4a78f33f41bc
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 13c3fd959ed400396ee770d3e300778cf20a50a9)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We want to make support for screen readers available
incrementally to avoid destabilizing existing functionality.
Accomplish this by initially adding a single "enable
screen reader" button only. When pressed, this button
will remove itself and populate the page with the actual
accessibility elements.
Change-Id: I65036d249c408d4dc1fa75e8c807d9b7300e4722
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 42d4619967688e4f313f5508de7594f0c0c976ff)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add accessibility (a11y) container QWasmWindow. This
container should underlap the canvas with identical
geometry but ordered below.
Change-Id: I7b91e3e69e3b1afa1b03ef7f7b7336e48f1a1594
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit f4dd67461d9873cdbfe7bef970477366047924d7)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
To be extended as neeeded.
Change-Id: I57d2f55f67de073fe3e4916b7ba655342cf661dc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit a478d730f896e89fce83483c8b056b47ae973736)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These were found with the help of -Wdangling-reference, which is
new in GCC 13.
The one in qtpaths.cpp is a false positive: parseLocationOrError()
returns a reference, so there's nothing for the full expression to
destroy. Moreover, it returns a reference to a static object, so
there's no destruction inside the function either.
The other two aren't, but are also harmless. QDBusMessage::arguments()
and QVariant::toList() return a stored QVariantList by value, so
QList's COW mechanism means at() returns a reference that will not be
destroyed. However, the compiler has no way of knowing that. And
since it depends on the implementation details, change the code to
not depend on that.
Change-Id: If53aa16fcc24586d752ffc76c193c81e43dc9d95
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 18def77d27f88ce26b6af29fe56a80429fed555d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QCryptographicHashPrivate::SmallByteArray is a 65-byte type, so there
were 7 bytes of padding at the end of QCryptographicHashPrivate anyway.
Change-Id: Ide4dbd0777a44ed0870efffd17394e1d5431e052
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 92a7c360208c6ab7504e8ff9e091fede73839fb1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QCryptographicHash::result() and resultView() are const, therefore two
threads can call them on the same object. Given that the finalization of
the hash is not a trivial operation but doesn't modify the state, let's
do it without a locked mutex, onto a temporary stack buffer. Then we lock
the mutex to copy said result to our cached value.
Fixes: QTBUG-110058
Change-Id: Ide4dbd0777a44ed0870efffd17394bf72785eabb
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit ccad719d2e935306e601b0f6af5ff2acb7cd272e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So we don't have to do these reinterpret_cast everywhere, as most of the
APIs we're calling take unsigned chars themselves. The reinterpret_casts
will be removed in the next commit, which needs to modify those lines
anyway.
Change-Id: Ide4dbd0777a44ed0870efffd17394f9f25062122
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 2d7a27b918ff576dbd8ec8b3aecaa45f8c78fa5e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Just describe the row instead. We'd lose the original input in case of
failure, so I added a class to print that value on destruction. Example:
FAIL! : tst_QAlgorithms::countLeading64(0) Compared values are not the
same
Actual (qCountLeadingZeroBits(value)): 63
Expected (expected) : 64
Loc: [tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp(374)]
QWARN : tst_QAlgorithms::countLeading64(0) Original value was 0x1
Fixes: QTBUG-109958
Change-Id: I69ecc04064514f939896fffd1738b1119cd80cf8
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d0408b5f13f811f73cf2485b5b31d5ec4b7f2b62)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Conversion must be explicit from float, but doesn't need to be from int.
qimage.cpp:1915:33: error: converting to ‘qfloat16::NativeType’ {aka ‘_Float16’} from ‘float’ with greater conversion rank [-Werror]
Change-Id: Ide4dbd0777a44ed0870efffd17390a0e86f1fd7e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 03b72188f45e72d313f8af2e16cb7067b6084f99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The QLocationPermission properties default to the least-intrusive
capabilities: Availability::WhenInUse (not: Always) and
Accuracy::Approximate (not: Precise).
Logically, QCalendar- and ContactPermission's readOnly property should
then default to read-only access, not read-write.
Orthogonally to this change of default value, it might make sense to
invert the name of the property, too: isReadWrite() or
hasWriteAccess().
Change-Id: I9359c82051b1a6735feca8b2f06b9891acef650f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit fae85282ba81a3f294b990f9e416a46680bfbe88)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Non-polymorphic classes should not be exported wholesale, because MSVC
exports inline API in such classes, too, which has caused numerous
problems over the years.
Inline the last two remaining out-of-line functions, as they're
trivial.
Change-Id: Ibc415b840b93a7350683e02433108270e1bd6bfd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit afb4e244b0554562c7904fa641114a8d1dd1b69f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Avoid dangling or incorrect device pointer during handler
destruction. This was recently fixed in the destructors, fixed here
also for the setDevice() functions.
Change-Id: I85b64726cd88d2c8e63eee59d5b4f2ae488df61b
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit 5633cb69f68ca3d3b82476f9025d863f804e76c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To make space for a tst_qpermissions auto-test.
Change-Id: Ic9ead8afa7ecd035fd5ed56c756f0156828c6705
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c63f9e81dde6a7a615f1e1363574857ec6c76f59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qsizetype(int32 on 32bit, int64 on 64bit) vs uint32.
qxcbwindow.cpp: In member function 'virtual void QXcbWindow::setWindowIcon(const QIcon&)':
qxcbwindow.cpp:1300:30: warning: comparison of integer expressions of different signedness: 'qsizetype' {aka 'int'} and 'uint32_t' {aka 'unsigned int'} [-Wsign-compare]
1300 | if (icon_data.size() > xcb_get_maximum_request_length(xcb_connection())) {
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
qxcbwindow.cpp:1301:53: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 3 has type 'qsizetype' {aka 'int'} [-Wformat=]
1301 | qWarning("Ignoring window icon: Size %llu exceeds maximum xcb request length %u.",
| ~~~^
| |
| long long unsigned int
| %u
1302 | icon_data.size(), xcb_get_maximum_request_length(xcb_connection()));
| ~~~~~~~~~~~~~~~~
| |
| qsizetype {aka int}
This amends ebdaf8ef9cea6f3669fc73bc3395acf2e497f7fc.
Fixes: QTBUG-109610
Change-Id: I2c9b5ad27881658463dd0870639c42d3ea8e7aba
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ec787ce14363c843f9c1149bad8045ff6acbcf1c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This patch fixes four issues with Metal tessellation.
a) Shader resource binding
The Metal tessellation implementation assumes identical SPIRV-Cross
native Metal resource binding mapping for vertex, tessellation control,
and tessellation evaluation shaders. These mappings are independently
generated by SPIRV-Cross for each shader stage, and may not always be
identical. This patch allows for different resource bindings for each
of the vert/tesc/tese stages.
b) Tessellation evaluation vertex descriptors
The Metal tessellation evaluation render pipeline vertex descriptor
generation code contains a bug where attribute offsets and built in
variable locations could be calculated incorrectly if the tessellation
control shader output variables are not provided in ascending location
order. This patch fixes this by sorting the variables by location
before processing.
c) Render pass descriptor
Metal tessellation draw ends the current render pass encoder to perform
tessellation compute tasks on a compute pass encoder. When the compute
pass is completed, a new render pass encoder is created to continue
rendering. A bug exists where the new render pass encoder uses a render
pass descriptor that clears the color, depth and stencil attachements.
This patch fixes this bug by changing the render pass descriptor color,
depth and stencil attachment load actions to MTLLoadActionLoad when
appropriate.
d) drawIndexed
A bug exists where when drawIndexed is called, the Metal tessellation
vertex as compute stage input descriptor buffer layout step function
gets set to MTLStepFunctionThreadPositionInGridX rather than the indexed
version MTLStepFunctionThreadPositionInGridXIndexed. This patch fixes
this by selecting the appropriate step function.
Change-Id: I122c67394719ad6b4801cd7643043839fd186bf2
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 0d7401d51bedecb1b84b78aedb50839928a0cc7b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Added a warning for when windeployqt is used with multiple binaries
which are in different directories.
Change-Id: Ic43aa9847eb2bf6927cebf5d457595eed6b16b5a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit a67607480d7cddf604d885532c4359b8c041fd11)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is unnecessary and basically doesn't have any effect.
Change-Id: I6b63e989c43bdcd55bf83d2c0756da2de1ab49df
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit a647d18df22d3aa8bfa3f4c1dbb1340095f0d200)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We decided that it's better to disable PkgConfig for Android, as it is
unlikely that someone uses them.
Task-number: QTBUG-110007
Change-Id: I6ae1059ddd05feeec047fbb906c7dba1586e816b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit e6693163e5e40668bc4cc5155003c173eea83273)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In order to generate metadata for a class `NS::Class`, moc will
"mangle" its name by turning the colons into underscores. This
however makes the generated name have a double underscore, and
all names with double underscores are reserved.
Instead, replace double colons with another string ("SCOPE").
We are then going to use this mangled name to create other identifiers.
To do so, underscores may get appended and prepended to the mangled name
(e.g. "qt_metadata_" + mangled_name + "_t"). This means that a leading
or trailing underscore in the mangled name would also be problematic;
avoid that as well.
Fixes: QTBUG-109851
Change-Id: I01391a57920545fc75f78ef4bfefaf6d3dd7b447
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e816f915411a0f517021769abd8919a423f635c3)
Since qttools commit 39fdcb8e7a, qtattributionsscanner fails
if 'Path' is not a directory. Use the 'Files' attribute instead.
Fixes: QTBUG-110002
Change-Id: I65fecdcb852ce9abea55f168cd939804bae9ae80
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 2c78c5d4569d89c204857ab007f9e260b219d624)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
...to 'name'.
It's clear from the context that this is the name of a module.
Change-Id: I07700a4413ceb12695c153e16d0a2dcded615d11
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit d756f4753eaf87755624a53c1e361d11f571fbd9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In a universal build the tool will find multiple duplicated rpaths,
but the install_name tool doesn't like it if we try to remove it
more than once.
Fixes: QTBUG-109738
Change-Id: I4a8bea0ad3e47b28e6384ceead551edc83e30d26
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 9a2198f9cdd5df482c64a52cb5d1e372ac24610c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The function is introduced in API level 30, causing an error
on a 29 device
Amends: eda4049a0142029c192e1690bafffbb98ee4ff99
Change-Id: I5f4e2301d04a0a2e0e2f4037e4c371efd2fef352
Reviewed-by: Bartlomiej Moskal <bartlomiej.moskal@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 40cb7434afe28c4dbe434a35b659e1af5299a3d9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In 705665957baf16f9ec4d256dd4d2fad98788314b we started relying on the
input method to decide whether a key event should include the resulting
text or not, based on the assumption that text insertion would happen
via the insertText:replacementRange: selector.
But the NSStandardKeyBindingResponding protocol includes several other
commands for inserting content, including insertTab:, insertBacktab:,
and insertNewline:.
https://developer.apple.com/documentation/appkit/nsstandardkeybindingresponding
We explicitly handle the latter, but for any command we didn't handle,
we concluded that the input method didn't want us to insert text, and
sent the key event without text, which broke tab character insertion
in text edits.
As long as we're not handling these commands explicitly, we adjust
the logic to treat any command starting with "insert" as an unhandled
request to insert text, and forward it as a key event with the text
included, as before 705665957baf16f9ec4d256dd4d2fad98788314b.
Fixes: QTBUG-109754
Task-number: QTBUG-106393
Change-Id: I4a164bc809c3606b43f267514a66ff017efeb4af
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7e7bae35f758acba45257d1cb4229d5bc43b07ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Clients who called the base-class implementation in QDialog would
as a result start hitting the canBeNativeDialog code path at the
start of QDialog::setVisible(), which would show the native dialog,
but without updating the QWidget visibility state.
To keep things 100% compatible, we shuffle the implementation of
QDialog::setVisible() into QDialogPrivate, which allows us to
override it in QMessageBoxPrivate and QErrorMessagePrivate.
The existing subclasses of QDialog that override setVisible have
been left as is, to not cause any unintended behavior change.
Change-Id: Icafe31a7b84a75049365e4e04b80492de08614d2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e0bb9e81ab1a9d71f2893844ea82430467422e21)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Due to an XCB library change, QXcbBackingStore::toImage() cannot be
safely assumed to return an image identical to QWidget::grab().
The test functions fastMove(), moveAccross() and moveInOutOverlapped()
relied on QXcbBackingStore::toImage() and failed.
They were backlisted on Linux/XCB.
This patch obtains a screen shot instead of an image from the backing
store on XCB platforms. It processes events until the screen shot
matches QWidget::grab(). It makes the test fail only if the comparison
times out.
The patch also removes the BLACKLIST file, containing only the test
functions mentioned above.
Fixes: QTBUG-109036
Change-Id: I26dd5b89dc62b313db066a285f6ad7d4d92baaf2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4096667d6601dcbc5e713e6b0fd5b5218453c4cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
First off, this doesn't cost us anything, because std::pair is defined
in <utility>, which qglobal.h unconditionally includes in C++ TUs.
More importantly, it prevents ODR violations: when a TU includes only
qtypeinfo.h, it will find std::pair<int, int> to be of Q_COMPLEX_TYPE,
in constrast with a TU which includes qpair.h, which will find it to
be of Q_PRIMITIVE_TYPE instead.
[ChangeLog][QtCore][QTypeInfo] The QTypeInfo for std::pair/QPair will
now be correct even if qpair.h hasn't been included, fixing an
One-Definition-Rule (ODR) violation.
Change-Id: I51f579c123183af25aac9f0ffcf077f752848fb1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f6b026eed1a4a3441ba9b1b92a9eaf2c17d69253)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Also replace the C array with a std::array and (some) indexed loops
with ranged-for loops. Most loops need the index in one way of
another, so can't easily be converted to ranged.
Change-Id: I7fa05f22de9df6c68ec5797c9583476a3881532c
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 70e070ecbd4d334598aed140a3825887733c3c59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
GCC complains:
qoffsetstringarray_p.h:85:27: error: comparison is always false due to limited range of data type [-Werror=type-limits]
85 | if constexpr (Highest <= (std::numeric_limits<quint8>::max)()) {
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fix by casting the RHS (of limited-range type) to size_t, the type of
the LHS.
Fixes: QTBUG-109875
Change-Id: I494ea544b8b3bfd877443119eebc160eb2f8e063
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit cf145a34b494e08a10271de277f6c4e62b54ea4f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(Un)Register the custom recognize in init() and cleanup() instead of
initTestCase() and cleanupTestCase(), so that a new recognizer is used
for each test function.
In the test functions, use a scope guard to unregister the locally
registered recognizers to make sure that in the case of a failing test
and early return, the recognizer is removed.
Change-Id: I4fe9509f35474514ef55191d799e6707199fe853
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 58afdea1b32899cc4ee8bf2062596ed523bbdffe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The multi-thread snippet in the documentation, when copied as is,
could actually crash because of the race condition between the main
thread and the thread that generate results for the promise.
This is fixed by explicitly calling QPromise::start().
Actually, the underlying snippet already has this call, it just was
not included in the documentation.
This patch modifies the documentation snippet to include calls to
both QPromise::start() and QPromise::finish().
Fixes: QTBUG-109230
Change-Id: Ic25f31a6b3b16ba6bc06a0b199289c8c5d50bab6
Reviewed-by: Sona Kurazyan <kurazyan.sona@gmail.com>
(cherry picked from commit a8261e327d6316d944cfcc312a1b2e71bd4e5d27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Linking to 'Drag and Drop' target will link to a page local to Qt
Widgets with that section title. The intention is to link to the
topic page located in Qt GUI module.
Add a descriptive keyword to the correct target page and use that
for linking.
Fixes: QTBUG-109289
Change-Id: Ib6a39b43f9080cf5bb72fb07ab163e75eefb4da9
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit 8a30b22930d3a3d15fba97ff7aec7f812721869e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When the test is showing the error message over and over, it's not
waiting for the native dialog to actually become visible, and as
a result, hiding it has no effect and won't result in a call
to processResponse, where we got rid of the native dialog.
To fix this we explicitly release the native dialog when
encountering this corner case.
Add logic to QErrorMessage to test both native and non
native dialogs.
Change-Id: I19ac3f463997aed1e66f646fdfcbb4d2459116d1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 349fda471e0df473f38f59c2baae688959d6d273)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The standard accelerators page was deleted, drop the link to it.
Change-Id: I2fa9a94200d0e5f8895bb8c6981c73b3e9dd159e
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit f10ae4b887f6652dcad95516ded43f2e2994e88f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of the more verbose currentDateTime(QTZ::UTC).
Change-Id: Ie759f4270b12fca39c458bf85c8296f5342033db
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 26b5325767a4084ca51f485b99ac58477246e062
with #include <QtCore/QTimeZone> added to tst_qmimedatabase.cpp)
Unify wording as "{Latin-1,UTF-16} string viewed by \a str".
Drive-by change: Fix a grammatical error, it's "a US-ASCII", not an
(because it's pronounced by the letter name "U" which is pronounced
like "you", so "a" not "an").
Task-number: QTBUG-108711
Change-Id: Iff763f4008341c35317bb3d7a2a228767ff6a648
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit a608744c9021a2ca26801bd4086c4360c9ded5f2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Support serializing shaders with specific qsb version. The default
behavior remains the same, using the latest version.
Task-number: QTBUG-101062
Change-Id: I090a88c1ccb3be4ac5eee1da4058afaa8bf3111c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit df00f9ea860d2d171d0132e2a49f6bdacc919100)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
That follows what File Explorer on Windows 11, or the system UI does for
tooltips in modern UI elements (the tooltip for the "minimize" button in
a titlebar still shows the yellow-colored tooltip). Using the accent
color makes the tooltip pop a lot more, but doesn't look native.
Also make the toolTipPalette helper function do something useful in dark
mode.
Change-Id: I2b07abd72eee50508f19f46aaec3408183c27100
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
(cherry picked from commit eac9e74d9271f793f2a49af6ba776dd444875844)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Move it to the table for QLocale::toString() to make it more prominent.
Explain the meaning for QTextStream::realNumberPrecision().
Change-Id: Ic2da22ff6bea09e79e17f19b4636cef35dc3a615
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fe4cc2793f80e285be66c36bc1ec6903ddcd312e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If an item in a list view has a null icon, then the decorationSize gets
calculated as -1, -1. The style would then try to wrap the text to a
lineWidth of -1, ending up in an infinite loop in viewItemTextLayout.
To prevent that, don't set the HasDecoration flag of the style option
when the icon is null, and don't fall back ot the decorationSize unless
the flag is set.
Add a test for this particular item configuration. This also fixes the
widget baseline test with styles that don't provide all standard icons.
Change-Id: I691db6abede9a9b2ad300f3ee7fbfdae5fb6097f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit fb8701cb8b1972d5ca6ffc383a436786bc170d16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Option has not effect anymore.
Change-Id: I199ff15ac68b785ba1787d44494c0b2dff3b1ad0
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 0a746a30a58f122931208047b908f21f1a070128)
They got marked as Qt6_PRIVATE_API because of these ARE private classes,
however their pointers are used in user code. For QMutexPrivate, because
we manipulate the pointer in inline code; for QPostEventList, because
it's used in a virtual member function's parameter list.
Fixes: QTBUG-109605
Change-Id: I69ecc04064514f939896fffd1736d1fa8d3f1768
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit a2fe33203344e5c47da4da7d1083909e472ca2cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It is a valid URL reference, which is not what people may want.
Fixes: QTBUG-109855
Change-Id: I69ecc04064514f939896fffd173783ce2228c1d2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit ce8fc1e88eef63308781d601dd10f694622abf95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We may get PointerDown events with "no buttons" as the button
state in some cases such as for tap events on Apple trackpads.
Make sure the mouse button which caused the pointer down
event is in the mouse buttons set for the event.
Fixes: QTBUG-108639
Change-Id: I0a49abc398308bbfed657b99fc74f60c16e05a59
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 1d3d7bfbbcfde475804db31747c3a4b42d3bfc9b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
According to the CMake documentation, IMPORTED_TARGET should be
specified before the moduleSpec, and after QUIET.
Additionally, double-quote the moduleSpec everywhere, since before, it
was only quoted in some cases.
While this is not required for pkg_check_modules to work, it unifies the
coding style.
Change-Id: Ic8ad708a8146f9b39ee40e9a719412441e231452
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 029e118a4e014c3751c4a8f6bcc41f85b78286d5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix test failure in WasmEventDispatcherTest::postEventSecondaryThread()
Revert to using qGlobalPostedEventsCount() for determining
pending events state, but move the final check to after
sending posted events. Also remove a superfluous check.
This partially reverts/amends cc60d706.
Task-number: QTBUG-109066
Change-Id: If4f437ce9379282c3d60b0272845a975794883de
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit daba0b8c19284fb68493cb8350804277b94b79ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For tiny scanline lengths, even the initial offset to align on 16
bytes may overflow.
Fixes: QTBUG-109477
Change-Id: I198c6fa5a2551a951893515f905bb7cc35479608
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 7eccd7ac1c98e0c15c0b4a13d036a5ef46896d8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To support cancellation of continuations attached via the parent future,
we store a pointer to continuation future's data in parent. This
requires preserving the lifetime of continuation future's data while the
parent is still alive (see 24dedaeaa1a94bfe9ade2da2a2c9aa112241b07a).
This is achieved by capturing the promise in the continuation's lambda,
which is only cleaned up after the parent's data is destroyed. This is
already the case for continuations without context, but was overlooked
for continuations with context: they transfer the ownership of the
continuation promise to lambda passed to QMetaObject::invokeMethod(),
which destroys the lambda's context after it's run. As a result, the
continuation's promise (and data, if there are no other copies of it)
is also destroyed, leaving the parent pointing to deleted continuation
data.
To fix this, capture a copy of continuation future's ref-counted data in
the continuation's lambda. This will guarantee that the continuation
data remains alive until the parent is destroyed and the continuation
is cleaned up.
Fixes: QTBUG-108790
Change-Id: Ief4b37f31e652988d13b03499505ac65c7889226
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 9e61cc4f72a4fe86fa97f64238f1e3d940a7746b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The method is now deprecated in Qt 6.5, not Qt 6.4.
Also, keep the documentation for now, but mark it as
deprecated there, too.
This amends 2436e259ced3.
Change-Id: Iff3e2c170a8fdb8834c0283de9554b503ed3aca4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit eeb469869e4fe7fd873bb9e8a0185ec7afc6d332)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The '--sign' argument may and may not accept two follow arguments
to specify signing path and alias from the command line. This
functionality breaks the parsing of command line arguments that
follow the '--sign' argument and expect that '--sign' is used with
no follow arguments. It does make sense to check if the arguments
passed after the --sign staring with '--' to make sure that '--sign'
with no arguments is meant to be used.
Fixes: QTBUG-109619
Change-Id: I4ee7fe953e5378c00760d84ec58f9e89e4348944
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 9c56a77027db2fedfc2b50f96ceaee5003a7d383)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Check if "-stagingDir" is passed from the command line before trying
to copy files to it.
Change-Id: Id39882e4e955bd54328c8e747377b9d49f977378
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f071421558c751dc03c338f3271546c459ed9209)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Pass every line to parseVersionScriptContent to not break the
version script generator state. The parser doesn't collect characters
from comment block, so the line containing the 'ignore-next' ELFVERSION
tag produces empty buffer for the further parsing process. Call the
parseVersionScriptContent function even on empty buffers to make sure
that 'ignore-next' counts lines correcly.
Fixes: QTBUG-109790
Change-Id: I5f77893462d397f6738a5da1af6ed8dd8a2df70a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ad7ad62d17b337671f97fd342148edcff74acaa5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qt-cmake-standalone-test uses add_subdirectory call when evaluating the
project. This leads to an error if users try to use path to
CMakeLists.txt as an argument, instead of directory when configuring
standalone tests with qt-cmake-standalone-test. It makes sense to check
if the user-specified path points to CMakeLists.txt and cut the
filename part when calling add_subdirectory.
Change-Id: I6b9ac0ca8323eaf11f219eb1e6bed3057120a231
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 90806123e961d469c36ee3b19ac0960524abb9e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When the qtMainLoopThread calls QSGThreadedRenderLoop::polishAndSync(),
it waits for the QSGRenderThread.
In the QSGRenderThread, QAndroidPlatformOpenGLWindow::eglSurface()
calls QtAndroid::createSurface() and waits for the "android main
thread" to return a valid surface.
When the "android main thread" now calls "runInObjectContext" (e.g. by
calling QtAndroidAccessibility::childIdListForAccessibleObject()) it
waits for the qtMainLoopThread and the program is stuck in a deadlock.
To prevent this, we protect all BlockedQueuedConnection from the
"android main thread" to the qtMainLoopThread by acquiring the
AndroidDeadlockProtector.
When QAndroidPlatformOpenGLWindow::eglSurface() already acquired the
AndroidDeadlockProtector we abort the current A11y call with an emtpy
or default value.
Note: b8a95275440b8a143ee648466fd8b5401ee1e839 already tried to fix
this by checking "getSurfaceCount() != 0", but there are situations,
where a new surface is being created while an old surface is still
present.
Task-number: QTBUG-105958
Change-Id: Ie40e8654c99aace9e69b0b8412952fa22c89f071
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit b832a5ac72c6015b6509d60b75b2ce5d5e570800)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The example overrides QWidget::resizeEvent() without using the
QResizeEvent * argument. This results in a compiler warning.
This patch marks the argument unused.
Change-Id: I647d0eda7d895e70ed6f232960aec992f5e37b6c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit f05aee76288f2cbf021b80ee1b1961bd183cbfbe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add internal documentation to header and implementation of
QGtk3Interface.
Change-Id: I3e6e970afa0c2ab26e0ce9efe6285cad1edfdb94
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit d18f142062896da855222c92ceb7e4273d2c8375)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The background color for radio buttons and checkboxes was not
correctly read from the current GTK3 theme in light mode.
This has lead to identical colors for indicators and background of
radio buttons and checkboxes for certain GTK themes (e.g. Breeze).
This patch sets the GTK default foreground color to the base color of
palettes for checkboxes and radio buttons.
Fixes: QTBUG-109454
Change-Id: Ic227029f2d366aa826e7bf1c3870428e3b638638
Reviewed-by: Jonas Kvinge <jonas@jkvinge.net>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 2c9b7a986d08e8f9b858973a2ad479e1a83adb13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The device would be deleted before the image format handler, and hence
be a dangling pointer that could easily cause a crash if the handler
or codec would access it on destruction, e.g. for cleanup.
Change-Id: I51d16b1feddc5945955ac75a2e8701233dba7b82
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit f091026be1deb4b4a90f32585b9b22f97209866a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Wayland omits optimizations tested in tst_QWidget::optimizedResizeMove()
and optimizedResize_topLevel() under certain circumstances, e.g. on
Ubuntu 22.04 / Gnome. This makes the test functions fail.
This patch skips the test functions on wayland platforms, if an
omission is detected.
This amends 2ec7a6322f465ad7cce3c48096d8912903196ab2.
Fixes: QTBUG-109746
Change-Id: If0df6b1cf451a7f0dccfc1bb7411e895d7ae29a3
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit df62cefdcb0ea6f644f1560285598ed179bb2bb2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When a palette mapping is imported from a Json file, parsing errors are
logged with qCDebug. This prevents errors from being logged in release
builds.
This patch replaces qCDebug with qCInfo for Json parsing to make errors
visible when the logging category qt.qpa.gtk is activated.
Change-Id: I3f92ecc3ab51f863f62ccef9f9061902320d3c3c
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 49a8311ae5f2fb467d43c8e68ab9490efd2e064e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The C toupper function is locale-dependent. Given the right locale
(Türkiye, e.g.), toupper(i) is either
- İ (LATIN CAPITAL LETTER I WITH DOT ABOVE; if representable) or
- i (unchanged; if it isn't)
The latter is clearly wrong. The former might be what is wanted, but
since most locales these days are UTF-8, Í will be unlikely to be
representable in char.
So I conclude that what's intended here is that i gets mapped to I,
even in the Türkiye locale, so use the new QMiscUtils::toAsciiUpper()
instead of <ctype.h> toupper().
Fixes: QTBUG-109520
Change-Id: I6fee2fb15c2facae79f1727455180567698fed80
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 7a6016aec4fdb446bd4f515fe7c08e1496cd2a7c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I don't quite see the relevance of this. We have explicit warnings
if versions don't match a bit below.
Change-Id: I08253fb99313896adb2c13d193ed3ec3954fb0b0
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 5de97970b85df747916831c97fb3a4f1fd912594)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
According to the specifications, the path in .trashinfo should be URL
encoded.
The path can be relative when possible, otherwise changing the
mountpoint will break restoring files from trash.
But don't do that for root (/) and home.
For more info, see.:
https://specifications.freedesktop.org/trash-spec/trashspec-1.0.html
Change-Id: Id8271a893a007f4cb5c10611f2b1bc71c1ff4860
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 314a4d121f55a7a6cd8335c9953d105574efab76)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QWindow::requestActivate() is not supported.
This amends c95de359b4fe7bc03f7defdb057ebbe79c51b3dd.
Task-number: QTBUG-107153
Change-Id: I45f53b5e9de85049ca41cc139a78a82450f53bed
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit f09f516ac149a723d3b00b8ecc746c12eb970465)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The name argument must be a C++ variable name, not a string.
Change-Id: I6bc45bc9a57fd8429cf033aa118eebff0fcfc4a5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 7a37114af92fcaa6f8ed2eb17a4632b4880c8bbe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test function used to flake on Linux occasionally.
8e6ede7cd131682161180bfab0cc46686674709b provided a fix. While it
seemed to work, further analysis has shown that the root cause is
event sequence in case of multiple paint events.
This patch re-engineers the test function:
1. Allocate test widget on the stack instead of the heap.
2. Send layout requests posted by QHBoxLayout constructor and
QLayout::addWidget() before showing the widget.
3. Remove calls to QCoreApplication::processEvents().
They are unnessecary, because
- the size hint request counter is supposed to increase (by any number)
- QTRY_VERIFY processes events anyway until the counter increases or it
times out.
Change-Id: I54998483725cbdd4899ba6f5469d7dae0980ab1d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 71e67dec957d41d55ae03f32613a80394c928352)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
...so that we do not need to call devicePixelRatio() again, which means
one less UI Thread Checker warning in Xcode.
Task-number: QTBUG-97518
Change-Id: I01d54ea113788cd0b141e124a47940f5cd3efabb
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 8e5806b6807df0d39f3bbd2a1c0ed590426e1aa0)
MSVC should deal just fine with a single argument macro, and this
prevents the silent mistake of passing a single argument to
Q_DECLARE_EXPORTED_LOGGING_CATEGORY which would result in
no error or warning, but without exporting the category.
Change-Id: I4190027f8914ad1ef3957759f8e8c0e6cbd8ba97
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 9bf42425f1cfaca990e37200960615d819b31886)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
syncqt arguments contain full paths and may exceed the supported
command line size on some platforms. Use a single rsp file to pass
all arguments to syncqt.
Added the missing end-of-line terminators for error messages.
Change-Id: I60ad0f6770458d5256e67f042a63a3c16cd5ecb5
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 947dd880cc2c1fc7973c0439ff8393e0f63f96a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The Qt namespace should be used for types defined in the Qt library,
not for user types.
Change-Id: I6df0ca054888f4a65b19a9cb44324321d1dcfad8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 25c67c608a7a6e8673eee27a105b11d723f9a9b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test shows an application modal QMessageBox, but assumes that doing
so will be non-blocking, which for macOS is not the case (yet). Instead
of making the dialog window-modal, which would potentially affect the
logic of the test, we disable native dialogs. This should be fine, as
the purpose of the test is to test the is_closing logic of
closeAllWindows, which lives on a layer above the native dialogs.
Change-Id: I6d627984a6ca452b876f34404b669fce41a00851
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit ad31b5f4c700fc7a66032fe14becc66b44c9d584)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We can use openURL instead, which also opens local files in the
associated application.
Change-Id: Ieddc6fb68d6b9e64195ed261953b9fffb6b0b73e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 351d3e50f993014ca6b17817c87d12153ca2f617)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Name filters may be not empty and include all files ('*'). We should
not add any file type limitations in this case. Ammends commit
ce20b81070c8283a7895e46dd79d560fb0b81462
Change-Id: I3983e576a0ada4b7b40837c5c797359114b1ae02
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit af0f13b46053254c7b2416a1f71a95d141247600)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Support passing Emscripten configuration options to
the QtLoader constructor using the "moduleConfig"
key.
Previously, it was possible to set Emscripten config options
on the global Module object. However, recent versions
if Qt has switched to using the MODULARIZE=1 build setting,
in which case there is no global object.
Fixes: QTBUG-107979
Change-Id: Ie99b772ddbb1d9f5464c868a43c821bae01519e0
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit a594e95c9a2faef247a284983ef3ece277917d15)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Although redudant, people are allowed to use Q_DECLARE_TYPEINFO on a pointer
type. There's no reason to mis-detect the isPointer trait in that case.
Change-Id: Ic116f24397c91f5a3d31f5d8ee9fa2e587823257
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 114b94c26e990c792f2735b1104dd094ada714f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If a type is trivially default constructible, QMetaType (and QVariant)
think that it can be built and value-initialized by zero-filling a
region of storage and then "blessing" that storage as an actual instance
of the type to build. This is done as an optimization.
This doesn't work for all trivially constructible types. For instance,
on the Itanium C++ ABI, pointers to data members are actually
value-initialized (= zero-initialized, = initialized to null) with the
value -1:
https://itanium-cxx-abi.github.io/cxx-abi/abi.html#data-member-pointers
This means that a type like
struct A { int A::*ptr; };
is trivially constructible, but its value initialization is not
equivalent to zero-filling its storage.
Since C++ does not offer a type trait we can use for the detection that
we want to do here, and since we have also decided that Q_PRIMITIVE_TYPE
isn't that trait (it just means trivially copyable / destructible), I'm
rolling out a custom type trait for the purpose.
This type trait is private for the moment being (there's no
Q_DECLARE_TYPEINFO for it), and limited to the subset of scalar types
that we know can be value-initialized by memset(0) into their storage
(basically, all of them, except for pointers to data members).
The fix tries to keep the pre-existing semantics of
`QMetaType::NeedsConstruction`. Before, the flag was set for types which
were not trivially default constructible. That included types that
aren't default constructible, or types that cannot do so trivially.
I've left that meaning unchanged, and simply amended the "trivial" part
with the custom trait. A fix there (to clarify the semantics) can be
done as a separate change.
Change-Id: Id8da6acb913df83fc87e5d37e2349a4628e72e91
Fixes: QTBUG-109594
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e8f5f20319ce5f75180c531b6e26e648ce55619c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
They got marked as Qt6_PRIVATE_API because of these private header
defining classes that don't follow Qt's naming convention ("mutex",
"condition_variable", "ControlElement"). We have an exclusion for
classes whose name start with Q.
Introduced by 5d903a64aca37ee7c2836e479e175336e9b7ca87 in the old Perl
syncqt and ported over.
Fixes: QTBUG-109605
Fixes: QTBUG-109604
Change-Id: I69ecc04064514f939896fffd173369623c960bcc
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 41b38c802b2b6251bdd65f8bf0d2031c304d70f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We were looping over all keys and removing the Qt keys
using an integer index. However, removing one key shifts
all other keys at higher indexes down one step such that
the loop eventually indexes past the end.
Fix this by getting the keys first in a separate step,
and then remove keys without relying on a stable iteration
order (which is also not guaranteed by the standard).
Change-Id: I8bc577d1831d6931ebca2b2e04faf65c9affb429
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 8a20a278fa5f1e2890f88a69d8b5f96873a67ac9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When unplugging a dock widget, it still grows by the separator size
when dragged upwards or to the left. The unplugged dock widget's size
can become too small to drag it or to access window handles.
This patch corrects the size offset for all drag directions. It expands
the target size to a minimum size, making sure that title bar and
window handles can be accessed after unplugging.
Fixes: QTBUG-106531
Change-Id: Ie771a9338ebfb4c0eafd3b3b4205de730cbd20ac
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit e29ffd3bd13dbc1e808cfc4f7764878f855d1a62)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
tst_QDockWidget::createTestWidgets did not set a minimum size for
test widgets. Upon unplugging, that can lead to a size correction in
connection with 8687c3f938cac56c4a2518576a5c9fac150d8de1, if the widget
gets too narrow to correctly display window handles. Test functions
checking the size after unplugging can fail in that case.
This patch sets a minimum size to each test widget created. The minimum
size corresponds to QStyle::PM_TitleBarHeight.
Task-number: QTBUG-106531
Change-Id: I3e552b37416d57d8ed30e0b9de4eec55f07ea158
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit c69e727274adae7d3943587091254696c46fb75b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Turns out we don't support QStringView/QUtf8StringView comparison, and
the only reason the corresponding test succeeded was because it
contained a typo (QStringView instead of QUtf8StringView).
Fix the typo and disable the now-failing test.
Change-Id: I2210a247aac66743851e53578172a563ee1e96f7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 92e913a5414ea3a7fb002a139251bb8ae53c467c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Make options for enabling "simd128" and "exceptions" public:
-feature-wasm-simd128
-feature-wasm-exceptions
Make sure both appear in the config summary and feature
list. Move the exceptions code so that they are next to
each other in the cmake file.
Change-Id: I3975b56703f40f7ffff270754535bc2eb5bfe488
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit ce560d28c8b426d3cb797fa04e9e78d980fc8501)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
3a449bbb69c9a3c3a5bc6a052f2de98ab79be7e9 amended the code to remove
acquiring a lock when waking up a condition variable. It is fine to
not have a lock associated when waking a condition variable; what I
misunderstood was the scope of the lock, which (and this underlines
the importance of commenting _what exactly_ a lock protects, for
each and ever lock) protected both the buffer as well as the counter
of the buffer. This made my reasoning flawed: it is necessary to keep
the lock while notifying, otherwise the counterpart could verify the
condition isn't satisfied and wait (e.g. see numUsedBytes==0), missing
the wake from the other thread (which could arrive between the check and
the wait).
Amends the previous commit.
Change-Id: If7db2d045331f1b33b976fb6bf6aa9117c41678f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit fddeec60cba806b88c5eb0e4758c3951457518a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This API is undocumented, but by keeping unchanged makes
it easier to use from external projects.
openFile(): Copy the accept/filter list parsing function
from 6.4. It makes sense to implement this behind the
API, so that user code doesn't have to reimplement it.
saveFile(): Slightly more complicated; the new variant which
takes a QByteArray is better since the implementation can
then keep a reference to the data for as long as it needs,
without copying the data. Add the const char * variant to
keep existing code going for now.
Adjust the calling code in widgets.
Change-Id: I1899ebffdb90e40429dcb10313ccc5334f20c34f
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit fbf2a318dd3f1e0f9fc8dadb68d47923dff3d672)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QGtk3Theme detects the appearance property by theme name: If the name
contains the keyword "dark", the theme is considered to be dark and
otherwise light.
This detection logic fails, when the GTK theme is dark without
containing the "dark" keyword, e.g. the dark theme "Adapta-Nokto".
While QGtk3Theme imports the right colors in that case, it wrongly
identifies a light theme.
This patch adapts the detection logic: If the theme name contains the
"dark" keyword, it is considered a dark theme without further checks.
If it doesn't, the current GTK3 theme's default background and
foreground colors will be read. If the foreground is lighter than the
background, the theme is considered dark. If the background is lighter
than the foreground, the theme is considered light. If both colors are
identical, the appearance will be Qt::Appearance::Unknown.
Task-number: QTBUG-93955
Change-Id: I0e0f4870a1397b6a7918331a852284bb1c91199e
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 7b64eb71c0fe68540d97eb22492b4d0b0a647e9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
1) Do not attempt to take the first character of event.key when the
key is a dead key - this always returns D as in Dead
2) Do not attempt to immediately modify the pressed key with the dead
key as the dead key itself will be modified
Fixes: QTBUG-109629
Change-Id: Ic66536b8b27df23c2f1c4ebf1c02e713990e62ef
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 988c7bfcae5f69f7918f4dacf74e8b1ad2bee9c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In a 'ninja qtdeclarative' build, the addCursor() function alone is
compiled 458x for a total of almost 10s cumulative compilation time.
This makes it one of the top-20 template instantiations in a Clang
-ftime-trace build.
The removeCursor() function doesn't show up quite as much, but
de-inline, too, while we're at it.
Task-number: QTBUG-97601
Change-Id: I37b920a8b364861efab78f736d71642dc82d8982
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 436501d87754ed61bc2d9f574b97be84c30a3f05)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Qt 6.5 will require emscripten 3.1.25. This is not the
most recent version (3.1.27 at the time of writing),
however .26 and .27 make changes to stack layout and size
which require further investigation.
Change-Id: Ibe285ef160d450d6b2c63a7fb71d3561b0032e37
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The test function places a QSpinBox in a QHBoxLayout, which has a
QWidget parent. The spin box is expected to be shown with the widget.
While the widget is the layout's parent, the layout is not explicitly
set. That makes the test function flaky in some cases.
This patch adds QWidget::setLayout() to explicitly set the layout on
the widget.
Change-Id: I3a1cc77c302c5ba96d3628d035139f9718dda9e5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 8e6ede7cd131682161180bfab0cc46686674709b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- port from QSharedPointer to std::shared_ptr (one instead of two
atomic ops per shared-pointer copy)
- port to std::make_shared (one instead of two memory allocations for
shared-pointer + payload creation)
Change-Id: Idecef5732d181a63e6936f54204eeb7ecbdc4a0f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit dbcbadb7ac6620fabadd173b54d292bbadcb5b58)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The logic for writing 0 and false to the keys and values
is off by one.
While we are at it, unify the naming between the two settings
that are possible to reduce (samples and sRGB).
Amends d64f776a9a41a8d1144397b7b62efbdee8d24857
Fixes: QTBUG-109453
Change-Id: I97f3a3c7175bcb555c70967056ab2de45b077f48
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 3e619aff308dad02ee3d54aeda85a2bbaae77063)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The QAndroidApplication::runOnAndroidMainThread() function creates a
task on QThreadPool::globalInstance() to wait for a timeout and cancel
the QFuture representing the task.
It does so by passing a lambda to QThreadPool::start(std::function)
that captures the future, a local variable, by reference. This is UB
when the lambda is ever executed, because the local stack variable's
lifetime will have ended.
To fix, simply capture the future by value, not by reference. Since
QFuture::cancel() is not const, we need to make the lambda mutable.
Fixes: QTBUG-109586
Change-Id: Icacfb0dc76bcd3a145f90126f535e7c0f4b5ef6a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 3642d5680df8a1b70e4a1a111347005e08555070)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Nicer member names make the code using the type more readable. It also
allows to add other members later.
Change-Id: I69f1f97673a8f1ad8eb73e4f1e5323eccf929413
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit b6fdf34dfca20c8312feeb28efd3288700ad4b3c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The latter is in a module (QtConcurrent) that depends on QtCore. Don't
make QtCore depend on QtConcurrent...
The code doesn't use the QFuture returned from QtConcurrent::run(),
anyway, so QThreadPool::start(function<void()>) is more than an
adequate replacement.
Task-number: QTBUG-109586
Change-Id: Id00a42525c3d7454a1fa2d4812de634dbbea1035
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 500e161987af24e2e10d46011d776258d5c0e47a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A waiting task on QThreadPool::globalInstance() will block the worker
thread that it was scheduled on, making it unavailable for productive
work. That's why one should only put CPU-bound tasks onto
QThreadPool::globalInstance(). When blocking nonetheless, use the
releaseThread()/reserveThread() trick to avoid deadlocks caused by the
pool running out of workers.
So, do that here.
Task-number: QTBUG-109586
Change-Id: Ia2660c69e1f23b5df0c308576301aac6e05d4725
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit c0496013484c35ab9b1a29ffb0f1eb687ef6db78)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Creating a QRunnable is expensive business, incl. setting up
QThreadPool::globalInstance() if it wasn't set up already, so don't do
it for a no-op task.
Somewhat mitigates, but doesn't fix, QTBUG-109586.
Task-number: QTBUG-109586
Change-Id: If2043134414d68adc9188e5bb7650ca08046b4aa
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 26ea6157e6429a6ba0794272df195c0bc591cda9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Our previous assumption was that the right value was used if we ran into
an "access denied" error. That error only states that the function has
been called before though. The warning should be omitted if the right
value has been set before.
Change-Id: I1379242f68e2f09bc6a25dd322fe3634622d8e8e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit c3f8198d07c04cd8962637f134a9c78fbb5760c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Upstream released 10.41 and 10.42 in quick succession.
[ChangeLog][Third-Party Code] PCRE2 has been updated to 10.42.
Change-Id: Iadec8e64e9ce7ddad17afb075157719af76379bd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 05e72d53a6b0546d67dc699f922811790a896fb3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QTemporaryFile is derived from QFile, so it's not a reason why
QFileDevice should exist. Instead, mention QSaveFile.
Change-Id: I1de3a32746a313ec57323f3f8ae42e326f11d147
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit c9d9b43b10509020be706629060f83fa3091c4c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Move the paragraphs dealing with encodeName()/decodeName() and Unix
special files to 'Platform Specific Issues'.
Change-Id: I076191e041ef238556aab28b5ad5d51974f8f7ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8b0818235d512c9085ce0fd0ea2490f1653a6c36)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Make it explicit that the local 8 bit encoding is UTF-8 on all
platforms but Windows.
Change-Id: Icaabfd28689a71ee5cc2957f058f9388405496d5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ac6e61d867d76d0a24449f82c0f484a513fec184)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Relevant mainly if we want to consistently expose these as the
theoretically correct uint32_t/quint32 from Qt Quick's
QSGRendererInterface. (not that int is not sufficient for
indexing the typical 3-4 families and 2-16 queues per family)
Some checks are not actually needed since the family index
must always be valid after create().
Task-number: QTBUG-108895
Change-Id: I474ccea51a81e7a096281604ff79b7db4cdd2484
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 4d36a83b6d665f5b022cf46e4a5349f8974c1fdb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
ASan inserts a lot of function calls in between our calls, so they end
up in the backtrace and cause unexpected results.
Similar to c672f148dbf179f2e0ac94dfac7d329d50a3e4a3.
Fixes: QTBUG-109559
Change-Id: I69ecc04064514f939896fffd1732dd2bc0317ae4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6e68b4d838f35b75cbf1a79863b52f43d08defe9)
Drop the use of \qtcmakepackage for the module page that results in
incorrect instructions, and replace it with a snippet with the correct
commands to use.
Fixes: QTBUG-109214
Change-Id: I936910ddb9e4118f931d85e4b096ad52006dcc32
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 8844c6ef379f466a12a5f4981c78bdb990d92db8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The qt_findAtNxFile helper in qicon.cpp expects a local file name that
can be probed with QFile::exists. If the src attribute of an <img>
element specifies the location of the image as a file:/ or qrc:/ url
rather than as a local file name, then we need to strip the scheme
off the file path, and in the case of a qrc URL leave the :/ prefix
before calling the qt_findAtNxFile helper.
Amends, and partially reverts, 760df7256588e76d082ea959399af36d7ba80a86.
We can't avoid testing whether the source in the HTML is provided as a
URL before interpreting it as a file name.
Fixes: QTBUG-109212
Change-Id: I7ea7a5bfde79bab90a8025c42e754129813dd0fc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 2d87c4d881b74619fef966ffb0d7a00cb4ccea50)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The 413593183bbb1137fdc784d98c171d67a167bb32 patch changed the way
how the display metrics are retrieved. By doing so, it was found that
the previous way retrieved the scaledDensity always equal to density.
It is intentional for scaledDensity to be dependent on the font scale
chosen by the user. However, this change altered not only the font scale
but also the layout. This patch will make the layout dependent on the
density instead of the scaledDensity and normalize the way the display
metrics are retrieved among Android versions.
Currently, the fontScale is ignored, QTBUG-109566 will track future
developments.
Fixes: QTBUG-109026
Change-Id: I6adacd17583cbe9bee368af35c50b780872ab222
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 99893a914a821567e10935ffb8be24df7147ccd9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These tests exhibit weird crashes when run under ASan, but sometimes
they fail sometimes they don't. Pending more insight, just skip this
test under that configuration.
Fixes: QTBUG-109329
Change-Id: I49d940de419f7166aab0da0b8c2b44297c4b6d74
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c672f148dbf179f2e0ac94dfac7d329d50a3e4a3)
Allow moving content uris if the destination is provided
a full content uri with a parent that's different from the
source content uri (i.e. different folders).
Note: since the underlaying Android APIs don't always know about
the parent of a uri, we do some step to deduce that, but that's
not always guaranteed to work.
Task-number: QTBUG-98974
Change-Id: If21954e5963f4eb0b96c7ccd983943ea2cab5b24
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit c203ec2720b694fd877512da531a227e0f3310cb)
Allow renaming content uris if the destination is provided
as a direct fileName (i.e. not full content scheme path),
and if the destination has the same trailing path (or parent)
which means a rename in the same folder structure.
Task-number: QTBUG-98974
Change-Id: Ibc4973366807dd5284c19912ab04ff90f2a573cb
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit c1fa5d602c541b06e3e2fc2d02f5d62060c84504)
Use DocumentFile and DocumentsContract to support more operations
on content URIs, such as:
* listing files and subdirectories with usable content uris
* mkdir, rmdir
* creating non-existing files under a tree uri
* remove
And since dealing with content URIs require some level of user
interation, manual tests were added to cover what's been implemented.
Note: parts of the code were from from BogDan Vatra <bogdan@kdab.com>.
Task-number: QTBUG-98974
Task-number: QTBUG-104776
Change-Id: I3d64958ef26d0155210905b65daae2efa3db31c1
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit e5d591a0d09032d1870e47d1bf59c9069ea0a943)
The mutual ownership of chunkCompleted<->fileReader caused both not
to be freed, which resulted in a memory leak. Resolve this by
introducing the ChunkedFileReader class which owns itself until file
read is finished.
Also, resolve a similar issue in qwasmlocalfileaccess.
Fixes: QTBUG-109436
Change-Id: Ieec4cde15a893fa6a2e21a62d3bb6637374c5364
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit cc60d70699019030a8cba777de5c46b4f4b8b31a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The latter are locale-dependent, and while that doesn't produce wrong
results here¹, it means they need to be out-of-line, whereas
QtMiscUtils functions are inline constexpr.
¹ isdigit could give a false positive on non-US-ASCII-digits, I
suppose.
As a drive-by, rely on the QtMiscUtils::fromHex() returning a negative
value when a non-hex character was encountered, to avoid the extra
isxdigit() checks. This property is preserved through the bit
manipulations: ORing together negative values yields a negative number
iff either or both operands were negative (in two's complement, which
Qt requires). The caller also checks the array bounds before calling,
so the isxdigit() calls didn't act as an implicit bounds check
(returning false if they encounter '\0'), either.
Task-number: QTBUG-109235
Change-Id: I4cd734468e223f1047a53afd264d077b28cb5f1d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 115b1eab86d0395dc29f90d271bfdd29d425442e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QtBase didn't contain any checks for QT_RESTRICTED_CAST_FROM_ASCII, so
a recent addition to the QString::append/insert/prepend overload set
made calls with C string literal arguments ambiguous without the CI
noticing. We had a similar problem with QString::multiArg.
To increase test coverage, we now run tst_qstring two times:
- without any define
- with QT_RESTRICTED_CAST_FROM_ASCII (lots of changes necessary)
Most removals are expected, because they disable tests that check the
implicit conversions from QByteArray and const char*, but the
relational operators with QLatin1String objects might warrant fixing.
In some places, when the conversion wasn't the functionality under
test, replaced C string literals or QByteArrays with QLatin1String.
We should also test with QT_NO_CAST_FROM_ASCII, but that's even larger
surgery.
QString doesn't have a ctor from std::nullptr_t, so QString s =
nullptr; doesn't compile in C++17 mode, but does in C++20 mode, due to
the const char8_t* ctor.
Change-Id: I0c5a31719a4b8dd585dd748e0ca0d99964866064
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 8420d3e0b205d0ef2367224afd3040c68e28bcc9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Compared to std::shared_ptr, QSharedPointer requires 2x the atomic
operations per copy, and this code uses _a lot_ of copies.
Port to std::shared_ptr. The uses are all in inline, non-exported
code, so there's no BC or SC issue here. Old code will happily
continue to use its QSharedPointer-based code, while recompiled code
will enjoy the transparent efficiency gain.
This also helps prepare QtCore for an eventual QT_NO_SHARED_POINTER
(which QtCore will not be able to set on itself, because QPointer is
still not ported away from QWeakPointer, but which should affect as
few headers as possible).
Change-Id: I8159c38d93f3bcfc22a236c8c26541ab5ee4e6d0
Reviewed-by: Sona Kurazyan <kurazyan.sona@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 85b15b101c70b962fd0030c26159ef7b1b50a1f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Added docs for
- move-ctor, -assignment operator
- move-construction and -assignment from QSP<X>
- qHash()
There's more stuff missing, but I declare 'twas enough qdoc wrangling
for this round.
The texts are taken from other smart pointer docs, esp. QESDP, so
they're consistent.
Fixes: QTBUG-83134
Fixes: QTBUG-63700
Change-Id: Iff980d043e1635ed6cfdd3113c68bc23f3a0bad7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5dc0f52e7047ca5927e6741fda554cb090184b71)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We only need to skip the backtrace ones, because there's no library
called "Qt6Core".
Change-Id: I69ecc04064514f939896fffd1732dd680058ba6e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b242457d345132083512ff56ecc4980fada2352e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If an image source in HTML is specified via local file name or resource
path (i.e. without qrc prefix), then the correct image is loaded.
With file:/ or qrc:/ schema however, the image is either not loaded at
all, or the 2x image is not loaded. The qt_findAtNxFile helper in
qicon.cpp gets a URL path, but expects a file path (that can be tested
with QFile::exists).
Task-number: QTBUG-109212
Change-Id: Ibcf687c69b3e53a10f21d718d28c8177a02d6be6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c9cf4037cafe22aa20cfea6efe1c6a4c7211d21f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends 52ce0c177e80c2d5b70b38d429abb3689b3da51e, which added the test
without adding it to the parent directory.
Refactor the test code to be data driven, add the image files as
external test data files, and adjust the test code to find the files.
Use the QTextImageFormat from the document rather than a manually
crafted one, as otherwise we don't test a real usecase.
This also makes the test more flexible for adding qrc, resources, and
file URLs.
Task-number: QTBUG-109212
Change-Id: Id0771037b961d95ec3cadd0cd6467d2448f22884
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit d8e213a9e6b3013f768cbf4d94878cd2a0f7bb79)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
After commit cc9144b4f39923dfb9ee17f951f93f257aa2d221, virtual keyboard
is hiding after clicking the done button. This is expected behavior,
but not in case when imOption is set to IME_FLAG_NO_ENTER_ACTION[0]
This commit removes hiding keyboard in mentioned case.
[0]https://developer.android.com/reference/android/view/inputmethod/EditorInfo#IME_FLAG_NO_ENTER_ACTION
Fixes: QTBUG-107662
Change-Id: Id280c4a67e3940fce5045724f77284a77c886f06
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit abe3bc1c432e670fc1244a643b720c1b6a2d56f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Let CMAKE_INSTALL_PREFIX be "/usr/local", and consider a project with a
call to qt_generate_deploy_app_script.
Installing the project with DESTDIR set to "/tmp/bla" would install the
project targets to "/tmp/bla/usr/local" but the Qt libraries to
"/tmp/bla/tmp/bla/usr/local".
That happened, because we used QT_DEPLOY_PREFIX as DESTINATION in
file(INSTALL). QT_DEPLOY_PREFIX starts with $ENV{DESTDIR} and
file(INSTALL) also prepends DESTDIR.
The value of QT_DEPLOY_PREFIX is controlled by CMAKE_INSTALL_PREFIX. Use
the latter as DESTINATION in file(INSTALL) calls.
Task-number: QTBUG-109553
Change-Id: I8f06d81968fa0de4f17c4f8bc9b17cc052da4c12
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 1f142d903835a86996a00c2ee32689c7fb10c1e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... in lieu of <cctype>'s toupper(), which is locale-dependent, and
out-of-line.
The code doesn't run into the toupper(i) issue in the Türkiye locale,
because we don't run tests in that locale and because 'i' is not a
valid format specifier, but don't let the next reader of the code
guess when the use of toAsciiUpper() provides unambiguous guidance.
Task-number: QTBUG-109235
Change-Id: I8988f5190441e1ae5cb57370952cda70ca6bb658
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 78db5cb6439070f43422cbda3a562b46c8fc5cf9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Not all focus objects have a cursorPositionChanged signal, so don't
connect unless there is one. The code should perhaps not show the
software keyboard at all unless the focus object responds to the input
method query with cursor positions, but that's for a different patch.
Change-Id: I0e01da42e96eb579d260b9158f005ad3215d0c26
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit f21c4500a6d4787d679d13e859b34d6c6a7a8c0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The keyboard was not hiding after clicking the done button.
This commit changes this behavior. If KeyCode is other than
IME_ACTION_PREVIOUS/IME_ACTION_NEXT the keyboard closes automatically.
Fixes: QTBUG-107662
Change-Id: I3449aa6898b826bfa03104275c7224329f24ed9a
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit cc9144b4f39923dfb9ee17f951f93f257aa2d221)
After we start to use THEME: Theme_DeviceDefault_DayNight, status bar
icons have low contrasts on some devices.
That is why we need to set APPEARANCE_LIGHT_STATUS_BARS[0] in case when
Status bar color is too bright.
[0]https://developer.android.com/reference/android/view/WindowInsetsController#APPEARANCE_LIGHT_STATUS_BARS
Fixes: QTBUG-108365
Change-Id: I38a31cfb0a3a1b912b86ed1b302c567e14a7ffcc
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit eda4049a0142029c192e1690bafffbb98ee4ff99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In qrhimetal, we were setting the current pixel size by multiplying
the width/height of the CAMetal layer bounds, which are floats, with
the scale factor, and then rounded these to the nearest integers by
converting from QSizeF to QSize.
This caused problems, namely a crash when trying to resize a modal view
controller on iOS, because Metal expected the height of the render pass
to be equal to (int)height * scaleFactor. So looks like we were relying
on the truncated rather than rounded value of the height for this.
To fix, cast the layer width/height to int before multiplying with the
scale factor, to be consistent.
Change-Id: I02f4f48db3dcc3802dd56aa816988847fc5d4603
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit f0e98e35a1a0eb842548d008c1524a1e436bc934)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... to prepend/append/insert QByteArray and const char*, instead of
the old inline QString::fromUtf8(), which litters the call sites with
temporary QString objects.
Can't use qToUtf8StringViewIgnoringNull() for QByteArray parameters to
avoid the extra isNull() check, because some QString tests depend on
whether we append/prepend/insert null or empty.
Fixes: QTBUG-109092
Change-Id: Ibf7b99aad844d0c2219ccc1c30f6666c5dfc7758
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 451dbca16c9ec4ef5a03a71b7b71a22291cf8a4b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The accessibility system on iOS does not support elements that are both
accessible themselves, and act as a container for other elements. You
either return YES from isAccessibilityElement, which allows you to
report accessible properties for the element, or NO, in which case
you can implement the informal UIAccessibilityContainer protocol
to report child elements. This was confirmed in Apple Q&A session
on accessibility December 14.
As Qt's accessibility system allow elements that are both containers
and have properties of their own, we can't build a hierarchy of elements
and containers, with only the leaf elements being accessible. Instead,
we let each UIView act as a UIAccessibilityContainer, and report the
entire child hierarchy as a single level of sibling accessible elements.
In doing so, we include elements such as the Window or Dialog that
root all the accessible elements. And apparently the order that we
report these elements back to iOS determine the z-order of the
elements, so we need to ensure "container" elements are behind
their children. Otherwise assistive technologies such as Voice Control,
or the Accessibility Inspector, will not be able to target the child
elements.
Fixes: QTBUG-108848
Change-Id: I5234bab2f14d5f368ae8c2672b051efcb80aa77d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 095604c9af90989957c974549bafdb0518c2ed3f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Get those values from the file engine instead, this is relevant
especially on Android for content uris.
Task-number: QTBUG-98974
Change-Id: I65fe4c59e5f1feed0dcf14cc8988b4a40d9d979e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f77668ffec48d8aaad7c74069c6f3e770a305ae1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fixes warning
AutoMoc: C:/dev/qt/dev/src/qtbase/src/gui/kernel/qplatformwindow_p.h(0:1): note: No relevant classes found. No output generated.
on Windows
Change-Id: Ib3ebec15dca419386f75a91c576930a65bc30d80
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 2acd0078598ed87a76b5ea66b042e8b096ac222f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Check for state.remainingChars to signal an encoding error only after
the last chunk has been processed. Splitting surrogates at chunk
boundaries is normal operation, not an error. Only if this happens at
the end of the whole input should we raise an error.
Amends fa2153bd10057d7adbc5f5ededa1fd97c4a68161.
Change-Id: Id92e37becaed25bbc11e0c22dedc4d41fb23f92a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 4ccb10dc918c3d4d01afa1ad718a24eb5fa49a3c)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
... not just those in the BMP.
The use of char32_t makes the isValid helper function easier to
read. Its passing to write() is enabled by the recent port to
QAnyStringView, which has a char32_t ctor.
Split into per-plane executions of the test function to avoid
running into timeouts on asan builds down the road.
As a drive-by, replace use of QPair with a proper struct, and
make the intervals symmetrically inclusive the bounds.
Change-Id: I2c6858d7e6a88f448eac1b1e124d7d7b82828d4c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 6b5419f43505867949016685fe40d17d81ff2646)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Since e0cad1aab53119a0e47467f2236f019ce8d6da2a, the code suffered
from an ABA problem where the TestFunctionStart expectation is set
in testFinished(), but by the time WatchDog::run() gets around to
examining the state when returning from condition_variable::wait()
in waitFor(), the next beginTest() has already set the expectation
back to TestFunctionEnd.
There are several known solutions for ABA problems. Embedding a
generation count into the expectation state seemed to be the most
straight-forward fix, and can be done without DWCAS support, because
the state is just 2 bits, leaving the other 30 or 62 bits for the
generation counter, so do that.
[ChangeLog][QTestLib] Fixed a bug which caused
QTEST_FUNCTION_TIMEOUT to be applied to the whole test execution,
as opposed to each test function.
Fixes: QTBUG-109466
Change-Id: If71ade932330407b85d204d45c74350c651325fe
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 26c190f57ea336106aeceffe1191a0314bb4443c)
By making their conditionals the same
Change-Id: I2f1663480103fdfb0c156fc3da2da8d69651824a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 24e4fb34cdabf1d1d1d25b79edac03740b274549)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The example docs were difficult to find.
Change-Id: Id7003b140275e722dad2c41767eabc24fef728e5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit d77b5fbcf1225381c78cadf3c1d925f98ca93937)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When a display is connected to an Android device
a notification is sent to the platform layer of the
application. The QAndroidPlatformIntegration will create
a platform screen and add it to QWindowSystem.
Task-number: QAA-1257
Change-Id: Id2cf6b47363630c3b5c93c0bc778e2058d8372b3
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9ce8d4890fdeaa02cc8a7687158d7453bbc7fd49)
... to make moc code locale-independent.
The C toupper function is locale-dependent. Given the right locale
(Türkiye, e.g.), toupper('i') is either
- İ (LATIN CAPITAL LETTER I WITH DOT ABOVE; if representable) or
- i (unchanged; if it isn't)
Both results are wrong for the present use-case.
Fix by adding QtMiscTools::toAsciiUpper(), complementing existing
toAsciiLower(), and using that. It's private API, but moc.h, despite
the name, is not a public header.
Task-number: QTBUG-109235
Change-Id: Iaf071ba2113b672aa0aed3da6a4e1d47fb659365
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b8c2a0c18a0676595946b5543ff88492a5fc7876)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As QOpenGLContext can be destroyed
it's a bad idea to store QOpenGLFunctions
(which are QOpenGLContext bound)
This change remove the inheritance and replaces it with
querying the functions per call.
Change-Id: I2f3104b62f395f3e65337a15d0a0835383b66e16
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 6160635c9d0616882ae826c6166d1d583d66827b)
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
In Qt 6 we consolidated vertical font metrics across all
platforms (see f761ad3cd9ad1252f24b76ae413298dc7bed8af3
and follow-ups). However, a couple mistakes were made.
First of all, when we use the winAscent/winDescent values
from the OS/2 table, we would also set the leading to the
line gap value from the HHEA table. However, the line gap
is actually built into the winAscent/winDescent, so we
ended up adding this twice to the line spacing, increasing
it with some older fonts. When using the Windows legacy
metrics, we now set the line gap to 0 instead to reflect
that this is baked into the height.
In addition, since we now calculate the values ourselves,
we would not round them to nearest integer like the GDI
engine does. We now round these values to make it clear that
the GDI engine does not support any fractional metrics.
[ChangeLog][Windows][Text] Fixed an issue where the line
gap of some fonts would be included twice in the font's
leading.
Fixes: QTBUG-109400
Change-Id: I02ab7447b5e82d9f4474f9bca581f82acee85ff3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 8892819d0c89d0434c94f0c0951458719cba5c2e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If a widget's geometry is restored to a screen, which is smaller than
the one it was saved from,
- the widget could appear (partly) off screen
- the widget's title bar and resize handles could be inaccessible
This patch refactors and documents checkRestoredGeometry.
In a first step, the restored geometry's size is checked against
a given screen size. It is corrected if necessary.
In a second step, the restored geometry is moved inside the screen,
if necessary.
It makes the function a static member of QWidgetPrivate in order to
expose it for auto testing and adds a respective test function to
tst_QWidget.
Fixes: QTBUG-77385
Fixes: QTBUG-4397
Task-number: QTBUG-69104
Change-Id: I7172e27bfef86d82cd51de70b40de42e8895bae6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 5edb71c6d4cb0051d27d023ddcd180c5f59f2725)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When generating an Xcode project using qmake that's targeting the new
Xcode build system, QMAKE_PRE_LINK does not work properly.
It generates rules that conflict with the default linker rules.
This is a limitation of the new Xcode build system which does not have
any known workaround.
Document the limitation.
Fixes: QTBUG-99601
Change-Id: Ie4e6bcb0603ced85f786e9f7f407172e84a00d83
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 5fe52a0420a50e0d0e78bb7ff5d7625443a43673)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Deprecate usage of:
- qt_android_add_apk_target
- qt_android_apply_arch_suffix
- qt_android_generate_deployment_settings
when used by user projects directly. Instead, projects should use
qt_add_executable / qt_add_library.
Show a deprecation warning when the commands are used directly.
The deprecation warnings can be silenced using cmake's
-Wno-deprecated command line option.
To detect non-direct usage from inside our own function
implementations, we set some target properties which are then read to
decide whether to show the message.
Fixes: QTBUG-108508
Change-Id: Ib039cc5f3a01c2276173abb1e43f4eed216d0170
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit b43a39977b9eeea344eea5ee4e71a6586d512fb6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
in our tests.
They are not needed anymore since
d20f4ae706559fb7de8db9dd4845f7ce3936061a got merged and the
QT_ANDROID_PACKAGE_SOURCE_DIR property is read at generation time
rather than configure time.
This means the
qt_internal_add_test ->
qt_internal_add_executable ->
_qt_internal_android_executable_finalizer ->
qt_android_generate_deployment_settings
calls take care of generation the right value for the property even
with CMake 3.16.
Remove the direct qt_android_generate_deployment_settings calls,
in preparation for their deprecation in public api.
Task-number: QTBUG-88506
Task-number: QTBUG-88840
Task-number: QTBUG-108508
Change-Id: Ief1d0f9f620bd37beeedde26dedb66f728fa4a6f
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 5e00c0c5e55c5a87b19655947d97ca6192e02e1e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If a QGraphicsEffect is active during destruction, the corresponding
widget does not inform it's parent about this change which leads to
artefacts of the old effect. Therefore trigger an update through
effectBoundingRectChanged() if the graphics effect source changes.
Fixes: QTBUG-109165
Change-Id: Ib3fd9bec2134ed61f098c4ce6629ebcc5df90787
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2946447f50bc03ae5c9b5b9668d43ca7223a53c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Adds QCH::supportsAlgorithm() method which returns whether the selected
algorithm is supported and we guarantee to get a result when generating
hashes. OpenSSL will be responsible for providing us this information.
Returns TRUE if OpenSSL is not used as a provider.
[ChangeLog][QtCore][QCryptographicHash] Add supportsAlgorithm() method
that can be used to query OpenSSL and check whether the selected
algorithm is supported.
Change-Id: I0d94e02b8c70beb79520150fab6c32bdd1da3fca
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 0657b0734ef78cbaeb5f9d800df79647790d3163)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This improves the runtime of this particular test function by
almost 17% on my machine.
Change-Id: Icd77cdda92374b92121988c99e56787d405fa2d9
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 7fa6670fa4ff5a916477f14d5754f9337ec9f1a8)
This turns const char[] arrays into const char* pointers and
therefore prevents the implicit conversion of string literals
to QString in QT_RESTRICTED_CAST_FROM_ASCII.
Fix by avoiding the decay.
Also simplify the template magic.
Change-Id: I88164a1866ac71b41d9cd1564f3a5e83d2d42aaa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ba52b29d336cc32a462306d9011b75e9948c7040)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There's no need to first convert to QString and then convert back to
QByteArray.
Change-Id: Idedcf3143f44c640a9259f16e364dfe76ecf4c0d
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit e86a5f5f8b184562b5cde0da8882a2d8ebce84d5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
WHEN writing an invalid character, THEN we expect the writer to report
an error.
The old code had it the wrong way around. It checked that WHEN the
writer reports an error, THEN the character was invalid.
The formulations are equivalent, but the latter is mixing up cause and
effect, making it less clear what's being checked (QXmlStreamWriter,
not isValidSingleTextChar()), so swap.
Change-Id: I703de9ddde98d9913977a913f671472930735900
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 7d0f08094a2318b753ea7d69b71c0abe0a46b3d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QBuffer::open() was only documented as \reimp, so its behavior
regarding WriteOnly was never actually described.
Add a test and document the outcome.
Change-Id: I75c49cd3f6a1961bcaece4a92a4e479bb3300d36
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit c262a1805a062fd99abc890f58ea951da80ff0af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Static Qt builds are not covered by BC guarantees, but since all
'libraries' are linked into a single executable, we face in all users
of the library the same ODR violation that we faced within the
implementation DLL: we can't define the same symbol as inline in some
TUs and out-of-line in others.
In the past, we decided to always inline in static builds, but that
breaks users which, by Hyrum's Law, have come to depend on the
non-existent BC guarantees for static Qt builds.
By switching to never inline¹ in static builds, we restore BC for such
users. The performance issues should be minimal, since LTO will anyway
inline whatever it wants, independent on how it was declared.
¹ except when the deprecation point has passed over the Qt version the
API was inlined (-disable-deprecated-up-to configure switch).
[ChangeLog][QtCore] Restored binary compatibility for static Qt
builds broken by the QT_INLINE_SINCE mechanism. Qt still does not
guarantee BC for static build configurations otherwise.
Fixes: QTBUG-109449
Change-Id: Ie3fa62621b74dc5e9dac301b9882c0e3c3999eaf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 8602a224b6ade5680329270d8d573b786a7a81a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We have this logging category on xcb and ios already.
Task-number: QTBUG-103620
Change-Id: I70153c4ea9d62316d0e05550559010d85e2f9d85
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit b3750e815f3b8b4dd68b4425014b7b8dfa9b985f)
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
1) Check only for the events that the dispatcher is able to process,
otherwise it enters an endless loop
2) Take care to run the correct wake up callback with
Asyncify.handleSleep
Fixes: QTBUG-109066
Change-Id: I10d29d18962c3e438e56712e1f43ecadedb6205c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 8f04c50cffe5d6b3963a29715b2dd2d37269d5de)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When an external screen is connected to an iPad, and the application is
starting up on that screen, we will get a connection notification about
that screen as part of the initial bootstrap of UIApplicationMain,
before we call the user's main().
Since we initialize and add all available screen on QIOSIntegration
creation, we can just ignore the early connection notification.
This avoids a crash, but the window will not show anything on the
external screen, which is a separate issue.
Fixes: QTBUG-106701
Change-Id: I9e0a9736bf602277316bd004e0d01c640feaf319
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit dd49793bc3b4dd3808f0f24b717c442a5095db14)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends 601dbd64993fcbbb2ce6aaa95ef153ffd4f852b9, which changed the
signature of the private callVoidMethodV function. However, that
function got called in a public template member function, so callsites
depended on the private function to be present. By changing the function
signature, we broke binary compatibility.
Bring the original function back and implement the variadic overload
through it.
Fixes: QTBUG-109428
Change-Id: Ie2297e120fbeb146089c0fbe8f91f8b8d3c79713
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit f2b49789b2f9f9145d318a00868d2f054052aee4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
OpenSSL implementation did not clear the previous result when
calling QCH::reset(). This could lead to not generating new hashes.
Change-Id: Ic83e6382038a2f8808af950b88e57316b90ef2bc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 1fe74c3bd3f727551b8168ee9f3e642d42233d55)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The object replacement character (U+FFFC) is used to represent
inline objects such as images in rich-text. To enable this,
we have special handling of it in QTextEngine. For classes
where inline images are not supported, it will just be hidden
from the visual text, which is unexpected.
Instead of always special-casing it, we make this dependent
on whether the document layout has registered any object handlers.
If they have not, then there will be no visual representation of
the object, and it is better to show the glyph for it.
For anything based on QTextDocument, there will always be the
image handler, so U+FFFC will still have special handling there,
but for non-rich labels and plain text editors the glyph will
be shown instead.
Note that there was also a bug in QLineEdit, where the object
replacement character was always replaced by a space. This was
introduced in 2007, in a patch which replaced a !ch.isPrint()
with a check for "the most obvious non-printable characters"
to reduce the number of characters that were not shown. However,
U+FFFC is a printable character and would thus not have been
filtered by the !isPrint() condition, so I think this was a
mistake at the time. However, due to the special-casing of
the character in Qt, it would not have had any effect until
now.
This also changes the QTextLayout::cursorToXForInlineObject()
test to actually test proper inline objects, as this was
previously using a hack which depended on the inline object
code to be used even for plain QTextLayouts with no handlers
for these.
[ChangeLog][Text] The object replacement character (U+FFFC)
is now only filtered out in rich text controls, where they
represent inline objects. In other controls, its glyphs will
be shown as with other text.
Fixes: QTBUG-101526
Change-Id: I7fcaf2b10918feb41589e1098016efbf79a0e62d
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit ca64365e3a7245f6ef0f8f6962db3c1b85421cef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Code checker doesn't like that we simply assign to the moved-from
object's member, so create a separate object to be nice.
Change-Id: I07c83cb051d87b33cc2d4f34078c50805c312ea6
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit b949f65f60829e98d2c413080daa0e485936665c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Current code doesn't take the custom margins into account,
it will cause windows with custom margins have wrong size
after DPI change.
Amends commit 2cfca7fd1911cc82a22763152c04c65bc05bc19a
Change-Id: I80b01c030a63d02cf66f105785df7c3f590481b5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 67284763e7ce0d12650b652e92dfd022a8affb1d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The .bat extension was already handled for, __qt_cmake_private_path,
and adding the extra one was causing an issue where
qt-cmake-standalone-test was calling qt-cmake-private.bat.bat!
Amends 8aae821b5aa2bd0ac919683dcb3cb62913ca9063
Change-Id: I9c374440c89c617e31f369fde8f041e5c1d17a03
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5d4768000377d6f4240198a2dc1cd00d7ef89de2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As framebufferForBufferObject has a code-path which returns a nullptr,
it's vital to check on that and return early in that case.
As this is the third segment in this function that does gbm_surface_release_buffer,
a qScopeGuard was introduced to reduce code duplication.
This also makes this function saver/easier to maintain long term.
The platform on which this segfault was reported is QEMU
Change-Id: I5ee1ad4073712349b7475bce3a7978961fea2344
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit ad2aca113daccb4d0e9299b7c37d61f2d9b1f930)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We agreed that qt-configure-module needs to come back to bin/ as it's
user-facing.
Amends d77ce33082516234fd7bbb5335401a1f3af8ca27
[ChangeLog][CMake] Upon further consideration, qt-configure-module
was deemed user-facing, and was thus moved back to ./bin on
all platforms.
Task-number: QTBUG-107621
Change-Id: I1f7874436e5b3988242091fc0303ea828f29d5c6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9773f0175cfe87b0c90db044ae20ddee3aae9ada)
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Use static_cast to convert a QEvent to a QKeyEvent,
replacing (QKeyEvent*)e
Change-Id: I52ac3f46aec42600251cf737db2e71c04f2b45c7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 223cf01cc6700c08c1a0e44a1aaa82f04b1f615b)
2022-12-13 07:22:13 +00:00
3195 changed files with 127545 additions and 81703 deletions
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.