Since https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8564 is
merged, the timestamp file for {target}_json_file.txt should be updated
for `Cross-Config` builds.
The actual error message before this commit when CMake 3.28 is used:
```
ninja: error: 'src/corelib/Core_autogen/timestamp', needed by 'src/corelib/meta_types/Core_json_file_list.txt', missing and no known rule to make it
```
Change-Id: Ib544b18b67d2d4722f3801b1f46a0e0e18e59d48
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 8041bfba47305352627d910930e52da496904c17)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5c9e77298583d9955c139765783e403314799f42)
d026fad3d962eed0119351cd37f34490e09153fd added converting constructors
for QPointer. This however made converting _assignments_ ambiguous,
introducing a regression for users coming from Qt < 6.6.
This code:
QPointer<Base> base;
QPointer<Derived> derived;
base = derived;
used to convert `derived` to `Derived *` (using the implicit conversion
operator from `QPointer<Derived>` to `Derived *`), and then the
assignment operator for `QPointer<Base>` that took a `Base *`.
The introduction of the conversion constructor in 6.6 makes it possible
to convert `QPointer<Derived>` to `QPointer<Base>`, and then fall back
to the compiler-generated assignment operator for `QPointer<Base>`.
The result is that the code above is now ambiguous and stops compiling.
Fix this by adding a converting assignment operator for QPointer.
I'm only adding the const-lvalue overload because the implementation
requires going through the private QWeakPointer::assign helper. We
cannot copy-assign or move-assign the inner QWeakPointer, as those
assignments require lock()ing the QWeakPointer and that's not possible
on a QObject-tracking QWeakPointer (but cf. QTBUG-117483).
Assigning from a rvalue QPointer would mean calling assign() on
the internal QWeakPointer _and_ clear the incoming QPointer,
and that's strictly worse than the lvalue overload (where we just call
assign()).
Change-Id: I33fb2a22b3d5110284d78e3d7c6cc79a5b73b67b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6c504f2519e1180dbcfd77d5bb08b0db9742eeaa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 11aa3b13b3edb3c8731ad45b8e475c6037ffce97)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The new linker in Xcode 15 doesn't provide any default linker or
framework paths when requested via -v, but still seems to use the
default paths documented in the ld man page.
We trust that linker will do the right thing, even if we don't
know of its default linker paths.
We also need to opt out of the default fallback logic to
set the libdirs to /lib and /usr/lib.
This may result in UnixMakefileGenerator::findLibraries finding
different libraries than expected, if additional paths are
passed with -L, which will then take precedence for qmake,
even if the linker itself will use the library from the
SDK's default paths. This should hopefully not be an issue
in practice, as we don't turn -lFoo into absolute paths in
qmake, so the only risk is that we're picking up the wrong
prl files and adding additional dependencies that the lib
in the SDK doesn't have.
Change-Id: I2347b26e2df0828471373b0e15b8c9089274c65d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit cdf64b0e47115cc473e1afd1472b4b09e130b2a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 269903a5db40c2eeb7b7b2d5d1f98a119486e7c9)
This is needed to support passing it to other processes so they can
enable legacy, compatibility mode. Right now, there's no such code, but
I am 90% certain we'll need it soon in 6.6.x, if not for compatibility
changes in the future.
There's a bug in passing a QNativeIpcKey to another process that causes
QSharedMemory to use the wrong QSystemSemaphore for control (a feature
that should never have existed in the first place, but we're 15 years
too late on that). I have not yet investigated a fix for this, but it
will likely involve knowing the original legacy key.
Change-Id: Idd5e1bb52be047d7b4fffffd1750b547013cb336
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9edb835904a7fa856e482464a7258019d5766333)
(cherry picked from commit 271d38b0ef6d9e77f7e242bf3081e0571662ae1c)
There's no need to return QString, only to create the QNativeIpcKey
elsewhere, when nothing uses this intermediary QString (those two
functions aren't used in unit tests any more, since the two "IPC: add
native key support" commits (2c286561bbc9e4e408d34e5bf43db8ad9acc0e84
and 3ae052d3bb5d7af0badf32575a5aa042cffd8243). Since they aren't used in
the tests, we can remove the Q_AUTOTEST_EXPORT macro too and the
unnecessary default argument.
I'll need the ability to return QNativeIpcKey to store the original,
legacy key inside of it.
Change-Id: Idd5e1bb52be047d7b4fffffd17506c05e4f61f79
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b5584ed2240abe3892fa5b0a23b3ad093ed9fec2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 608b08f4d57369378b1a101b78a46202bd17c11a)
Both executables (subscription, bindablesubscription) are documented
as one project. Make sure that e.g. Qt Creator can also load this
project.
Fixes: QTBUG-117109
Change-Id: I3912f2f76379940b02f3a57a7a55440a30366755
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f2ec221bd62b8722915db9fc7dc3eb78991f6e6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit f5056133a35e15ea2d57beed2e015f8bf802cdfc)
Amends 4f4a8e75ab34003a4a49b89392ae7712415ac788, after which
QItemSelectionModel printed a warning when destroying the model.
We reset the selection model in response to the model getting destroyed,
and since the model is already set to be nullptr at this point the
select() function complains about changing the selection with no model
set being a no-op.
Fix this by not calling reset() when the model gets destroyed - the
stored selection and currentIndex are already reset at this point -
and instead only call reset() when a new model is set in initModel.
Fixes: QTBUG-117200
Change-Id: I12fc6b3fb2f2ff2a34b46988d5f58151123f9976
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit dc126de22ea4d38736ae57c08c0b271f3c53fad9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ae8e356c5152cc62aef55edf50e41125c500cf44)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Added to the list of important links on the Android Platform home page.
Task-number: QTBUG-116780
Change-Id: Id65a73d56bff0b288ebb1da098f6dbd8cbbe606e
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit e7847a3258aa4eb6fc51c97a2ac05f57a1eadb53)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 67a4f257b81d57dcb048ae0f0757d5f8702642bc)
Allows us to change the target distro through platform configuration
yaml file.
Pick-to: 6.6 dev
Task-number: QTBUG-117120
Change-Id: Ie6e99e4b25198e27491e6191f57d77dbbe3c4eed
Reviewed-by: Toni Saario <toni.saario@qt.io>
This makes it source compatible with Qt 6.5 by allowing us to change
FastType to something other than float, which we have done for Qt 6.6 on
systems with AVX float16 instructions.
Change-Id: I7ebf0c178ba0ff7f04f6788d182a1a000fe31c0c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit baac34de6fcbdcc6ee5eb06c3db16c7eda32f121)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 224d4ad279ab37e99dc6194a2232e9f72ded6225)
The patch adding the function unexpectedly made it into 6.5 before
6.5.3 was forked off. That's nice, as it reduces the number of
releases with a broken implementation, but the documentation and
ChangeLog were written assuming a merge for 6.5.4.
Fix the documentation.
Amends 6da6a17de9ccfcd5458ea72507b131660e0ab948.
[ChangeLog][Editorial][QtCore] Delete the old entry for
qHash(qfloat16), keep the one from this commit.
[ChangeLog][QtCore] Fixed qHash(qfloat16) which was broken from 6.5.0
to 6.5.2, inclusive. If you compiled against one of the affected Qt
versions, you need to recompile against either Qt 6.4 or earlier or
6.5.3 or later, because the problematic code is inline.
Task-number: QTBUG-116064
Task-number: QTBUG-116076
Change-Id: If8fa35fb8532cf0bbf2ba0438694d95fd9bd6991
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0f19cafc3cbb85dfd67c5c6f7421943e9c063ea1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8e14e13c16249f5dd4f25e8d681498e393241493)
Behaving differently in QQuickWindow vs. a QRhi-based widget
window is not great for WebEngine. The env.var naming is not
the best (QSG prefix) but we already have some precedent for
this (recognizing QSG_INFO in QRhi), and there is no other
choice anyway.
Task-number: QTBUG-116445
Change-Id: Ibfd495cbd1d42502441d6629325bdeb033e813f3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit ffb857e9d0745fdd31bca091333f1120c5857d7b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 69c0ca3174e2484a241dcfbeb786084eca3c57e5)
The ipc_posix feature was OFF despite the following test values:
TEST_posix_shm ON
TEST_posix_sem ON
TEST_sysv_shm OFF
TEST_sysv_sem OFF
The 'NOT (TEST_sysv_shm AND TEST_sysv_sem)' part of the condition is not
correctly evaluated. Resolve the parentheses to work around this issue.
Fixes: QTBUG-117052
Change-Id: Idac23d207f8dd644d059977ca41b6e32b17b3a49
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 828770c60c1c0342a015fc7fe2d6e714f645fb64)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5c9fa4ca4a88a83c8fab84ce22f68af9c0a6a893)
The original design was supposed to be small, at a single pointer, but
that never made it through, with the "QString key" member. So the
anonymous union for typeAndFlags overlapping with the extension pointer
was just unnecessary headache.
So separate the two. This means QNativeIpcKey's size increases from 4
pointers to 40 bytes on 64-bit systems and to 24 bytes on 32-bit systems
(so we have 6 unused bytes on both architectures).
Fixes: QTBUG-116821
Change-Id: I512648fd617741199e67fffd1782b7d5ba5ddd12
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit eb5c5a76cf369dd5e40289c1013f043c7e82ff2e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ef5f2322a767d84d31dc67d0be9a751054cf8b19)
So we can add them in the future but cause older versions of Qt to
reject them if they don't know what they are.
Change-Id: I512648fd617741199e67fffd1782b85935bb832a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 18867845eb77537c4125e1da4dfcd049e303ee27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a5a1231d527a259d0dac9dc62e04a284fe183d51)
When collecting plugins required for the android application according
to linked targets we should take into account all prefix directories.
But not only the first one. Otherwise the order we use when adding
paths to extraPrefixDirs will affect collecting of the plugins. This
specifically leads to the issue if the user project builds custom Qt
plugins. The plugin directory from user project build tree will be
found first and all plugins from Qt installation directory are
discarded.
Fixes: QTBUG-116920
Change-Id: Id94ebaf5ccd1a279a74b38b59ff535f45230e1b4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 630d3328ddc35a02c42fa6501636eaee6eb76a37)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 38f03c87193194dcb7aff1eb9c1fd63820839c0f)
whenAll() and whenAny() create a shared context object which is
referenced by the continuation lambda. The refcount of context is only
correctly managed when it is copied non-const to the lambda's
capture list.
Fixes: QTBUG-116731
Change-Id: I8e79e1a0dc867f69bbacf1ed873f353a18f6ad38
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit ba2ebc24a1b29020699dc2282b05a60506b56c6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a2792bac1a6077460f288a2b918449011f8c89d6)
When loading the font data, we had some unprotected reads. To harden
this, we check everything against the length of the font data
before reading.
[ChangeLog][QtGui][Windows] Fixed a possible crash that could happen
when loading corrupted font data.
Fixes: QTBUG-116773
Change-Id: I156df3b8833c9ed785fcc690821a7a74d9a51126
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 9fe47cf2e11d7c9ad4f72e6fc5e53f10a9743b03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d0ed5db78160ce7c16d9fffef79aa11a7783e34e)
Compilers that support 128-bit integer types usually don't have
support for 128-bit literals, so provide Q_(U)INT128_C macros and back
them with UDLs. This, of course, only works in C++, so until compilers
provide built-in literals that support C, too, that's all we get.
[ChangeLog][QtCore] Added Q_INT128_C() and Q_UINT128_C() macros to
create qint128 and quint128 literals in a platform-independent way.
Fixes: QTBUG-116822
Change-Id: I4be645baf2e007ee1aa1a27f9b5166671806dc49
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 16433a4a6ed22750adfdb9633149c3bd485c4656)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 321dcd1d1d0fdd627160e882c471529baa6cafa7)
Since compilers don't provide such macros, do it ourselves.
In order to test these macros, add ad-hoc specializations of
QTest::toString() for qint128 and quint128 locally to the test. Turns
out it's not too hard to write them, so we might move them to a public
header, yet.
Change-Id: I1483f3af2ccec6038e1c780649f9ffe413bb59ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 104a0a9ecdb18d65e4d9075d87e8860c6c9d8335)
(cherry picked from commit 09bf722590ca6d1482b6605e1dffaaadd863e125)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Remove "Example" from the title.
Edit the link (title) to the documentation of Mandelbrot in QThread
documentation.
Delete the foreach related sentence as we are trying to port away from
this Qt pseudo-keyword.
Task-number: QTBUG-108861
Change-Id: I6d04f24ac9c1fa1efe30a947c2da2ec7475edc80
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 73a1ae6ea91cbcc7ddfd80defd78ac924dea4c6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e9d400b4aae39519d11db95904800e0e36721188)
Add const in front of local variables when applicable.
Replace const by constexpr when the value of the variable can be
calculated at compile-time.
Task-number: QTBUG-108861
Change-Id: I2cd1bc97aaa07d6d564731d9ccddba9a74e96fef
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 7903a52d46401e224f1d85067d51bf443066cbec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit f67e649e9b47122c0cbe6bc03d82dfbca8a5949c)
Check that QIntegerForSize<16> and std::numeric_limits<quint128> work
and that q(u)int128 are available in C mode, too.
Change-Id: I44af8282399c78f6e74a8268af53bad64407ca34
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 32f66f7008ce8fff1a8cdc5219978d1a61d4684c)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 297aa6d751fbbb034f14eb376fcbbdca358cc593)
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Using ints for the tags is not ideal. There is no type safe
way to do conversions from strings, and how the int corresponds
to the four-byte tag is not clear from the API, so user code
can end up being less readable due to this.
Especially since this type of tag is a data type used several
places in fonts, and we will need them again for implementing
support for variable axes, it's worth giving this an extra
round of polish.
Since it was not addressed in a timely manner and we don't want
this to delay the upcoming release, we mark the API as
preliminary for now, to give ourselves the option of changing it
to something.
Fixes: QTBUG-116929
Change-Id: I498478785dcd5ece954151f01f1a017828d6b8b8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 6ab362a7eaddd6b2e867c9de6dbb04b7f760d005)
(cherry picked from commit 8055247fc0426d64e24d9d21a4ea5b984afa61fe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When appending to an empty string, we optimize and
copy the internal pointer. But if the other string was
created with fromRawData this might be temporary data on the stack/heap
and might be de-allocated or overwritten before the string
is used or is forced to make a deep-copy. This would lead to incorrect
data being used.
This is easy to overlook if you plan to append multiple strings
together, potentially supplied through an argument. Upon appending a
second string it would make a full copy, but there might not be a
guarantee for that. So, it's hard for users to avoid this pitfall!
Fixes: QTBUG-115752
Change-Id: Ia9aa5f463121c2ce2e0e8eee8a6c8612b7297f2b
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4660a230d527a9cffda41999103aba6ff5c2ecd5)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d4a6c81081db24812a043c44d0d3d683b53e7d80)
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
There were two problems:
- On platforms where QFLOAT16_IS_NATIVE == true, a qHash(qfloat16{})
call has become ambiguous between the three FP qHash() overloads
(float, double, long double), where it was unambiguously calling the
float one in Qt 6.4. This SiC was caused by the replacement of
operator float() by operator __fp16() in
99c7f0419e66692260be56c0385badeacb3f6760, which is in Qt 6.5.
- On platforms where QFLOAT16_IS_NATIVE == false, qHash(qfloat16{})
would produce a different value from qHash(float{}), and therefore
Qt 6.4, when the seed was != 0, because the former would go via the
one-arg-to-two-arg qHash adapter while the latter one would
not. Since participating functions are inline, this causes old and
new code to produce different hash values for the same qfloat16,
leading to a BiC possibly corrupting QHash etc.
Fix both by adding an explicit qHash(qfloat16). This function is
inline, so it doesn't add a new symbol to 6.5.x.
[ChangeLog][QtCore] Fixed qHash(qfloat16) which was broken from 6.5.0
to 6.5.3, inclusive. If you compiled against one of the affected Qt
versions, you need to recompile against either Qt 6.4 or earlier or
6.5.4 or later, because the problematic code is inline.
Pick-to: 6.5
Fixes: QTBUG-116064
Fixes: QTBUG-116076
Change-Id: Id02bc29a6c3ec463352f4bef314c040369081e9b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6da6a17de9ccfcd5458ea72507b131660e0ab948)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
cppreference.com says¹ that the space after the "" is deprecated now,
so remove the space. Let's just hope all our compilers support this,
otherwise it will get ugly².
¹ https://en.cppreference.com/w/cpp/language/user_literal#Literal_operators
² https://github.com/yhirose/cpp-httplib/issues/953
Pick-to: 6.5 6.2
Change-Id: Ic8e4939e3ba713023c5a5c020305c96b521dbda9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5503b478935aee563d31c5df035803818f4cead3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QWindow::setMask() is not guaranteed to turn the masked out areas
transparent, and it's up to the client to ensure this during
painting.
Change-Id: I1155b3ad095152a993532f2290cacb670e20daa7
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 5ce4aecd495667a50dd121930f9ca39dc07cfc36)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The event might come from a partial expose, but we want to
fill the entire bounds of the window, as we're filling with
a gradient.
Change-Id: I66cedb160fb0ed06935c06ba2fe5dec9ed468833
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 61c043333b255afcd83260b78027242fc27a2e83)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Wrap the directory creation logic with try/catch to handle possible
file system exceptions.
Pick-to: 6.5
Change-Id: I11ad4552dccfdc8cc8a4ec4912d0a15d0f9557c6
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
(cherry picked from commit 7164cce881c3d65eb18749471ba5e358c7d5998a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Call close explicitly to avoid any issues related to non-closed file
descriptors.
Pick-to: 6.5
Change-Id: I02df30032dc04afd5d135d707eff4a6efe6a3ea5
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
(cherry picked from commit e9ca247479206b3d6f3815c599a244d9bfbae394)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Generate the missing deprecated header in the framework directory for
the cross-module deprecation case.
Amends 7e84a04563142d217317928865a8f6475d189d95
Pick-to: 6.5
Change-Id: Ibb2d262e41c6de7dfb34c39cabd6b19c43aa9636
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 09c46d63af3ea68d7b49c395b9375d2b5d3ed666)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
See code review 496440 on Gerrit for the details.
Change-Id: Ibd32a44cf7e2e07f36687cc2f0eeaf3008f64e73
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 9b40272562cb8f83efcd8a062c76edc41a9cf952)
There was an extra `q` before dnslookup.
Found while trying to build tst_qdnslookup, the target wasn't seen by
CMake/Ninja.
Change-Id: Id594aab30dc9081fc269541561e0f2db5e615657
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 0ce51dee0e3c0d0e49c2ad211bdbbed03003d3a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This lets us testFlag() instead of using raw bit-field operations.
Task-number: QTBUG-111228
Change-Id: I2c26e9a24728e81baa42cf14c75271a015460913
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit ad63118071e3068ef3f45e75fad82a04952ba0fb)
Its methods act on their parameters without changing the converter, so
can all be const. Its instances thus have no non-const members to
exercise, so can always be const.
Task-number: QTBUG-111228
Change-Id: Ifcdb2f2159c2cfcd7998dd118aa327a32d299ccf
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 77fdd21cbf1a053efe6eec51356c665ed982d47c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The two were in the same files but mostly unrelated to one another -
aside from the converter defaulting to the dumper for output.
Furthermore, the dumper actually uses QDebug and QTextStream, not
QDataStream; rename it to reflect this reality.
Task-number: QTBUG-111228
Change-Id: Id65c120c319b555039f7fd186ed262f35ff5260a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit eaebb5c4d2e2a87b23d63c5406bf54458b4c4a24)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I overrode clang-tidy where it uglified or obfuscated and did some
clean-up provoked or made possible by its changes. Konrad pointed out,
in review, a constructor that could be = default; it could, in fact,
vanish entirely as a result.
Task-number: QTBUG-111228
Change-Id: I9b7744a3abaa29e6f9e0689d0f6985bfd88cd0fd
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
(cherry picked from commit d8517fb1ab83e7051b1d2c2152014e7ff1760426)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A couple more compilation units could use Qt::StringLiterals. Prefer
QL1SV for the code constants, to keep code small. Convert fpToString()
to take QL1SV instead of const char *, with suffix empty by default.
Also rearranged some spacing, some if it suggested by clang-tidy.
Task-number: QTBUG-111228
Change-Id: I03d810d52afcd4a760d18f2553914b75af716b74
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 319b2e0e86f0afa6aa48625702010b5a6db4fe38)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If the style changes while a popup is open (or about to close),
the popup will change style as well before it's hidden. And
this can result in the popup window briefly ending up smaller
than what it needs to be, in order to fit all the menu items.
In that case, it will show 'up' and 'down' widgets in the
menu that auto scrolls it when hovered. And all this can
happen for a split second while the menu is about to close
(as a result of the user clicking on a menu item).
A bug happens because of this if you click on the last menu
item in the list, and this causes the style to change. In
that case, the 'down' widget will end up directly underneath
the mouse for a split second, which will trigger an auto-scroll
timer to start. This timer will trigger a bit later, after
the popup has been hidden, and scroll the list view a bit down.
The result is that the next time you open the popup, it ends up
at the wrong place on the screen in a failed attempt to center
the current index on top of the combobox.
This patch will make sure that we always scroll the list view
to the top before we start calculating where the popup should
be placed on the screen. Otherwise the geometry ends up wrong
since the popup will anyway be resized (if possible) to fit
all the menu items before it's shown and should therefore not
take scrolling into account.
Fixes: QTBUG-113765
Change-Id: I61b5b832904de471c2303fc67325feec322b1449
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 8393922e7071221a9c6c0811eb714f20bf4ed02b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QLabel *l is declared uninitialized, assigned in a for loop. The last
object is deleted for testing purposes.
This leads to a false compiler warning about deleting a potentially
unintialized pointer.
=> initialize with nullptr to silence the warning.
Change-Id: I1422b04fc1fdbfc7248de577884aabfb539f3f4b
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 41c8d215f273c048d76c51de4c56cb55c4325c85)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's Thomas Porter and Tom Duff, not Xavier and Yoann.
Change-Id: I2e9345c06c299e9c0475831e21c3b9b85c58a32f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 631cb589bf53223648376c72d588a7914e463924)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Private libraries were linked conditional to QT_FEATURE_private_tests in
the CMake file. qstatictext_p.h was included conditional to developer
build. A developer build fails, with test enabled and private tests
disabled.
=> Change the CMake condition to QT_FEATURE_developer_build, to resolve
mismatch between CMake and cpp file.
Change-Id: I79213e7d3c38851b8b80cb8ab248d7bff750c227
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 38380de63c53b27dc85a1ba49e1ffade1c183fdd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
0b421fa58b9a73d657bf17834788fd1175c4767e ensured a correct focus chain,
when buttons in a QDialogButtonBox were hidden.
The implementation did not check, if a hidden button was added via
setStandardButtons(). In consequence, it was removed from the
standardButtonHash and never added again.
QDialogButtonBox::button() returned nullptr for a standard button,
once it had been hidden. That introduced a regression.
This follow-up patch makes sure, a standard button is not removed
from standardButtonHash, when hidden. By no longer removing it from
standardButtonHash, it makes showQDialogButtonBox::button() always
return the pointer to the standard button, even if it is hidden.
The function handleButtonDestroyed() used the argument
QDialogButtonBoxPrivate::RemoveRule::KeepConnections, in order to leave
signal/slot connections untouched. It expected the the destroyed button
to be removed from standardButtonHash. In order to retain that
functionality, the enum class RemoveRule is renamed to RemoveReason,
and one value was added. QDialogButtonBoxPrivate now handles all
necessary cases of removing a button:
ManualRemove (previously Disconnect):
- remove button from roles
- remove button from standardButtonHash
- disconnect all signals
LeaveEvent (previously KeepConnections):
- remove button from roles
- do not remove button form standardButtonHash
- do not disconnect signals
Destroyed (new):
- remove button from roles
- remove button from standardButtonHash
- do not disconnect signals (QObject will do that)
An autotest is added to tst_QDialogButtonBox.
Task-number: QTBUG-114377
Pick-to: 6.5
Change-Id: Ib28625d44fa89c3d06f181f64875c2e456cebbfa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit edc984db384311e25a0afe4902585bd97e4ebcd1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
processWindowScreenChangedEvent() returns early if the
screen for the (top-level) window has already been updated,
for instance by a call to handleScreenRemoved(). This was
preventing us from updating the DPR and window geometry.
Move the code a slot connected to QWindow::screenChange,
which gets emitted for all windows (also child windows),
whenever the screen changes.
Fixes: QTBUG-116232
Change-Id: I44701fd001ab1fd54efe9c8451c6a58cfc0b285f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 89ce65c2d01e77c1cf49bb8579f63b60480e0186)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
FindWrapOpenGL.cmake assumed that IMPORTED_LOCATION is the absolute path
of the library within the framework. That's not the case with CMake 3.28
anymore. There, IMPORTED_LOCATION is the absolute path of the framework
directory.
The relevant upstream CMake change is
6b01a27f901b5eb392955fea322cde44a1b782a3.
Pick-to: 6.5 6.2
Change-Id: I6b702a28318e0978c56dec83c398965aa77ef020
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 0efea8020c1d221635aaa0a71529edb392cfe3cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The \generate list names are added for each categorized section with
some explanation. Here, calling the overviews as
explanations-(name of the section). The idea is to give general terms
instead of specific phrases like 'core' etc, for better understanding.
Task-number: QTBUG-115347
Pick-to: 6.5
Change-Id: I673e38c0e9193b7f7d54008bfcf82c2d3a10be3f
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 29eb5d8ace744cd4a946aca3f5f1ffe0f4bd0a1f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There doesn't seem to be reason for it to exist, and apparently it
causes compilation failures with icc.
Fixes: QTBUG-116517
Initial-patch-by: Yorick Bosman
Change-Id: Ic2ed1d4318d522851278afa7f9791441af4fa709
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ca4633f243a23de1848ebf32aef45f23d6d18154)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The problem does not become apparent until a QQuickWidget or QRhiWidget
using Vulkan is put into a QScrollArea and then attempted to be scrolled
vertically.
Fixes: QTBUG-116338
Change-Id: I55367b51aaf2bb8d039bf5e313a0d8c3d7908327
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 750d00aba7e49b6093bc273924ba688cb433b505)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Require the C++17 standard, but not what is set by Qt for syncqt,
to avoid unwanted standard check in some corner cases.
Pick-to: 6.5
Task-number: QTBUG-116789
Change-Id: I34e07e172e31d5ffc69b84dd3ef30f02f6e75a9d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 7a70c6fcfd5d3e000b80ab9b833f4e2b14a3563d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends e7477e8934ab38722f5589914d08b3f15e870109.
Do not call QWindow::resize() on changing min/max sizes if
bounded window size has not changed. Otherwise it may unexpectedly
reset window's state on some platforms, like Windows and Linux.
Fixes: QTBUG-115699
Pick-to: 6.5
Change-Id: I217ca3fd854a1f41d6df312e3258734d1d3bce45
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7efc0f6f1994a06359deb859fd73126d576df226)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Reorder the includes following the coding conventions.
Remove unneeded includes.
Add needed includes to avoid Transitive includes.
QGestureEvent is passed by a pointer in the gestureEvent method in
mandelbrotwidget.h. So, we do not really need to include the header.
Instead, forward-declare QGestureEvent class in a namespace.
Task-number: QTBUG-108861
Pick-to: 6.5
Change-Id: I48cfd663bf98350281ef7f31e6c0ef3e301a08ca
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit a4d7a4ccb39daa86ee2ef23b1408344822ae7c16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Create QString at compile time using the literal operator""s instead of
using pointers to characters. This way, no conversion or allocation will
occur at runtime.
Task-number: QTBUG-108861
Pick-to: 6.5
Change-Id: I4fb51d74abbbfa08fb9fddfa90d8afcebd82a7e2
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit ae0d545d31b480ca65e93e5af5f4649caabaa683)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The documentation for QPalette::accent had been missed and its updated
as part of this patchset.
Amends patchset 17c589df94a2245ee92d45839c2cba73566d7310.
Fixes: QTBUG-116930
Change-Id: Iaa53e15dbecaa3c741e2db013c96b4424be39e91
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit e418980b2fbd60a778f469b0d6852aab28df9001)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Adding some Qt Design Studio macros for global
qtdoc use. This would ensure flexibility for
the documentation writing.
Task-number: QDS-10142
Change-Id: Id61a68d124aad1b8c8f9e17358fb5990efbab5de
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit c33fd574c970eb920a899a9caccb2e6b1838ee19)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
91dcc76fc1 might have fixed the underlying issue, so we no longer
need the XFAIL codepath at all.
Fixes: QTBUG-114720
Change-Id: I67ccbed67a0536b679c50c26eb0b3e51c93dceeb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2f945aaa263d4688724d11e6ba7f768c4dc6bdd0)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Error is the default for this option in ld64, and with the new linker
in Xcode 15 the option was deprecated, causing a warning, so let's just
skip adding it and assume undefined symbols results in errors.
Fixes: QTBUG-116732
Pick-to: 6.5
Change-Id: I736a891ae102fe1dfb2cdf869f42c665e231adba
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c00b17de6620c9339be39ca35fea98e19951e72f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Just re-use the private functionality present elsewhere. As a drive-by
fix this will also properly separate the individual points with commas,
making the output readable again.
Before:
> QPolygonF(QPointF(0,0)QPointF(93.75,0)QPointF(93.75,62.5)QPointF(0,62.5))
After:
> QPolygonF(QPointF(0,0), QPointF(93.75,0), QPointF(93.75,62.5), QPointF(0,62.5))
Change-Id: I0cf0408bfb2fe72974e4dbd5d2958c5a2aa56b5f
Pick-to: 6.5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit c7486cd665e201dd48f49312681de4a776fbe558)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We check for a valid event dispatcher when waking up,
but there was no check after processing queued events,
and processEvents() would continue with a stale this
pointer if one of the queued events happened to delete
the application object.
Fix this by checking if this is still a valid pointer
after processing events.
Fixes: QTBUG-116330
Change-Id: Ic4d91298986847e6095ce9daea51a4b974106c06
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit fefb1e18b1b6834ea344bed273735f096c61eb90)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
a611a9f537f1187825339c2a2214c8ec4a23680f (in Qt 5) added support for
mixed-type comparisons through QCOMPARE. That commit added a new
overload for qCompare taking two types, T1 and T2; but it also left the
same-type qCompare(T, T) overload around, guarded by a Qt 6 version
check.
The mixed-type version is however not a generalization of the same-type
one, because it won't work if one of the arguments doesn't participate
in FTAD. Case in point: braced-init-lists. In Qt 5 this worked:
QCOMPARE(some_container, {42});
but in Qt 6 it does not work any more. The mixed-type overload fails
deduction (can't deduce T2); in Qt 5 the same-type overload deduced
T=SomeContainer, and {42} was used to select a constructor for
SomeContainer.
--
There's a partial, straightforward workaround for this: default T2 to
T1 in the mized-type overload. In that case T2 has a "fallback" if it
cannot be deduced. This is partial because of course doesn't address
the case in which T1 cannot be deduced, but I don't think that is
common at all.
QList is special here, because it has qCompare overloads that makes it
comparable with arrays, initializer lists and more. I don't like that
very much -- we should probably have a qCompare(input_range,
input_range) overload, but that's an exercise for C++20.
Change-Id: I344ba33167829984978cd8d649a1904349a9edab
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5560723e9dd8f32a2fb2530b975ba0bb0f9f5ef7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In order to test the impact of migration to QASV.
Task-number: QTBUG-101707
Change-Id: I17f84ca98fc87d89bb4cd6ad98c8a12aecd315ee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 516d828f240c3166a057372dde6cbec4ea6d380a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
33c88f86b5b8714977719a8ccff0f7c15c9cbd44 added some logic to QAPM in
order to have it automatically emit headerDataChanged when rows/columns
were added or removed in the model. This was done as a stopgap measure
to prevent QAPM from asking for illegal indices in order to implement
automatic remapping of the section headings (since there's no
mapSectionToSource).
The commit seems to have introduced a regression in QHeaderView, which
isn't prepared to receive headerDataChanged while a row/column count
change is in progress. When receiving headerDataChanged, QHeaderView
will try to read the row/column count and will store it internally.
When it will then receive the signals for insertion/removal of
rows/columns, it will interpret it as a modification of the previously
stored value -- even if the value it stored was already correct.
Fix this by avoiding to have two signals in flight at the same time;
emit headerDataChanged as a queued invocation.
Task-number: QTBUG-114225
Change-Id: I521465a852b8c7135f22f730ead41dca760ba428
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit a0bcad39033bddd9b9d14a524b829513105913d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The wording was slightly ambiguous giving readers the idea that it will
scan for a \0 terminator in the data; however what actually happens is
that readBytes() gets the length of the string from a quint32 in the
stream right before the data, and readBytes() always adds a
null-terminator.
Fixes: QTBUG-3287
Change-Id: Ie22500a9c191ffd590a6b57babeb67577c24dddb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 74098981bd42e6bc135c22506e5a910e37544406)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Just roll everything up into qt_message().
Change-Id: I2b24e1d3cad44897906efffd177fb9867131b795
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 88e9ce201b9599db7470c7879e0bf29262501a42)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
IFW requires static build of Qt which does not build tests on all
configurations. This allows building modules without them building tests. Previously IFW used 5.15 repos, those build tests in test workitem, not running into the issue.
This is only relevant if the tested repo i.e IFW implements it's own
test instructions.
Change-Id: I1e03f3b577d7be314f92ed3989e5f6daf2a46da1
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit 409aa8d097a424c6281653d8c4dc3bc1c46054ed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The default minimum date and maximum date for QCalendarWidget are not
the 'earliest and last dates' that QDate class can handle. Instead,
minimumDate is initialized to November 25, 4714 BCE (first Julian day),
and maximumDate to December 31, 9999 CE.
Change-Id: Ice9289853a7e825ff2b31567efb81cdfb7d678a1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 99371811594e813f26e014a3adc629746231765b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
"GPL-2.0" as a SPDX identifier is deprecated in SPDX 3. Use
the more explicit GPL-2.0-only instead.
Change-Id: Ie543135ad1d73205f7a94db140189f5132098ea2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 8550d60acaead1f5a148f8e8e8384798dc6cd071)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
GPL-2.0 SPDX identifier is deprecated. Use the more explicit
GPL-2.0-only instead. Also, in SPDX expressions AND and OR
need to be all uppercase.
Change-Id: I0875cf3b9b2020f69e3318d5ff314988a3992409
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 0b3b1ab26c126701c8ac317d94d80858f0bb2ec7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For better integrations with Qt Creator, add a custom target with
the Jar files so they are shown under the project files. Since
source_group() is not supported, add_custom_target() is used.
Change-Id: Ie527fdce918d526ee6e8953e27d4e0f4131a9828
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c76918eca2a964906f1c2a59886b3b6892ffe264)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We don't have a good way to detect whether the button is modified or
not, to bail out of using the native dialog helpers.
Document that this API shouldn't be used to modify the standard
buttons (they are standard after all), and recommend the explicit
APIs for adding custom buttons instead.
Fixes: QTBUG-112525
Change-Id: I38c8ef5e1717a85f0db59c9e705d0775982ffb57
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e9a1c53214d3936721e00bebbdc1e949e10658dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We always allocated them in the constructor function, and never tested
them for nullptr, so just manage them as regular members.
As a drive-by, apply const to read-only variables in relevant code.
Change-Id: If0a3ac8982582f2adf5187a3c0357f4da93467fb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit a7b50c40a0af8e617b73f581c019d0f16f7d04d8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Make sure the Mimer SQL include files and libraries are found
to enable the Mimer SQL QtSql plugin.
Fixes: QTBUG-111219
Change-Id: Ieee0e26f3689dd373fda81c98180066927d25b40
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d21003fc48f26712eedb2798db57e04120f9101f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... by using valueBypassingBindings() when accessing the properties
from the setters.
Also adjust initModel() to use the raw pointers instead of accessing
the property when comparing the value and doing all connections.
This change is safe, because initModel() is a private method that is
only called from the constructors of the class and the setter.
Task-number: QTBUG-116346
Change-Id: I6ecde571aeed74077099c6bf8f66736ba14d29f8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 9578485f35d7942e190c5ea8f5c187644a4e4c6b)
Because the local `seed` variable shadowed the member one, this test
was run for each QFETCH_GLOBAL with the same data and seed. That
doesn't make sense, so make the test use the member variable `seed`,
as all other tests already do.
Since zero is one of the seeds coming from QFETCH_GLOBAL, drop the
seedless calls to qHash(), too.
Amends 64bfc927b09b46bb7fc0dc6caf1bf1a4d4133ab4.
Change-Id: I1e22ec0b38341264bcf2d5c26146cbbcab6e0749
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9c63667d01eb13f43d3b51a8a3502bfc233d6b0b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old code only tested with seed = 0 and seed = 1045982819, the
latter being a "random number", which, however, fits into
32-bits. Since Qt 6.0 increased the seed from uint to size_t, amend
the test to actually test a seed value with some of the upper half of
bits set, too, also in 64-bit mode.
While we're at it, also test with each seed's bits flipped for extra
coverage.
Remove a static assertion that prevented testing seeds with the MSB
set.
Change-Id: I5ed6ffb5cabaaead0eb9c01f994d15dcbc622509
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 8ca319a172b84207be404ed3bb619c3548a802da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Same bug that plagues tst_qbytearrayview.cpp, similar fix: drop the
static checks for GCC. Except that here, following code uses the
variable, so it needs to exist. Fortunately, the GCC ubsan bug does
not affect construction from a string literal, so we can use
that. This is losing the position checking for "." in qtConfEntries,
but the the original author (Thiago) informs me that was just a way to
save two bytes, we don't actually need the assertions, so remove them.
As a drive-by, remove the unneeded, and potentially pessimizing
(forces the compiler to allocate storage for it in the binary), static
keyword from the constexpr variable, which should more than make up
for the extra two octets.
Change-Id: I88397ac61c5cd8f53d39e957212c895239aace04
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit de6f4053139377b63cf92f6bca4d96d488682de4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We might be drawing glyphs outside the main thread, which triggers
the main thread checker for our access to NSApplication from
qt_mac_applicationIsInDarkMode().
Change the CoreText font engine to pull out this information from
the theme instead, and teach the theme to only updates its color
scheme on the main thread.
Change-Id: I02be713d9705c6e0c21107db7f7de039182f601d
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 6cf4c5b98fb0e3f30379d79003ab587aadebbce7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since showing the native popup on macOS is blocking and processes events
the QComboBox might get destroyed while the popup is open. Guard against
this by using QPointer and returning early (dismissing the scope guard
that would otherwise reset the menu's parent, writing to freed memory).
The problem is then that the native popup remains visible, as the
destructor of QComboBox calls cleanupNativeCombobox which destroys the
platform menu (i.e. the QCocoaMenu instance), but that doesn't dismiss()
the popup. Add a call to dismiss() to the QCocoaMenu destructor to make
sure that destroying the menu closes it first.
Fixes: QTBUG-116155
Change-Id: If0ac19796603667f4c8e80c302710dc4c9aded50
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 03d62322b239772e0440cee9ce7576147239f339)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit reverts 2d77051f9dfd11ae292ad4bac2f28c5f7a0e7f83.
When requesting an allocation of size 0, we will actually get
a nullptr.
qarraydata.cpp:
~~~
if (capacity == 0) {
*dptr = nullptr;
return nullptr;
}
This will let the Q_CHECK_PTR trigger falsely. Such an occurrence was
initially detected during the cmake_automoc_parser build-step.
Found-by: Marc Mutz <marc.mutz@qt.io>
Task-number: QTBUG-106196
Change-Id: Icb68c5dd518c9623119a61d5c4fdcff43dc4ac5d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3db9ef358da817480d6f4c055d85a6aa7be17991)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It makes sense (in my opinion) to have the top-level CMakeLists.txt
to include and call certain commands that should be controlled by
qtbase, to avoid submodule update difficulties when we want to do
changes in qtbase that shouldn't concern the top-level file.
Create cmake/QtBaseTopLevelHelpers.cmake and move some pre-existing
code from the top-level CMakeLists.txt into separate functions that
are defined in qtbase.
This file will be included in the top-level one and said commands will
be called there.
This also prepares for qt_print_build_instructions not call
qt_internal_qt_configure_end anymore, because it will be called
by the top-level project.
Change-Id: I1fe3490001cf441d742c64b2ef1f267cd4362f6a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 6add599079f3b653256957eeca2042095711d04e)
Before this change, the dirty feature code only checked for
differences between FEATURE_foo and QT_FEATURE_foo, without taking
into account modified INPUT_foo values that might passed via the
configure script.
This led to issues in certain scenarios when reconfiguring with the
configure script.
For example configuring with -gui / -DINPUT_gui=ON and then with
-no-gui / -DINPUT_gui=OFF would fail saying
'Feature "widgets": Forcing to "ON" breaks its condition'
This happens because the widgets feature depends on gui being
available, but because INPUT_gui modifications don't trigger the dirty
feature re-eval code, we don't recompute the value of widgets.
Extract the code that takes into account the INPUT_foo variables into
a separate function, and use it both when computing feature values and
also when detecting dirty features.
This means any non-matching INPUT_foo variables will now also trigger
dirty feature checking.
Use the same function to replace the duplicate code we have to early
initialize the developer-build, no-prefix and pkg-config features.
Task-number: QTBUG-112957
Change-Id: I775cf70b48291a659b0fecf7cb9570ec12735bca
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 4d86ca8c4ef1797dd697f3f35fc023d5b50e4664)
To be able to reconfigure Qt with modified feature values using the
configure script, and take into account INPUT_foo values, we need to
ignore FEATURE_foo values. But we can't always ignore FEATURE_foo
values, because users might want to toggle them by editing
CMakeCache.txt or using an IDE.
What we can do is tell CMake we are configuring via the configure
script, in which case we can mostly be sure that any passed
INPUT_foo values should have higher priority than pre-cached
FEATURE_foo values.
We also need to remove all the cached INPUT_foo variables after they
have been used for feature computation, so that subsequent
reconfigurations where an INPUT_foo is not passed anymore, doesn't
cause a feature to accidentally reuse the previous (stale) value.
Pass -DQT_INTERNAL_CALLED_FROM_CONFIGURE=TRUE to CMake when configuring
via the configure script, and use that as a marker to make INPUT_foo
values have a higher priority.
This needs to be done centrally in qt_evaluate_feature and also in a
few more locations where we check INPUT_ values, like the developer
build and pkgconfig features.
Because QT_INTERNAL_CALLED_FROM_CONFIGURE would become a cached
variable, we want to remove it at the end of the configuration phase,
so that future 'cmake .' reconfigurations are not considered to be done
via configure.
To do that, we unset it right at the end of
qt_build_repo_end in a per-repo build, and in the final
qt_print_build_instructions call in a top-level build.
The latter needs a cleaner fix in follow up commits in qt5.git and
qtbase.
Task-number: QTBUG-112957
Change-Id: I3fd338092041ef09e3f5a4dfbaf61da5deea0514
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 2799391703e44a34b6557e234462e425a61785f2)
Previously if Qt was configured with -developer-build, configure
would pass to CMake -DINPUT_developer_build=ON, which will ensure that
both FEATURE_developer_build and QT_FEATURE_developer_build are set to
ON.
Then if somebody tries to toggle FEATURE_developer_build to OFF in
the CMakeCache.txt and rerun cmake, the feature will bounce back to ON,
due to the code in QtSetup.cmake that doesn't take into account if
FEATURE_developer_build is already defined, and thus reset it based
on the value that is cached in INPUT_developer_build.
Change the checks for INPUT_developer_build and INPUT_no_prefix,
to take into account the defined-ness of their
FEATURE_ counterparts.
If they are defined, ignore the INPUT_ values.
This allows toggling the FEATURE_ variables and also aligns with
the INPUT_ handling behavior that we have in qt_evaluate_feature which
ignores INPUT_ values once the FEATURE_ is defined.
While this aligns the behavior with other features, there is still a
problem.
If you first configure without -developer-build,
and FEATURE_developer_build is set OFF, and then reconfigure with
-developer-build, because FEATURE_developer_build is already defined,
the INPUT_developer_build=ON is ignored.
This is a problem for other features as well and will be handled in a
follow up change.
Task-number: QTBUG-112957
Change-Id: I4f31157b0e7963e4d43e28062a585e939ceea0c1
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 17efffe1ad6b85f45f418d5d08b5e85a456b12e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Before this change, if a user toggled a FEATURE_foo variable, we only
recomputed the value for dependent features who's CONDITION would break
with the new value. If the CONDITION was not broken, the dependent
feature value would remain unchanged.
For example if FEATURE_developer_build was OFF, and the user
toggled it to ON, the FEATURE_private_tests value would remain OFF,
because OFF is a valid value for private_tests' CONDITION.
But we would like FEATURE_private_tests to become ON if we toggled
FEATURE_developer_build to ON.
To address this case, we need to recompute features who's dependent
feature values have changed.
The algorithm introduced by this change is:
- keep track of initial dirty features, aka track when FEATURE_foo is
different from QT_FEATURE_foo. We expect FEATURE_foo to be the
variable that a user toggles in the cache file or an IDE.
- when evaluating feature values, collect feature dependencies from
the various expressions given to options like CONDITION, AUTODETECT
- if any feature dependency is marked dirty, reset the feature value
to its auto-computed value and mark the reset feature as dirty
- repeat for all feature evaluations
Because feature evaluation is eagerly recursive, we will successfully
reset all features that need resetting.
To ensure against unforeseen breakages, allow disabling this behavior
by configuring with -DQT_NO_FEATURE_AUTO_RESET=ON
Adjust some of the messages to contain more details.
Note that the pre-existing behavior of resetting feature values when
the condition can't be satisfied, stays. For example if
FEATURE_developer_build is OFF and FEATURE_private_tests is manually
toggled to ON, it will reset to OFF
because its condition can't be satisfied (developer_build is still
OFF).
Amends 61943aefd68b7d88c5eb395c4e44d08a94a70ad0
[ChangeLog][Build System] The build system will now try to recompute
configure features when dependent feature values are toggled by the
user.
Fixes: QTBUG-96936
Task-number: QTBUG-85962
Task-number: QTBUG-112957
Task-number: QTBUG-116209
Change-Id: Ib627f3675df8a3b08f4936cdc9c51f2d6e15f58c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 65e04162d17dfe2d18fa302c930f0a3d68131a2e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It makes more sense for it to live next to the other feature code.
Task-number: QTBUG-96936
Task-number: QTBUG-85962
Task-number: QTBUG-112957
Task-number: QTBUG-116209
Change-Id: I8438e6fce9deaa5e709e4b0e2e1ea4eb0600a89a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c1d2356856481b32099cfc8fd5e6fdc856ea7d31)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If '-G<generator type>' is passed to configure script we should respect
this argument but not override it by the autodetected generator type.
'-cmake-generator' option will still have higher priority, but if
generator is set using CMake argument it will not be auto-detected by
other build config specific options, like '-debug-and-release'.
Change-Id: I75b49e33fa717f90bbd74045948fccb9f5350e8d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 139f3f61bd9d68422aa05a8d82ee3aa7897918d2)
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
UIColor.tintColor is only available on iOS 15.0 or newer. Ammends
commit 69cc7f946a66527c3f2b7a28510dcb37459dc33a
Fixes: QTBUG-116840
Change-Id: Id82006629ee3c3d2548ea39afde265cdccf2cdab
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 00bdf56b83e5959e8a4e9924ba9edf533f4c58ab)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
zlib 1.3 has been available since August 18, 2023.
Version 1.3 now defines the following:
# define crc32_combine_gen z_crc32_combine_gen
# define crc32_combine_gen64 z_crc32_combine_gen64
# define crc32_combine_op z_crc32_combine_op
We patched those in manually with qtpatches.diff, so we update it to
reflect these changes.
Updated the diff with 'git diff --relative > qtpatches.diff' from within
the 3rdparty/zlib directory.
Since updating zlib always requires some manual intervention add a
minimal guide that will be printed on using import_from_zlib_tarball.sh.
As a drive-by fix an error in import_from_zlib_tarball.sh where passing
in a path already containing a backslash as:
import_from_zlib_tarball.sh zlib-1.x/ ./
would append another backshlash to that path (zlib-1.x//). Furthermore
add the '-v' flag to the copy command to make it more verbose.
[ChangeLog][Third-Party Code] zlib was updated to version 1.3.
Task-number: QTBUG-116236
Change-Id: Ib7c8698035e1e049b455308c5774fcaf88b7622a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 3652cdf6c78d22126c4f2ec363f338169330c849)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QWidget::setVisible is virtual, and called via hide() by both the
QDialog and the QWidget destructor. A dialog that becomes invisible
when getting destroyed will at most execute the QDialog override.
Subclassing QDialog and overriding setVisible() to update the state
of the native platform dialog will not work, unless we explicitly
call hide() in the respective subclass's destructor.
Since e0bb9e81ab1a9d71f2893844ea82, QDialogPrivate::setVisible is
also virtual, and gets called by QDialog::setVisible. So the clean
solution is to move the implementation of the native dialog status
update into an override of QDialogPrivate::setVisible.
Add test that verifies that the transient parent of the dialog
becomes inactive when the (native) dialog shows (and skip if that
fails), and then becomes active again when the (native) dialog is
closed through the destructor of the Q*Dialog class. The test of
QFileDialog has to be skipped on Android for the same reason as the
widgetlessNativeDialog.
Fixes: QTBUG-116277
Change-Id: Ie3f93980d8653b8d933bf70aac3ef90de606f0ef
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 505ed52cd4dcef081d9868424057451bd1dce497)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Signals are blocked explicitly, so the modelReset signal that would
normally make the view update the accessibility framework does not work.
Update accessibility explicitly.
Fixes: QTBUG-114423
Change-Id: Iba6f0b9dfb258e85111326184d7899bf0570a5c1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit a0b7eee6c6af8d233e3bb7bd5c39f9059ec994f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
They can (it's just very, very unusual).
Fixes: QTBUG-116695
Change-Id: I2b24e1d3cad44897906efffd178178f1542e67f2
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 40e9e42bc6ea81bd22c187ba6d08954ab3e0a245)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix a potential nullptr access in
QNetworkReplyHttpImplPrivate::loadFromCacheIfAllowed() on accessing to
QAbstractNetworkCache::data(). It is not yet clear in what cases
cached data can be null, especially if metaData is present,
but we have user reports of such crashes.
Amends a6776de0c70d23ac197682c7bef603450cb8b03f
Fixes: QTBUG-116788
Change-Id: I548065c6f809d9d45db6dd785c28acbdc77621e2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 74fb2519e32760dbe9f10a9ffd2b460d827062a5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The formatting of the connections in the initModel() call was confusing
and made me overlook the fact that they all were directly used to
initialize the connections array.
Indent all the nested connections, and move the closing '}' to a
separate line to make the code more readable.
This commit amends 4f4a8e75ab34003a4a49b89392ae7712415ac788.
Change-Id: I607e09699a3b4865cb17639ffc75f754f4400c91
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 76617b07cf386f46a094b811373718725b14174e)
Private libraries and WrapOpenSSL were linked conditional to
QT_FEATURE_private_tests in the CMake file.
qsslkey_p.h and open ssl symbols were included conditional to developer
build. A developer build fails, with test enabled and private tests
disabled.
=> Change the CMake condition to QT_FEATURE_developer_build, to resolve
mismatch between CMake and cpp file.
Change-Id: I3ac93b02701e467a0b548c35d441d35a45c4568b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 70b57c943ad981ffe2e519fc0ab7176f83dafcd4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QItemSelectionModelPrivate::initModel() uses string based connections,
to connect/disconnet its QAbstractItemModel.
The QObject::destroyed signal is connected to modelDestroyed(), which
does not disconnect other signals.
QQuickTableView's selection model binds to its QAbstractItemModel.
The binding also reacts to QObject::destroyed
Eventually, QItemSelectionModel::setModel(nullptr) is called.
At this point, only a QOBject is left from the QAbstractItemModel.
That leads to warnings about disconnecting string based signals, which
belong to QAbstractItemModel.
This patch changes the connect syntax to the QObjectPrivate::connect
API. Instead of keeping a list of string based connections around, the
connections themselves are kept in a list member. Disconnecting happens
based on that list.
Connections are also disconnected in
QAbstractItemModelPrivate::modelDestroyed.
An auto test is added in tst_QItemSelectionModel.
Fixes: QTBUG-116056
Change-Id: I57e5c0f0a574f154eb312a282003774dd0613dd6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 4f4a8e75ab34003a4a49b89392ae7712415ac788)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The setter is complicated, because it reads the values of four
properties (loopCount, totalCurrentTime, currentLoop, and direction)
and modifies the values of two properties (totalCurrentTime and
currentLoop).
For the read-only properties, inroduce local variables, so that the
binding evaluation is done only once, and re-use the local variables
afterwards.
For the read-write properties, use {set}ValueBypassingBindings()
methods, because we are anyway explicitly calling notify() afterwards.
Intorduce a newCurrentLoop local variable to calculate the new value
of currentLoop, and update the actual property only once.
Use the newCurrentLoop and msecs variables instead of accessing the
actual properties when determining if we need to notify about
property changes.
The other complexity is that the setter calls a virtual
updateCurrentTime() method in the middle of the calculation.
Subclasses can override the default implementation and modify the
properties there (at least QSequentialAnimationGroup updates
totalCurrentTime property under certain conditions). Keep it in
mind and re-read the property values after the call to the virtual
method.
As a drive-by, make some pre-existing variables const.
Task-number: QTBUG-116346
Change-Id: I0a48bcabde15333e80ea2d54e308cb9438b310e7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit bfc2d69c613d9431f00ac303aed3076e0d1d4dae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The bindable property tests were not using the QTestPrivate helpers, so
add a new test which uses them.
The new tests revealed a binding loop for the interval property.
Fix it in a usual way by explicitly removing the binding and using
{set}ValueBypassingBindings() in the setter.
Task-number: QTBUG-116346
Change-Id: If94f57938da449a68e3527aead5ebd55ba410adb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 7d70edd31cb4c55471ad96e3a1d7114e2c081cf6)
If an inline member function is defined outside of its class' body,
its declaration must have the inline keyword. Otherwise, in certain
situations, MinGW complains like this:
qstring.h:1118:13: error: 'void QString::clear()' redeclared without dllimport attribute after being referenced with dll linkage [-Werror]
Fix all instances in qstring.h by
- adding the inline keyword where it was missing on the definition
(except constexpr functions, which are implicitly inline)
- removing the inline keyword from all out-of-class-body definitions
While the latter isn't necessary for fixing the MinGW
warning-turned-error, the churn is warranted: It's enlisting all
platforms' help in checking for inline consistency (by causing
"multiple-definition errors" at link time or "inline function never
defined" at compile time when we get it wrong). If we kept the inline
keyword on the definitions, only MinGW would continue to warn, and only
in some, as of yet not fully understood, situations, so we'd have no
control over when these warnings pop up in user code.
Change-Id: I0ae78f1d8f1fa4eaec0b162ea16013669370eead
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 1c1d7ab486b87489163c56b05d10ff907e1d821d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Setting color scheme before handling theme change provides incorrect
palette color when user switches from light to dark or dark to light.
This is visible when using Fusion style (or other style that supports
dark mode) in Windows. The change has been made as part of patchset
787038bb1d282b4d6c5c040d8e902ccac9befb41.
It also has to be noted that handling palette changes to make further changes to the palette (or the style sheet), is less likely than
Handling the colorScheme change signal and in this sense, this patch set
can also be considered as an improvement.
This patchset reverts that change and updates color scheme after palette change in the application.
[ChangeLog][QtGui][ColorScheme] Update colorScheme property after
palette change.
Fixes: QTBUG-112653
Change-Id: I71bc413c56663fefdf9fe5871bbb19b7e6c3d9ff
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 39882a1354cb06d2b0b0a0d5b41a168041df0476)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Added example categories and fixed some minor typos as well.
Task-number: QTBUG-116359
Change-Id: I2e270a1919003f4cea233666b64437e4c2b77121
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7ef93cbf6883af053b1bdf042975b11a39f0312b)
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Running the BenchmarkDemoQt6 application features a massive
startup time, followed by running out of memory (GPU-side,
assuming a discreet adapter), which is then remedied by the
system with heavy swapping. This is due to creating 8+ GB
of staging data.
While there are doubts about the application itself (seems there
is an upload for each Quick 3D Texture per material per model,
even though the texture itself is the same?), there is no reason
for the D3D12 backend to use so much more memory compared with
other backends.
That is now ensured by only creating a staging area for the data
(taking the 256-aligned row pitch requirement into account), not
simply using the subresource (i.e. the whole image) size. This is
equivalent to what e.g. the Vulkan backend does.
Fixes: QTBUG-116729
Change-Id: I1b5083c6b859ec0736cd9fd792cba8236aeba6e3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit d5eed2c5f54da60be9bc5966a6be7c18dc77011f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Make a local variable more local, set a variable only once its new
value is known to be valid.
Task-number: QTBUG-111228
Change-Id: Ib6aa16e8c834f89c6ccc0715f20b0e5f0a7f3b6d
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
(cherry picked from commit 40b07ee887d9717088e3189b15c86a5c87759b1d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
After the v43 update landed, a bug surfaced that was fixed by it, so
it has been picked back to 6.6, in which it has landed before 6.6.0
branched. Consequently the new enum members are in fact [since 6.6],
not [since 6.7], so update the documentation to reflect reality.
(They may also be in 6.5.3, subject to ongoing debate, but they were
not in 6.5.0 so are not [since 6.5], even if 6.5's branch does end up
describing them as [since 6.5.3].)
Change-Id: Ida938fc3e3575d6e45d61449123464ebb5b6638c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 648f6482582c1110f297b46508416e0166aaea24)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The serialization converter example's text converter's loadFile() can
be made tidier by making the conditions within its loop into a chain.
Task-number: QTBUG-111228
Change-Id: Ic82355eab7380a0c671b3805ca140958bb1c5af5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
(cherry picked from commit d631f888042e3f3f5d4d0284c6bad8eb91e2c9a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test case is an incomplete version of the test that will be added to
verify the fix for the referenced bug report. The test crashes already
when showing the dialog without this fix.
Task-number: QTBUG-116277
Change-Id: I969a723157f6453b78bafae5cb24a6b37b1eea50
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit e73f35d9c63378ed26e33f488a3ee5bb0745e9d5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It was added in 5.12 and we've had a few upates since then.
Task-number: QTBUG-111228
Change-Id: Iacb5368d4baa7d25f981bb0b8bd8d68b5461e17d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 833ed75b650bb870a158fa8f6e50f06e64fb90a6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Marc disagreed with clang-format on some, which are thus excluded.
Task-number: QTBUG-111228
Change-Id: I1402274635dba866a8160a68211874cb11dcfa61
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 670f66eed3fd81f4b7c3e6f43d06e5bb79176527)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's unlikely that C++ code needs to query that feature. It also
causes full rebuilds of Qt if the feature's value is toggled.
Remove the no-prefix define from qconfig_p.h.
Task-number: QTBUG-116689
Change-Id: I7d968b1c3d6bff3653e1233cea09a36579776347
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit afe158b93686a82e5f1586b1785a2fdd7e8bb765)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The palette set by windows vista style during polish doesn't allow style-
sheet style to override it.
This patch reset resolve mask for the palette set by windows vista style
and thus it can be overridden.
Fixes: QTBUG-115511
Change-Id: Ifcaf441f806cfa0273599b3dce83fdfaec3f5a66
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4cf92d83c3a8966fd1716939829fdbd4642810e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Without adding the corresponding properties, they will not be available
in QML.
Task-number: QTBUG-116106
Change-Id: I233e456ced585b9274a1724cc550bc2959757104
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit bcae883274a11a6a80a901a6e2776332992ed08e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The callback doesn't get called if the signal is emitted immediately
or if hitting the early returns
Fixes: QTBUG-113995
Change-Id: Ib3e1d324a2becd8148cd76b4441fce5c4cc725e8
Reviewed-by: David Redondo <qt@david-redondo.de>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit d524f0a75632d8603e32b3ee7fe02138ff8343d1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Installing a second mimetype with *.txt as glob had a different
effect depending on whether it was installed into the same prefix
or a different prefix as the one where text/plain is installed.
Change-Id: I7f54b8efe22f620eb57257745c48fe5402c87626
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1b39e61a775d70ee96287e9f0e418cb5741e6638)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In ec27b99c2a16994127f77d76eb1fb466c390aee9 the filtering mode is
changed from Linear to Nearest since users encountered obscure cases,
in particular when multisampling with large sample counts got enabled,
where the different filtering mode becomes noticeable. (Qt 5 and Qt 6
up until 6.4 uses Nearest, whereas the OpenGL -> QRhi migration
introduced using Linear in 6.4)
Meanwhile, the as of now undocumented high DPI downscaling feature
got introduced, and that prefers linear filtering. (since that's
definitely not a 1:1 mapping when it comes to texture size and the
on-screen quad) To reconcile the differences, add support for both
kind of samplers, and choose based on the sizes.
This should have no effect when not running with the env.var.
QT_WIDGETS_RHI=1 QT_WIDGETS_HIGHDPI_DOWNSCALE=1 set, but should
restore the pre-6.5.2 look when they are set.
Fixes: QTBUG-115461
Change-Id: I42eb8526cb7f74236b5550e26c4570771d2fbfb4
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 9505305c403423f58e70471aaf55994bb734a0bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
By saying what's special about some of them
Change-Id: I17bf2e12a27bf55f621020ddf3819ee9e606847d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6577242adff254724c739637a92372839c29da04)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
d->model is the source model, so a QAbstractItemModel; techincally it
made no difference because it resolves to the same signal(s), but it's
less confusing as QAbstractItemModel.
Change-Id: I4388a50ac33a2bee628fccc1aef6a9d1898e2ca2
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 726899dc6569448598b3775a63eca7e14c4da3f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of adding it after the block size was calculated. This makes no
difference for non-growing (exact) blocks. For growing blocks, this
means we take that extra element into account before rounding to the
next power of two, instead of after. That results in a change of the
thresholds of when a block grows and also what capacity it will
contain.
For example, for a QString growing to 22-25 elements:
Request | Previously | Now |
elements | bytes | malloc()ed | capacity() | malloc()ed | capacity() |
22 | 44 | 66 | 24 | 64 | 23 |
23 | 46 | 66 | 24 | 64 | 23 |
24 | 48 | 66 | 24 | 128 | 55 |
25 | 50 | 130 | 56 | 128 | 55 |
To avoid wasting elementSize - 2 bytes in this footer, we only include
this footer if elementSize <= 2. Thus, for a QList<int> growing to 11-13
elements:
Request | Previously | Now |
elements | bytes | malloc()ed | capacity() | malloc()ed | capacity() |
11 | 44 | 66 | 12 | 64 | 12 |
12 | 48 | 66 | 12 | 128 | 28 |
13 | 52 | 130 | 28 | 128 | 28 |
In both cases, we now only allocate powers of two while growing, which
may be beneficial to some allocators.
Change-Id: Ifa1111900d6945ea8e05fffd177dcb96e251d0a1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 961620824ca0ae764b3c6ce98b16ecce951168c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The SizeShift was not taken into account when constructing QASV from
QL1SV. This is not an issue in normal Qt builds, because SizeShift == 0
there.
But in bootstrapped case (and in future Qt 7) SizeShift changes to 2,
and the bug becomes visible.
The tests that were available on dev were never picked to earlier branches, so the cherry-pick skips the test improvement.
Change-Id: I337b37b5230323a5357f48fd1c9bf799ca507d52
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d752da1857358726b89027ac039c20c1cd696b36)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
... by using valueBypassingBindings() when accessing the properties
from the setters.
This commit is mostly trivial.
Had to change the template parameters in the unit-test, because the
updated QTestPrivate::testReadWritePropertyBasics() creates an instance
of the TestedClass, and QAbstractProxyModel cannot be instantiated,
since it has pure virtual methods.
Task-number: QTBUG-116346
Change-Id: I0cae29263ea9bb92c9de06891b0ba8633fb9fd72
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 6a873778b976b4752e874a2d87ea84e5d9e0d3c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... by using valueBypassingBindings() when accessing the properties
from the setters.
Task-number: QTBUG-116346
Change-Id: Ibbad552fa1e611f4bb704b4e47667df5f328f152
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 2ef65f895be6cf7b448e739301a19a3c82458f7b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The pre-existing tests were not using the QTestPrivate helpers, so
extend them with the call to QTestPrivate::testReadWritePropertyBasics.
The updated test didn't reveal any problems with binding loops, so no
other action is required for now.
Task-number: QTBUG-116346
Change-Id: I51a17974a7f5bec3c969fcb55b6f28e3e9218eb5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 96a62cd1f5e5c5a915d60ba6d86a5ea44fc32acc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old tests were not using the test methods from QTestPrivate, so
add another test case.
Task-number: QTBUG-116346
Change-Id: I291ede26461e79a615630f1decad2ad7549b4dd8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit cdb50edc9862679e8795a8404ce49fb26534f4bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The pre-existing test for QLocalServer was testing only a minor subset
of cases, so replace it with the call to
QTestPrivate::testReadWritePropertyBasics.
The test for QLocalSocket's bindable properties was missing, so add
it.
The new tests didn't reveal any problems.
Task-number: QTBUG-116346
Change-Id: I695bb050d39eeae9ffb84c097c36601a4ca89af6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 1ad424aed502386c97359b65f37edf2966c0dfa6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Rewrite the logic of the setters to use removeBindingUnlessInWrapper()
and {set}ValueBypassingBindings() calls.
The logic of both setters didn't change, because previously the
pre-existing bindings were implicitly removed when calling the
assignment operator.
The new code just makes it explicit.
Task-number: QTBUG-116346
Change-Id: I475e6cd65fc73796176f257835cb67b9e70a1e34
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit df9651c3fcdd026255add31744b2f75dc2ecdd62)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... by using valueBypassingBindings() when accessing the properties
from the setters.
The most complicated case here is the currentTime property, because
its setter was calling the public currentValue() and currentFrame()
methods. Both methods are reading the same currentTime property.
Fix it by replacing the calls to these methods with the calls to
valueForTime() and frameForTime(). Both take an int parameter, so
the updated code can use valueBypassingBindings() to pass the current
time to these calls.
Task-number: QTBUG-116346
Change-Id: I5c3a05f3e21e4c9e53ed98c9f8d1dce76e40a00d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 47d2788e0b99870cbd21044ac1e42d0c2cabb1f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This class has two bindable properties - watchedServices and watchMode.
What makes this class non-trivial is the fact that these properties
depend on each other - setWatchedServices() need an up-to-date
watchMode to set up the services, and setWatchMode() needs an
up-to-date list of services in order to update the mode on them.
Update the setters in such way that they remove the bindings from
the updated property, and at the same time trigger the re-evaluation
of the property they depend on.
This includes refactoring of the helper setConnection() method in such
way that it does not cause property re-evaluation, and also update
of the {add,remove}Service() helper functions to take the watchMode as
an input parameter.
The public {add,remove}WatchedService() methods were updated similarly.
The logic of the removeWatchedService() method was additionally
updated to do some changes to the properties only if the
service-to-be-removed actually existed in the list.
Task-number: QTBUG-116346
Change-Id: If46cf926c7ace9dc4893d8daaef088f61e41c21a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit d85663ced8762b3096dbcbcfbc3894895a6e11c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Extend the unit-tests for bindable properties and fix the discovered
binding loop by using {set}ValueBypassingBindings() in the setter of
the duration property.
The code refactoring does not modify the setter logic, because
previously the binding was anyway implicitly removed when calling the
assignment operator. The updated code just does it explicitly.
Task-number: QTBUG-116346
Change-Id: I0f339d182efb60500ee7f12e407f200d739da312
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit b64e36240b807e6dba783732593036439fec8a62)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The bindable property tests should use the helper functions from
QTestPrivate.
Task-number: QTBUG-116346
Change-Id: Ie1a61ab80e6f737eac02246214c2c93129a1cf94
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 22c2c15b27a65e988be2c7e21f3e97c4ced97375)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The pre-existing tests were not using the QTestPrivate helpers, so
extend them with the call to QTestPrivate::testReadWritePropertyBasics.
The updated test didn't reveal any problems with binding loops, so no
other action is required for now.
Task-number: QTBUG-116346
Change-Id: I360614a40fe2bacb796051607ed67e7e666b4f22
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit ac59fcdab8adb80648fee15956428630946dd01d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... by using valueBypassingBindings() when accessing the properties
from the setters.
Task-number: QTBUG-116346
Change-Id: I04abc394f4406dc0fa75c55a9093e10c27a20c30
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit b6b94111c77df60c425617d0d76a6574906294c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
ifstream may block the file descriptor in some operating systems.
Wrap the reading of files in staging directory with extra scope,
to make sure that ifstream closed the descriptor before the removal
attempt. Also make sure that we closed the ifstream explicitly.
Change-Id: I56ef5e9925501912d5cd61e8545f664e0a0d90b8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 3115610cfa37b1341392039537299aea4a0b5d93)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Added by commit b42a2b3c3338a320a438bc081cb885fd4547f01f for 6.0, but we
forgot to document it.
Change-Id: I2b24e1d3cad44897906efffd1780086b51c0e3fa
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit a15fef35ff9f78a2c16c31cc106175453d5ecfe0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's very hard to debug a macro.
Change-Id: I2b24e1d3cad44897906efffd17803b8eac9bd844
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 9e8c93fac10b802448b6b7938054220984734434)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
libstdc++'s std::filesystem::path implementation incorrectly assumes
that any 8-bit char input is UTF-8, when it patently isn't on Windows.
Reported at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111244
Fixes: QTBUG-116609
Change-Id: I2b24e1d3cad44897906efffd17803f2862935c9b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 2b06d41b46cf97a92dee10c4432cdc5c719bcee0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Accessibility implementations rely on correct information about the
model dimensions when operating on item views. An item view that has a
root index set needs to report it's size based on the root index, rather
than for the view's model directly.
Pass the rootIndex to all calls to QAbstractItemModel::column/rowCount.
Refactor the code to avoid excessive dereferencing of a QPointer, apply
const and fix/improve coding style in touched lines.
Emit a ModelReset notification when the root index changes, or (in the
case of QListView) when the model column changes.
Split long Q_ASSERTs into multiple lines to be able to better trace the
exact reason for an assertion, and replace the assert with an early
return of nil when it's plausible that a cached cell is no longer part
of the view (i.e. because the root index changed).
Add a test case that verifies that changing the root index changes the
dimension of the view as reported through the accessibility interface.
Fixes: QTBUG-114423
Change-Id: I7897b79b2e1d10c789cc866b7f5c5dabdabe6770
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit c59b34b8cf1c2a087e361d4235990803d89d34ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Take a copy of the d->childWindows container because each loop body
may end up directly/indirectly calling QCoreApplication::sendEvent()
which means unbounded/unknown code could be invoked causing recursing
into the class, leading to modifying the childWindows container while
iterating over it.
Task-number: QTBUG-115803
Change-Id: Ib62ba38700e8862940ba98fdeb663dd730ff125f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 875f988af5d9df6c85269959414014d6ef1417ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The example keeps around image file names only and append
them to the selected dir path, that works fine for file
scheme files, but for Android with content scheme files,
that doesn't work as good because usually the paths are
returned by a provider and managing them manually like
appending a file name to a directory (tree) path might not
work.
This patch retrieves QFileInfo objects and use the absolute
file paths to open any image.
Fixes: QTBUG-116181
Change-Id: I9911a181d92ba0452500398cbe052b9583bd79a0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 381612f7944b202c8b1428f0cc9d1af72f5f7647)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The 6.5 versions of the overload not taking a context/receiver object
were constrained by requiring a functor to be free function or lambda.
207aae5560aa2865ec55ddb9ecbb50048060c0c0 removed that constraint, which
might be source incomaptible if wrapper functions in user code forward
the constraint using Expression SFINAE. Those wrappers would no longer
be removed from the overload set based on the same criteria as the
function they wrap.
We can't constrain the new functions based on the same predicate as
before, as after the simplification we have only one overload with, and
one without context object. But we can still remove overloads for
incompatible functors.
Add the respective scenario to the QPermission test as a compile-time
test.
Found during 6.6 header review.
Change-Id: Id21391b4a6b78a29de2f8fa04374f4262e5fafa7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d027b0c8162ac888de233cf3a41e3254ba2d7cc8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QString::fromJsString -> QString::fromEcmaString()
QString::toJsString() -> QString::toEcmaString()
For API naming compatibility with QByteArray::fromEcmaUin8Array()
Change-Id: If6e2121e31e630d6728ed24e41d14b763f395aaa
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit c802a9e987c9e38c01580f467eab92a651b3e033)
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The container is childWindows in all cases:
- place(): queries the windows' geometries
- setChildActivationEnabled(): sets a bool member in subwindow->d
- subWindowList(): {pre,ap}pends windows pointers to a separate QList
Task-number: QTBUG-115803
Change-Id: I0fdd5f22f29f085b71bf46f68bf9ec04c45c9317
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 79dc2980e69d1b568c3c80e30a3bd0af21548f22)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Take a copy of the member container as the loop may modify the container
(either by moving/reordering the Rearranger elements or by appending).
Task-number: QTBUG-115803
Change-Id: Iaf891b29e9c7cdfdb3dc82e03ed94defb8d0cf4c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit cfec14e1ff94b05bdfe15294199964247dbac518)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends 118f2210c6279803b9a4103a796ce75e88f8beb2. That commit added
#ifdef Q_OS_UNIX
if (test == "assert"
|| test == "crashes"
|| test == "failfetchtype"
|| test == "faildatatype")
return; // Outputs "Received signal 6 (SIGABRT)"
#endif
Which duplicated 4 out of the 5 tests in the block:
#ifdef Q_OS_LINUX
// QEMU outputs to stderr about uncaught signals
if (QTestPrivate::isRunningArmOnX86() &&
(test == "assert"
|| test == "crashes"
|| test == "faildatatype"
|| test == "failfetchtype"
|| test == "silent"
))
return;
#endif
But as Linux is Unix, we never got to that second block for those 4
tests.
Change-Id: I2b24e1d3cad44897906efffd177fb4b5507d190a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit f1ba2b9f44964a0546da4815669cf728e50dd4a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Won't make a difference in codegen, but it's the right thing to do.
Change-Id: Ifa1111900d6945ea8e05fffd177dc8d200c2368f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 167d28e77adbaeb482cfb3c27c5acd41777430cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When QWindowsUiaTextProvider::RangeFromPoint was
called with a point that is not over any
character, it was previously returning S_OK
and a nullptr for the text range.
This is contrary to what the
ITextProvider::RangeFromPoint documentation [1]
says:
> If this method succeeds, it returns S_OK.
> Otherwise, it returns an HRESULT error code.
and
> The property never returns NULL.
Therefore, setting pRetVal to NULL and returning
S_OK at the same time is problematic.
Return UIA_E_ELEMENTNOTAVAILABLE instead for that
case, and only return S_OK when actually
setting a valid text range provider as well.
Ideally, this should return an empty range for
the character that is closest to the given point.
That one could be identified by iterating over all
characters and calculating their distance to the
given point, but that would be too expensive.
[1] https://learn.microsoft.com/en-us/windows/win32/api/uiautomationcore/nf-uiautomationcore-itextprovider-rangefrompoint
Fixes: QTBUG-115801
Change-Id: Ib08d02677935a45517c937613785f1e3f53ee032
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 9900a12df649229c9ff9e2115ac90fb7f634da1d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Initially, DH functions were deprecated, but when OpenSSL v3 was released,
they changed their mind (now they changed it again). OpenSSL must
be configured with 'no-deprecated'.
Fixes: QTBUG-83733
Change-Id: I69f14929e91f5fc147f9297f6fff20674e81b6f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 8051edfdb5efcafd76b178990b8ff760342aeee3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The was introduced with the rewrite of QMetaObject::invokeMethod() in
commit 0f76e55bc440a70f5d9530a192c9ce6334a8f06, because we have an
optimization for zero timers to avoid creating a temporary
QSingleShotTimer object. The old implementation did attempt to normalize
the target slot name, but did so because it looked metamethods up using
QMetaObject::indexOfMethod:
int idx = meta->indexOfMethod(sig.constData());
if (idx < 0) {
QByteArray norm =
QMetaObject::normalizedSignature(sig.constData());
idx = meta->indexOfMethod(norm.constData());
}
The new implementation does not use this method so it didn't need to
attempt to normalize.
I am fixing this only in QTimer and not in QMetaObject::invokeMethodImpl
(even though it is trivial to do so) because I don't believe spaces in a
pure string to invokeMethod were ever expected to work:
QMetaObject::invokeMethod(obj, "slotName ", Qt::QueuedConnection);
The Q_ARG and Q_RETURN_ARG (for code not recompiled) still does
normalization inside QMetaType::fromName().
Fixes: QTBUG-116060
Change-Id: I964c2b1e6b834feb9710fffd177cac60c83ef413
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4368179c37cae05d16109e319fc1c77490754c7d)
OpenSSL 3.1.2 can be configured with no-deprecated option, in this
case test fails to build.
Change-Id: Icaf457f55fb001b632922856dbe4bbb5bdba220e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit a323f05c5e3b4b2268b3a00eac79af1bdfaa03bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Let's do it in initTestCase(), where we're already searching for IPv6
addresses, instead of storing the information in a local static.
Change-Id: Ifa1111900d6945ea8e05fffd177efb6a055aaa58
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit fd924ab0b648f6a7516a6940272115a7db736a25)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If some header files were moved to another module within same repo it
makes sense to allow deprecating them. 'syncqt' now is able to detect
this kind of header files if the 'foreign' module is specified in
qt_deprecates pragma as part of the deprecated header name.
Task-number: QTBUG-116483
Change-Id: I479ea60e71de112b67c281722600cd818aac7762
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7e84a04563142d217317928865a8f6475d189d95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of a manual loop, which was there since at least Qt 4.5.1
(beginning of the public history).
Change-Id: Ifa1111900d6945ea8e05fffd177dd3dfea450a67
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 9c70e117114b51d3c72283d976048e2768968039)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I thought it went without saying...
Fixes: QTBUG-116218
Change-Id: I964c2b1e6b834feb9710fffd177c8338f8f1e618
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 2c86903704413d869131d5ea81951eb8de51639e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This was disabled in d0d1d7403377363a101d4f1781d06a9b44787d0a, I guess
accidentally, by a too-wide conditional. The change the same commit
applied to QtNetworkSettings didn't make the same mistake.
I am also opportunistically updating the conditional to QT_CONFIG (I
missed this in 9d4579c1cd0aae5f75c8702826b5d874a6aae83e) and adding the
Linux-specific check, as the AF_NETLINK implementation does not rely on
getifaddrs() or if_nametoindex().
Drive-by fix indentation.
Change-Id: Ifa1111900d6945ea8e05fffd177ef8fcb11b4e1e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 2e51fbf89a748ad3550e786f1bdbf623169550d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Commit 3ad9f94ff2de3a1f812bb0139ff31e31d5ffb529 (Feb 2023) moved it to
qvariant_p.h but commit 79ae79d05c65019233cf9ae9e77ef59d90e75ac2
(authored Sep 2022 but committed June 2023) brought it back, probably by
accident due to conflict resolution during rebasing.
For some reason, no compiler in our CI complains about it, but ICX 2023
(based on unrelased Clang versions) did:
variant_p.h(101,23): error: call to 'customConstructShared' is ambiguous
Fixes: QTBUG-116496
Change-Id: Ifa1111900d6945ea8e05fffd177eab656a2dc507
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit bed203a6fccb77e008dc384615b0ffaae6e14b54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit f4d6d04898bcc239f4b271330ba778de69bbd893.
Reason for revert: EDID serial numbers can be shared across monitors, so the move to EDID serial number for screen index detection does not work as intended,and breaks monitor detection.
Fixes: QTBUG-116499
Change-Id: I6995b21788eb632e38eeef3a93492dbe0740da4a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 695948fad028f97521135ecb3478f2798ae6700f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Check for the index of last '/' from the non-encoded path.
Amends ea75e34d6968bb59624874411e793c95b26d0dbe.
Change-Id: I3ef5d454a46c711a85fe7ef01ea9d3d93a2d574f
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 4721721f6005c90cb1760b0c6e074468aa73512f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The latest version of gradle was released on August 17, 2023
This update ignores most of the changes to gradle.properties file,
as we do not really use most of the variables which are set by the
upstream release.
Task-number: QTBUG-116236
Change-Id: If66e1a264328b772e742473b859ed9240f77b9c6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 39b39f0d5fd971515443f7517c850cc3ad698ef2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The QTextFormat description refers to setDirection() but this function
does not exist. The correct function name is setLayoutDirection() even
in Qt4.
Change-Id: I2d1f49fba558874b5875d8d93ef61d6208134609
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit fd96e11bb1200902ff7ec2bbe6f3903b2d96bdd8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qaccessible.h and qplatformaccessibility.h are supposed to always be
installed as public headers, regardless of QT_FEATURE_accessibility.
Their contents are wrapped in "#if QT_CONFIG(accessibility)", so
installing them even if QT_FEATURE_accessibility is not enabled
shouldn't be an issue.
The warning was about uncoditionally installed header files,
"CONDITION_INDEPENDENT_SOURCES", being in a
"qt_internal_extend_target(Gui CONDITION QT_FEATURE_accessibility"
call. Thanks to Alexandru for confirming my vague suspicions about the
issue in the bug report.
This amends commit 9f36ab1f8df7f79ffb78259725110106aa5a8e37.
Task-number: QTBUG-111785
Change-Id: I5e5950f341d6729e15961d6fb3d3f8fe85007e38
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit be0e81d493db8a4117a00de21adc39ce02f0ee42)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These examples have been removed as part of the examples revamp project.
Change-Id: I2a8237334a2acae2735c2dbd86004048d288896a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 41f032e358e704693834a98d37331d0d63b7aab9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Make sure that MacOSSonoma symbol is defined in
qoperatingsystemversion.cpp, instead of duplicating the
MacOSVentura symbol. This seems strictly speaking not
needed (as this shouldn't have compiled otherwise), but is
avoiding confusion in the future.
Also document when it got added (Qt 6.5).
Amends 0237709e2.
Change-Id: Idff7cbe0b5862907d735fb60f91f85469cb1edf0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 5d8e0ce0fbe179b9f4e4ec46c209c746b57cbdf2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
File filter was not properly processed when using LocalFileAPI.
The QtFormat->AcceptList conversion was happening twice, resulting
in erronous types. This prevented dialog from appearing on Chrome.
Additionally remove unused debug code.
Fixes: QTBUG-115087
Change-Id: Ie6770e2f1d2aa7c3ad19f9ab105dbec8102d45fc
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 62caae95784a2e70d46194622e96e0e6bdf13c28)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We are BLACKLISTing on macos/arm - the test is flaky.
Task-number: QTBUG-115945
Change-Id: I3be28c895d46ce5ba86e00d597016334bdb16021
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit a3cbbe449a1946d1f50930859efe5f003cf6fda6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test changes couple variables to emulate the user project
environment. These variables also affect the policy handling.
The test will build and work properly only if tests are built
standalone. So add this limitation.
Amends 2e340cea88b6721cf09f24a190aa6a81af81852e
Change-Id: I0cc49bf55bf7763e4c3ecdfa5333fb0453f06794
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d02c3151b224443b72a7c9d5791ed93325ef21f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since the native file dialog doesn't allow changing the name filters
after it's been opened, another way to ensure that we comply with
the provided nameFilters list is to provide them all at once.
[ChangeLog][Android][FileDialog] use all nameFilters at once since
Android file picker can't change nameFilters after being opened.
Change-Id: I389feecae190af41b87c7f2070494bd57eec4b69
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 0f4181919663e85ddc142456b357dcde3d0a4a7f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Calling this function before we had a QGuiApplication instance, would
return an empty string, even if QT_QPA_DEFAULT_PLATFORM_NAME was defined
at compile time. We now return the default platform name
[ChangeLog][QtGui][QGuiApplication] QGuiApplication::platformName
now reports the default platform name if QGuiApplication hasn't been
instantiated yet. It used to return an empty string.
Change-Id: Iffe7cde8943ed2d186bc494d0920b9cf79389dd0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit dd3840a1a201318c8f089dc7d34ec38f64e05b4e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's very flakey in CI: http://testresults.qt.io/grafana/goto/XZQAAPRSg
What we want to test is whether Qt issues paint events in response
to enabling an already enabled effect. Doing so via qWait will process
both window system events and posted Qt events, and the former might
include spontaneous paint events from the system that we can't control.
Task-number: QTBUG-115945
Change-Id: I65e5c6a4458e77b3bd2ad700c5caf6d441f4ca53
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit ea25b3962b90154f8c6eba0951ee1c58fe873139)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The displayed failure messages were missing the label, making the
output confusing.
Change-Id: I4e20687f85b651dcac66ebd6e0881809dc0be709
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 6e853572c5ee614687987db6b8d8506c5971ee5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replace if-block with early return on null QWindow.
Task-number: QTBUG-116232
Change-Id: Iaf402edfd9b03734b64fdf707834fa92c827a1dc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 198eaaf523b8905d23c3b8f01a75647e42012327)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The recent change in QCocoaScreen (108d2e44867acfa98c3b0c211d9b48f39d10efa9)
fixed the problem with no widget found at 'hot spot' (while we know
it's there, since we create it and wait for it to get expose event).
Fixes: QTBUG-108402
Task-number: QTBUG-115945
Change-Id: Ibbf6867bb3381b8137d64cdbd15cc467d8fcf348
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 708b3285f395944062ef32f2c4f0190b470854db)
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
QStringView already did since 6.0. I don't know how we missed this.
Change-Id: I5acc02341c5940499682fffd1774f7c3a807317a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 3c4c7860f08e45de2965ea544a8eb742549bb150)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Also declare the type as shared using Q_DECLARE_SHARED
Found during Qt 6.6 API review.
This commit amends 46e909a37a38289a601333ae6f205e8946152287.
[ChangeLog][QtSql] QSqlIndex is now a relocatable type.
Change-Id: I78394cba082b4df2e4d8a6aab8e8e87f2340962c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit f081578ce097e5b437a0b1beee84f7056e9099f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QSqlField and QSqlRecord implemented all special member functions and
the member swap() function, but were missing the Q_DECLARE_SHARED
macro.
Found during Qt 6.6 API review
[ChangeLog][QtSql] QSqlField and QSqlRecord are now relocatable
types.
Change-Id: Ia10f1d3fd9f634864be5b36d1d3903301adfa9ab
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 2f8771191369b19d05971a135700ad9c17f11063)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qt6_android_generate_deployment_settings is implicitly used by
qt6_add_executable in user projects. This test makes sure that the
function behaves as expected for user projects specificly, since in Qt
tests it behaves differently because of Qt-specific conditions inside.
Task-number: QTBUG-116037
Change-Id: Iea10eca7a780ebaff0c05b91ebe47b821b9ec956
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 2e340cea88b6721cf09f24a190aa6a81af81852e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The function has a precondition, namely that [bytes, 16) be a valid
range. Therefore it cannot be noexcept.
Found in API review.
Change-Id: Idcc61cdc3b1cbffc20a86b0dbc4eb17e51c1becd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c8d04c1a37c5f307a8e27f8897d5868286fb32cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Qt::TimerType is not a faithful representation of a QDeadlineTimer.
It's missing the actual deadline, and so should not be allowed to
participate in implicit conversions.
Consider whether you'd like to see such code:
foo.setTimeout(Qt::PreciseTimer); // HU???
So split the old (TimerType = CoarseTimer) ctor into an explicit
default ctor (applying NSDMI to make it =default'able) and a new
explicit (TimerType) ctor.
[ChangeLog][Potentially Source-Incompatible Changes][QtCore] The
QDeadlineTimer(Qt::TimerType) constructor is no longer implicit. To
keep old source working, wrap the Qt::TimerType argument in
QDeadlineTimer{}. This is backwards-compatible with older Qt versions.
[ChangeLog][QtCore][QDeadlineTimer] The (Qt::TimerType) constructor is
now explicit (was: implicit).
Found in API-review.
Change-Id: I72aaaad5201bd288a6fd6af398573aaa9d0eda5a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 17f2b6d2e9379d7edaf5acd17a6547ca46b12f2b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When a QWindow is moved between being a child window and a top level,
it gains a corresponding QNSWindow, which we create as part of
QCocoaWindow::createNSWindow(). NSWindows are not visible by default,
so we need to re-apply the QWindow state to the newly created window,
just like we do for other QWindow properties.
Change-Id: I809d12b09eeccea7a4ee4e8444f69db46dbd159e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit a143158eb12c398c756532aaec58340ec980b44d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
bbb71e7e80f292c2e69faef81b1624832981147e added an eventFilter override
to QDialogButtonBox, in order to fix QTBUG-114377. The approach added
a symbol to QDialogButtonBox, which breaks binary compatibility between
patch releases.
=> Use a separate class to install an event filter
=> Remove the symbol (eventFilter override) in QDialogButtonBox
Fixes: QTBUG-116287
Change-Id: I920deca9f45f6246ed1fcbf5346f681dd5dd12f6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit aff0915352dda0cfaa11a249b665fbe47be21d69)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If qt is first configured without -developer-build, and then
reconfigured with -developer-build, QT_FEATURE_developer_build will be
ON but QT_FEATURE_private_tests remains OFF, and is not reset to ON.
This causes a link failure in Network, because the source files
defining the QNetworkAccessDebugPipeBackendFactory class are only
added if QT_FEATURE_private_tests is ON, which is not the case above,
but the C++ code checks for the QT_INTERNAL_BUILD define which is
defined when -developer-build is ON.
Align the C++ code to check for the private_tests feature.
Task-number: QTBUG-112957
Change-Id: Ib6ed891a84c6b118836497d6ead48019bb1b9052
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 409469ba14633545f8cf445baf9ffc286d491094)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If OpenSSL version is 3.1.1 or above - this version moved the protocol
under security level 0, but the default one is 1.
Fixes: QTBUG-116166
Change-Id: Iaabb2cf33e2a9f280d6167233ee16080dee808b0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 6d6d22b65d9a0cc8664cc9e051e66a80db132b6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Static variables for a message handler were used only in developer
build, while they were declared unconditionally.
That has lead to compiler warnings about unused variables in a
non developer build.
=> declare them only in developer build
=> move assignment and static method in front of the method,
that uses them.
Change-Id: Ie06f91f7857130f08fd484a6e7319ddfd16c546b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 366b4d3ae7783a055a6b1d6fe18470169cb6f8f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Back then elfreader and other unix functionality was added for the
purpose of having one generic deployment tool but it was never used.
Remove the code to be more clear on what to expect.
Change-Id: I2b7a759de04afe0c5fb210ad65f1c86e32934f18
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 68b16974a72a35e33e4e947f7edfabd6ccd5f6a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The [NSWidow windowNumberAtPoint:belowWindowWithWindowNumber] API has issues
with sometimes being out of sync with the window server, resulting in failing
to hit test windows that we know are there.
This has manifested in flakeyness in our tests, for example in tst_QWindow's
testsInputEvents: http://testresults.qt.io/grafana/goto/YNGj7TgIg
A workaround is to call [NSWindow windowNumbersWithOptions:0] to force a sync,
but we might as well use the more modern block based API to iterate our own
windows in Z-order. This API seems to do the required sync on our behalf,
or at least doesn't operate on stale data.
The logic has been otherwise kept as is, including treating non-top-level
windows as candidates for hit testing, which seems strange for a function
named topLevelAt(). This is to be investigated further.
Task-number: QTBUG-108402
Task-number: QTBUG-115945
Change-Id: I5599881c381a0a673d262e4b9585e2c6798c9810
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 108d2e44867acfa98c3b0c211d9b48f39d10efa9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As /examples/opengl is already listed in exampledirs, .qdoc source
files under that directory do not need to be listed in sourcedirs.
Doing so will cause the example to be listed twice in lists generated
by the \generatelist and \annotatedlist QDoc commands.
Same applies to imagedirs variable.
Change-Id: I168dbfe111a4cb9615626eb9869f97d3814a14b7
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
(cherry picked from commit 634f474300fe27b6decb61937f1c5a5401807fad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We updated FreeType to 2.13.1, but forgot the attribution file.
Task-number: QTBUG-115340
Change-Id: I1e7bc91b9fd4a7674d40d15b3f2759f38831cd8e
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
(cherry picked from commit 11321384d9393c27ad218971d0fdf3c735a05dee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When using MinGW compiler and Qt is configured with "-static-runtime",
we should pass "-static" to g++ while linking, like Qt 5, instead of
"-Wl,-Bstatic", to get rid of dependencies on libgcc_s_seh-1.dll,
libwinpthread-1.dll and libstdc++-6.dll.
Because syncqt doesn't link to any Qt library,
"target_link_options(${target} INTERFACE -static)" has no effect on it.
So we should use "PRIVATE" instead of "INTERFACE" for executables.
Change-Id: Icf551783f92ef3615b3840c9af16d163eee09fdb
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 9256d9e7b6ab4bfeaeb733c88719e1019d7bd92b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Starting from OpenSSL v 3.1.1 DTLS 1.0 is only available, if the
security level is 0, which is not the case most of the time. So
we consider this version number to be a 'threshold' after which
we don't test v 1.0 anymore.
Task-number: QTBUG-116166
Change-Id: I9763703f36ae742e1d3c7cb17872cf8d0d82ab85
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit c1b287c531f444dfe57e6bb1353e1c517ad2d416)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Change-Id: I2bceddb470e7870f19fc616e3dbae73cc057cb66
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit 42fd8a8e8a758e7e4ddaae9943402b2e3bae25fe)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The documentation suggests that it is possible to reimplement
QTextEdit::paintEvent(), but doing so might produce cryptic runtime
warnings:
QWidget::paintEngine: Should no longer be called
QPainter::begin: Paint device returned engine == 0, type: 1
The correct way to reimplement this function is noted under
QAbstractScrollArea::paintEvent(). This patch updates the note and
copies it to QTextEdit for clarity.
Change-Id: Ib7d8dadeb2358475bcdb0b2e624857700f9a004e
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5a2474b2dd0472948c53b16c4bf566db489dcfb9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Observers should only be registered when _reading_ the property.
Otherwise we get binding loops.
Change-Id: I974f6ea444fa7a5d333ed79eea6f34e3d757d169
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9306db6d465a165ebe2edcbe5b0180f04d0c46ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Create the global static free timer ID list in the constructor
so that it is destroyed after any global static QDaemonThread instance
that may be using it.
Fixes: QTBUG-58732
Change-Id: Ic2d33ac3aa2ec3ca0261be9996920aae260e16fd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit cff1c12eca6e1e7d2645f7079895718193beb621)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
During refactoring of the vista style in
46f98147f4e3a09b32042c0655d5de7285a795e3 a regression slipped into
subControlRect()'s default branch which lead to a double call of
visualRect(). This breaks nearly all subControlRect() calculations in
rtl mode.
Fixes: QTBUG-116224
Change-Id: Ida722e1b6c6a311b27a9b48d1fe1378b47c21cf4
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit e26a87f1ecc40bc8c6aa5b889fce67410a57a702)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The default argument staying on the old int overload meant that on
Windows a nullary tryLock() call would need to go through both DLL-
exported functions (int, then QDeadlineTimer) and on non-Windows
platforms, it would hit the out-of-line QDeadlineTimer(qint64)
ctor.
By moving the default argument from the old to the new function, we
reduce the nullary call on Windows from two to one exported functions.
On non-Windows, we make it to hit QDeadlineTimer's constexpr inline
default ctor instead.
Found in API-review.
Amends ff9da1db0b0963f967f45ab430ec40a3051b70b4.
Change-Id: Id3e9923cf97ee1673fe05c85c30b5a12531857b3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f780893c39d6090e804c8caeb08af4f919777109)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Clean up after all users are ported to the SlotObjUniquePtr overloads.
Change-Id: I3e58249296ea9674c45fb412463ae3201518de72
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1a3f573bd9fd7463e1def4c1fe655bcf0e2e6baa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It relied on an implementation detail of operator+=(), that the latter
wouldn't just use assignement (e.g. if `this` is empty/null).
It also had undefined behavior, when the char array used with
fromRawData() went out of, the nested, scope, the code was pointing to a
dangling stack pointer.
Thanks to Thiago for the explanation in code review.
This ties in with further changes in this series, where append() is
changed to preserve null-ness; there is no way to preserve null-ness in
append() while keeping this unittest passing.
Change-Id: I43b9f60db9ce2d471f359f32bcc48e7b4cfceeab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d1da83002d18040f8ac21ebf6542ff71cb462509)
There is no need to check if lhs.d == rhs.d in the end of the function,
because we already have the same condition earlier.
If none of the previous conditions was true, we can just return false.
This commit amends 7a370838177e581c8a9342808ba86e081951a41c.
Change-Id: I06dca9b3dedf5895820685a6ded5363963e6fa3f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit e6a36f21a3c44943afc8c60b9dc2e40976fcdb49)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Explicitly include <QtCore/qshareddata.h> into the headers that use
QESDP.
This commit amends 6ff4c3d787ecc2e6d2740f22d0406b34346faede.
Found during Qt 6.6 API review.
Change-Id: Ia52d9e7551295f0c7380c7ed33b68f452cb689aa
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 314d86335ddd3ba8f67267c0e25b4df5fe0419c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... and rename it to qbswap(), thus enabling the endian conversions
for Id128bytes via q{To,From}{Little,Big}Endian() functions.
Found during Qt 6.6 API Review.
Change-Id: Ie320cee52ec2b9de0aaa112adec8febb7f5b68a2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 470b2b8ad9f28eaf24518dfa3f48cc13fcdc421f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The examples have been removed as part of the examples revamp project.
This patch resolves a number of qdoc warnings.
Change-Id: Ie3d2f5637136c631d7e9f7a8ffd93baea52f77d8
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 132be307fff049e83ba8b93733fc571c0c45469b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... and use them around the code.
Avoids the impedance mismatch between users, which .release() their
SlotObjUniquePtr's into the ctors, and the ctor, which constructs its
member SlotObjUniquePtr from that.
The old constructors are left in on purpose and removed in a follow-up
commit to facilitate cherry-picking into branches that might have
additional callers.
Change-Id: I6f8bce317d5116296973a3a2e3f97db1451f579d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 14cf4f75848180503d3c83ff1d9aeb4536c307b7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
More expressive and type-safe.
Move it to the .cpp file (the only user) and make it static to avoid
creating a non-namespaced symbol.
Change-Id: Ib9b393e660e51c1791ed3a9a4a12e5c75736bf2a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a19585eee174dd593aa979e5232e9cca677bef44)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We already have a QObject (*this), so we don't need another one in the
form of a QTimer; we can just let QTimerEvents be delivered to *this.
Changes surprisingly little code, because the code used start(int)
already.
Mark the timerEvent() final to avoid surprises from potential
further-derived classes.
Change-Id: Ib4ee8f8f6b9995d67d964afb231e913a00a76af3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 22858ffcedda16cd9f773df9ec74a5bff72a081a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QFlags<Option> will anyway store the value in an `int`, so we gain
nothing from choosing quint8 as the fixed type, except artificially
limiting the number of possible future options to eight.
Found in API-review.
As a drive-by, put options one per line and add a trailing comma where
possible.
Change-Id: I0ed588ea6c7912e50705af89c47e2cf7e2ee23a0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d8952690c75f83388e2b24f1b0f76266a58552e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When Edit Popup Menu was not shown, the size of EditContextView was
wrongly returned. That is why the popup appeared in the wrong position
and then "jumped" to the right one.
To get correct values even when Popup is invisible, size should be
calculated manually by getting height/width of all visible buttons (with
getMeasuredHeight/getMeasuredWidth[0]) and paddings of EditContextView.
[0]https://developer.android.com/reference/android/view/View#getMeasuredWidth()
Fixes: QTBUG-115632
Change-Id: I5f6abffab1a1e836c59a922ffa727d893ca9820f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 51d331b13bc1b922797eb81b2a73f78e1c07bf22)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Accent color role has been renamed according to name rule of other
color roles in QPalette.
Fixes: QTBUG-116107
Change-Id: I70ac98a1e97afbdc7ea5f8d79f808c307e170712
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 90980a54e87147ae59ed0628f8b1de67d98ecae4)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reduce test precision to account for rounding errors, and at the same
time increase the setup precession by premultiplying in rgba64 instead
of argb32, which makes the test randomness trigger more regularly.
Task-number: QTBUG-115945
Change-Id: I3e95449ada26ff5bb0acc00412f345733603f4c0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit ae9594ea98e723a99b8ad8c056505f4c7deb77c9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This clarifies what doesn't work, that we print a warning, and that it
applies to all Unix systems aside from macOS, not just Linux.
Fixes: QTBUG-115852
Change-Id: I80612a7d275c41f1baf0fffd1779701e98e7552d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 120fc8244a484a5fde5b19f2e603b05692b79f61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
While at it, also make \brief a proper sentence, starting with
an uppercase letter and ending with a dot.
This amends code added in commit 29b2506e8c .
Change-Id: I5ca4c5e2a7dd2e826ba4392f4ea0e0dee00c92f4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
(cherry picked from commit ab1b22c49b4a815991c73e84818db7538f9a1a0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Straightforward, the code was already iterating over a local const
copy, i.e. Q_FOREACH wasn't needed here.
Task-number: QTBUG-115803
Change-Id: I3e806c54ce56b6eb06431eea6aea1758c8ecd154
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit a6274fa39ae865b20d395817f30a6f7c83bd5ea9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends f2f8820073488c89fb71e3eb2d2e87bb582c3995.
I have no idea how this went through the CI, but assigning to a const
variable cannot possibly compile.
Reported-by: Axel Spoerl <axel.spoerl@qt.io>
Task-nubmber: QTBUG-115839
Change-Id: I0f22dcd5ab691f92880ea3c6446aedca53df0721
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c0a38066095b3ed28281391e75c251709f875f53)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
All of these fall into the trivial category: loops over (readily made)
const local containers. As such, they cannot possibly depend on the
safety copy that Q_FOREACH performs, so are safe to port as-is to
ranged for loops.
There may be more where these came from, but these were the ones that
stood out as immediately obvious when scanning the 100s of uses in
qtbase, so I preferred to directly fix them over white-listing their
files with QT_NO_FOREACH (which still may be necessary for some files,
as this patch may not port all uses in that file).
Task-nubmber: QTBUG-115839
Change-Id: I7b7893bec8254f902660dac24167113aca855029
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit f2f8820073488c89fb71e3eb2d2e87bb582c3995)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These are all trivial: all are over (already or newly-made) const
local variables.
As a drive-by, replace a QList with a C array
("never use a dynamically-sized container for statically-sized data").
Task-number: QTBUG-115803
Change-Id: I1b1e8f093abf75093900631e6fe3cbc9e3019d34
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 6f5f10bea80eb9439a1498e7a19d8631fc791ed3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The PRELOAD variable in wasm_shell.html wouldn't get substituted with
preload list when using qmake. Do that as it is done in cmake.
Fixes: QTBUG-115507
Change-Id: I3c659626dc6fa6f4fdf9e31bd62b87fc6a7d8bbe
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 2b0d6a068fcc6723fe3dfd8ac167307f352097ff)
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Add a note to state that Qt projects and user project build folders
should be added to the antivirus exception list.
Task-number: QTBUG-114928
Change-Id: I4873dc75506d55a9e6c2a2614eb8f05c14f37142
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit c3470b20874d2460d5f4e1dc820bfaf5daee132b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Some older compilers used to generate warnings if the 'inline' keyword
was used only on method definition, but not on its declaration.
It does not seem to be a problem at the moment, but still move the
'inline' keyword from the definition to the declaration of the new
QUuid constructor, toBytes(), and fromBytes() methods.
Split the fromBytes() declaration, moving the keywords to a separate
line, to fit into the 100 characters limit.
Found during Qt 6.6 API Review.
Change-Id: Ic5bd3ad094669cda76592968789cf83e9a72bccd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 6616d4e1f3cc991ac723981d90b411a9cae7f795)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It moved to libexec at some point in 6.5.
Change-Id: I1e80c0dd1dc253c08bf509aeb605b863a5d67e47
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Simo Fält <simo.falt@qt.io>
(cherry picked from commit c6279001c73a11c3bc805cfd44fb3280d87b2e32)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There seems to be no current() method. Replace with the vkInstance
method.
Fixes: QTBUG-115853
Change-Id: Ifc0f741186092862b498fe4be2d39076b92fa725
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 50bce440277d4383dcf3a055cb9b5d513735bcbc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit e2f0495e7efffefe927e43b26fa3a3a610aa003f.
Cleaning the cache is not be needed, as the invalidated key will make
sure that the cached QThemeIconEngine engine will not reuse the previous
engine to generate the pixmap, but request a new engine from QPA.
This way, a new pixmap will be generated also if system settings
change that will influence the pixmap generated by the platform engine.
Change-Id: I9632c37c4ec86fe46acb701ec69a7868b3434322
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit fd5c2058ae089611200f00b8b7ba76a8d339c506)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This amends commit 923790832777f3e4d9d9be5eba13a9ffdedcf9e7, which
shouldn't have integrated, but apparently the qdoc check in Coin
wasn't running that day.
Task-number: QTBUG-111550
Change-Id: Ife6108eb49fb8988d43390200de480fc5b57e58f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d7bad11a87a5edcc55e6d0a45201b48f52f54e23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If source or build directry contain '3rdparty' in their path, all
header files are marked as 3rdparty and will never be installed.
This commit is CMake counterpart of
ea4a3d78a776e10955caf6cf9b1054ddb50f40d3
Amends ea4a3d78a776e10955caf6cf9b1054ddb50f40d3
Fixes: QTBUG-116137
Change-Id: Ib93fb879867e3aeb6e44193c4253e73173c141d2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7544d91ae1948c21225c345e2c941ab40b37b518)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The original code duplicated contained elements of a QStringList by
repeated appending it to itself, preventing the container from being
marked const.
Instead, keep a list of unique mime-types, and iterate over the list
eight times.
As a drive-by, port from QList to a C array ("never use a
dynamically-sized container for statically-sized data"), use u""_s
UDLs (since we're touching almost all lines of the function, anyway,
also in the unrelated mimeTypeForName() call).
This allows porting the Q_FOREACH loop (which anyway cannot deal with
C arrays) to a ranged for one (which can).
Task-number: QTBUG-115839
Change-Id: I844ae38104bb2980ea194b85f9017a3e95791ea2
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 47375a213f0751b5649ee7c4ae47fae020f9c77f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These are all trivial: all are over (already or newly-made) const
local variables.
As a drive-by, replace a QList legacy left-shift-based- with
initializer_list-construction.
Task-number: QTBUG-115803
Change-Id: I453e24272c4c4b7dce5b91a0bd04481d833c50bb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 40afcb9d01713c02737f6f83a59437fc8320ef0b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In Qt 5 times, if Qt was configured with -make examples, running
make install would not only build and install the example binaries,
but would also install the example sources into the prefix.
Installation of example sources was not implemented when the Qt 6
build system has switched to using CMake.
There is still a use case for it though, mainly for Qt Creator, which
only shows the examples of a Qt kit if the sources are available.
In contrast to Qt 5, in Qt 6 we will not install example sources
by default. It will be opt in.
To enable installation of examples sources, configure with
configure -make examples -install-examples-sources
or
cmake -DQT_BUILD_EXAMPLES=ON -DQT_INSTALL_EXAMPLES_SOURCES=ON
The -make examples part is required, otherwise
-install-examples-sources has no effect.
All example sources can be installed by calling
cmake --install . --component examples_sources
in the qt repo build directory.
In a top-level build, per-repo installation can be done using
cmake --install . --component examples_sources_<repo_name>
where repo_name could be 'qtbase'.
A single example's source can be installed by calling
cmake --install . --component examples_sources_<subdir_name>
where subdir_name is the subdirectory name of the example, e.g.
'gallery'.
Implement installation of example sources by hooking into the
qt_internal_add_example command.
This means that all examples in all repos need to be added via
qt_internal_add_example instead of add_subdirectory, to ensure the
sources are installed. The majority of repos already use it.
For testing purposes one can configure with
-DQT_BUILD_EXAMPLES=ON -DQT_INSTALL_EXAMPLES_SOURCES=ON
-DQT_INTERNAL_NO_CONFIGURE_EXAMPLES=ON to allow testing installation
of examples sources without building them.
Take into account an additional variable called
QT_INTERNAL_EXAMPLES_SOURCES_INSTALL_PREFIX to allow installation of
example sources into a location different from the example binaries.
As a cleanup, the NAME option that could previously be passed to
qt_internal_add_example_external_project has been removed.
That's because it's never used anywhere and could not have worked
anyway because qt_internal_add_example_in_tree never handled it.
Fixes: QTBUG-112135
Change-Id: I52aa5ec643ff7e212276c88d8dd2dfecdbdbeb0d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 121f7f382badc0f8af6fdbb547f8649b5e1b75c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QTimeZone is not trivially-copyable, so we shouldn't default arguments
of that type (cf. QTBUG-98117), but continue overloading.
Found in API-review.
Task-number: QTBUG-98117
Change-Id: I24e9d6c10512a50c172b5722c7d75bf74adf60a6
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 3adf81f09f019199d7e5bb008196657c8a76e840)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- Mention QEXPECT_FAIL on the best practices page.
- Link to the best practices page from "Chapter 6: Skipping Tests with
QSKIP".
- Add some more links.
Change-Id: I0c9e0adb9fe500791dad44869434cf6ecdcf51a1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 5de991059e1590b0f40b73b5929953c3a6754478)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When changing the current index while the tab bar is not visible,
calculating the necessary scroll offset might result in wrong results if
the tab bar still has an old size. When the tab bar then gets shown and
resized, the scroll wouldn't be corrected, potentially leaving tabs
unnecessarily scrolled out.
We don't need to make the current index visible if the tab bar itself is
not visible, it's enough to flag the layout as dirty so that the next
show event (which either way makes the then current index visible)
triggers a laying out of the tab bar tabs.
Amends e851d4c06154bf02b23030ff1f7024a8b9edf874.
Fixes: QTBUG-115109
Task-number: QTBUG-113140
Change-Id: I3d8633f9f8b907a36190123839a6104a17bfe138
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 3965d52ad5a6376d593026a87831026a8a5f3469)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Case-insensitively match the architecture string for x86 and amd64.
Fixes: QTBUG-111219
Change-Id: I775e81965f46bb7479e0e9a05e66b8a080656ee5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6e9f989eb61dd39562c47707cbd70d7f514b6e54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's ... broken. Found and filed lots of bugs. Add #ifdef'ery and
QEXPECTED_FAIL() to document the state of affairs, hopefully reminding
us to fix these things come Qt 7.
Task-number: QTBUG-116064
Task-number: QTBUG-116076
Task-number: QTBUG-116077
Task-number: QTBUG-116079
Task-number: QTBUG-116080
Change-Id: I29e89fdf995ddf60ef1e03c7af009e80980c9817
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c86cf385d6d66d8fd3de1666205aaf4b8fcec747)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Another one in the series of problems around having texture-based and
regular widgets in hierarchies where some widgets are native and some
are not.
Fixes: QTBUG-115652
Task-number: QTBUG-108344
Task-number: QTBUG-113557
Change-Id: I34306503cb17ccb915b90168ec3f39e209f668e5
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 373c08d03d39b6933a16a5b839aa7ae271cede42)
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This reverts commit 566def740ec58e842e6bb37177f80e20aebaa245.
The fix had some unwanted side-effects when the
QAccessibleValueChangeEvent carried a value of type string. Only
QComboBox uses QAccessibleValueChangeEvent in such a way.
The consequence of the reverted patch was that it broke QComboBox
so that the screen reader would read aloud the value change event
regardless of the visibility or focus state of the QComboBox. (Thus, if
you e.g. changed the QComboBox::currentIndex on a *hidden* combo box,
the screen reader would still read aloud the event)
This is also the root cause of what is described in QTBUG-93763.
Also, due to the usage of NotificationProcessing_ImportantMostRecent
the screen reader would treat it as such an important event that it
would abort whatever it was currently speaking.
In addition, the reverted change didn't fix any bugs and it failed to
implement the suggested behavior in a correct way (as was described in
QTBUG-75003 - albeit properly described after the change was merged).
QTBUG-75003 has already been reopened due to this, and the change can
therefore be reverted quite risk-free.
Task-number: QTBUG-75003
Task-number: QTBUG-93763
Change-Id: Ib91872adc563c31534fe2b30fd9c447bfcca6b40
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 193fb8bb68e35f6ad25a7d62a6e321bd41ecf688)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Clarify that the order is the expected byte order of the input data.
Found during Qt 6.6 API Review.
Change-Id: Iaa1f5eef22df60676e52197fbcf613f6e9970a3e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 17297e17927631f22dbb342c00f65af6a2b5a5e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There's no guarantee that qconfig.h will be present
when __qt_internal_get_qt_build_emsdk_version() is called
during configure, since the file is written by a file(GENERATE)
call which does not write the file immediately.
Handle this case and allow configure to complete.
Change-Id: Iab85790f9f133fd1ba5f276cdd7bc55f9af1d980
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit f7953cdee6eed997f1b5f3e5085dac405f3d5e31)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A child window should be possible to place at arbitrary positions
within its parent, even outside the parent's current rect. Once
the parent size is changed, the child might become visible.
The current code also caused issues when the parent did not
have a size yet (0x0) at the time of the child's setGeometry
call, resulting in the child always being placed at y=0.
Change-Id: I1534b606ab6eb7d51216d3b305a1b60443c41ec2
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 89209c8eca985c290f8afec3e1aa8fd3426cda65)
Adds a warning symbol.
Adds a note to the brief string.
Change-Id: Ib036295bbcf7ab5eca7fd554fb2da836fedad8a0
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 5290ba4cbd1e5bcdc217b58b0495768263097ba3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We were only ever testing with a 0 seed, even though the function was
called for all QFETCH_GLOBAL seeds.
Add the seed.
Amends 5e93361888e3d2b03e7b6da19517b44e0239fb47.
Change-Id: I3c78714ad6fb3f94233789dd2c8884d9b157fa76
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fa522eb8becba3243aae8bee191f6f60672434f2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We need to apply properties of the QWindow the underlying "native
window", in this case our <div>, on construction, without waiting
for the user to call one of the QWindow setters.
Change-Id: Id422a9424f584e2269ef333e2c7c88a123ecb70b
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit b0827bf8d43768153186181a7ef8fde3f9c95d40)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Commit 9db5ca87897340873a4606c651a37e0356e8f1a0 sets the default
qtDataDirectory to the value of qtInstallDirectory, which results in an
invalid path when appended to the SDK. This results in build failures
for Android when building with qbs. cmake builds are not affected as
the data directory is explicitly set in the build scripts.
Change-Id: Ia29c5bae7648f5fccefe019c225e187985bd2592
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit c27798da2f5a426e50423a83a42d8ddaa0abbc13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Only top level windows should have window manager features,
to match other platforms.
Change-Id: I7a0563ef34aeb430d0b1a16633a5626482ccd17d
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 3c438c5d4c218ce750d2dc5f8cb14c5b4a3f7385)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Pass an encoded URI string before parsing them through the Android APIs.
Fixes: QTBUG-114435
Change-Id: I65131799fad81bfe7490d663d3b7996c94d37f0b
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit ea75e34d6968bb59624874411e793c95b26d0dbe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A subinfo has its own item list. Recurse into it when debugging.
Task-number: QTBUG-115058
Change-Id: Ide820e4440caa97b84a3366c2d385546fb6026ec
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit efc4bf5e63cd90c2e1f3bda1cce8dea957865f0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The method calls show() on a dock widget group window, when the window
flags have changed. When all of its contained, tabbed dock widgets are
programmatically hidden or docked on the main window, an empty group
window is shown.
This patch implements bool hasVisibleDockWidgets(). It returns true, if
at least one of the group window's dockwidget children is not hidden.
It replaces show() by setVisible(), passing the return value of
hasVisibleChildren().
It adapts tst_QDockWidget::floatingTabs() to test the fix.
(Drive-by: remove dead code)
Fixes: QTBUG-115058
Change-Id: Ifb8e2450e91a7c78decc06f592e160631ca2faf5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit e03bc88a80382b68359ba6ea5fc4cb9507ceb85f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The method reads the next element in a loop, as long as valid elements
exist. Within the loop, it returns
- false if the end of an element has been reached
- true if a new element has started
When the document end has been reached, the loop continues, until
readNext() returns Invalid. Then, PrematureEndOfDocumentError is launched.
This is wrong, because reading beyond the document end is caused by a
missing return condition in the loop.
=> Treat document end like element end and return false without
reading beyond it.
=> Test correct behavior in tst_QXmlStream::readNextStartElement()
Fixes: QTBUG-25944
Change-Id: I0160b65880756a2be541e9f55dc79557fcb1f09f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ccd8a496cf46313ea0df9fe70f4e4b57f9434b24)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Strictly speaking, we don't need the *bus*, only libdbus-1, but some
machines in our CI appear to be misconfigured somehow. I don't
understand how they can both have and not have this library in the same
run.
Change-Id: I80612a7d275c41f1baf0fffd177a66a04951948c
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 7a1ffacca0096125603b99a58f651c322468db27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
By actually registering them.
Commit 850d850c5af8ff77a4b9d53457ec6b1ba6c20cb3 changed from
qMetaTypeId<QDBusArgument>() to QMetaType::fromType<QDBusArgument>() and
in Qt 6, fromType() does not register the type with the database. That
means the lines became runtime no-ops at that time or during the
QMetaType updates since 6.0. All they did was instantiate the C++ inline
variable.
The testing also detected we didn't register QList<QDBusVariant> as an
alias for the "av" signature. I'm not entirely sure you're allowed to
use this because QtDBus does not like re-registration of the built-in
types, and "av" is already assigned to QVariantList. This is no trouble
for the parser, anyway.
Minor change to qdbuscpp2xml to allow reading from stdin, so we don't
have to create temporary files.
Fixes: QTBUG-115964
Change-Id: I80612a7d275c41f1baf0fffd177a14925e7d23ac
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 56bd5d60c9fb9b9078847e4c4919956af3cbf08a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Call QDBusMetaTypeId::init() in the cosntructor. This ensures that
the custom metatype registry is not destroyed before the instance
of the connection manager.
Task-number: QTBUG-58732
Change-Id: I8c7c4c23deab2c7e11c6389a8976666ccf6baf48
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e8e8e1082e8dea3ddecae98123156a24df96558d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This constructor matches way too many argument types (integral,
unscoped enums, FP types), so it's likely to cause mayhem, even if
left in as an explicit constructor.
We now have a named constructor for the same functionality, so just
drop the "unnamed" constructor.
"Unnamed" constructors are important when emplacement is more
efficient than construction + move, or when implicit conversion is
required. Neither is the case here: The named as well as the
"unnamed" constructors just copy ten bytes around, and the compiler
can optimize those extra copies away just fine.
Found in API review.
Change-Id: I7faafd3ebf522fb2b0e450112fb95d643fece5ce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9c1d20337a5585c620e13776f9c33582f2e479d8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These are all trivial: all are over (already or newly-made) const
local variables.
We don't have a mechanism to mark a subtree as Q_FOREACH-free, and
adding QT_NO_FOREACH to each executable is overkill, so we just have
to hope that no new uses are being introduced until we can mark the
whole QtBase module as Q_FOREACH-free.
Task-number: QTBUG-115803
Change-Id: I13dc176756633674bab8c93a342ecdba6c5dd23e
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit d4ba15914871089df72ef1f4b5785d52df0fb4bb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When the placeholder text is changed after having been displayed, it
doesn't get updated on the screen any more, unless the entire viewport
is updated, e.g. because of a document change or a focus event.
This patch simplifies QPlainTextEditPrivate::updatePlaceHolderVisibility()
to update the visibility if the text document is empty.
It replaces the member QPlainTextEditorPrivate::placeholderVisible
by the function isPlaceHolderTextVisible(). It returns true, if the
document is empty and a placeholder text exists, and otherwise false.
It adapts and corrects tst_QPlainTextEdit::placeHolderVisibility():
- usage of new member function instead of data member.
- do not expect an empty placeholder to be visible.
Fixes: QTBUG-115831
Change-Id: Ic4427ce7f7f1b8cde89957b9de0b978bd34ba923
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 4c7cac682fddfad274325ff82b5f212543e5373a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Child windows on Windows cannot have a frame, so checking only for
Qt::FramelessWindowHint is not sufficient. Add an additional check
to see if the window is a native child (has the WS_CHILD flag).
Change-Id: Ib5cbec0f6157da687a5585e12a6c4c6935919538
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit f56fc425f9a103ed71697314196649641ef3691c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Were added for 6.6, but turns out they were not quite ready, and also
live better together with the quadpath class in the curve renderer.
This reverts commit aaccd50224f9a5b22b717ac743634be77c5bc678.
Change-Id: I58399f8e280d5353cb9c3102e8a8e15dcfa4484a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit 3cc693d2565c5633382517145822bb5edc3106cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Under some configure options, gcc13 emits an intractable warning on
this line. This patch works around it.
Fixes: QTBUG-115809
Change-Id: Ib63f2ad81ebdb1f609a7f42c25119c5ae29f08bb
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit f8f23c43feb2fb233a8f047cd1b82259498d9aeb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QMenuPrivate::hideMenu() hides a menu and reposts events in case a new
action has become the active one. For that purpose, it waits 20ms and
60ms for visual effects to be rendered.
If the last action has been triggered, the menu's deleteLater slot has
been called before hideMenu(). In that case, it gets deleted while
events are processed during the waiting periods.
Subsequently, menu becomes stale.
This patch replaces the QMenu * argument with a QPointer. Early returns
are inserted after waiting. QSignalBlocker is replaced by manual signal
blocking, to prevent the signal blocker from recovering the state of a
stale object, when it goes out of scope.
An auto test is not added: The error scenario occurs, when a menu is
triggered by keyboard input, while a mouse event is sent to the main
window from outside the menu. Such a test scenario is complex to match
and exposed to flakiness.
Fixes: QTBUG-115597
Change-Id: I4f937fe66fb1b5cf78ebee70fd0006712172cb12
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit e66cbdf68455263aa6b77d4ea9a4e621837dbad3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QAndroidPlatformInputContext::focusObjectStopComposing() sends an input
event for each character newly added by the Android virtual keyboard.
It then sends a second input event to notify that the cursor has
advanced to the position after the new character.
The implicit assumption is, that the receiver of the input event does
not change the text.
If e.g. QLineEdit::setText() is called in the QLineEdit::textEdited
slot, the text does change. If the change implies a cursor change,
QLineEdit notifies the platform input context about it.
However, by sending the second input event, QAndroidPlatformContent
returns the cursor back to the position after the last character added
by the virtual keyboard.
This patch joins the composed text and the cursor position into one
single input method event. A new cursor position, set by the receiver
of the input method event, is no longer overridden.
The patch adds test functionality to tst_QLineEdit::setText().
Fixes: QTBUG-115756
Change-Id: I85ffac5d6bab93ccb144be0f5b8083258a270550
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit be3b9b2ab12f664c196d649e8c4247d70805d667)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit 4c1df115ecfb14c353c0ec46efdb1f9d2fc0ea95.
We cannot guarantee that there are no more QMetaType
instances that reference the interfaces being destroyed.
All such instances will become invalid after the interface
destruction with no way to verify that.
Change-Id: Iad17fe88753143734b8b817dda184e3c3818575c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8a3330be38b5cac6098795f502fd54e7c8f555fb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Combine the lock and the custom types list into one struct
so that the check code does not have to be duplicated.
Task-number: QTBUG-58732
Change-Id: Ib61d5be3a3cb6465acc5834e5dcbc735fb8b4d8e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit df485fff264265aaaa280d8039aff35a5e9af6fb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When QT_NO_DEPRECATED_WARNINGS is defined, we undefine
Q_DECL_ENUMERATOR_DEPRECATED as it's used raw (rather than via an
intermediary or version-variant). The same is true of its _X()
variant, so do the same for this - which involves redefining it to a
still function-like macro, so that its parameter gets ignored.
This amends commit 59b03992ab332a320ac7cff7c5b099b2c30e14b2 (and shall
get conflicts on older branches, before the defines in question moved
to qtdeprecationmarkers.h in 6.5).
Change-Id: If85c135cddbb33e93cb90f400af123c74e0298ac
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit ffaa1281d492d9ab1b0301944c12301dacff55cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
First lookup with value(key), second lookup with remove(key). Use
constFind() to get an iterator and use that instead.
Change-Id: Idce585ad2269be91eda0381aeb2f2d164033f71f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 99c6190bdf3906bd84ed1368a4d41abe08470f78)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The assertion is triggered when a timer cannot be started. This
is normal occurrence when an application exits before all pending
D-Bus calls are processed. And there is a code handling such failure
in the same function. Qt also prints a warning message in this
case:
QEventDispatcherGlib::registerTimer: invalid arguments
Task-number: QTBUG-58732
Change-Id: I37859443fa90ae1bf7da1572ac9b02a54c8e1b99
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 90e0c6693b3bd9c5272bd8e6255ca9aefd183912)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This makes the API symmetric again (fromBytes()/toBytes(),
fromString()/toString(), fromUInt128()/toUInt128()), but also gives us
the option to remove the QUuid(quint128), should we so choose, because
of its overly-broad argument matching range.
Found in API review.
Change-Id: I91bd2450d62ed565ec3b8e46c875f4983bd9dc73
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 70835a93351b3288a8df4361e648b9cd951ad436)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It matches any integral type, any unscoped enum and any FP type, so we
can't allow it to be implicit. In fact, it's probably better to only
have a named contructor, fromUint128().
Found in API review.
Change-Id: I9b250e0b5e74a449b6df4efe3ea38b750c9744ed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7bbd707299581840fa0ab369dd826102899cd2ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If user attempt to build Qt using multi-config generator set Release
and Debug configurations by default if they are not set, instead of
relying on what CMake suggests as default value for a platform.
Change-Id: I4bdb33e56818984c189b737acccc9ac50659db96
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d09a9f6de3cf672e52fd4081eec7b07b9ed0e877)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of copying a list, sorting it just to check it's sorted, and
making a QSet out of it just to check the size is the same as that of
the list (thereby checking there were no duplicates), simply apply
adjacent_find with greater_equal. If none of the elements is ≥ their
successor, that means all elements are < their successor, and _that_
means the range is sorted and has no duplicates. q.e.d.
Change-Id: Id73c674ad4e29117370e8fc6af9fdfc690a3fba9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 29d07101e5dd7efbb0ffbab1acb5d8d4ef0ed731)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QAndroidPlatformScreen::addWindow() asserted the existence of a backing
store, when a window is added. But QQuickWindow neither needs nor has a
backing store.
This patch removes the assertion, which was introduced in
dbb072eb2838a04e89e34dad686394a496d5de87
Task-number: QTBUG-97482
Change-Id: Ifb43f83d39e16b972754e86d0ff9633f58dac3f8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 9a39ad8dfb4e6d1a179bd0fa38026886f8f7cb8e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Move the SlotObjUniquePtr directly into the QMetaCallEvent, without
having to up and down the ref-count.
Change-Id: I029f71c60defce71ac8778547efe999ce0cf7b4b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 4cf51f46166b50904f0161f028a9ff1c9ba5ae3e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Using Q_FUNC_INFO has an advantage that at least GCC includes
the variable type and name into the string. This makes it much
easier to understand access to which global static is causing
an assertion.
Change-Id: Ie6ce992921c0969df262fed22024a22650783f93
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 31e414d36e59424af5c459cf0f87333eba0f4a57)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Drag the QCOMPARE (which even dynamically allocated a QString
fromLatin1()) out of the QBENCHMARK loop. Testing performance of
QString::fromLatin1() and/or qCompare() is not pertinent to the task
at hand, which, ideally, doesn't involve any memory allocations, so
there's at least the chance that this skewed the result noticably.
Didn't run the benchmark as this was developed on an asan build.
Yes, this breaks comparability with the stone-age measurements
reported in comments there, so sue me.
As a drive-by, replace the fromLatin1() with a u_s UDL.
Change-Id: I9b2a8b2e3596ec9b07c6b4ea369257b1a86e09db
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 17dad4b88bcdacc144812d0b63664540177cff77)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As a header, it would otherwise make all TUs that include it (with
PCH: all) incompatible with QT_NO_FOREACH.
Without deeper analysis (which economy of time forbids in this case,
given this is just a manual test that's probably run 10 times per
year), and seeing as this is in an event handler, I opted to play it
safe and iterate over a copy (which is exactly what Q_FOREACH
does). Added a comment to indicate it may not be needed.
Task-number: QTBUG-115839
Change-Id: I7db75321dd34888f6dd7a64cccb7462ff35935fa
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit cc15e42e2c14ac40339620035b77d3f82f5480d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
First include the common tst_qmimedatabase.cpp (and nothing else),
then implement the differing
tst_QMimeDatabase::initTestCaseInternal().
This will allow adding #undef QT_NO_FOREACH to tst_qmimedatabase.cpp
in the next step.
Change-Id: Icc1890229e9443bd35c81d4f0440ba7df5da906c
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit b7c6b670baf13cdf12b3ba93504e8df86e7b0af1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The single Q_FOREACH use here is simple, as it's over a local variable
that just isn't marked as const due to the way it's constructed, and
the loop body clearly doesn't modify the container, so the protective
copy that Q_FOREACH performs is not needed. But std::as_const() is, to
prevent a detach() (attempt). Add that.
Task-number: QTBUG-115839
Change-Id: If228f649efd87388f6e312078b24a5b46ac8dc36
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 5a8464b1f8fc88a47697012590dd4a8bb2201a61)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These classes are not exported, so we don't run into duplicate vtables
here, but the header is included in a few TUs other than qhostinfo.cpp
(all, when building with PCH), so make sure we compile dtors only once.
Change-Id: I51f6a6d27fc084ad469f82dc7aef3327bdd9a906
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit a2c8524ad7dd59f31b400b5da8979138dc835fcc)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The MIME database appears to use underscore to join its locale tags,
where QLocale::uiLanguages() uses dashes. This meant that lookups by
anything but the raw language were failing even when there was an
entry in the MIME database for the desired locale. Also, since 6.5,
the uiLanguages() list always does contain the locale's own name, so
don't add it to the list again.
At the same time, the search was putting the "default" key (used by
the MIME database parser for the entry with no locale specified) at
the end of the list but macOS (at least) uses that for the "en_US"
version, omitting "en_US" itself from the locale-specific data, with
the result that those using en_US as locale, but with some other
languages later in the list, got the translation for one of those
languages instead of the en_US one, since they were found before
"default" was reached. So insert "default" after the first block of
en-entries in which en_US appears, if it does, rather than at the end.
As a drive-by, amend a comment about using "pt" as fall-back for
"pt_BR"; as it happens, for pt_BR, uiLanguages() will contain "pt" in
any case, as pt_BR is the default for "pt". (Like en, pt anomalously
defaults to a territory other than the one the language is named
after.) So use de_CH -> de as example, instead (and place the comment
where the decision is taken).
Fixes: QTBUG-105007
Change-Id: I1f4835190748256ce53a51321a94ae450ab7f61e
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1b5e13c8d9db92cec41a1b50d74ce3af5853a7dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since the feature breaks Qt build in some configurations, disable it
by default and make private, so users should enable it explicitly and
make sure that openssl libraries are accessible for linking at build
time by either PATH or LD_LIBRARY_PATH.
Fixes: QTBUG-114783
Change-Id: I6eb53c43ed937ec1c0164025bc8953cc5170dc44
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d55c5e2a4384038c1deb5066e48d29444f891ebc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
ElideNone was originally introduced as a way of modifying behavior
of specific widgets, such as QTabBar. The text would previously
always be a elided and an ellipsis character would be added somewhere
to indicate this to the user. Given that context, it makes sense
that the documentation says the effect of ElideNone is that ellipsis
does not appear in the text, since the text would still be elided
if it were too long, given that the painter would draw it clipped to
the widget.
When QFontMetrics::elidedText() was introduced later, this became more
confusing. In the context of this function, you would expect the text
to be returned truncated to the width but without the ellipsis character.
Instead it just returns the full string.
Since this has been the effect of ElideNone since the start and multiple
places use it as a way of disabling the truncation of the string, we
simply update the documentation to make this more clear.
Fixes: QTBUG-40315
Change-Id: If037430da6260020b1d99be7bd43e622f8afa844
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit e7507d6cb706d28954343723438c4fc7d6fe5ba4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Identifiers matching _[A-Z_].* are reserved for use by the C++
implementation. Replace the __ prefix of variable names with _v_,
making them non-reserved.
Change-Id: I35127d7473678e2efd93a4b21847db562c53abd2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 8de746a96c4f83093d1bd50dc1bc3c68148097ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The following commits neglected to amend
tst_QImageReader::supportsOption() with the ImageOption enumerators
they added to QImageIOHandler:
- c0ba249a48fd85ee8e047ff47448a4ed32d6cd91
- 163af2cf53d3441b453744b99254c07a175af5de
- ba323b04cd78fb43e9e63b891e973d24b08250af
Fix first and foremost by adding the missing ImageOption::ImageFormat
to the list of PNG-supported formats (which, curiously enough, predates
the public history and therefore the above three commits), and second,
by rewriting the whole test function to enable -Wswitch, so further
additions are less likely to be forgotten.
Change-Id: I102121b2c8a9067864b8ade2ebe2650be6fb6010
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
(cherry picked from commit 679bb388f09ca09f29ad23d22f9b381bf4f6eea0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In main.cpp, the loop is over a local variable which would be const
were it not for the multi-step initialization that I didn't want to
change. The loop body clearly doesn't modify the container, so port to
ranged for loop with std::as_const().
In printvolumes.cpp, the loop _does_ invoke unknown code (through the
function pointer passed as the second argument), but, as could be
expected, the two users of the function don't pass functions that know
about `volumes`:
- in the tst_QStorageInfo auto-test, an rvalue `volumes` is passed,
so we don't need to analyze the qInfoPrinter function passed there,
as it cannot possibly reference the temporary
- and in main.cpp of the manual test, we just pass printf (which is
technically UB (taking the address of a standard library function),
but I don't care right now).
Task-number: QTBUG-115839
Change-Id: Ibcd10a0e0b3229d8f2a1d98545d8fa6d473a0f75
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit bb11f7a9fa576b679fc64b09abadebf90dfbe9a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Most of these are of trivial kind (loops over const locals).
The one that isn't, in cleanupTestCase(), is, however, also simple:
it's a loop over a local, too, but it would be too much churn to
change the initialization to make the container const, and the loop
body clearly doesn't modify the container, so just go with the
std::as_const() pattern here.
Task-number: QTBUG-115839
Change-Id: I188a78ea67a63be2d50a81fea431e5ea9f2783cb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 961717d372ad94b90e8d06152e92f1af54810a25)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This source file is included in four other test projects, so it makes
more sense to port it away from Q_FOREACH than to white-list it
everywhere it's used.
The change in ModelMoveCommand::doCommand() is trivial. I only dropped
the pointless top-level const of the loop variable as a drive-by.
The change regarding `parents` in ModelChangeChildrenLayoutsCommand's
doCommand() is also trivial, I just ported to braced initialization to
get the QList to be const. We're forced by the Qt API
(layoutChanged()) to use a QList here, therefore no array.
Ibid., the change regarding `persistent` is simple. The container
cannot be marked as const without a lot of churn to its initialization
(applying IILE, basically), but other than that, it's a local
variable, and the loop body clearly doesn't modify it.
Task-number: QTBUG-115839
Change-Id: I7a0e85804626a3cc612921b49e72e4b9f30b676d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit f493b72ee7e6c525159a6df5df13536021ed6b91)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I'd previously understood CLDR's minimumGroupingDigits to mean the
most significant group must have that many digits. It turns out to
mean only that the first grouping separator doesn't get added unless
the more significant group has this many. Once we have one separator,
more can be added that do isolate a single digit.
In the process, I discover some of the prior arithmetic is incorrect;
it is now fixed. Added some basic testing, amended some existing
tests. In the process, fixed naming of some double validator tests.
Fixes: QTBUG-115740
Change-Id: Ia6ce011ba72e72428b015ca22b97d815ebf751b2
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit c5515f5eb17d525329e7adec6ea28ff4d5d5c24a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
"Never use a dynamically-sized container for statically-sized data."
Port the loop from Q_FOREACH (which can't deal with arrays) to ranged
for (which can).
Task-number: QTBUG-115839
Change-Id: Ib89d07fb751e3905a230ee5641e2e509e9415bed
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit ba4b88d9d2f1dd03906f445c55f8959e0165505f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The Q_FOREACH is in a header, so we need to port away from it,
otherwise it makes any TU that includes it (in PCH builds: all)
incompatible with QT_NO_FOREACH.
This is a trivial case of marking the local constructor const, but go
a step further and replace the QList with a C array ("never use a
dynamically-sized container for statically-sized data"). Both
consumers of the container (after s/foreach/for/) can deal with array.
Task-number: QTBUG-115839
Change-Id: I142e438dcf2d785bb34022a3fb1ff46b8eaa0edd
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit c0738f9ff00801e58f47603de5742cf330e55c13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
"Never use a dynamically-sized container for statically-sized data."
Port the loop from Q_FOREACH (which can't deal with arrays) to ranged
for (which can).
Task-number: QTBUG-115839
Change-Id: I40773a0397b83cce0c803967ee3fd7ae274933d3
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 11c2a5b4778dc2c67cf21c020e8266067a99f3d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
"Never use a dynamically-sized container for statically-sized data."
Port the loop from Q_FOREACH (which can't deal with arrays) to ranged
for (which can).
Task-number: QTBUG-115839
Change-Id: Ifef42704c4f695a8fb05ea5d9b3e095af3f35171
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 29f911ab92b77f402e1082b457f1d83d3da28943)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
"Never use a dynamically-sized container for statically-sized data."
Port the loop from Q_FOREACH (which can't deal with arrays) to ranged
for (which can).
Task-number: QTBUG-115839
Change-Id: Iecfc037c8bbfc0b3196ed0c65f680768a8d2353a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 3b6ae86ce8a1d45e735c748f1cc766d9c592755a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QList rather pointlessly has a startsWith() function, which means this
code compiled. But the code makes no sense: it tests the same
condition over and over again, so I'm assuming that it should be
path.startsWith() and not path_s_.startsWith().
Amends 3f56950862181f4d50f30d66f577c933795522c3, but that just
imported the code from qttools. I didn't check whether the bug was
present there, already.
Change-Id: I98a4bbfe0400700655a5c2137f7a976a835a8d28
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 52ef958429cf09a46f71d0165bb4150c61f76ebc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The build fix applied to the 2.13.0 update has also been applied to
this update.
Fixes: QTBUG-115340
Change-Id: I970b560948af3472b222690019a85a79c537b7d9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 0bdd01b7f7c248543c3cd44509d79011f7babd8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These are all simple: QObject::children() returns a reference-to-const
QList, so we can leave the calls in the for loop (no detach()ing).
The loop bodies also clearly don't modify the list of the QObject
children (they're just QVERIFYs).
Task-number: QTBUG-115803
Change-Id: I9c5dcb2aefc433a1dead55dab669e645b6906963
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit ddcf716762e5100f56e23b4171f225ed1a97709c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is iterating over data member containers that are otherwise only
touched in the constructor of the same object. Luckily, the
initialization of these containers does not require *this, so use
NSDMI and mark the containers const, proving they can never be
modified and thus the protective copy of Q_FOREACH isn't required. Now
that we got rid of Q_FOREACH, we can and do make them arrays for extra
measure ("never use dynamically-sized containers for statically-sized
data").
Unfortunately, C++ neither allows us to use "flexible array
members" nor AAA in NSDMI, so grab the nettle and supply the array
size manually (ever so slightly violating DRY, but the compiler will
complain if we get it wrong).
Task-number: QTBUG-115803
Change-Id: Ibb2ce48b6dcaf2e9d3d1a625602f3865d280c7c6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit e0c1ae09fd79160015c8399980d2bec4df2273df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is iterating over a data member container that's otherwise only
touched in the constructor of the same object. The only reason why
it's not a const is that the initialization from QWizard::addPage()
makes that very cumbersome. So port to a ranged for-loop and apply
std::as_const().
Task-number: QTBUG-115803
Change-Id: I033e3725df95b29a8ef295c4e74d746d83234835
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 4741a7cd1c58dbb2adb85e7645ad552994b760ff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is iterating over the keys() of a member container we've just
filled in the same function. The loop body clearly doesn't modify the
container being iterated over. Port to the future-proof ranged
for-loop over asKeyValueRange(), using the _-in-SB pattern Christian
Ehrlicher showed me to indicate we're not interested in the value.
Task-number: QTBUG-115803
Change-Id: I3d86a1de9ea460b7d57fa421ea76e41d2c122f43
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit d67aa6291d62300567ae0b99806941eda683fe46)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is safe to port to a ranged for loop, as it's iterating over a
private member container that is not modified under iteration
(WizardPage::shown() is just returning a boolean member).
Task-number: QTBUG-115803
Change-Id: I50891e4b7509bd64399a128a5ee47d7795374f8e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit d0a4b29132c2d03e3f379d098a6fee4dba0a7ac4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This function is called only from one test function. Mark the
function's argument as const in the caller, bringing this use into the
const-local category, which is implicitly safe to port 1:1 to
ranged-for.
Task-number: QTBUG-115803
Change-Id: I9145c1ae2aed5ab3cafc4947dc3eaaf9a27c6a04
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 88464f7e9388f7a2df096ebb8b02026d0b229f15)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The former implies the latter, so it makes little sense to treat them
differently. Even if some types of targets are (currently) never
compiled with PCH, users of qt_internal_all_x() shouldn't need to know
such details.
Change-Id: I8ead238a8d9e55da632b2929638b67724a42d73c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 51b3269eef20a6559f6f055ae4897ee7d6fe1f08)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These are all trivial: all are over (already or newly-made) const
local variables, albeit sometimes at the cost of an extra scope
(can't, yet, use C++20 ranged for loops with initializer).
In resizeMaximizedChildWindows(), decided to leave the container
construction as-is and use std::as_const instead (applying IILE to
make the container const would be too much churn).
In setViewMode(), removed a pointless clear() that prevented the
container from being marked const. There are no references to the
container following the clear(), and the container does not hold smart
pointers, so the clear() cannot have had non-trivial side-effects.
Task-number: QTBUG-115803
Change-Id: I00ce9c12ab696de30229f3605c16313af7eafffc
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit af34c64d7f721bf7c003a2fcded7c909cecfe124)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For the child windows we have to use showNormal() explicitly,
as the default window state logic of platforms like iOS does
not have access to the QWindow, only to its flags, and we
can not use Qt::SubWindow as a proxy for being a child window,
as that's a window flag meant to be used for MDI sub windows.
Change-Id: I2b5e669f6180ffdcb75479dece38ae5e5430aef6
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit be03c9f1d9e509dafd2d6ee95cac4b67e775460f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is the result of running util/normalize. In this second patch,
the tool replaces QPair with std::pair. This is a bit surprising, and
suggests we should replace all QPair with std::pair in our headers
soon.
Change-Id: Iea0a2fb460a5da66fb534b3787c97d8300a04ca9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit aa48e212d7920d3c675ca5ad6d1675b4f24fa1da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QPaintDeviceWindowPrivate::markWindowAsDirty() is used to signal that
the entire window needs repaint, for example when the window is being
resized. If multiple resize events come in before we have a chance to
redraw the window, we'll end up redrawing the window based on the
window's current size and exposed region, as we should, but we'll
still have a dirty region, because we didn't redraw the window at
any of its old (larger) sizes. Resetting the dirty region instead
of appending to it should be enough.
Change-Id: I37443cc1044779f847348a2303a6cebc1a8f3bcb
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 774095ed9aea96e3a9e56441079735cd726c072a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Ran the script, no new IDs to add. Revised tests of Central Standard
Time: America/Ojinaga has joined Matamoros for it, in Mexico.
Fixes: QTBUG-115732
Task-number: QTBUG-111550
Change-Id: I9b41d8c0156b9fbe3961dbe9a35d55493fc55501
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit c84d78d105a3d3a413ca61db911352bbf695e370)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Same implementation as for macOS.
[ChangeLog][iOS] QWindow::setMask() is now supported for masking the
rendering and touch input of child windows.
Change-Id: I2f9429f0f8fa278fdd8edc15c7b242c7c6bc0ff0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit ed7c7a1458a0d903cea250e8b7272c6b5bf9c624)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Unifies code paths that end up closing and releasing the window.
Change-Id: Ie041079a22bbae0912df0406291c8146f02d0cd7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 4eb127506277d1db02a34f3d73d906e32a749819)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These are all trivial: all are over (already or newly-made) const
local variables.
The only noteworthy point here is that, in order to mark it as const,
I had to move a container definition to the more narrow scope in which
it was actually initialized. There are no references to the container
outside the narrow scope that would require it to be defined in the
larger scope.
Task-number: QTBUG-115803
Change-Id: I20890f48a48ca662679f55fa5db759419d4db8c5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 32e8b272858ded710930db7f314794eb2f77d04c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These are all trivial: all are over (already or newly-made) const
local variables.
Task-number: QTBUG-115803
Change-Id: Idd6e65065ee27c2d29ce1b49607aadb2eaf5e15d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit b8881ff2806f58f6da0027470663aac790bfae73)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These three private methods were introduced in
4e60681c879a54cf5b34862a30e27c492ed36363 together with the QJniObject
class.
Digging through the whole git log for the qjniobject.h header shows
that the functions were never used. Not in template or inline methods,
and not even in the out-of-line methods.
Considering all the above, removing these methods would not cause BiC
or SiC issues, so just do it.
Change-Id: Iaeeefbc2f1002e9413fd16651abd71381362a536
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit f50e29568066e293a54104086a11e72c3abb3823)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Example got removed to tesets/manual in
8937169c190246ebc85df242f85b3
Change-Id: Ica1470b6b478f49e318ea51f244c599cd12bf5a3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit f350f69abe5cd4730384f49d57b2753268b3bb66)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To avoid having to take high-DPI scaling into account for geometry
calculations/comparisons.
Change-Id: I941b74781264455b70520df8d1e6e91592e00310
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 4ede419533b5fe148b2c47711f82739d36991ce4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In b64b0c7947f9f2b0ab4ed33fe526880f54e3981f we bailed out from
QCocoaWindow::recreateWindowIfNeeded() for foreign windows, as
we should not manage any NSWindows on their behalf.
Unfortunately QCocoaWindow::recreateWindowIfNeeded() also took care
of adding the view as a subview to the potential non top level view,
which we do want for foreign views.
Ideally we'd move the reparenting out of recreateWindowIfNeeded()
and into QCocoaWindow::setParent(), but this is a more intrusive
change, so for now just restore the original missing logic.
Change-Id: Ic35ebf94d4adc2f19cedb1cb6a5d0215a1c9c2b4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
(cherry picked from commit 3f3b2be870c34ef72034d4b853ef202e478c7cb7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Remove 'qfreelist.cpp' from the NO_UNITY_BUILD_SOURCES section
and fix the underlying problem of the clashing symbols with
'qabstracteventdispatcher.cpp', by wrapping the unnamed enum in
a namespace.
Amends: a07426d23a02bd4029c6576f92fa43d324ff56be.
Task-number: QTBUG-109394
Change-Id: I585ab06a33d46a11a48220f504c53a5f4fa91d7e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit da5f2fc6be6768275501be6ec3e1b742fb995e9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's a free function, because a) it rhymes with move(ptr) and, of
course, SlotObjUniquePtr being a std::unique_ptr, b) we can't add
member functions to it (and no, inheriting from a type whose dtor is
neither protected nor virtual is nothing you will catch yours truly
doing).
Change-Id: I2026126857a7bba204d683bad118e8a2c5cb2924
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit a9982a3b637e482c52a1ca97f9e235eb302048c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Drops the direct deref'ing.
Change-Id: I9f159244d50572659fa8e9cabfbef47e769ac54e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 5bb4020cbe3ce0619d6046708b677469415de850)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Most touch events don't have uniqueIds, but it happens with TUIO
fiducial objects.
Fixes: QTBUG-115758
Change-Id: Ibacce255898ce63090bc5b888c12242838603dd5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 17f61ddc63291914cbd4402f8398a6e9709f7b37)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is how all other libraries handle this, so use it here, too.
Amends 0c8b98774cd0f3dad939d31e820e7e47c1da088a and
09d1196281ccd03dac55781ac91f6c4eb7bb4de9.
Change-Id: Id3b8fa1b834e2bebe5e6ddc1f67e43c66ccd9aab
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit a631fef20f0ad59cd85e2247731641ece2338c30)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qstringbuilder.h needs qstring.h completely parsed. Without this
change, we won't be able to include qstringconverter.h even at the end
of qstring.h (needed for QTBUG-114208).
Picking back to 6.5 to reduce the diff with our LTS going forward.
Task-number: QTBUG-114208
Change-Id: I83d5bcc0939b698209481793f60a0199aa95a06e
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit edcb8e901b9353eacaefc5ba646800125edafb51)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The latter is a better choice if you don't need the result QFuture.
Describe the QThreadPool::start() overload in prose, since the
signature changed in 6.6 from std::function<void()> to Callable
auto&&. The chosen wording is compatible with both.
Fixes: QTBUG-111875
Change-Id: I9f67c2f7e4b221602bf1c35b72e5d38898a4f0c9
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 47a0282707d6a0d12f6f584c81a982632d09cfb7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We failed to delete the slot object when lookUpHost() was called in
these (exceptional) circumstances:
- on a thread with no event dispatcher
- after application shut-down, when the QHostInfoLookupManager
Q_APPLICATION_STATIC was destroyed already
Fix by adding the missing destroyIfLastRef() calls into these code
paths, too.
Amends ad5eb297e179a164e297a7c2eb3b9674a1196605.
This would be so much easier if we had SlotObjUniquePtr...
Task-number: QTBUG-115263
Change-Id: Ief8bf125bc196742c0ce59c1fd87ab93242fc0da
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 693c9e6b1b2f160862a7490af78072a244fa5b9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The Android QPA implementation requires a 1:1 link between a platform
window and a platform backing store, to correctly flush a backing
store to the screen. QAndroidPlatformBackingStore has a bool member
m_backingStoreSet, to remember if this link exists. It defaults to
false and is set to true, when setBackingStore() is called in the
constructor. It falsely remains true, when a platform window is
deleted, e.g. because a QWindow has been hidden. When the QWindow is
shown again, a new Android platform window is created. With
m_backingStoreSet still being true, this new platform window will
never be associated with a backing store. As a consequence, it will
never be displayed on the screen.
The 1:1 relationship of an Android platform window and an Android
backing store is neither ideal, nor in line with other QPA layers
(e.g. XCB). Changing the Android QPA implementation is complex and a
short term fix is necessary.
This patch removes the member m_backingStoreSet. Instead of it,
QAndroidPlatformBackingStore::flush() directly checks, if the platform
window corresponding to the QWindow argument is associated to a backing
store. If that is not the case, setBackingStore() is called.
QTBUG-97482 has been fixed with another approach, which this patch
reverts.
The following commits are effectively reverted by this patch:
9a39ad8dfb4e6d1a179bd0fa38026886f8f7cb8e
f91588923b1e7b68f1bd79b38af44d024df85996
a4ca9e80658bca7dad1529f03c1b59173a6ecf62
dbb072eb2838a04e89e34dad686394a496d5de87
959a8b3967ac3b6315f5b458628ec5661dfc367e
Fixes: QTBUG-97482
Change-Id: Ic4344f8df2e954c057dd2705340f11dfd2d4c6fe
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 86fe84f5f7fd9a55e0f26a9572996caf443ff834)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Document previously-undocumented methods. Document in terms of what
each thing achieves, not how it does it. The U+00B7 is not the period,
it is the centred dot. Fix various anachronisms; the existing docs
were out of date with the actual code.
Task-number: QTBUG-111228
Change-Id: I17da880e0afd7260aa6f3b7bdddb430c437f4562
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
(cherry picked from commit fd7fbaf887f951c34389aa58925ddc680ee544df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Prefer stand-alone versions of the names when available. This saves
the need for a Han-specific kludge in the check for discrepancies
between our enum names and the en.xml names. Causes no change to
generated locale data.
Change-Id: I162f3107d6ffc1f8b893b206e0b78b61cf7254f6
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 40b063cd745136c1c0be4c9903955218ef647a02)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In the Windows zone-ID code, we tokenize() a text extracted from CLDR
data. However, a leading or trailing space (or a repeated internal
space) would then give an empty "IANA ID" for us to match, causing the
empty ID to be mapped to the Windows ID for the entry with the
superfluous space. This was uncovered by an entry with a trailing
space in CLDR v43's data.
Canonicalize spacing in the IANA ID lists extracted from CLDR so as to
ensure this doesn't happen. (We could pass Qt::SkipEmptyParts to the
tokenize() call, but fixing the issue when generating the data is
cheaper and more robust than fixing it at run-time every time it's
consulted.)
Task-number: QTBUG-111550
Change-Id: Ib3883419558d6574141e9ab0bc929ade2d73e020
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 69a0cec4d0b0a498dd7303c636678990791e65ba)
Ran the scripts, added the new enum members to docs.
Updated tests:
* Two of the new languages are right-to-left,
* Canada has replaced a silly date format with a sensible one.
Fixes: QTBUG-111550
Change-Id: Ie6f1e6e94477167c9e2b5c67e6518ca0f6a7e7fb
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 923790832777f3e4d9d9be5eba13a9ffdedcf9e7)
Also add a comment to check the locales new additions enable do have
substantial data. Some of those added in the past are more or less
stubs, for all that they're officially present.
Task-number: QTBUG-111550
Change-Id: I04d46ee96303ecec56c056a0deff6a9457b863e9
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 5db5d3e4b1e4c3ba996f9cc6109d1d0309255aa3)
The digit-grouping and fractional-part separators need to be distinct
for parsing to be able to distinguish between two thousand and one vs
two and one thousandth. Thakfully ldml.py asserted this, so caught the
glitch in CLDR v43's data where mn_Mong_MN over-rode mn's decimal, but
not group, and thereby clashed with group. Fortunately the over-ride
is marked as draft="contributed" so we can back out of the collision
and limit the selection to draft="approved" values (but only when
there *is* such a conflict, as plenty of locales have (compatible)
draft data), thereby ignoring the conflicting contribution.
Brought to the attention of cldr-users at:
https://groups.google.com/a/unicode.org/g/cldr-users/c/6kW9kC6fz3g
hopefully that'll lead to a saner resolution at v44.
Task-number: QTBUG-111550
Change-Id: I1332486e60481cb4494446c0c87d89d74bd317d4
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 8a762c6f0f1155d402fbc31f422fd4aa7fffaddd)
From CLDR v43, "The parentLocale elements now have an optional
component attribute, with a value of segmentations or
collations. These should be used for inheritance for those respective
elements." Since we aren't extracting collation or segmentation data
for the present, omit these elements from the scan for parentLocale
information.
Task-number: QTBUG-111550
Change-Id: I42871929f539c1852471812801953f2fc8be0e8a
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 615047e98f1ef2a6d1d1d1830c74d1d02dcec336)
The script and territory to exclude from reports about unused ones
were swapped, so we excluded a territory from the script list (which
didn't contain it anyway) and vice versa.
The test for whether to report used the non-existent .territories
attribute by mistake for .__territories
Change-Id: I29e9d9f8f34883d7c3a5ac15470d9e7a0366e3db
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 37c5a9f20b9973a0f29c05965e243622f5596da0)
Amends commit 9a8b9473d5f0fd4639193481ba9b344d91f3f00a - apparently
the enumdata.py entries were tidied up after the data had been
generated, leading to them being inconsistent (and I missed that in
review). That, in turn, meant the next update would have changed the
public API enum members, backwards-incompatibly; so make enumdata.py
consistent with the released public API. We'll be tidying the order up
at Qt 7 in any case.
Task-number: QTBUG-110333
Change-Id: I3eed2924ce8b69deb552e923d9b0dc142c5f3a65
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 4e23da908621d3bc02e8f0a661ee0946f9a124f6)
Mark the module are Q_FOREACH-free, so it stays that way.
These two instances are risk-free, because the loop is over local
variables that the loop bodies clearly do not touch, so the safety
copy that Q_FOREACH takes is not required here.
Change-Id: Ida3c1d51c661d77a59a2ad105e080c3c9b66c53f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit c91146b9eff65cd8c860d26e09242795300a6b14)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Well, except that the ownership of the slot object here is actually
shared between the PermissionReceiver and the lambda passed to
QPermission::Private::requestPermission(), which eventually may hand
ownership over to QMetaCallEvent, so we can't really use
SlotObjUniquePtr.
While we can, of course, manually copy and call ref(), even if the
slot-object is stored in a SlotObjUniquePtr, unfortunately, the lambda
is subsequently stored in a std::function, which infamously cannot
hold move-only objects, so we actually need something copyable.
So grasp the nettle and implement a SlotObjSharedPtr.
I was originally planning to just make this a typedef for
QIntrusiveSharedPointer, but that's not in dev, yet, let alone 6.5, to
which we're picking this, and there was always this nagging impedance
mismatch between the QIntrusiveSharedPointer behavior, inherited from
it's Q(Explicitly)SharedPointer roots, on the one hand, to always
ref() in the constructor from raw pointer, and, OTOH, QSlotObjectBase
starting its life with a ref-count of one (1) (not zero (0), like
QSharedData).
I eventually found the (elegant, if I may say so myself) solution to
just not provide a constructor from raw pointer, only one from
SlotObjUniquePtr, which, granted, has the same issue, but which is, by
now, probably, hopefully, more fully grasped by QtCore regulars, and so
we can piggy-back on that for SlotObjSharedPtr's constructor
semantics.
Add a comment nevertheless.
Inside the lambda, we could theoretically move the slotObj into
QMetaCallEvent::create(), after adding such conversion to
SlotObjSharedPtr, but that would require making the lambda mutable,
and seeing as it's stored in a std::function and copied around, I was
not ready to make that change just yet.
As a drive-by, make PermissionReceiver's constructor explicit.
Fixes: QTBUG-115330
Change-Id: I4e0cec13d19a19eeec31e4101ce289d07c92ce46
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit f1411088879b31ec381e2e708625c13c321549d7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QAtomicInt::ref() returns bool, not int, so do the same in our ref().
As a drive-by, drop the superfluous inline keyword.
Change-Id: I60712df3640b67dfd857355d364e0fc5a3a40650
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 902063628ff3e4539d276095009bdd024faf0a41)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is the only way to detect, and act upon, the addition of the
virtual function in other Qt modules.
Amends a4ca9e80658bca7dad1529f03c1b59173a6ecf62.
Task-number: QTBUG-97482
Task-number: QTBUG-115691
Change-Id: Id32fdd3d8af1fced17983dd104318645a5578b8c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f91588923b1e7b68f1bd79b38af44d024df85996)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's a) not needed, because qstringbuilder.h simply just defines op%
and not op+ when these defines are not set and b) surprising for users
that they have to include <qstringbuilder.h> if they want to use op%
without also setting one of these defines. Finally, it just throws
readers of the code off the track for no good reason.
So, drop the external guards for qtringbuilder.h in qstring.h and
qstringconverter.h.
Task-number: QTBUG-114208
Change-Id: I00b3e405d905d319437c32a7253b39de1625d096
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
(cherry picked from commit 15ff5bafa0cdb21134c6c4660206c16d26960da8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
`\target`s generate a span where they occur. If they occur outside a
table cell, QDoc generates illformed html. Fix such instances by moving
the offending line into the table cell they target.
Task-number: QTBUG-115247
Change-Id: I677e909ec73a6d0af8195d88d23581d8dd97c6e5
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
(cherry picked from commit 78bc1a9a25602ba898b1f84a6c41c3804758f6cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QByteArray::assign() re-uses existing unshared capacity(), if any, and
is therefore potentially more efficient than '= QByteArray(~)' (and
never slower).
Task-number: QTBUG-106201
Change-Id: I5e5114064c8aaa23892e95c235335632d7c5cd0a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit d7d15c1a47c01fd75e073f82345aad826887350f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Remove old files from the output location before saving new ones.
Change-Id: I75181126c6c920e13951e9a46a6be1c666d457fe
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
(cherry picked from commit c6ab516f71efeeaaf2a10dbc0368fb437f8b3a6c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QMetaType does not own the interface from which it is constructed.
Consequently, we end up with a memory leak.
This is not a huge issue, given that the map of meta-types is static,
and the application is about to be close when can discard it anyway, but
it causes avoidable sanitizer warnings, which are annoying when
debugging more severe memory leaks.
Change-Id: Ifee3f4e19835536f4a6cfa4f6866ab621581ad4f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4c1df115ecfb14c353c0ec46efdb1f9d2fc0ea95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fixes an issue with generated code where the name of an enclosing
namespace is identical to an enum class type, when Q_ENUM_NS is used.
Consider:
namespace a {
Q_NAMESPACE
namespace b {
enum class b { Key, Key2 };
Q_ENUM_NS(b);
}
}
moc generated code such as:
Q_CONSTINIT const QMetaObject a:🅱️:staticMetaObject = { {
...
qt_incomplete_metaTypeArray<qt_meta_stringdata_CLASSaSCOPEbENDCLASS_t,
// enum 'TestEnum'
QtPrivate::TypeAndForceComplete<b::b, std::true_type>,
// Q_OBJECT / Q_GADGET
QtPrivate::TypeAndForceComplete<void, std::true_type>
>,
nullptr
} };
which confused the compiler:
error: ‘b’ is not a member of ‘a:🅱️:b
83 | QtPrivate::TypeAndForceComplete<b::b, std::true_type>,
Fixes: QTBUG-112996
Change-Id: I37aee83c32efe96cc9d6c2bd0bdb9ba80bb7b8a7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 7779400ba6fee98b1f90702f92c17a5a4089c5ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If module depends on some module Private part only the sync_headers
dependencies from this public part of this Private module is skipped.
Check if the module is Private and use the public module to read the
_qt_internal_sync_headers_target property.
Amends 0006a564c85d49153288cd3834197effed53394e
Fixes: QTBUG-115712
Change-Id: I4678e2a6c9ec8f80862a97d48f0a3b4214ae2307
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d7a3733056c8b3c72b243fe486c2a2b553c8c825)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use [&] instead and remove overparenthefication as a drive-by.
Amends c888e3922d73df791f0f31553536abf03b241a65.
Change-Id: Ic7930d5011c247122a1b3396ea0d6a9a2d6107de
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 19c70f40d257d528df65fac44eb847676425d03f)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QTreeView::visualRect() returns a given model index's visual rectangle.
The method is used to toggle the background during hovering.
The previous implementation included the row indicator, when the first
row section was hovered. When it was unhovered, the row indicator
remained highlighted, until the mouse had left the view port.
The reason is, that the highlighting implementation changed the
rectangle returned for the first section, to include the row indicator.
The implementation for neutralising a highlighted section relies on
QAbstractItemViewPrivate::setHoverIndex() and
QAbstractItemView::update(). These methods don't know about the row
indicator to be included, and therefore do not update() its rectangle.
As a consequence, the correct background gets painted but not updated
on the screen.
This patch moves the calculation of the visual rectangle to a new
QTreeViewPrivate::visualRect_impl(). In addition to the model index,
the new method expects an enum argument, representing the calculation
rule:
- SingleSection: Calculate the rectangle of the given section.
- FullRow: Returns the rectangle of the entire row, regardless of the
index's column.
- AddRowIndiCatorToFirstCulumn: Adds the row indicator to the rect,
if the model index points to the first column.
The patch updates all calls within QTreeView, to use the private method
with the right calculation rule for the use case at hand. It elminates
manual (and repeated) modifications of the return value.
The patch implements QAbstractItemViewPrivate::visualRect(), which
returns QAbstractItemView::visualRect(). It is overridden in
QTreeViewPrivate, so that QAbstractItemViewPrivate::setHoverIndex()
and QAbstractItemView receive the rectangle including row indicator.
As a drive-by, several local variables have been constified and/or
renamed to indicative variable names.
Fixes: QTBUG-115149
Change-Id: I4838bcf744f87d8cfb259c5d8758fb65e091e9fe
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d35e8ad754ebb08430669cef64f10d34e4277d1f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The blacklisted test does not crash, as its expected output indeed shows.
Change-Id: I07522a7d065b5f39620975a3546bcd156024c41d
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 5993480b691da713da1501190d1207e2724fa565)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Introduce QT_SUPPORTS_INT128 and QT_NO_INT128 marcos to handle 128-bit
types. These macros allow to undef Qt's own 128-bit types and the
related code, but keep the compiler definitions unchanged.
This is required for Qt Bluetooth, where we need to use
QT_BLUETOOTH_REMOVED_SINCE to get rid of the APIs using
QtBluetooth-specific struct quint128 which clashes with the 128-bit
types. The idea is to use QT_NO_INT128 in Qt Bluetooth's
removed_api.cpp instead of directly undef'ing __SIZEOF_INT128__,
because the latter is UB.
This commit amends befda1accab417ce5f55cb11816e6ded51af55e3.
Change-Id: Ia2c110b5744c3aaa53eda39fb44984cf5a01fac2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit eb0abd9789062d95bc62dbbc29b2038dc40472b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In porting the selftest machinery to Catch2 in 24e83de8d192 we
accidentally added an unconditional early return when determining
whether to check for unexpected stderr output, resulting in not
checking error output on any platform.
The return statement has now been moved into the Q_CC_MINGW
condition, but as we now seem to have similar issues on macOS
and Linux with some of the tests outputting "Received signal 6
(SIGABRT)" as we do for QEMU, we need to add a few more explicit
early return conditions to the function.
Change-Id: I7a25f000843b5f1003a5db883f08285185046b46
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 118f2210c6279803b9a4103a796ce75e88f8beb2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Commit ca54b741d6edda24773137aacee229db31dd3585 used the internal
has_operator_equal (and commit 01d94760d8d34e51e1442682fc151747943c7e25
copied that for has_operator_less_than) instead of using the recursive
expander that was being used here. That assumed that the contained type
in std::optional would always be the last final check, which is an
incorrect assumption.
Fixes: QTBUG-115646
Change-Id: Ifbf974a4d10745b099b1fffd177702934bec27ff
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit cff13c2417225fcb5e2cca4c9a045bfe49c1034c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replicate qvulkaninstance.h's logic. The idea being to allow
to compile code that uses QRhi (so includes qrhi.h) with a pre-built
Qt that was built with Vulkan support, but there is no Vulkan SDK
(and so vulkan.h) on the developer's system. Normally this is not
something we care about, e.g. compiling an application using
QVulkanInstance or any other Vulkan functionality implies one has
to have the SDK installed or at least the headers available in one
way or another.
However, including qrhi.h (and so qrhi_platform.h) happens in some
cases in applications that do not themselves initialize a QRhi,
i.e. they do not care about the QRhiVulkan* structs, because
they only ever use a QRhi retrieved e.g. from the QQuickWindow.
Design Studio is one example. To allow building DS against a Qt
that is Vulkan-enabled (e.g. the official Qt releases) but in
an environment that has no Vulkan headers, we skip the QRhiVulkan*
stuff when there is no vulkan.h available.
Change-Id: Ic81250e6c90939a38f79cab1438fbb9f483f56df
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
(cherry picked from commit c6fce818db7e56f659ea88784d2f9278f9ce1436)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It is part of a solution to produce notarizable binaries for
application using Qt WebEngine.
Task-number: QTBUG-99555
Change-Id: Ice0bbcfb12829906328f55158b0c37f03878f17c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit ebb361ee3f02d677460fc2b55a47c6cd4bbbc489)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Activity.getReferrer does not only return app IDs but also URLs if
Intent.EXTRA_REFERRER is set on the Intent. In the case of Chrome the referrer
is set to the website triggering the Intent. To improve the detection of the
calling app we check first if the browser specific
Browser.EXTRAS_APPLICATION_ID is set. If it is not set we fall back to
Intent.getReferrer.
Change-Id: I33d1edd52de98486d9616713e531ea20ada87bcb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 7012bea614fb47a07a4626c2e2e2855dba3742b4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
in QXcbAtom::initializeAllAtoms().
See also the example in
https://manpages.debian.org/testing/libxcb-doc/xcb_intern_atom_reply.3.en.html
Fixes: QTBUG-115599
Change-Id: I6590fe1aa11deec7fef7ce6d8f5c49a71d636648
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 552e3b9b78c136aebedf0a591af04661f0dedbbf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As a result of d8bbb5ee0e60d44a70d29306e607a59caf7fe5bc, we
were no longer calling QDialog::done(), which users may have
overridden.
We now pull out the dialog code to determine whether to
emit accepted/rejected directly in done(), so that we
can go back to calling QDialog::done().
Change-Id: Ie08270123d61d9010acd8c989b66986f71960ad0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1f70c073d4325bc0eb9b0cec5156c3b89ce1b4df)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The native dialog helper is populated with buttons based on the message
box buttons, which are still represented as QAbstractButtons, either
by adding custom buttons, or by turning QMessageBox::StandardButton
into QAbstractButton.
To ensure as little difference as possible between the native and
non-native backed dialogs, we plumb the dialog helper clicks back
to the corresponding QAbstractButton. We were already doing this
partially for custom dialog buttons, but now we also do it for
standard buttons.
As the click() will plumb back to _q_buttonClicked, which calls
setClickedButton to finalize the dialog, we don't need to do
this explicitly anymore.
For custom buttons it now means the result() of the message box
will be the custom button's index, not its role, but the result
in this case is documented to be an opaque value, and it's best
to keep these the same for native and non-native dialogs.
Change-Id: I5fe3b28e4c4ed879775610103cd1b591b3353f7e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4a4283e3e98d779e6eb6cb47d408fe4fd402cdf8)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
In d8bbb5ee0e60d44a70d29306e607a59caf7fe5bc we started respecting the
button roles of buttons added to QMessageBox, by emitting accepted()
and rejected() if the appropriate roles were found.
Unfortunately this only touched the QMessageBoxPrivate::_q_buttonClicked
code path, for non-native dialogs, leaving the code path for native
dialogs in QMessageBoxPrivate::_q_clicked alone.
We now follow the same approach for the native dialogs as for the
non-native ones, by calling QMessageBoxPrivate::close() and
QMessageBoxPrivate::finalize() explicitly, instead of going
via QDialog::done(). This allows us to pass a dialog code
to finalize().
One side effect of the original change was that overriding
QDialog::done() for non-native dialogs no longer had any effect,
as we were using lower level plumbing. Since we now align with
the original change for native dialogs, we will adopt the same
limitation, but this will be fixed in a follow up for both
cases.
The callback code for custom buttons in native dialogs could also
use some alignment with the non-native path, but this is also
left for a follow up.
Fixes: QTBUG-113685
Change-Id: Iea03a0007f884d6c7f11d2bd891446bdaa5ddc67
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
(cherry picked from commit 6da1ecc8c2b9f7fd488194b6e81b41a314b678d5)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
After 449b45ff34ce4a45e5d6a24967566f69f43ebbb6 we emit aboutToQuit
before quitting the main event loop, matching the documentation and
semantics of "about to". Clarify this in the documentation, so that
client do not rely on a missing main event loop to trigger processing
of root level deleteLater() calls in a nested event loop.
Change-Id: Ifd116394a1960814edf69f20c5aaff6a8e5cfc24
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 04b619d950b65c99fc934ffbe4f2fd0e1fccf4a9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The Freedesktop Icon Theme Specification [1] describes that,
if a theme does not specify anything for its 'Inherits' key,
"implementations are required to add the 'hicolor' theme to
the inheritance tree. An implementation may optionally add
other default themes in between the last specified theme and
the hicolor theme."
And later, when describing the lookup algorithm, that "The
lookup is done first in the current theme, and then recursively
in each of the current theme's parents, and finally in the
default theme called 'hicolor' (implementations may add more
default themes before 'hicolor', but 'hicolor' must be last)".
But it doesn't explicitly describe the behavior when a theme
does specify a list of inherited themes via the 'Inherits' key,
and this list explicitly includes 'hicolor'.
In that case, our custom fallback theme, which we inject after
the theme's explicit parents, will be prioritized after 'hicolor'.
As it's likely that the theme author added 'hicolor' to their
parent list to ensure that 'hicolor' is at some point consulted,
but didn't intent it to be priorized, and that the spec puts focus
on 'hicolor' being last, it seems reasonable that we can move the
'hicolor' theme to the end of the fallback list, and as a result
always prioritize fallbackThemeName() over 'hicolor'.
[ChangeLog][QtGui][QIcon] The 'hicolor' theme will now always be
prioritized last when looking up fallback themes, even if
explicitly declared as a theme parent in a theme.
[1] https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
Change-Id: I76538e4e7e9e395f9e5a38e704c60fb6b9688885
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit e603661c48903fa674332a218b21cb35b288de4c)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Was missing for some reason when this got added in 6.4.
Change-Id: I4f8b780c7119649688d8d8a197e8ef59730b0b61
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit cdae120f7f23fefcb4adbc34c6f082c60faa2952)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
caps.apiVersion is inst->apiVersion() limited by the version the
physical device reports. Therefore, use caps.apiVersion when
setting up the memory allocator, like it is done everywhere else.
This is expected prevent vma init failures on lavapipe in some Linux
distros.
Change-Id: I4e693820c95a5e0174846afb20e42aadd56034d6
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit f9d473ac726fe012fe05a9e6f7502ca50c2245e5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
One may very well force a 3D API not functional. In this case there will
be no QRhi. A bunch of warnings will be printed (which is good), but
then flush() should not do anything, and that was not handled before.
Change-Id: I82139070311152c959d39a553842f4462d8e7811
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 108b1014415a491cb0abb58c04a28a5c691085a1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If a callback deleteLaters a QRhiResource that should still be
handled and not left unreleased. Swap the order.
Change-Id: I8419a28a9db5bb59f768ab5820dfaf593464d6d2
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit d907f1aa92dbd4500a18db2c2492491c34c66087)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Showing code that cannot possibly compile is bad practice.
(vkAllocateCommandBuffers is in QVulkanDeviceFunctions, not
QVulkanFunctions)
Rather use a member function that is actually in QVulkanFunctions.
Change-Id: I3063a8a229152144ce866e915eb4c14ecc58e9ce
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit e8e9c287ec6a086a96b36e692ab6d5ed11b64951)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Ironically enough when the old macOS 13 problem is no longer occurring
(at least on an M1 Mini with 13.2.1), so the OS version based
differentiation could likely be removed, there are now reports about
problems with old Intel hardware and earlier OS versions.
Therefore, get rid of the OS version based logic, and rather add
a global flag that is enabled unconditionally for now, which
disables MTLBinaryArchive usage altogether.
How much we lose is not very clear anyway. The OS performs its
own persistent caching (most likely), hidden from applications.
Thus what we lose really is the fine grained control over the
data (e.g. specifying a custom storage file via
QQuickGraphicsConfiguration), with the possibility of pre-seeding
for the first run. As the performance of subsequent runs is less
likely to change in any significant way, this is seen as not
a big deal for Apple hardware in general so we might just live
with this. (and on macOS 13+ this was already crippled anyway
due to the OS version logic)
Fixes: QTBUG-114338
Task-number: QTBUG-108216
Change-Id: If7b908baea2093f6882674ebfbdc18e770d6503e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit fa96e76ab124965f3112ae63298c69782b1bb311)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Running a Vulkan-based QRhiWidget (upcoming in 6.7) and QQuickWidget
shows the "...does not support OpenGL-only windows" warning which is
pointless nowadays. Since Qt 6.4 RasterGLSurface is not in use,
whereas the surface type can very well be VulkanSurface too.
Change-Id: I790767e683b2a4cffc99cbc38015aca809cf83c5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 4abf862bca3a4942afc1953411fb7ad3871f032e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Should be no different from MetalSurface and OpenGLSurface.
Change-Id: I529f2904a43e44376e9f2da2489fac57670d954d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit e310bc1646eab51b70eb68e7d4ed344dd263167f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit adds some initial support for handling the 'L' suffix after
numbers. This one is especially important given that the __cplusplus
define is using it.
Other suffixes will be handled in some later commit, which should also
unify the already divergent parse behavior between DIGIT and PP_DIGIT
parsing (e.g. when it comes to byte prefixes).
Task-number: QTBUG-83160
Task-number: QTBUG-115558
Change-Id: Ie61eae49c468abfaee80e7e4f7097917a254dc0e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f0039bd5170ad84d972a023316e8d153b89f841a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There is no QT_CONFIG_thread.
Thanks to Alexey Edelev for spotting why I couldn't run the test.
Change-Id: I11c99d9b1ff8fed67b118028b76fba8ee6db3c42
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 4693c812684a08b2e34dfcfc76ddd6f58bfc8acb)
mouseMoveEvent overrides in QColorLuminancePicker and QColorPicker
have triggered value changes unconditionally. This happened under the
assumption that the widget attribute WA_Hover is not set (which is the
default behavior). In that case, mouseMoveEvents are only delivered if
a button is pressed.
If WA_Hover is set - e.g. by applying a style sheet - mouseMoveEvents
get delivered also when no button is pressed. This leads to faulty
behavior: The color and the luminance change, whenever the mouse is
moved into the respective widget. Color/luminance are changed to the
value representing the edge on which the mouse has left the area.
This patch changes both mouseMoveEvent overrides. They return early
to avoid hovering changing the colors of the luminance/color picker,
but ignore() the event in case anything behind the picker needs hover.
Since this is a purely graphical effect, an autotest was not added.
Fixes: QTBUG-115516
Change-Id: I000d113a1c81c46799cbb5197bf9acb3849e7d3b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit a2ec43b8ebcbf8462928800a7db4f6af7e482b18)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We dropped support for macOS 10.3 in Qt 4.6, 14 years ago.
But the logic to only 'fake' the unloading on Q_OS_DARWIN
remains. Also, add a statement explaining the behavior
in more detail.
Change-Id: I62ec7df7c4b807f84c96619f78b3cef704c51335
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit ea0b7dafb287ed3d044b574fb7671346bca087e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Qt insight's TP is using plugin type "generic" so that insight plugins
can be deployed for every Qt application. As "generic" plugins are part
of QtGui windeployqt deploys these if a dependency to QtGui is found.
As defaulting to a deployment of insight plugins might cause confusion
among users, we make deployment of these plugins explicit if the module
is available.
Change-Id: I9d2a8595373d5a15b7afbeaf7174226563b1cb6f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ae7bc8803f16219b4fde93bf7312976cb28f7c2f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A regression was introduced in
48841c34d2e86a741ec9992b9704c0fa5973503c
when configuring qtshadertools with -prefix -debug and
no -developer-build.
qtbase would have been built as Debug, but qtshadertools as release.
This caused qsb.exe to link to a debug c++ runtime via QtCore, and a
release one via QtShaderTools libraries and thus cause heap corruption
crashes during runtime due to the mismatch.
This happened because the check in cmake/QtSetup.cmake thought Debug
was the default build type (nothing was specified on the command line)
without knowing it was explicitly set BuildInternals.
Set a variable when BuildInternals sets CMAKE_BUILD_TYPE and make
sure QtSetup does not override it then.
Augments 33af62db3747bb6fcb7490ef2d2abc5bb53925b6
Amends 48841c34d2e86a741ec9992b9704c0fa5973503c
Fixes: QTBUG-114958
Change-Id: I5e0a27b4d77512494c026dd911ec5757889a5a1a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 8c912cddebe544010e7da3f87af5b21f3328d7ec)
Before this change, we had the following behaviors.
On platforms other than Windows-MSVC:
- when no build type was specified, we defaulted to Release
- when -developer-build was specified, we defaulted to Debug
- regardless of platform, unless the option was explicitly specified,
we never defaulted to -debug-and-release.
On Windows-MSVC, we always defaulted to Debug. Which is inconsistent
with the rules above.
The difference happens because CMake always sets CMAKE_BUILD_TYPE to
Debug during the first project() call when targeting the Windows-MSVC
platform.
We interpreted that as the user setting the build type, and thus we
didn't want to override what the user specified.
After this change, if we detect that it's cmake setting the build
type, we assign a build type that follows the non-Windows-MSVC rules.
This change unifies the behavior across all platforms.
Adjusted the configure help with the new reality.
Augments 33af62db3747bb6fcb7490ef2d2abc5bb53925b6
[ChangeLog][configure] When no explicit build type is specified,
Windows will now default to building Release like the other
platforms.
Change-Id: Id2bf269c51cf300ec09751ece2ad721869e0f90c
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 48841c34d2e86a741ec9992b9704c0fa5973503c)
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The docs were never added (unlike the docs for erase_if).
Change-Id: I7857c5eded68791ddfc4e6ce42a60d5736f5a438
Fixes: QTBUG-115473
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 76e650045e342c977042195059a6eedd7809a260)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We do not need the Q_CC_GNU check, as the __SIZEOF_INT128__ check is
enough.
Change-Id: I12bdd02186c4f5dad0ab3f4596f4b37e5c3f7eee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 27b06e50e0c864ee50f9bab8eeb97ac038d0306a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use QT_DEPRECATED_VERSION_X_6_6 and provide reasons for deprecation
for the enum value and for the QPropertyObserver constructor.
Change-Id: I0f9b4c6dc8bb9fd5eac692a6953c90059f3c77ef
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit aaa8c3835303e6eb3579df300e06ea6696ca769f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The description in terms of timeouts was confusing. Instead, say what
it actually does, in plain terms. Mention that you can do similar for
a duration.
Task-number: QTBUG-115447
Change-Id: I4618d7fa290e7959ed3cb51e5c2576b041f77091
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 669470e2be99dbeef2ec1b2083cf6a86c8c9d917)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Remove stray comment at the end of tst_qexplicitlyshareddatapointer.cpp
Change-Id: I31a6c38002e56e7c43e527864ba3d9324950079f
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 93e9d214904b73d4d89ea4f2c1b836d768cf7284)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Remove stray comment at the end of tst_qxmlstream.cpp
Change-Id: I88550e2b75194e7895d8578ca0e8350af59d4dfe
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 3bb991ca05b7b727b66f117ef362edf10a1850c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The existing signal connection can cause a loop and undefined behavior
in the interaction between the line edit for a hex rgb color and the
individual rgb values.
=> Change connection to textEdited, to react only on manual editing.
Fixes: QTBUG-115189
Change-Id: Ie3062c575652b905a8ab16edb2f5f77f8d150f36
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 4a26ae1b270bfeaac5cf60850407fadfbe5db3ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends commit 94de5f9b25e1816039885c765e2a5b312f7daa7e so that every
change to the default locale is reflected in an update to the default
collator used by QString::localeAwareCompare().
Although the change to the system locale does update the QLocaleData
object shared by all system locale objects, the possible change to its
collator() may imply the default collator needs an update; and the
collator backend's init() may use the language, script and territory
that's changed in setting up the revised collator, even if the QLocale
instance referenced has the same QLocaleData.
Change-Id: I957486c03c3d779fc9a2f0b889346ec13b1af868
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit df736da245bf1ea04fadffa1f5d35c37252930a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When parsing a string whose time-zone part matches local time's name,
use local time in preference to the QTimeZone with that name. The case
is ambiguous, and the bug was already fixed (by something else) in
dev, but this caused a failure in 6.2 through 6.5; and using local
time is more natural to QDateTime in any case. The fix incidentally
makes the the logic of the zone-resolution code more straightforward
and a closer match to how findTimeZone() found the match.
The issue was hidden from 6.6 by a change [*] to the handling of POSIX
rules, that lead to plain abbreviations such as CEST and BST - for
which the IANA DB has no entry - no longer being considered "valid"
zones, despite being technically valid POSIX zone descriptors
(effectively as aliases for UTC).
[*] commit 41c561ddde6210651c60c0789d592f79d7b3e4d5
Fixes: QTBUG-114575
Change-Id: I4369901afd26961d038e382f4c4a7beb83659ad7
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ca6a0fd63fdd5209f2cc1ff59e6b31c0bed14597)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since QDateTime uses some fall-backs if qTzName() doesn't give it
something useful (as happens on MS-Win when local time is UTC),
QDateTimeParser should check the result of those fall-backs as well as
the qTzName()s when checking for local-time as zone.
Change-Id: Ic809b7e44cd0c83fb076b24c27547268345fa379
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit c888e3922d73df791f0f31553536abf03b241a65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QSpan is Qt's version of std::span. While we usually try not to
reimplement std functionality anymore, the situation is different with
QSpan. Spans are non-owning containers, so the usual impedance
mismatch between owning STL and Qt containers doesn't apply here:
QSpan implicitly converts to std::span and vice versa, making STL and
Qt APIs using spans completely interoperable.
We add QSpan mainly for two reasons: First, we don't want to wait
until we require C++20 in Qt and can use std::span. Second, in the
view of this author, some design decisions in std::span hurt the
primary use-case of spans: type-erasure for containers. This results
in two major deviations of QSpan from std::span: First, any rvalue
container is convertible to QSpan, allowing seamless passing of owning
containers to functions taking spans:
void sspan(std::span<T>);
void qspan(QSpan<T>);
std::vector<T> v();
sspan(v()); // ERROR: rvalue owning container
auto tmp = v();
sspan(tmp); // OK, lvalue
qspan(v()); // OK
This author believes that it's more helpful to have compilers and
static checkers warn about a particular wrong usage than to make
perfectly valid use-cases impossible or needlessly verbose to code.
The second deviation from std::span is that fixed-size span
constructors are also implicit. This isn't as clear-cut, because an
explicit QSpan{arg} isn't per-se bad. However, it means you can't
transparently change from a function taking decltype(arg) to one
taking QSpan and back. Since that's exactly what we intend to do in Qt
going forward, in the interest of source-compatibility, the ctors are
all implicit.
Otherwise, the API of QSpan follows the std::span API very
closely. Like std::span, QSpan isn't equality_comparable, because it's
not clear what equality means for spans (element-wise equal, or (ptr,
size)-wise equal?). The major API additions are Qt-ish versions of std
API functions: isEmpty() on top of empty() and sliced() instead of
subspan(). The (nullary) first()/last() functions (Qt speak for
front()/back()) clash with the std::span function templates of the
same name, so are not provided.
This patch adds QSpan as private API. We intend to make it public API
in the future.
Fixes: QTBUG-108124
Change-Id: I3f660be90eb408b9e66ff9eacf5da4cba17212a6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit f82cf6333e4e21c96d8b6bb272392f8142ead2b7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It actually takes one parameter, because in this overload the connection
type can't be specified, for example:
QTimer timer;
timer.callOnTimeout([]() { qDebug() << "slot"; });
The call chain is:
QObject::connect(timer, &QTimer::timeout, functor);
connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 &&slot)
connect(sender, signal, sender, std::forward<Func2>(slot), Qt::DirectConnection);
the connection type is always DirectConnection.
Spotted by Giuseppe in code review.
Change-Id: Ia8bbd91e98a357244cbfae4e3ed63d4c73038fa2
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 794e0d1ac6b99c9398e4802b4f9e60012dcf055d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
They aren't used because the C++11 atomics are the only atomics we've
supported since commit 9d1fab424e38d0ed40677926c0a434272ad41320 (5.6).
Change-Id: I53335f845a1345299031fffd176f84ccd054b804
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 9bcf82afb35a90430bbb8cc15b4eead45179a825)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... so it can use the new QMetaCallEvent() ctors taking that type.
As a consequence, the slot object ref-count is now no longer touched
on the way into the meta-call event (was: upped in QMetaCallEvent
ctor, then downed in QScopeGuard).
Manual conflict resolutions:
- QScopeGuard -> custom Holder struct
Change-Id: Id9bd157792458a3834809c23e94ca5f504f7abd1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4015f81d31d783549bfe0bd26ab1504789e056fe)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This makes it clear who is responsible for obtaining additional strong
reference to the slot objects, because these functions no longer do.
Change-Id: I39187e3c441d8f82d50d907731f1cbdfb2a95b9d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 00dbd3cd26d2cf4dbcde3a8f517d0d6b6d0bc9ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is for consistency with QObject::connectImpl() and
QObjectPrivate::connectImpl(), if nothing else.
See the commit message of the QObject::connectImpl() porting patch for
why we leave the function signature unchanged (key-word:
tail-callability).
Change-Id: I515d3be4a5126f9f4738dd7bde5174377faf2343
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ff75ace02d62572be5a8b686b0ea15e909081575)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... removing the custom scope-guard which was .dismiss()ed too early
(the allocation of 'c' could theoretically fail, and the old code
would leak the slot object in that case; nothing we're generally
guarding against in Qt, but it's a nice drive-by gain, probably shuts
up static checkers, and makes readers wonder less about the lifetime
of the slot object).
As mentioned in the patch porting QObject::connectImpl(), leave the
unique_ptr out of the function's signature, see there for rationale
(key-word: tail-callability).
Change-Id: Ib90371b9768a72fd62d080b71eef2c82f851db81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 18857db2dd0ededda0c9a6ba1731327f4121042a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This gets rid of the smell that one destroyIfLastRef() call guarded
against nullptr while the other one did not.
Don't change the function signatures, as passing by unique_ptr, while
making the transfer of ownership clear, makes it impossible to call
the function as a tail-call: Non-trivially-copyable arguments live in
the caller's stack frame and the caller has no idea whether the object
was moved from in the callee or not, so it needs to run the dtor,
which prevents this from being tail-callable.
Passing .release(), OTOH, makes it obvious that the unique_ptr is
nullptr afterwards, so leaves the door open for tail-calling.
However, the QObjectPrivate::connectImpl() wasn't, and continues to
not be, a tail-call. Investigating why, while intriguing, is for
another patch (and much more important for the template wrappers of
these functions than then one out-of-line function we're dealing with
here).
Change-Id: Ib951ed2a2b622d70cb12ddbf01c83ec56b1ce70d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 93382070183ff5a0bf9a09f7f0e8264472888117)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When, like in tst_QFactoryLoader::extraSearchPath(), where asan caught
it, or, presumably, on re-creation of a QGuiApplication with a
different QT_QPA_PLATFORM_PLUGIN_PATH, setExtraSearchPath() is called
with a different path than before, then it would leak QLibaryPrivate
objects in the call to libraryList.clear().
Fix by adding QLibraryPrivate::Deleter and holding the objects in
unique_ptr<QLibraryPrivate, Deleter> instead of as raw pointers. This
statically guarantees we're not leaking these objects anywhere else in
QFactoryLoader.
Change the name of the container from libraryList to libraries to catch
any unported users, incl. in older branches.
Since libraryList is now a std::vector (QList cannot hold move-only
types), statically assert that it was never attempted to be copied or
moved, even in older branches, with Q_DISABLE_COPY_MOVE().
Amends ddba24535fb5732c3cb757414cf1a393bd98f693.
Not picking to 6.4 and 6.3, as they are closed at this point.
Fixes: QTBUG-115286
Change-Id: I6d1272622b12c505975cc72f9aba0d126d2817e2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e60aed5ed000b635d8424f9120249725d9e68c78)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
By the time QObject::destroyed() is emitted from ~QObject(), sender no
longer is-a SenderObject, only a QObject, so calling a SenderObject
member function on it is UB.
Says UBSan:
tst_qfuture.cpp:3854:84: runtime error: member call on address 0x60200000e550 which does not point to an object of type 'SenderObject'
0x60200000e550: note: object is of type 'QObject'
00 00 00 00 e8 3f 96 c9 51 7f 00 00 80 3e 00 00 c0 60 00 00 02 11 00 00 08 00 00 00 16 00 00 72
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QObject'
Fix by removing the QObject::connect().
This, of course, breaks the test's WHEN, but I don't see how to keep
that WHEN without the UB. At least the THEN part is not invalidated,
and there doesn't appear to be another test that tests that destroying
objects before signal emission results in a cancelled future.
Amends 612f6999c81a500a024f128bdf739342d659754a.
Change-Id: I38ca4611c071e8fd200393b600210e36d4030bc6
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 4b0261fed08dc766a7eeeb1e41121f8634e9b8cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It doesn't make sense to disturb users with the policy warning if they
don't specify Android paths. Suppress the policy check if Android
paths are not set for the target.
Fixes: QTBUG-115119
Change-Id: Ice9d0459c01feb505857133bb942b1b6e775e55a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 575b8a7fa289a2e27984a6c322069f9e1b499024)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These pages are designed as tutorials, so
they can be \page instead of \example.
Also, reorganized the tutorials, moving them out
of the testlib manual, into several qdoc files.
Task-number: QTBUG-115248
Change-Id: I2cbd66ecc1082ecc9d3d1742b621ee009daf1031
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 28defcfb78f3f70ad91a43a641012bd914e4e6b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Exclude TUs that cause problems in a build where all of QtWidgets's .cpp
files end up in a single unity_0_cxx.cxx. This should ensure that the
build will forthwith not fail because someone added a new .cpp file in
the "wrong" position.
Of course, this is just a snapshot, with my configuration: GCC 13,
Ubuntu 20.04, -developer-build, C++23, -sctp.
Task-number: QTBUG-115352
Change-Id: I6a445701e2ac41d67a3ec69715b7bf6ed5ec65f7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b91891a76bc2d9b47ba84e9ebefeccd77a76a87e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Exclude TUs that cause problems in a build where all of QtCore's .cpp
files end up in a single unity_0_cxx.cxx. This should ensure that the
build will forthwith not fail because someone added a new .cpp file in
the "wrong" position.
Of course, this is just a snapshot, with my configuration: GCC 13,
Ubuntu 20.04, -developer-build, C++23, -sctp.
Task-number: QTBUG-115352
Change-Id: If33a485b697f60a2f4d6198f0798c953fa47af51
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a07426d23a02bd4029c6576f92fa43d324ff56be)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When we reset the theme so that icons should be provided by the
system theme, then reset the search paths to the system-provided
paths as well. Otherwise we'll keep looking for the system theme
in user-provided search paths, which can't work.
Change-Id: I10bcb404db9924e038f6fdc8970e53bbb69ac7d1
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e1a93b3d9a9f18013b28b4136866a76df11c2ea1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As a drive-by, re-use the result from the first QFile::exists
check.
Change-Id: I6b36b165ba3d1f82c9b4be18d44a671f71e8507e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 510224f4463c2a372b83d91f0daf24a91069a9fe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends a452e2254644ffbed289fdf051eaf41d7e6a3b0d. No new tests, existing
tests fails when QPlatformTheme returns a QIconEngine implementation
that provides the tested icons. However, the existing test fails when
the platform icon engine provides and address-book-new icon, and depends
on the order of test functions, as the name() test function modifies the
global theme name and search path. Fix those issues in the test.
Change-Id: Ie1c1d14f08fad5e906296bab662df5cfacdbbf07
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit cb16ba59804e312ba809cf078c8695c7e6656947)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Extract Method create_impl() with all the stuff that doesn't depend on
create()'s template arguments, which will reduce compile time and
amount of generated code.
Change-Id: I9d8f59c168873ac3527b570ef6142079824061cf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit dc7820a296d58cc61628addd010e28d893d4950b)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Looping over the entries had a typo in it and was quite unnecessary,
as it just made a fresh copy of a list we already had.
Change-Id: I0f3023b06163e5854d425d816e465785cda5fc91
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 07e4015687c52ded043345605b7c9426f1424c77)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If the path where Qt sources are located has 3rdparty in it we skip
headers processing since all headers are treated as 3rdparty.
Use path relative to the source directory when indentifying the 3rdparty
header files using regex.
Fixes: QTBUG-115324
Change-Id: If97328cb9a9ece01d43c56022f4613da9b29c03f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit ea4a3d78a776e10955caf6cf9b1054ddb50f40d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
They have no preconditions and cannot throw.
As a drive-by, merge the definition of isEmpty() into its declaration.
Change-Id: Ifffa0d4cb2a285bb802d39d10a757be9c31cfae1
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 464461dea6cab1808cdba7987e50026289afae56)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use it in QMetaCallEvent, to have some automatic test coverage. Other
code that might benefit has undergone changes since 5.15, so will be
ported one-by-one to avoid conflicts on cherry-picks.
Change-Id: I566bab1803e3675f75a9fdf294a4b0f047d21c11
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c58074b42dcd48a293fe493795d51ca2b101a280)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We were not ref'ing or deref'ing the slot object in the various places
that owned it. So, if, in the end, the QHostInfoResult object didn't
call the slot we would leak the slot object.
Fixes: QTBUG-115263
Change-Id: I45f43756c7589470045d97b59257ccfd85a325b7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 061ab84e98a3457c361287084e0c1e9a396ab197)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Using QT_REQUIRE_CONFIG results in a static_assert if the xmlstream
feature is not available. This is a SiC change, as the user has
no reasonable ways to guard against it.
Fix it by using
if QT_CONFIG(xmlstream)
instead.
This commit amends 7337474d041d7e4a7a33157ebd7d84406ed13966
Change-Id: I0c55e4cff06157743c05a543a092f9be1eb67c2d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 4601717378fb6822226cf4ad1e5e52960bf0a773)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The autogenerated list of overviews was adding the \group command which
included all the groups instead of overviews.
The idea here is to categorize the overviews later on once we have
the list of all overviews.
Task-number: QTBUG-114762
Change-Id: I3cf53886be277abc86b5ec54d399cd6933fbe882
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit 7c2ecfcf2970cdce8aef043deb38aabdc3baffd8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... so that everything that requires argv is done first.
Also introduce a new variable, argc, for sizeof...(Args) + 1.
This will allow us to apply Extract Method to the tail end, which now
no longer depends on argv or Args.
As a drive-by, port from std::array to C arrays so we can use
automatic array size deduction: There's still no such thing as partial
CTAD (certainly not in C++17), so if we wanted std::array to deduce
the size, we'd also need to let it deduce the type; and we don't want
to add an ugly cast to the nullptr). C arrays, OTOH, can deduce the
size while fixing the type since K&R C.
Change-Id: I5a694d4f4d41974eb4b1075ff030bbef902ed492
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 74707948652d1b251b2296ce0b3a515b2ddbcc08)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Like in 9f8449a054a165ae560c91d3e31409bc293df80d, for
doubleProxySelectionSetSourceModel(), the sortStable() test also
leaked _everything_. Fix in the same way, by allocating model and view
on the stack intead of the heap.
With this patch, tst_QSortFilterProxyModel is now asan-, but not
ubsan-clean (and, because of
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110704, asan still
reports a leak in cp-demangle.c, which should be™ gone once we fix the
rest of QTBUG-99563).
Task-number: QTBUG-115264
Change-Id: Ic0e833d7336435e324457f9d9667ee8573a7dafc
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 65647d54b9fddb0b0e3238024d79e12e4bf53295)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Allocate participating threads and objects on the stack, not the heap.
As a drive-by, port from QList to C arrays (never use a
dynamically-sized container for statically-sized data™).
Code predates the public history, all active branches are affected.
Change-Id: If8def658c1c7b505074938d637e78ad2d1f9fd57
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 69d767bec265587a5645a08f14bb7e7540f01867)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Surprisingly, this wasn't mentioned in the detailed description at all.
Users would need to click on the link for the example in the "See also"
section and then read through it to find any mention of how tool bars
are created.
Change-Id: I9db23b475009072f34defab38b6d6200a45f2f35
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 14d10c632bad3346d404271535e6225d226afaa5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Because we didn't handle Negotiate in the "Start" phase during
handleAuthenticateChallenge, we would not emit the auth signal before
our second attempt, assuming the server prompts us for one.
Emitting the authenticationRequired signal is needed for users
to be able to set the Service Principal Name (SPN) option.
Alternatively, username and password if not relying on Single sign-on.
Done-by: Emil Wipplinger <>
Fixes: QTBUG-114559
Change-Id: I833c08dfeda36a6548c5ad6b8af4b8aa9d644c45
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 90af40ccd07fda57f966107c5fd8ffcbd955b384)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Remove a stray qDebug() statement, that was forgotten in the source.
Change-Id: I5c413b4356f05570474fa2a0d6ad661785c818b0
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 31da99954282908fc896989344c4be104ae6e62f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Regression after 585150e3d947d0ee30489f275e7fc39bce4fe059.
(cherry picked from commit 195c893424a386d66cbec01c777e08c54d6af49a)
Change-Id: Ie728904736dd41fb8dfa6ecc9f843beea95b4604
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
std::chrono is still used in the header.
Do not rely on transitive includes, instead include the header
explicitly.
Change-Id: If9140499e5dccf0065a4826831d3b83813910318
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 32d44b612c0e412b10af021c9c6bc911e2f01d04)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
std::chrono is still used in the header.
Do not rely on transitive includes, instead include the header
explicitly.
Change-Id: I2cf5dc275c3272151efd655a4fa85936942c5708
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 7a33a08376a30bb7b788cafc2343378131fd1e8d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Says ASAN:
Direct leak of 524 byte(s) in 1 object(s) allocated from:
#0 0x7f708f0a67cf in __interceptor_malloc ../../../../gcc/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x7f707d94bf9e in CRYPTO_malloc crypto/mem.c:196
#2 0x7f707d7bd248 in asn1_item_flags_i2d crypto/asn1/tasn_enc.c:65
#3 0x7f707d7bd1b7 in ASN1_item_i2d crypto/asn1/tasn_enc.c:45
#4 0x7f707d85b7be in i2d_DHparams crypto/dh/dh_asn1.c:54
#5 0x7f7075a82223 in q_i2d_DHparams(dh_st*, unsigned char**) qsslsocket_openssl_symbols.cpp:435
#6 0x7f7075a82223 in QTlsBackendOpenSSL::dhParametersFromPem(QByteArray const&, QByteArray*) const qssldiffiehellmanparameters_openssl.cpp:139
#7 0x7f708ca9b588 in QSslDiffieHellmanParametersPrivate::initFromPem(QByteArray const&) qssldiffiehellmanparameters.cpp:285
#8 0x7f708ca9b588 in QSslDiffieHellmanParameters::fromEncoded(QByteArray const&, QSsl::EncodingFormat) qssldiffiehellmanparameters.cpp:94
#9 0x55fd8a545ebe in tst_QSslDiffieHellmanParameters::constructionPEM() tst_qssldiffiehellmanparameters.cpp:98
[...]
The pointer returned in the out-parameter of a i2d_DHparams() call is
supposed to be OPENSSL_free()ed by the user (this is not at all
obvious from the docs¹, but an SO answer² indicates that's how it
should be (as well as asan stopping from complaining with this
patch applied)).
¹ https://www.openssl.org/docs/man3.1/man3/i2d_DHparams.html
² https://stackoverflow.com/a/53563669.
Amends 2cf63c71ebe139890526057dcc51b24ea6df6c30.
[ChangeLog][QtNetwork][SSL] Fixed a memory leak in parsing of
PEM-encoded Diffie-Hellman parameters.
Change-Id: I9ed4a26c4676db1c0d54a1945a4fb5014ce568cd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 676087ef1f7cc885d51256ec30e242d972dccb65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A caller of Q(Abstract)NetworkDiskCache::data() is supposed to delete
the returned value, and this caller forgot.
Do it now; better late than never.
Amends feb1afc78290433b0c22b1b3f6d65542eeb5b957.
Change-Id: I1b27663df9ad49e0203172265d224fdb6ec06646
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit bad3b8f78b9eddb9dd5c08d96f9ee8137d98c19e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QThreeWidgetItems that have been removed from their parents (or the
widget) must be deleted manually. The treeWidgetModel() test forgot
that, driving asan nuts.
Code predates the beginning of the public history, so picking to all
active branches.
Change-Id: I139549b0bd8baf4abfb90f926f6290119471046f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 51edc438dd88d3260b6d824a95d4b4782c59fb03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... because otherwise the union can change its alignment based on
the presence of the data128 member.
For example, QtBluetooth explicitly #undef's __SIZEOF_INT128__ in
its removed_api.cpp, which leads to UB without this patch.
Found during API review
Change-Id: Ia17122cc9f3d422530cf722ea528591fce7ab7ff
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0b3c5816c6d6be52918aa51178f03bd760449eb9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The QUuid(quint128) ctor was handing the incoming data differently
from the QUuid(Id128Bytes) ctor. Same was valid for the return
values of QUuid::toUint128() vs QUuid::toBytes().
The provided test didn't reveal it, because it was treating the same
128-bit input value as BE in one place, and as LE in another place.
This patch fixes the test, and updates the implementation of
QUuid(quint128) ctor and toUInt128() method to verify that the
updated test passes.
This commit amends 8566c2db85a6f579a1a0432d0b7621633158e04c
Change-Id: I24edb8ba0c8f7fd15062ba0b2a94ad387c3e98b6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0393fa6bf244c1135a9ed20cba8649687da45b9b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
constexpr functions are implicitly inline
Found during API review.
Change-Id: I94daa0a67336fa99a1465115edb83e545580a78a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit ef4e36aa3c816d9d8d07db412e72821a75de4e40)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The treeWidget member of MainWindow could be initialized before the
body of the constructor, enabling it to be a *const variable.
Task-number: QTBUG-111228
Change-Id: If4a3b04729bc7fa5859ca88183eec376f6992455
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 5651be517a9f25798a051f7dd7548d40381148df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The user might not be aware of, or able to see, the difference between
Unicode's assorted horizontal spacing characters, leading them to
expect their input to be accepted for a format despite differences in
spacing. So treat the various horizontal spacing (other than tab)
characters as equivalent when matching the separators in a date-time
format. Add a test-case that failed before this fix.
Fixes: QTBUG-114909
Change-Id: I3e798d3e5b89adb8e86168ebd3954904b258d630
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 144e10eafbba82d8ac554bbd25afab112482f509)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A numeric field with no digits is Intermediate, since digits can be
typed into it. The testing for this was complicated by the fact that a
sign might be either a sign in the field or the start of a following
separator.
Break out the testing of separator matching at the start of a view.
This simplifies the existing checks for full separator match and we
can use it in the no-digit numeric field's handling to make the check
more robust (matching the whole separator, rather than only its first
character). It incidentally prepares the way for other changes.
Task-number: QTBUG-114909
Change-Id: I5abfccbcae3cba0979b4723c400de038fe2bf324
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 61b2a6f5874275e92e37f4270a1817a4c101778d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It turns out that Darwin's date formatting uses the Julian calendar
for dates before 1582-10-15, when the Gregorian calendar first came
into use (in some countries, while many others continued using
Julian). This leads to discrepancies between the (Gregorian) dates we
pass it for formatting and the (Julian) dates it actually prints, that
are the same number of seconds before 1970.
Previously the QLocale system backend for Darwin already had a kludge
to work round its handling of negative years, so it suffices to extend
that to years before 1583.
Fixes: QTBUG-54955
Change-Id: I70f219b73bf20c0cd63bcda2b0e99042354872ca
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 207954d5f0751c61f8d8b325797a806ef5f8c854)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Commit 8ea27bb1c669e21100a6a042b0378b3346bdf671 adapted the definition
of Q_ASSERT already.
Adopt the same logic for QTEST_ASSERT.
Change-Id: I5a5d0f62df79b18635d3b426a439c35b25d739c2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit d4d600d411333bdfbcd116993ce30abd97b2a9aa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Windows with Qt::SubWindow flag should not have platform decoration.
Fixes: QTBUG-115054
Change-Id: I7111df6057a087080194c1d46e350df839bec437
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 0493504f34c6673e05be630d8096cf2a78a780b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* use nullptr
* use member init
* set ExpandingFieldsGrow fieldGrowthPolicy for QFormLayout, which
makes it behaviors similar on macOS as other platforms
* select first row to make up/down keys works by default
Change-Id: I25d9869d2ca1c7274c2b750aada8270734787546
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit ed1fbc7a88008ddf118556a97f1ee34989151c75)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a follow up to a4ca9e80658bca7dad1529f03c1b59173a6ecf62,
adapting the backing store setters to become proper overrides of
the newly implemented QPlatformWindow::setBackingStore();
Change-Id: Id4f5ff8650ca4e4d3cab1d71d27041c6129bf4ea
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 959a8b3967ac3b6315f5b458628ec5661dfc367e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The gc_sections linker flag was recently wrapped in a
$<CXX_COMPILER_ID> genex to prevent adding it the command line when
using an incompatible compiler.
This causes an issue when generating .pc pkg-config files because
$<CXX_COMPILER_ID> can't be used in the output of a file(GENERATE)
call.
Record the flag in a global property, both the genex-wrapped and bare
forms, so that we can perform a string replacement when generating
the pkg-config file to remove the genex wrapping.
This is not perfect, in the sense that consumers of the .pc file
might get the wrong flag if using an incompatible compiler, but
it's better than outright failing the Qt build.
Distros will be expected to patch the .pc files if necessary.
Note the issue does not usually happen for regular Qt builds because
gc_sections is only enabled automatically for static builds, but for
static builds we don't currently generate .pc files.
So the issue only happens in shared Qt builds where the gc_sections
feature is enabled manually.
Amends a2b6c2f3437bf1779da787e719bea08bc6f28622
Fixes: QTBUG-115243
Change-Id: I3f6bdf86c24ee90b6da04994e458b438cc41fc7a
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
(cherry picked from commit 53b6c88a2529a5767b2f4c6ff91680b93dc5e357)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When converting from an array to a map, we double the number of
elements, spread the old elements out to make one free slot of space
in front of each, and then place Integer values counting from 0 into
the free slots.
The old code contained a loop that would add a strong reference to the
original elements that happen to be containers and thus are
ref-counted in the first place. But this additional strong reference
is not needed: In both cases, detached or in-place, the detach() call
that ensured unique ownership of 'map/dst' will have either directly
or indirectly updated the ref-counts of the elements correctly, and
the following loops just reshuffle the elements in the QList, they
don't create new copies (QtCbor::Elements doesn't by itself manipulate
container->ref, but even if it did, the copy would have increased, and
the assignment of the Integers would have decreased, the ref-count
again). Adding the strong ref without a user then caused the container
members to be leaked.
Fix by removing the loop.
[ChangeLog][QtCore][QCborValue] Fixed a memory leak when an array was
coerced into a map.
Amends ccea34464075759424e61806c7bc98ee3e658670.
Not picking to 6.4 as it's closed at this time.
Fixes: QTBUG-115249
Change-Id: I369c372e91c3f0cfe3c65f9b0ea8507d08fdaf48
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ecab68989e623737f7f930d7b123471ccffbfb95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
earlyConstructedSockets is a QObject, but had no parent and was never
deleted, leaking all the data is holds.
Fix by giving it a parent.
The code predates the begin of the public history.
Change-Id: Ibc5688afd6111e84f591c37e39b6bb618d76c47a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8cb542c2d430ffc5a6d63c404c7e700132e6364a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Qt 6 requires /utf-8 for user-projects by default, but allows users to
opt-out (cf. 0cdcbb40a1f7fe0288698898027717959f4fbee1), so we shouldn't
use non-ASCII characters in public headers.
Amends 97f643faee876cadb36f110ef5a96abf1b68acff.
Fixes: QTBUG-115229
Change-Id: Ieb93ea9f3526e7bcc2e5aeffb5e69c68d10db792
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7a1625abf1648c4161c334a8f497a676fdaf17dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QTest::toString() returns a new[]'ed char array, which needs to be
manually deleted and QVERIFY2() doesn't take ownership of its second
argument.
Fix by wrapping in unique_ptr<char[]>(...).get().
Bug exists since the dawn of the public history.
Change-Id: I19ec09f46ec0ce5eacf1437f62dc625bc9343831
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d3c08df330f615dc3a248fd0c346a5c1ad6e1c38)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Setting the parent of a QObject to nullptr means the ex-parent no
longer owns and deletes the object as its child, leaking it.
Fix by creating a scope-guard to defer deletion until the tests have
run.
This is simpler than the alternatives:
Putting it into unique_ptr would require a new variable name, or a
larger refactoring of the function, because the `test` variable is
being re-used for many different objects in the course of the
function, most of which should not be deleted.
Using QAutoPointer would drag in QtWidgetsPrivate, and the class is
probably not available in all active branches.
Finally, deleteLater() would require reliably returning to the event
loop, which may not happen if the test is run in isolation.
Bug exists since the dawn of the public history, and QScopeGuard is
available in all active branches.
Change-Id: Ib4fcb44b0b68d4ccbcf5af144a18ffb378a72213
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit e667624371613fad17b09d106e2eb80d581e0e0f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QWidget re-uses backing stores created in QWidgetPrivate::create().
The Android platform plugin creates a new platform window, when a
widget becomes a toplevel window. When it is hidden, the platform
window is deleted. The link between QAndroidPlatformWindow and its
backing store is made in the constructor of
QAndroidPlatformBackingstore. When a new QAndroidPlatformWindow is
constructed and the backing store is re-used, there is no more link
between platform window and platform backing store.
This has lead to screen assets not being painted, when shown more than
once.
This patch forces QWidgetPrivate::create() to construct a new backing
store on Android. This way, toplevel windows always have a backing
store associated with it. It adds an assertion to
QAndroidPlatformScreen::addWindow(). That will make e.g.
tst_QWidget::visible() crash without the fix.
Fixes: QTBUG-97482
Change-Id: Ib1b172068b03549df161ab93ac24a273221d5423
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit dbb072eb2838a04e89e34dad686394a496d5de87)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QWidget re-uses an existing backing store. Platform windows depend on
being associated to a backing store, in case they become toplevel
windows. If a platform window gets deleted and re-created each time it
is shown or hidden, it has to be manually associated to the re-used
backing store.
This patch partly reverts fbf0aeea7d3b38ced7a16fcd5c3e2e9b45536292.
It removes Android specific code from QWidgetPrivate::create(), which
has been added to suppress re-using backing stores in the absence of
the new API.
Fixes: QTBUG-97482
Change-Id: Iaa1b7652efa120ec1955914c0383e8ccd8a41429
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit a4ca9e80658bca7dad1529f03c1b59173a6ecf62)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
They have no preconditions and cannot throw.
Change-Id: I9c3020e00cffc84dfc3a14469cbb80557a4df5cf
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit ba95594ea211a045f0e28326a066917a662c89db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I'll be adding docs for parts currently lacking them; fix up the
numbering first, to disentangle from "real" changes to docs.
Task-number: QTBUG-111228
Change-Id: Ia10f212626bf5ca9fab2b6ba6cf02dbd560a2f02
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit e8a68b556cfa7f4e72faecb400db625608bf6460)
Assorted code was iterating from tranCache().cbegin() to
tranCache().cend(), and getting away with it because CoW means
tranCache()'s two distinct returns were referencing the same pimpl,
but let's make tranCache() return a const ref so that these calls are
all accessing the same object (and we get complaints if we do anything
non-const with it via this method).
Axivion-Id: qt_qtbase_dev_linux:SV1685
Change-Id: If43ccf37c2b27837e5462cb4a0eeb07f0045cbfe
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 77d0f3753643fa818c4bef7542f7e5d97812252c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
tst_QThread peeks into QThreadPrivate, which means that a UBSan build
needs access to QThreadPrivate's type_info, for which we need to
export the class.
Amends 268ff00ef50a74ffa58e53c2c8897b7a7319be41.
Change-Id: Ic26df3d323d50b51d369d5f2bd78db7e047b5341
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 22b3eca55dfa409fd5184b033be84f5a600fe283)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's not needed anymore, because the class is no longer part of the ABI.
Change-Id: Idfacc6023288ce603b30ab5aa904106e8c850444
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 3fb0208d4b164f10131aeb48774a099cae4f8415)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Renumber the code fragments to match their order, while adding a
number for the previously undocumented custom method. Add a brief
description of it. Move the createMenus() part up to after it, combine
the createActions() with its (as createActions() is long gone, fused
into it and sharing its snippet number).
Task-number: QTBUG-111228
Change-Id: If0fbcadfa058fc12cbd74ba1897646113bd016b0
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 98765cab974d02ccd364355a44dfeb8e8ef969d5)
This will make the description of the type flow more naturally.
Task-number: QTBUG-111228
Change-Id: I751bdaf420be7afc9cb4925af4f2a94367840605
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
(cherry picked from commit bb69def7d14795b64580ed68cc49ae31bff90340)
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
A few examples seem to have copied and pasted a help action "About
&Qt" that triggered QCoreApplication::quit. This does not look like
best practice. Use QApplication::aboutQt instead.
Task-number: QTBUG-111228
Change-Id: I1887a3c999d752a24c7c4d3cabc4a5d63b29b966
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 3ccf2f8308ba33cab575c22ad2e246b987a3dc0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's really showing how to request a resource and act on its becoming
available. The use of XML to do so is incidental; the use of
networking is central.
Task-number: QTBUG-111228
Change-Id: Ibcf438c7ef3b2464ddfa8b96a79fb15523e4a468
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit e54a7c56677280d9a9eb976dd455085dcce10c40)
Put readBookmark() first of the constituent parts, as it's the most
intelligible (albeit currently undocumented) and gives some clue to
the purpose of readTitle(), which is next.
Task-number: QTBUG-111228
Change-Id: I91d3d6bf8adc3f3001c90274bb62a9da6bf05362
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit b610c7aa89dd6224fbf58983ad8c2a391b2a559e)
... and out of QtPrivate.
No inline API requires it anymore, so move it into the only TU using
it. Can't move it into the unnamed namespace because of the friend
declaration in QFutureInterfaceBase.
Change-Id: I27452960492bc1193a4d0eaeb2acd913d4dd02a5
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit d41db62154dfbf6cb78f6a64e962939a79eec03c)
...when using a Qt cross-built for embedded Linux and
NO_UNSUPPORTED_PLATFORM_ERROR set.
Attempting to install such a project will now give the following output:
-- Skipping runtime deployment steps. Support for installing runtime
dependencies is not implemented for this target platform (Linux, shared
Qt libs, cross-compiled).
Fixes: QTBUG-114069
Change-Id: Idd2af2135d2ca3cc0e5eeafb7701e891f8a0cc25
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7c82a49e6fc4ec606cffa4fa8d3ceb42c87439cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends 5f531ae2ac873c09deda096d292777422c4dee4d
The overload taking QDeadlineTimer::ForeverConstant was required,
prior to making it an enum class, because the conversion preferred
'int'. It was made an enum class for 6.6 and most overloads were
removed, including the one for QMutex, but QRecursiveMutex was
missed.
Change-Id: I4490dd3d7641c06346ea502f10c09915411319ad
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 93fe8cb305791ab0099831361ff1634a047dd13f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old code violated the following principles:
- DRY: the same code occurred 3× in the code-base
- SCARY: the vast majority doesn't actually depend on template
arguments, causing template bloat
Solve both with a tiered Extract Method.
We cannot change the order of the operations performed on
QBasicFutureWatcher, in particular not the connect() to the
contination w.r.t. setFuture(), so we cannot leave the connect to the
continuation lambda outside the function, as it would mean to also
leave the setFuture() call outside.
Thanks to Volker's makeCallableObject(), we can, however, type-erase
the lambda using QSlotObjectBase, which is what connect() internally
creates, anyway, therefore bringing the whole function behind the ABI
boundary.
As a non-QObject, non-QMetaObject friend, we're lacking support for
actually doing something useful with a QSlotObjectBase, but that can
be fixed in the implementation now. The interface is stable, which is
what matters for 6.6 now.
This will allow a subsequent commit to drag QBasicFutureWatcher behind
the ABI boundary, unexporting it.
Saves a whopping 8KiB in tst_qfuture text size on optimized C++20
Linux AMD64 GCC9 builds.
Done-with: Fabian Kosmale <fabian.kosmale@qt.io>
Change-Id: I0e5c2564907d92f6938689ab249be11fc0332ba5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit dfd07205e58d67324a82e5aed0ce7fec63bd9368)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Extract Method non-template customConstructSharedImpl() to avoid
instantiating std::unique_ptr with a different per-F Deleter over and
over again.
Not picking to 6.5 because the function was confined to the
qvariant.cpp TU in those versions.
Cf. 11791e2a50417661679f84aeae21ce959cab638f and
d783363f60173f1bc6525f1a8bbbd87f1e3afc1d for similar issues.
¹ https://www.open-std.org/jtc1/sc22/WG21/docs/papers/2009/n2911.pdf
Change-Id: I73d21d929a7db2ab47f62a3246cf913d82e3db75
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0ecf8a21587e33c5c5b554d5bc059488001c8990)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Register the directory tokenError in the build system to expose it to
embedded devices / for cross compiling.
Do not fail the test function, when a test file isn't found. The tested
functionality is platform independent and will be tested on other
platforms.
Task-number: QTBUG-92113
Task-number: QTBUG-95188
Change-Id: I885d8fdfbbf8ec60e6326bfd871fa85a4390247d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit b476570932dcfc1b32e8405bcdd219c2dcc421f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Different mime types are widely used on mobile devices. For example all
text copied from gmail is copied as text/html type.
After 2937cf91c74b6562bf56e8872dfd2bfaafebb3cc commit there is a
regression that makes it impossible to paste any text different than
"text/plain".
To fix it, any "text/*" mime type should be treat as it contains a text
(not only "text/plain"). That will allow to paste different text mime
types.
During this work also tst_qclipboard testset was turned on for Android
and new test (getTextFromHTMLMimeType) was added.
Fixes: QTBUG-113461
Change-Id: I3ef9476b8facdc3b61f144bd55222898390127c9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit fdccb66a4e9a8b22c881c4775895b7af174b0b24)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit c3c5d2cab07ffed1ddfb7978870c05917d89fa39.
Reason for the revert - it breaks the purpose of the Qt::Uninitialized
ctor
The commit also updates the QUuid(quint128, QSysInfo::Endian) ctor
to avoid the compiler errors:
error: member ‘QUuid::data*’ must be initialized by mem-initializer
in ‘constexpr’ constructor
Change-Id: I0057fab3d7203adaddad3e890129668923a9eef6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f1ffc11e613ebe3132d94937eb60d59c2095e7ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
syncqt uses qt_deprecates pragma to generate deprecated header files
that might live forever in Qt packages. This adds the version argument
to the pragma, that allows specifying the version when the respective
header file should be removed. The new pragma format is the following:
pragma qt_deprecates(<header>[,<major.minor>])
If deprecation version of the deprecated header file is lower than
the current Qt version, syncqt will display the respective warning in
the log and skip generating the deprectated header file.
Also the user warning message now displays the exact version when the
header file will be removed.
Task-number: QTBUG-115029
Change-Id: Ifd7464b8539b8be93b95690fd1ca70ef0b14e436
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4bc0a08bea3c262ebda26163f9271c946c430ff0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amend 813bbc515bdd8af843ef56115711691e926d0bcb. Unclear why this
passed CI, but we can't use implicit conversion of string or character
literals.
Change-Id: I1b3515e42b09a5caae1e632320b8251c27177f52
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 8f3f765dad8757a9307f8b538c0f3af2b7bb245f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We need deduction guides to turn the AtomicPointer template argument
(the pointee) into a pointer:
QAtomicPointer<int> → QAtomicScopedValueRollback<int*>
Extend a test to cover pointers, too.
Fixes: QTBUG-115105
Change-Id: Ib416c6a43e4da480b707a0bf6a10d186bbaad163
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 97ec1d7d8ecb07be20cf43f475067faba04f5aa5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is the result of running util/normalize, dropped some false
positives:
- it removed the space after "d, " in Q_PRIVATE_SLOT(d, foo())
- it removed spaces in moc text streaming of "SLOT(" << ... << ")"
In addition, the tool replaces QPair with std::pair. This is
surprising and therefore performed in a separate commit.
Change-Id: If4e3815d7c0840defc1b82bcbf41a8265acda0d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 25f5983ea8f53aca24eae1cc57a6070c7d07aa67)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
One line is better than three.
Change-Id: Ib738ec18b51accead3897b450b26207b3fba87d8
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit bcf14392df0d83e79e10022112aea7dd91c5a1f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Not adding internal modules to the windeployqt module list makes it
give off nonsensical warnings, and can force the deployment of debug
libraries despite a --release tag. Add them in to prevent this, and
shave off the "Private" part of the module name if it exists to maintain
compatibility.
Fixes: QTBUG-114854
Change-Id: I884fdc495f340ad20ba6257587da170d6c1a1415
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 87bfd3308209c3f859d116c024de1d2c35bf18b3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test was relying on the fact that, having written 1 byte to both
writeEnd1 and writeEnd2 (and ensured those bytes were written with
waitForBytesWritten()), both read ends would be activated by the next
event loop. It turns out that this was an unreliable assumption, because
the processing of that 1 byte on the second socket may not have happened
yet. So firm up by waiting that both read ends are readable before even
creating the QSocketNotifiers we will read on.
I'm not entirely sure what this test is attempting to test. Its
documentation says it's testing a QAbstractSocket condition, but the
read ends aren't QAbstractSocket (this test should have been in
tst_QAbstractSocket if so). It may be testing the condition that caused
that QAbstractSocket behavior, but that wouldn't be a good test.
Drive-by remove redundant flush()-after-waitForBytesWritten() calls.
Fixes: QTBUG-115154
Change-Id: I61b74deaf2514644a24efffd17708f8071f707ed
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 93b87b5cbfae3c50e539f6ec37bd7b95e89e455e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It was hard to see the problem because of the lambda, combined with
reinterpret_cast on the output of non-typesafe C macro. NLMSG_DATA
returns a void*, so use static_cast to be sure not to do something
wrong.
This only affected the code that dealt with unexpected replies from the
Linux kernel, which it doesn't send. So I don't expect this fixes any
improper QNetworkInterface behavior.
Found by CodeChecker.
Change-Id: I61b74deaf2514644a24efffd1770d75e5a4f2636
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 5bcacdbd1aa237cb3d39ffafbe378688a00ea502)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Also prepend a "Error:" label to all strrerror handling locations,
to make it clear where the error starts.
Task-number: QTBUG-101926
Change-Id: I1a781b4c5716636eff4d47a6c8554dcbd51d2697
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 3ba3f322b6b1781cfc1a64be8240b1ae74c36840)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The documentation claimed the exact opposite of what the
implementation did. Since callers use it the way it's implemented, fix
the doc.
Fixes: QTBUG-112895
Change-Id: I74d6259727c7af7265224c6d79ba39265663704b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 258e7ed9fd04c39c14d9365fd7aaeb7ba20e64f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
E.g. the view.layer thread checker problems are eliminated
for some time now. The other mentioned XCode warning is
likely not there anymore with newer XCode. Whereas the
rest (that we pass validation) should be obvious.
Change-Id: I9754077aa6e178ee2b866b64538991412af5bb5a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit f88ac070295c1efacc6b5422e7835c2267fd061a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The title bar height = caption bar height + resize border thickness.
This calculation is used by many open source repositories for quite
a long time, including Microsoft's own famous products such as
Windows Terminal. And if you use AdjustWindowRectEx() to get the
title bar height, the result is also exactly the same, so this should
be the correct calculation.
Normally, when DPI is 96, it should be 23 + (4 + 4) = 31px.
Change-Id: I0a2de3b55d5b62327eacc7e2ff5dc23771b8efdb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 47ee4eae6ad361e9d3a1df4415562ff092de6644)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replace variable names referring to XML "location" with names referring
to XML context.
Task-number: QTBUG-92113
Task-number: QTBUG-95188
Change-Id: If00e92dce237d95fa1850f0b45192995724ba99f
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit f67a497dbe70dd3258997010c286654aaf963d1c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If a style sheet is active, then the palette in the QStyleOption might
be a generated, short-lived, temporary QPalette instance. As QPalette's
cacheKey is based on instance-counters of the private data structures,
it will always be unique for such a QPalette, even if the brushes are
the same as in a previous instance.
(QPalette::cacheKey is just a 64bit integer, we cannot possibly encode
the entire QPalette data in it in a collision-free way, and since a
brush in the palette might contain a pixmap or a gradient we couldn't
even generate an efficient string representation for it. We could at
most cache and reuse QPalette instances based on the attributes in the
style sheet rule and in the base palette of the widget. However, this
seems fragile; it might be an opportunity for future optimization.)
Some styles use the QPixmapCache, with a key that includes the
palette's cache key. The key will always be unique if the palette is
based on style sheet rules, and then we fill pixmap cache with pixmaps
that can never be reused, making the cache both useless and wasteful.
To solve this, generate an empty key if we detect that it is for a style
object that is the target of a style sheet. Return an empty cache key
string from QStyleHelper::uniqueName, which will make QPixmapCache
return immediatey when trying to insert or find an object.
This is not pretty, but it makes the change minimal and low-risk.
Refactoring the respective code paths to e.g. consistently use the
BEGIN_STYLE_PIXMAPCACHE helper macro requires larger changes that
can only be verified visually, and so are out of scope for a bug fix.
This requires changes to code that uses QStyleHelper::uniqueName, as we
need to avoid that other key elements are appended to the generated (and
maybe empty) key. As a side effect, this ends up with code that makes
better use of QStringBuilder.
Fixes: QTBUG-114473
Change-Id: I011aed0885f105cbf1e8c0bc6b94c46df47761a3
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 813bbc515bdd8af843ef56115711691e926d0bcb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As a result of the fix for QTBUG-75214, Qt inadvertently no longer
reads the AND mask that specifies transparency for 16-bit and 24-bit
ico files. This is because it tries to detect 32-bit icons by checking
icoAttrib.depth == 32, but icoAttrib.depth is set to the depth of the
QImage, not the depth of the icon, and 32-bit QImage is used for all of
the non-indexed cases (16-bit, 24-bit and 32-bit.)
This commit instead uses icoAttrib.nbits, which should reliably
determine whether or not the icon is 32-bit. This makes the behavior
consistent with other ico reading software, including Windows.
Also, adds a unit test that verifies correct behavior of icon masks,
checking for both QTBUG-75214 and QTBUG-113319.
Amends 1d128ed1dfbcf49453ada922e54381c37264fde5.
Fixes: QTBUG-113319
Change-Id: I89ac86ff16054c8925fff6afc8c530fa737f8385
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 1079b537396fcf5cd6c50cc8af19b078a50cf547)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The method initialized the tab position with the enum value OnlyOneTab.
=> Change this to the correct initial enum value Moving.
Fixes: QTBUG-115147
Change-Id: I4ce04f0a41dac6e93affd300eb424f4087eb7867
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4b43a329b799f2b5d0fb2f850f03773abc6aa21b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Create the fixed string once and reuse it. Also give a name to the
escape code that's its repeated character.
Task-number: QTBUG-111228
Change-Id: I3d6416070f1d5490ec137e251daff0e1637fb788
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 97f68cd3068587103c8b0a0ccdcd6e61431efc1e)
ASSERT: "size_t(i) < size_t(size())" in file qbytearray.h, line 492
due to info being emptied out completely and then the code does
while ((info.at(0) == '*')
info was empty because the recent fix "that wasn't the function argument
list" would exit the loop with pos at end.
Incidentally, this change fixes the fact that qCleanupFuncInfo was
removing lambdas:
main(int, char**)::<lambda()>
became
main(int, char**)::
which was, well, shorted, but weird.
Change-Id: Ic7e8f21ea0df7ef96a3f25c4136a727dc0def207
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 056bdef045867dad07066351787b2edb771be569)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amend 3e59a88e8968c6cdac788926bec34c259146b6a8, which incorrectly used
isHidden() to test whether the scrollbar is visible or not.
QWidget::isHidden() is only true for child widgets that are explicitly
hidden (or created for visible parents, which the scrollbars are not).
Since the scrollbars are children of a container that is hidden and
shown, isHidden always returns false.
Instead, use QWidget::isVisibleTo, passing the scroll area, as that
tells us if the scrollbar's visibility is relevant for the layout of the
scroll area.
Add a test case for QAbstractScrollArea, verifying that the scrollbar's
size is correctly taken into account when calculating the size hint.
This change revealed an instability in the tests introduced in the
earlier commit: the layout process is asynchronous, requiring event
processing to update the visibility of the scrollbars. Add a call to
processEvents before storing the reference size hint. Also, explicitly
set a style that doesn't use transient scrollbars as otherwise we cannot
control when the scrollbars are shown.
The chagne also revealed an inaccuracy in the QListView test, which
only passed because the width of the vertical scrollbar was included.
We cannot use font metrics results to compare expected width, as the
item delegate's text rendering uses text layouts.
Task-number: QTBUG-69120
Fixes: QTBUG-109326
Fixes: QTBUG-113552
Change-Id: I1f06f9e88046a77722291ac17c56090f8dff7cf3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 8c18a245b0245de20c064cd53d03498088bd57df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QXmlStreamReader accepted multiple DOCTYPE elements, containing DTD
fragments in the XML prolog, and in the XML body.
Well-formed but invalid XML files - with multiple DTD fragments in
prolog and body, combined with recursive entity expansions - have
caused infinite loops in QXmlStreamReader.
This patch implements a token check in QXmlStreamReader.
A stream is allowed to start with an XML prolog. StartDocument
and DOCTYPE elements are only allowed in this prolog, which
may also contain ProcessingInstruction and Comment elements.
As soon as anything else is seen, the prolog ends.
After that, the prolog-specific elements are treated as unexpected.
Furthermore, the prolog can contain at most one DOCTYPE element.
Update the documentation to reflect the new behavior.
Add an autotest that checks the new error cases are correctly detected,
and no error is raised for legitimate input.
The original OSS-Fuzz files (see bug reports) are not included in this
patch for file size reasons. They have been tested manually. Each of
them has more than one DOCTYPE element, causing infinite loops in
recursive entity expansions. The newly implemented functionality
detects those invalid DTD fragments. By raising an error, it aborts
stream reading before an infinite loop occurs.
Thanks to OSS-Fuzz for finding this.
Fixes: QTBUG-92113
Fixes: QTBUG-95188
Change-Id: I0a082b9188b2eee50b396c4d5b1c9e1fd237bbdd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c4301be7d5f94852e1b17f2c2989d5ca807855d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Added a template that we can use instead of rewriting the message for
every policy.
Change-Id: I13cc182244d5f092e3d5677664bc149c6b126da5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 8b4dbce54e5e1bf53a1610ac0010e236fc9b2be9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's a bit cumbersome, but works, in principle, using CTAD.
Task-number: QTBUG-114200
Change-Id: Ib7354180e870a695a978edabf684aedfcf9d9ecc
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit b08ddd2c4ecedccd0bc08e9f2390a7b86ed861f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit c2a92199b57b195176d2a0d68d140d72c1cbfb71
"QLibrary::setFileNameAndVersion: reset the tag after findOrCreate".
This restores the behavior of resolve() and compatibility with Qt 4 and
5, which is documented to imply a call to load().
Do note that if you call load() or resolve() and don't call unload(),
the library you've loaded can never be unloaded now. So don't leak!
[ChangeLog][Important Behavior Changes] QLibrary::isLoaded() now reports
whether this instance of QLibrary has succeeded in loading the library,
via direct or indirect call to load(). Previously, it used to reported
whether the actual library was loaded by any QLibrary instance.
The change to QLibrary::resolve() itself is effectively a no-op in this
patch, because isLoaded() would have returned false, but it ensures that
the implementation does what it says it will do.
Fixes: QTBUG-114977
Change-Id: I907aa7aea8ef48469498fffd176d7a76ae73e04a
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 1ca71cbff0fe28185b4854a162f924af700d57e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This avoids us committing to the QByteArray return value, which is
overkill for short strings. Instead, pull the streaming of the unit
behind the ABI boundary, so we're free to change the implementation to
either stream directly or use SSO'ed std::string.
Change-Id: I10927acb9d64077d9018b667958ca16be218012a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 568ab62185bfa7876db4d8804101a8f946b04898)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The test hasn't failed on Windows for a long time, but regularly fails
on macOS in CI, so replace the entry accordingly.
Task-number: QTBUG-115154
Change-Id: Ib89d15cb9edafad5dd71f6e3f830d03aaeb16331
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 6ee9adc43aef1da47fcd9fee13140af81549e875)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
CMake find modules of third-party libraries may create dependency cycles
in their imported library targets. For example, Conan's Vulkan::Vulkan
is such a candidate.
Prevent an infinite loop when generating .pri files for Qt modules that
link against such targets.
Fixes: QTBUG-95569
Change-Id: I09b4a281930f7c6ce5e8c716fe0ab91e2453a24a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f7b7262f110ee44f649d2c061832de26d1b3ee5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qt_internal_add_tool has the implicit logic that disregards the
previously installed flags and adds new flags that overrides the
exceptions behavior. Add the tool-specific option to make sure
that this won't happen.
Ammends 0f5fbe369b84c422003e24322abc90a1b09520d2
Change-Id: Id149d8d8002390581813475124ba37dd39d56b9b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d4e3d008fe95be309f40e25cb08b0639c926bf76)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QCache::insert on failure destroys the QPixmapCacheEntry, which calls
releaseKey(), which invalidates the key. That's hard to follow, so add
an assert to make it more explicit and prevent future errors.
Change-Id: I9c062ef5a6e34c783c064330c914ce4f9a3f9984
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit ee956824db495c12f51dd0d864e009f0417464d5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old one showed an old XBEL file's content, with trolltech URLs.
Update to match the new XBEL file's content.
Task-number: QTBUG-111228
Change-Id: I2b3bb7d67c6f96b04208fe4b1f9af10055dc0496
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Kimmo Leppälä <kimmo.leppala@qt.io>
(cherry picked from commit acb950c129f9bbaa7864de2a7a507ee870551dd8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old screenshot showed an old XBEL file's content, with trolltech
URLs. Update to match the new XBEL file's content.
Task-number: QTBUG-111228
Change-Id: Idacc31b7786b1e6ed1425857470b1d37227096cd
Reviewed-by: Kimmo Leppälä <kimmo.leppala@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit a028e53fa49c995a7dc06ffaac2be1ebe0923f9c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There was a typo in the code that reads the property.
Change-Id: I6a26899ecc6de800fcfaff6da659a611939753ff
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
(cherry picked from commit 9f016e96564e0472e54514c7ba21c87f87bfd54b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Most links are now https, several have relocated, one entirely
rebranded. Same example in both QXmlStream and DOM forms.
Task-number: QTBUG-111228
Change-Id: Ifbc58dadc834cf51113adb1c82de971a8768ee58
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
(cherry picked from commit 4731cdc09d21050dacaaa66ddd79e50682a476f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously only toDateTime() was tested. Adding a test-case for
toTime() provoked adding full testing for both it and toDate(), based
on toDateTime() tests.
Task-number: QTBUG-114909
Change-Id: I5c24b3869b3deefc36a7125133822e8f41cd24ba
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 95a74de486f377a218adeb44a408c8656426de99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
doc.qt.io was described as Qt 5 documentation; no need to version-limit it.
Task-number: QTBUG-111228
Change-Id: I1c5abe3d805c2b845a74b9fe454c494fa1eff4c7
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 54f65187ec2efb0c28582fbb0320d847556cb3f0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
http is enabled by default if you have threading support, which is true for qdoc. There is therefore no reason to believe that a normal
qdoc configuration won't have it configured, and hence no need to
check also explicitly for Q_QDOC.
Change-Id: I118388fedaa87225ce81a211d361d593da61105d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 9c43bb61349bb73563461819fa02255875c24201)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As happens for other widgets
(s. QAccessibleWidget::parentObject), report the app
as accessible parent for item views that don't
have another parent set.
Otherwise, the accessible tree is broken when
there's a top-level item view:
The application has the item view as a child,
but the child does not have any parent set.
Extend a QListView autotest accordingly.
Fixes: QTBUG-115135
Change-Id: Ie06874681180a30fc6248dc98f80c4158d837278
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6ec35ff8c56222a317b838b6aac390eb6974de85)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's a bit excessive to warn every developer about this, especially if
they are using non-Xcode generators; besides, we are already generating
a bundle identifier if it is missing anyway.
Change-Id: Ib11ad51a0e516e0ea61ad2f7bf499b846bc0b792
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 594b932c589f6ec538240d6b5022298f9abc3e95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Each line with a test function must be followed by a line describing
the conditions for ignoring that test function.
From what I can see, this wasn't explicitly stated anywhere.
Fixes: QTBUG-114825
Change-Id: I1941d6c9a6d56a8374a0c5a99c538cf1eaebd544
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 6b6678bc88e1b53f055b3a7cb8cd30da8ac0e248)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
onExit is called whenever the application exits, i.e.
when the app canvas should no longer be displayed and
the loader/embedder code should take some action.
Emscripten provides two callbacks which can be used
here:
- onExit, called when the app exits (but see EXIT_RUNTIME)
- onAbort, called on abort errors.
These map to the two cases Qt's onExit supports. onExit
is not called when EXIT_RUNTIME is disabled, which means
we don't need the special case for exit code 0.
In addition call onExit on any exception. The second
call to showUi() in html_shell.html is then not needed
any more and we avoid duplicating the UI state handling
in user code.
Update the qtloader_integration test to handle changes in
behavior (we no longer set the error text on exit). Use
emscripten_force_exit() to simulate application exit -
using this function makes Emscripten call onExit even
when EXIT_RUNTIME is disabled.
Change-Id: I72b5463c1836e8d5054e594abbd304fbc67032b7
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
(cherry picked from commit a4d1c30a1b52e797cce504f90bcf20d7943dd1f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Implement the main features of the pre Qt 6.6 loader
as adaption layer on top of the new loader.
Task-id: QTBUG-115049
Change-Id: Iabe860d3fb0488fd003876508787da3688e0c87b
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 20d17b1a3b0e3a17a0ed1214cc21d84d79d3c829)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... instead of Private ones, at the cost of having to befriend of all
the lockable classes, because we need access to their d_func()'s.
This simplifies the code, because we don't need the manual QClass to
QClassPrivate mapping (o2p) anymore, we can just use d_func(). This also
paves the way to make QEventLoopLocker almost completely inline and use
a 3-pointer form of QBiPointer, once available, to hide the bit
fiddling. We couldn't make such a change if the class continued to hold
pointers to QClassPrivate's.
Task-number: QTBUG-114793
Change-Id: Id300e4d45d6cacabe090a46cd6433c5ead3c8b0c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 416e07e0575922323b76e4e7768409b203292837)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The alternative would be to explicitly cast each list.size() to int. I
think using iterators is a cleaner solution.
Drive-by changes:
- Give a std::pair's members better names than first/second, by using a
structured binding
- Port to qsizetype
Change-Id: Icff3126192f9813fba698d5722b209307011ca48
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit c88961bcf4779933457bc8965b1281f83165a12d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Commit c5b816393d1ea88f047ae05568786d54b5bd5f56 ("Get rid of
bootstrapped atomics", 6.5) removed the last use of them.
Change-Id: I53335f845a1345299031fffd176f52293e4b9752
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 7c25358144976d8f7b7d2b56f81782d607bb8cbf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
At the moment labels such as "one\two" are incorrectly
decoded as "one\x5ctwo".
Backslashes were originally excluded after Thiago Maciera's review,
see commit 8f1277da8c137270ff857128d8fea1423d8a7700.
Now Thiago agrees that original reasoning for excluding backslash
was incorrect and we do want to decode them.
Change-Id: I8f13fc678b40a7a9474a0171c50e3e221dfe85c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 25b4bd5841401119c90f2ac1d49b74f2415ec40f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The goal is to use overloading instead of default args that are
non-trivial.
Task-number: QTBUG-98117
Change-Id: I120befcbab2afbfe5894bfffe6a2d882d8efd250
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 71d9ebfb1f9924b81b431150c9722b683150769b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
See: https://lists.qt-project.org/pipermail/development/2023-May/043804.html
Not being an enum class looks more of an oversight, in most places usage
of the enumerators was already prefixed with QProcess::UnixProcessFlag.
This is cherry picked from 22c540a66dbb849bf6b8bf49027cfaf8510ef066, but
much smaller.
Change-Id: Ie37d74e0039d3f65f90af560cb85bb11b77ae20c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 22c540a66dbb849bf6b8bf49027cfaf8510ef066)
The "manual" generation left a trailing comma in the object definition.
This is illegal, as per RFC 8259:
object = begin-object [ member *( value-separator member ) ]
end-object
Hence, the resulting JSON does not get accepted by any parser.
Let's just not do that and use QJsonDocument.
Change-Id: I882486e55f66c52d142638f37584088091bbc123
Fixes: QTBUG-115124
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 04f2acf93ad28848808822c9a8e0479509ec5555)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's perfectly ok to de-inline a function, even an exported one, so
remove the tryLock_impl() middle-man and pull the Qt 7 pre-programming
into the here and now.
Amends 5cea5fc80b9e1b19d620ec6be1acd5cdbd220971.
Change-Id: I7e9626a91d8ebd64e02c3784c74621950da669fb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 508629522d8c6580161a2fd9bfd2fe26f6c4c034)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Testcase appearsAndSort failed when running the complete testcase but
not as single test. More irritating was the fact that the error was in
QAbstractItemModelTester::headerDataChanged() but the affected test did
not change any header nor does it use the blamed model...
The reason for this is, that QAbstractProxyModel emits a queued
headerDataChanged signal when the header item count changes and
therefore only evaluated when the event loop is run.
Fix it by calling processEvents() after the rowCount change in
filterColumns().
Amends 72e802f3b0cc7a0f36fe3c445d401d38af97ca99
Change-Id: I10cb5aa9c40a6925113cc9c23616774bf15784a4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit cdc608359a54a4b286494c1563f3cd94609030c0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The Private class consists of just one quintptr member now, so it fits
into the ex-d_ptr member of the public class.
Since no allocations take place anymore, and we widened the contract
to allow for nullptr arguments, mark the constructors as noexcept.
[ChangeLog][QtCore][QEventLoopLocker] No longer allocates; all
operations are noexcept now.
Fixes: QTBUG-114793
Change-Id: I89699e331711f517d0502392dba106a47ccc9a0f
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit d8a8a3a5dc035c36756c1deb1a9cfe0da9796818)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Example source code should be LicenseRef-Qt-Commercial OR BSD-3-Clause
Change-Id: Ia9cf6f4783fde0e25f72a31bbe6d809118fd4240
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 3040eadd832b8dadaae04660047fdcd42519b0a2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Interface libraries don't build anything, commands that belong them
might not run if nothing depends on an interface library. We still need
to make sure that we run syncqt for interface libraries.
Add '_sync_headers' for interface libraries to "ALL" explictily.
Amends a8cf976ce6c82192bdf2d4b310e9ba0ea75bd0b0
Fixes: QTBUG-115101
Change-Id: I24b34574fdc3060e3a60886620dbe5c1b526f1a7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit d22a696b6623716e0b922d833997582a5c415a19)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Removing dangling references to the example due to its move to
manual tests.
Change-Id: I13f5fad93763d1ef70ddd8b3dcf430b5df8e28f9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d2db1d511ddbc4d676bcd93881e17e42edd37b84)
VCPKG by default does static builds when building for Android.
This is at odds with the bundling-concept, so it should not be done
unconditionally.
Since we don't necessarily have the WrapOpenSSL target on-hand, let's
just do a file-exists test for the one of the paths we would include.
Change-Id: I3693354308d5168d8a9c3d1659bfa51540114b7f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 20d3827ecca29f46ce147d519274942e5ca33263)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
My fault, I had added that bit of the docs a while ago.
Change-Id: I1fa2c10b0f7263e12b5b2a4d18f362c702f9d831
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5eec5a674baadc435ff879225d9a157d135cfffd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
syncqt uses iostream API that 'excepts'. So enable exceptions flags
when building it.
Amends 49ce711796c2f10dfe658cc77b81db1f2d1b25f7
Change-Id: Ib0cd581eaec9ae73edc9de423019098304049463
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
(cherry picked from commit 0f5fbe369b84c422003e24322abc90a1b09520d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Much like QT_FATAL_WARNINGS, QT_FATAL_CRITICALS also is
interpreted as a counter. Revamp both function descriptions
to make scope and purpose clearer.
Also, mention logging rules as a way to surpress output,
in addition to a custom message hander.
Change-Id: I44767abb067a6accd81f13dc549c9787ef9a4729
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 62e3fa28d7610b5b1b5b5b9c3f67423549a3aec6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
CAS failures should result in PAUSE/YIELD, cf. qYieldCpu() docs.
qYieldCpu() is only available since Qt 6.3, though, so adding it as a
follow-up with limited pick-to.
Task-number: QTBUG-115062
Change-Id: Ibcc73881875a47935940015e30b9a27a282054d4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 06d520dbef21f5debe9f092c63d2aa9b02afb4c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The old code first checked for == 0, then, if false, executed a
fetchAndAdd(-1), both with relaxed memory ordering. This can lead to
executions that, counter to what the code comment states, can count
down past 0:
// T1 T2
loadRelaxed() // true
loadRelaxed() // true
fetchAndAddRelaxed(-1) // e.g. 1 → 0
fetchAndAddRelaxed(-1) // 0 → -1
while fatality is detected exactly once, this execution doesn't stop
at 0 and causes further calls to isFatal() to count down further, with
the (very) remote spectre of underflow past INT_MIN.
Fix by using a CAS loop instead, so each count-down uses only one
step, not two, which therefore can no longer interleave.
Fixes: QTBUG-115062
Change-Id: If77b906c94cb4b9fa91bfad84fe63bc8d9103b0a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b933a5668cc5647d26378f8a9a52901d0497585d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Hiding a button in a QDialogButtonBox doesn't remove its default and
focus behavior. Hiding the button shown in the first position, breaks
the focus chain. Tabbing between the button is no longer possible.
This patch implements listening to the buttons' HideToParent and
ShowToParent events. Hidden buttons are removed from the button box
and kept in a separate hash. That ensures focus chain consistency.
When they are shown again, they are added to the button logic and
their default/focus behavior is restored.
An autotest is added in tst_QDialogButtonBox.
Fixes: QTBUG-114377
Change-Id: Id10c4675f43d6007206e41c694688c4f0a34ee52
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit bbb71e7e80f292c2e69faef81b1624832981147e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The change in commit 04ee5795cc31ee81fb0c27bf55d9e8f662995753 was
source-incompatible if the function in question was a non-static member.
I could add a new, template constructor to catch those, but this is
simpler.
Fixes: QTBUG-115043
Change-Id: I53335f845a1345299031fffd176f1071afbae7a9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ef9fe7a99a9a6779e7133167fe84426bfe9cc371)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It was changed from ERROR to XML_ERROR to disambiguate static variables
in d3f8d7fd4140b269532e2daca8eb5cbfe28ed465. Make the change in
qxmlstream.g, so that generating the C++ code doesn't revert it.
Change-Id: Ie51955a2b013ce8d9580ce64f708598f9a103754
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit a982b67538155500269418b9fec81f19ff019510)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The optional-like FastScanNameResult was used to make some previous
changes backport-able to Qt 5.15 (std::optional is C++17 whereas Qt 5.15
requires C++14).
Amends commit 6326bec46a618c72feba4a2bb994c4d475050aed.
Change-Id: I409e1da83f82927c1eb24c47c1414c0c7ab1bf5b
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit effb3bddf63eb6c53d81ce6b0a30be6e3e80e189)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I see this with -unity-build -unity-build-batch-size 32, but I don't
know whether it's unity-build or just Clang 15, so also pick to
6.2. The issue exists in 5.15, too, presumably, but I have no desire
to find a non-C++17 fix.
It appears the generator (glgen) is out-of-sync with the state of its
supposed output as of at least 18aae36a90c0753f1b1e615ba8437d8ebd1bd2fb,
so don't try to update the generator (I failed to find where these
fields originate from, anyway).
Task-number: QTBUG-115031
Change-Id: Ia27620b8f8034c3e8eff383abb849e6ce93dce8a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4443d392e4f234a5315cfd773559af936cb62ddb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
a7deddba519fc1f6fd637496e92ca5daccf6d453 implemented a warning for
disallowed null parameters. A check, was missing, if the argument is
actually null.
This patch adds the missing check.
Fixes: QTBUG-114683
Change-Id: Iecbd636599a28284a0a9afe2987e48552f3658ff
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 634ef449bffad3e97a7141ca6c2df0795407b9fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The class would previosuly produce a crash when the QEventLoop* or the
QThread* were nullptr or if no QCoreApplication existed. We want,
however, the out-of-line constructors of the class to be noexcept, and
for that, they should neither allocation nor have preconditions. The
former is for another patch; this patch deals with the latter.
[ChangeLog][QtCore][QEventLoopLocker] Is now a no-op on nullptr
QEventLoop*, QThread*, QCoreApplication::instance() (was: crash).
Task-number: QTBUG-114793
Change-Id: I4246f74008df6ad7fcbfde56403397b065fbe861
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 3748b194d4de790540aa74db8d65b602e097f415)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Collapse all three Private ctors into one (void*, Type) one.
Task-number: QTBUG-114793
Change-Id: Ia5c67c0ffdcddfdecb38fe3e095d60f6761f1160
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit d18a9dd977a59bf735ed3b6a19e101d4b26a1cef)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Still suffers from a bit of an impedance mismatch, because it's the
first step in making QEventLoopLocker shed its Private, but will be
used in a subsequent commit to DRY more code.
Task-number: QTBUG-114793
Change-Id: Ia14effb6255961edae68eaf941fece9dca0cb844
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8c2c4f178a1722fc8c749ca6ee894df151808138)
We shouldn't try to promote tool targets if they were not created
when Qt6FooTools_FOUND is FALSE due to missing dependencies and
Qt6FooToolsTargets.cmake is not included.
Add a check for Qt6FooTools_FOUND to prevent errors like:
CMake Error at lib/cmake/Qt6/QtPublicTargetHelpers.cmake:257
(get_property):
get_property could not find TARGET Qt6::qtprotobufgen. Perhaps it
has not yet been created.
Change-Id: Ie26db637d4d8ef682a0ada5ea36ef0e8ceced008
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 3f6041a24fe9b663e6a00481a30e84b2cd15763c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Extract Method on the count-down algorithm of fatalCriticals and
fatalWarnings, so we don't have the repeat the calculation and the
comment.
Task-number: QTBUG-115062
Change-Id: I4bcbc2f5a21b999e7f301085581677b437a889e9
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 3ffc1f9775cde1369ebdfcfa91ec18c393c24260)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This environment variable is used by vcpkg to avoid having to pass
the --triplet argument on the command line on every vcpkg invocation
and shouldn't influence the triplet used during build. In fact,
the vcpkg.cmake toolchain will automatically attempt to deduce the
target triplet if we don't define this beforehand.
As a replacement, read from the QT_VCPKG_TARGET_TRIPLET environment
variable. It has the QT_ prefix to make it clear this is not a
standard vcpkg environment variable.
[ChangeLog][Build System] Qt no longer uses the VCPKG_DEFAULT_TRIPLET
environment variable to deduce target triplet. By default we let
vcpkg's toolchain file automatically deduce the triplet to use.
The new QT_VCPKG_TARGET_TRIPLET environment variable can be used
instead, or pass -DVCPKG_TARGET_TRIPLET=<triplet> to CMake.
Change-Id: Idc6cbd52a68578d1762ca175c4973355409688ac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit ee736717d35d10d15e05a8b93255088889f3a9ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When Qt is configured with `-qreal float`, then we should still compare
QVariants containing floating point values with the full precision of
the stored type, and not cast to qreal (ie. float).
Cast all floating point types up to double, which is the highest-
precision floating point type we support in Qt. This might have a small
performance impact when compiling with `-qreal float`, if the FPU does
not perform well with double-precision floating point values.
We don't test any `-qreal float` configurations in CI, so not adding
a unit test for this.
Fixes: QTBUG-114991
Change-Id: I198ec2c39913b501ef2fe99ae3048b160baa1fd8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 1fe60cbcc3c476f5f4bc4bce49d4e73d99c49d3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... unbreaking -unity-build-batch-size 103.
As a drive-by, make the shared function constexpr and noexcept.
Task-number: QTBUG-115031
Change-Id: I2bf30a280eccd896a5aa7de92c72aab30e797640
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 19bfe3e0b111827d6afc9e3602839f3dd0ad37dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Changing the repeating pattern to one that can survive negative numbers,
even if most places it isn't possible.
Fixes: QTBUG-115003
Change-Id: I636e246b00a9dda65c147dff3e1f1d1a748d1879
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 7c6be5e884db0be343fe767683c6b0a8c194ce45)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QIbaseResult turns null into zero when database field doesn't
accept a null argument.
This patch adds a warning in that case. It would be better to return
with an error, but that breaks existing behavior with code relying on
it.
Fixes: QTBUG-114683
Change-Id: Ib50b7b6b4dd6c51489ba8b355f7baa8b1b14dc15
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit a7deddba519fc1f6fd637496e92ca5daccf6d453)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When a table view adds its first row, QHeaderView::initializeSections()
is called. It initializes the vertical header view with the number of
added sections. Subsequently QHeaderView::sectionsInserted() is called
with the same amount of newly added rows/sections.
That leads to the initial amount of sections being 2x the number of
rows added in the first go. In other words, the table view will display
at least one row more than the underlying table model has.
This patch adds an OR condition to the early return check at the
beginning of QHeaderView::sectionsInserted(). The method returns early
if the number of sections equals the number of respective sections
(rows in this case) in the model.
An autotest is added in tst_QTableView::rowsInVerticalHeader().
Fixes: QTBUG-114225
Change-Id: I895444f025591981965562e54e2335391db52357
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 2a1772a6499d440b9ee2435a5f0c22d93b9d8897)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QWidgetPrivate::focusObject() always returns nullptr. That has lead to
mismatches between QGuiApplication::focusObject() and
QApplication::focusWidget(), when a widget got focus by the window
system (e.g. mouse click).
This patch implements QWidgetPrivate::focusObject.
It returns the current widget, if it doesn't have a focus proxy.
If it has a focus proxy, it resolves the proxy chain and returns the
deepest focus proxy.
(Note: It does not return QWidget::focusWidget(), because the focus
widget might not yet have been set, when the method is called).
Fixes: QTBUG-92464
Fixes: QTBUG-108522
Done-With: Liang Qi <liang.qi@qt.io>
Change-Id: Icf01e8ac4fc5f722fbf8e0ca5a562617ae9ae8f2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit f83ea896227dfb37281ca18cdebbd072df3b1da7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Detected with -unity-build-batch-size 103.
Here, we just replace one of the static functions with a lambda,
because the transformed function was far away from the use site while
the unchanged instances (in qhsts.cpp) had several brethren isFoo()
functions and the use was close to the definition.
Task-number: QTBUG-115031
Change-Id: Ib84a64cd8b9f20cad7806659990df76552c0c5e4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 586e07785ce276547d30502a8a44b212d37b95c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amend 9d5a8162a5a168972c7aaf39b130da6a72dc13e2, after which building Qt
for Android locally required an OPENSSL_ROOT_DIR variable to be set.
Instead of making it harder for everyone to build Qt for Android (even
if no intention to work on or test network code locally), downgrade the
fatal error to a warning.
Change-Id: I6f2176a40663cc9f55aa3066af78499af1f20894
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit b3608700f92fb0f4362371a401ec7f3a774fde37)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There's enough space in the LSB of the three pointers to encode the
type.
Saves sizeof(void*) in the Private class, but, more importantly, paves
the way for the next patch to get rid of the Private class and its
memory allocation altogether, turning QEventLoopLocker::d_ptr into
what this patch still calls QEventLoopLockerPrivate::p.
Neither QTaggedPointer nor QML's QBiPointer apply here. QTaggedPointer
only supports a single T, plus flags; QBiPointer supports only two Ts,
and one flag; we need three Ts and no flags. This could be a
QVariantPointer<QEventLoopPrivate, QCoreApplicationPriivate*, QThreadPrivate*>
I'm thinking about it; just would want to find a second use-case for it.
Task-number: QTBUG-114793
Change-Id: I0e21bd8745cc75a9c04b71343c398ad953283857
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit c70257e9b22226f52caade22b085fb6508fb1ec1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qrandom.cpp #undef's Q_ASSERT/_X(), breaking TUs that happen to use it
after qrandom.cpp has processed.
Exclude it.
Fixes: QTBUG-115031
Change-Id: Ie419f4ed2323f9c9e91f4dceaf8fecc097673d0e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 093a0b4f6ee8f31b059ae83e5526d0da037dbd8e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix 'IN_LISTS' typo, should be IN LISTS.
Change-Id: Ia0bd1bf45922b2c9c1779e03b40dad6eab97eef1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f0ae4b07ebb3c86a6bc6ca0e375c06cd51f45324)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Like qlogging.cpp, qdebug.cpp also #undef's qDebug, breaking TUs that
happen to use it after qdebug.cpp has processed.
Exclude it.
In CMakeLists.txt, also mention qlogging.cpp undef's qInfo() and
qDebug(), too.
Task-number: QTBUG-115031
Change-Id: I4c910f051f1578f27cac8e5e6b358e7ee2eeb97e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b8dd99a1b2bc02abd2f0c48c38b336b58d3e0721)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Deprecated Qt header files generated by syncqt were missing in
installation package of Qt, after migration to cpp based syncqt.
Restore them.
Note: we didn't receive bugs since 6.5 release so far. I would check
the existing files and remove them completely in 6.7. See QTBUG-115029.
Fixes: QTBUG-112956
Change-Id: I2e5375ee0dbd87a76135594cd489bb67f6d3456d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 97268742e4869875cb98a1a9fc7884d16d7e7e69)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Non-polymorphic classes should not be exported wholesale. Luckily, in
this case, all SMFs are either out-of-line or (implicitly or
explicitly) deleted, so we don't need to wait for Qt 7 to do the
change.
This is a prerequisite of adding move semantics to the class, as well
as some other optimizations that require non-exported functions.
As a drive-by, collapse ctor declarations into single lines, because a
follow-up patch will need to touch the original lines, anyway, to add
noexcept, so there's no point in keeping separate lines to optimize
the API review diffs.
Task-number: QTBUG-114793
Change-Id: Iccfcc11d37aa9274e48345a1e01e0f827e465644
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 97adda8675dcc9ca380a43d49b6c59fcea734090)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add support for downloading files from the web server
to the in-memory file system at application load time.
See included documentation for usage.
This preload functionality is different from Emscripten's
--preload-file and --embed-file in that the files are
not packed to a single data file or embedded in the
JavaScript runtime. Instead, the files are downloaded
individually from the web server, which means that they
can be cached individually, and also updated individually
without rebuilding the application.
Any file type can be preloaded. The primary use case
(at the moment) is preloading Qt plugins and QML imports.
Task-number: QTBUG-63925
Change-Id: I2b71b0d6a2c12ecd3ec58e319c679cd3f6b16631
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 64007c749703090ebf7f9b1b49b4267bb9993b99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The range of the Latin1 key is from 0x20 to 0xff
in both xkb_keysym and Qt::Key.
Task-number: QTBUG-113387
Task-number: QTBUG-74479
Change-Id: I2eaba3129bead9526910f716c211f637804ab592
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 1652687d34d8e663c53c456b45cf0040570d870d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This points to the location where qtloader should find
the Qt installation when loading Qt shared libraries
and plugins.
The path is relative to the path of the html file which
contains the application, and is set to "qt" by default.
Deployment of the Qt installation to the web server is
left to the app developer, since this depends on the
exact use case. One possible way to deploy is to create
a "qt" symlink to the Qt installation, for instance:
html/myapp/myapp.html
html/myapp/myapp.wasm
html/myapp/qt -> /path/to/qt
Task-number: QTBUG-63925
Change-Id: I76b129dffc75c06ff6bc67d8c20ce12557b32f31
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit d659c93068120474fb433ad55c619c5d52ab7d8d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Don't re-use processEvents() for the case where we
get a callback from the native event loop and want
to send events. This makes it clearer that these are
two different cases.
Align with the Core Foundation event dispatcher where
processPostedEvents() is virtual and is overridden
by the Gui event dispatcher to send window system events.
Change-Id: I3ea9c55c1d9c03195c1937c4dcc0e5b689e15448
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3f8f79ddafc68e2a3e1bdf59355e9a4958f46d12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Surprisingly, CMake copy/install empty directories when `file` or
`install` are used with `FILES_MATCHING PATTERN` argument.
In order to avoid this, we can exclude the empty directories using a
PATTERN EXCLUDE argument.
Change-Id: I17a22f9b9e317bc4a66cee3df39815659ddb4c04
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 86e0c111fd0b9a2c2becb4e37199e9091e883fde)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
because it's flaky in current CI setup.
Task-number: QTBUG-109776
Change-Id: I3e432e632622f47b8125344187daf238a03a7372
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 8b98c0a4c21e16da2da1499bfc67396cb6924e56)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
qt_no_master_include is not used in the deprecated headers since
are generated by syncqt, are never scanned and master include logic
is controlled by syncqt.
Change-Id: If6f737938abe67349c8f88387ccb5efdb95afabd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit afc8260359191b5e5b2f2c0a124e2094c01f7e1a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When a key for a pixmap cannot be generated, then the only meaningful
way to indicate that failure is to return an empty string. Instead of
plastering checks for the generated key being empty all over our styling
code, reject attempts to insert a pixmap with an empty key string in the
QPixmapCache, and fail to find immediately. Such a key makes no sense
either way.
[ChangeLog][Gui][QPixmapCache] Trying to insert or find a pixmap with
an empty key string now always fails immediately.
Task-number: QTBUG-114473
Change-Id: I15bf8064ac7a4fe715722d98f2df2b8608809c7f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 79abdd3cd496b472f0a6140fcf94e68ff79fda2b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The `qvk_sampleCounts` variable is defined in `qrhivulkan.cpp` as well.
This causes an issue when building with unity build. To resolve the
problem, I renamed the variable in `qvulkanwindow.cpp`.
Fixes: QTBUG-114918
Change-Id: I0b38c6b3e30792dd6f770d4dea8cb4c7789961d1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit c90cc8c900b81eb75ba443e2be7a01d4a946fe70)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Apparently, in unity-builds Q_ASSERT does not always compile its
argument, so I'm getting -Werror,-Wunused-variable on Clang 15.
Fix by adding [[maybe_unused]].
Amends da0f72ebb817bb9c92c7a183b281d8a4bf31a135.
Change-Id: I2de810aded1226ce4e5651de8c2e9464de3f274f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f71f0312d66c4e937c7ce13972617c393e96cabb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add scripts which generates Qt plugins and QML imports
preload lists, for use with the "preload" functionality
form qtloader.js.
The preload lists downlad plugins and imports from $QTDIR/
to /qt/ at application load time, where $QTDIR is configurable
using the qt.qtdir qtloader configuration property (set
to "qt" by default).
Sample directory structure:
app.html
app.js
qtloader.js
qt_plugins.json [generated]
qt_qml_imports.json [generated]
qt -> /path/to/qt [symlink]
The json files are generated by the scripts in this commit.
app.html configures qtloader.js to use the json files
as preload lists, which instructs it to preload from
"qt", which again is a symlink to or a copy of the Qt
installation.
Task-number: QTBUG-63925
Change-Id: I53bd197f22057dbb70e9a9bee43b9d9b969aa072
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit be7b748b7e049a4e42611f3e5f920a568348ff15)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Adding the "assets:" prefix to BaseName leads to wrong names returned by
QFileInfo{"assets:/path/to/file"}.fileName().
Instead to return "file" it returns "assets:/file" which is not the
expected result.
Fixes: QTBUG-114576
Fixes: QTBUG-114219
Fixes: QTBUG-112261
Change-Id: I574bf325300c0aedef68b1b183fa837144ad63c6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 76619eae4c4e857721529c87eb3c9d519fa2f0b7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There is no guarantee that it will return 0 after one call
to sendPostedEvents(), since more events may have been
posted during that call. This can in turn cause infinite
looping since the wait() isn't called.
Move sendPostedEvents to the top of processEvents()
to make sure we send events before waiting, in line
with the implementation for the other event dispatchers.
Fixes: QTBUG-112893
Change-Id: Iba7d87cf1c08cd302884782cb135d758afeb9e4b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 9c9aca3b4393a1f1c8169c7b811e46ec5de25df9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The default for showsHiddenFiles is NO, so we were not showing hidden
files unless the user toggled them via the keyboard shortcut.
Change-Id: I796144452cf8f5a6cc46f1ba6747affcd0a35879
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit bc648641209ff598687ae9bcf88cd40d8aaf8847)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In our NSOpenSavePanelDelegate we respond to panel:shouldEnableURL: by
checking the file dialog's filter options. As part of this, we pulled
out the file's attributes using [NSFileManager attributesOfItemAtPath:],
but this API triggers the TCC (Transparency, Consent, and Control)
machinery to ask the user for permission to access the path in question.
We could replace the directory check with fileExistsAtPath:isDirectory:,
but this would still leave the checks for writable/readable/executable.
Luckily for us, the plumbing for QFileInfo uses lower level CoreFoundation
APIs that don't have these issues (except for isBundle, which we should
fix separately).
This also means we can remove the custom isHiddenFileAtURL helper, as
it was based on the same kCFURLIsHiddenKey as the QFileInfo plumbing.
Fixes: QTBUG-114919
Change-Id: I9ebefaeb1ef7bcc5bb9a1c5cd4b993ce230cf506
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 90345459fce8ae9ca58ca2279ea50129ad14e287)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In our NSOpenSavePanelDelegate we respond to panel:shouldEnableURL:
with YES if it's a directory or symlink to a directory, which matches
the native behavior.
But the panel has a special flag to treat bundles as directories instead
of files. We were checking this flag, but ignoring the case where it
was actually set (which it normally is not), and as a result would
go on to filter directory names as well.
We now handle both cases, and only call [NSWorkspace isFilePackageAtPath:]
if needed (when the treatsFilePackagesAsDirectories flag is not set).
Change-Id: I2b9a16ff99b4b643389acc042c032813f432ac59
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 8fbce6b4a04ba9712e45340afc9b52fe2966f125)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The warning has been reported by users, but never observed in CI, even
though the only path that can lead to the last return statement becoming
unreachable is very common in Qt: if a QDebug stream operator exists,
then we always return early.
Nevertheless, rewrite the code to have a single return statement.
Task-number: QTBUG-112371
Fixes: QTBUG-114944
Change-Id: Iaf9ec683ceceedb00771fb0743a09dcc8f50ba3f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
(cherry picked from commit cf5da333672516921eddb4b3ba020d39b0a169d6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We want to pass the QPointingDevice* because we've already identified
it by its "system ID" (xinput device number). The other versions of
handleTabletEnterProximityEvent and handleTabletLeaveProximityEvent
try to identify the stylus by only its deviceType, pointerType and
unique ID, which can go wrong if there are multiple tablet devices and
the unique ID is not provided (as with N-trig and Wacom tablets being
used at the same time). Anyway this fixes a TODO comment from
6589f2ed0cf78c9b8a5bdffcdc458dc40a974c60
Leave a "deprecated" comment by the QWSI functions that should not
be used.
Task-number: QTBUG-104878
Change-Id: Id9f19c60b54b7900b02d5f87b5d12f9a9189721d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1a49eae776f1c40b5e22f668e30107ccbde0238b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The lack of 0x adornment made hex confusing. `xinput list` shows device
IDs as decimal, and device IDs appear in decimal in some categorized
qt.qpa.input.devices log messages, so let's be consistent here too.
Also fixed one more that was inconsistent in that category:
"scroll event from unregistered device <x>"
Change-Id: I98a39b30b1bc030611d3cfe9dd5e95886faf48ff
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit a6059cebe85c4ba8dd43df8aae146799c8bb6cb0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When QXcbConnection::xi2SetupDevices() reacts to a device hierarchy
event and re-discovers an already-known slave device, it doesn't call
xi2SetupSlavePointerDevice() again. I.e. it won't attempt to add it to
m_touchDevices or m_tabletData because it was already known. So it
should not clear m_touchDevices or m_tabletData either, but only remove
the touch devices that are known to have disappeared. Tablet styli
normally come and go from proximity, so it's ok to avoid deleting the
corresponding device data.
Also fix some other failure cases after testing hotplugging more with
tests/manual/inputdevices: there should be no crashes, no duplicated
devices after plugging (although the QAIM might have a bug that makes
it look that way), no leftover instances after unplugging.
Amends 2a9d93efc68324ce5e41831ea46a3945f1c4531d
Fixes: QTBUG-114334
Change-Id: I30f5e532f7dd3a465d56ecdd34d893cbadbf0453
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a8a75d2c4b0f50f4029aac76d09657d8bbab1295)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
`QVariant::convert` may lead to crash or produce garbage data when
attempting to convert a gadget between a pointer type and a value type,
for example from a variant holding a QLocale gadget to a QLocale*
pointer and vice versa. Similarly, `QVariant::view` may crash under the
same conditions.
The reason is that conversion is implemented through copy construction
assuming that both source and target types are either both pointers or
both values. If converting from pointer to value type, the result is
crash during destruction of the QVariant. If converting from value to
pointer type, the result is a QVariant holding a pointer to garbage
data (and possibly crash if pointer is dereferenced).
Similarly, if attempting to convert a pointer to a QObject derived type
to its value type, the system crashes, with a slightly different failure
mode. During `QVariant::convert`, a temporary `QVariant` of the target
type is created. Since objects that can not be copy constructed are
invalid for `QVariant`, the temporary is left empty without constructing
the target value. Then, when attempting to convert from a pointer type
to a value type, the temporary's destructor is incorrectly called on the
owned object. Since the owned object is never constructed, this leads to
a crash.
The proposed fix is to return false from `QMetaType::view`,
`QMetaType::canView`, `QMetaType::convert`, and `QMetaType::canConvert`
if the target type is of different 'pointedness' than the source type.
After this fix, converting and viewing gadgets and QObjects behaves the
same way as primitive types and core types, which already returned false
when converting between value type and pointer type.
Fixes: QTBUG-114797
Change-Id: If5ad764a60f2f3c912070198073b28999d995f17
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit a8792feaaaeefbaba6c7a35468d6d5a166abf8f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Make sure that QT_ANDROID_DEPLOYMENT_SETTINGS_FILE is expanded
correctly and completely when using it in custom commands.
Task-number: QTBUG-114888
Change-Id: I87c9cb052ea6afedd129fec0a1c415ad38e8eeb5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 0be35f3a7bb97bacf7ddd47729f2f97dcf750b80)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We want syncqt to be built optimized by default. The current approach
set the default build type for the external projects and optimized
flags for the non-configure-time syncqt build. The problem is that
syncqt still have compiler flags littered by either the Qt configuration
type or the system defaults that are applicable for RelWithDebugInfo
configuration(the default one we chose for syncqt).
This patch makes sure that we cleanup all compiler flags from any
optimizations and apply optimized flags for all configurations. Also
we discard '/RTC1' flag if it's set. Configure time executables now
respect the language related flags that are set in the project and
adjust the flags passed to try_compile.
For linker flags we should use those that are applicable for the
preferred build type. Since syncqt is built in RelWithDebugInfo
by default we should replace linker flags in all configs with
those are used for RelWithDebugInfo configuration.
Fixes: QTBUG-114925
Change-Id: I782f81a36f5ef7ee4d342ce8ac6c217cb2552f3b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 49ce711796c2f10dfe658cc77b81db1f2d1b25f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The check_language macro spawns a new cmake subprocess to detect
availability of a language. We use that to detect availability of
the Objective-C/C++ languages when targeting Apple platforms.
That's problematic because the parent process CFLAGS / LDFLAGS env
vars influences the result of the subprocess compiler detection,
and in some cases that can fail the detection.
An example of that is passing iOS specific flags which then get
mixed with the default macOS flags added by CMake, resulting in
a linker failure.
Instead of using check_language, explicitly enable the Objective-C
and C++ languages when targeting Apple platforms because we know
that we need them for compiling Qt.
This avoids the issue because enable_language is not spawning a
separate cmake sub-process and thus passes more information to the
underlying try_compile project to ensure a successful check.
The change also means that CMake will error out earlier in case if the
Objective-C compiler is not found, which was not the case before.
Fixes: QTBUG-114470
Change-Id: I1a16c1e5828dfe10b2d7da27cc9a8c787517ab8e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@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 961ff0cc8a7408f59b2d0f9adfa980fd89bd3274)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Homebrew offers a formula for `vulkan-headers`, which does not include
the MoltenVK headers. MoltenVK does include the vulkan headers, but if
someone passes the vulkan-headers path to CMAKE_PREFIX_PATH, then our
module cannot pick up the MoltenVK headers. Brew's MoltenVK
installation is a bit odd as well, as in, one needs to point the
CMAKE_PREFIX_PATH to `HOMEBREW_PREFIX/molten-vk/libexec/` instead of
the directory head.
Change-Id: I933faeb16b3f54597e3a0af0af584d79b3c0a344
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f1db0ca2518bc4e3e4740f46a41c37715db14b4f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I added the ability to use `-no-unity-build`, and included the
batch size in the config.summary as well. In addition, qt_feature is not
being used for `-unity-build` anymore.
Change-Id: I4a10e03d3505336d2256280ed2854ec0425df47f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit f607e22d59e970f5016141ee4e70c834e64658dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To maintain flexibility in how we store the features, we
introduce accessors through indirection rather than accessing
the property directly.
Made as response to API review.
Change-Id: I3e5d4ddabe93f67796af4626fddefe028ded9888
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 17f8e2c441f2302f1df19053208f77f7fb60e1f1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The button state from windows when we use GetAsynckeyState() provides
both MK_LBUTTON and MK_RIGHTBUTTON at the same time. This creates an
issue when we validate only with single state to determine
DRAGDROP_S_DROP operation.
Normally, The MK_RBUTTON will be delivered when we have long press
during drag. But sometimes (no definitive reason identified) the key
state from windows contains both the key state (MK_LBUTTON | Mk_RBUTTON)
during drag and drop operation with touch.
This patch set fixes the issue by validating all key state instead of
a particular state.
Fixes: QTBUG-112995
Change-Id: I67bf5f4956b68279ecc5fbeca8e8e7aef46d0482
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 3902fb0438d946a466b67f2b82ba8779c731e55d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For non-native dialogs we set the clicked button before calling finalize,
which emits finished(). We did the same for custom buttons in native
dialogs, but for standard buttons in native dialogs we deferred it
until QMessageBoxPrivate::helperDone, which meant that during the
finished() signal the button was not set.
We now set the button as early as possible for all three cases.
Change-Id: Ifdbaa9a25105fef0bb56dd28caee9af55cd74e67
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit cd9ae49962bbadf20c4b6599187b5a1bb0d8dc8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... and collapse adjacent C string literals.
Both QStringBuilder and non-QStringBuilder builds have no problem
resolving an operator+ for char[] and QByteArray, so there's no need
to turn the char[] into a QByteArray using the _ba UDL first.
It just causes pain because not all active branches support this UDL,
so remove, to bring this code in line with what the cherry-picks to
6.2 and 5.15 must needs had to use.
Amends 6326bec46a618c72feba4a2bb994c4d475050aed.
Change-Id: Id3d61483729c51c82f58b826efcc8fc7960c3ccd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 3bc3b8d69a291aa513d2d120c8ef46f968f1efdf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This class doesn't exist on MSVC, so the inline functions didn't
become part of the ABI, so it suffices to only export the two
out-of-line functions.
Task-number: QTBUG-104164
Change-Id: Iedf8b0b1882802db53406942d7ac2a27e7ddfa23
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b249a8ab3ab68ee4e823f5cf32d9d742bebe1cd1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If an application runs on a macOS or iOS version that introduces new
permission statuses that we haven't accounted for, we don't want to
crash.
Replace Q_UNREACHABLE with a warning and Qt::PermissionStatus::Denied.
Change-Id: I063042f510caaa8936742f6195bd455d09c4d9ee
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 993cbef7f41446b550c28fcbb30c5c4a5b40d19f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The feature allows to not use OpenSSL in QCryptographicHash
implementation and removes OpenSSL from dependencies of QtCore if
disabled.
Fixes: QTBUG-114783
Change-Id: I2a49fa9ddfa5acedcfc95a3330fd7863a8052a5c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit bacb04d77b064d1f348d310b5b57aeebe93f590c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Similar to the isEmbedded() case, when the parent of a QWindow is a
foreign window, created via QWindow::fromWinId(), we don't have a
QNSView parent that will handle mouse enter/exit on our behalf.
Longer term we probably want to fold this case into the isEmbedded()
case, but as that function is used other places too this requires
some more research, so for now let's fix hover events.
Fixes: QTBUG-114605
Change-Id: Ib61aefc84ed080417a6820a4a365555424b208be
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 21f3a6d8c5dc737c82cdc02c5debb6cf86894d98)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For now we do not have a QCalendarPermission::AccessMode::WriteOnly,
so we have to report Qt::PermissionStatus::Denied.
Fixes: QTBUG-114864
Change-Id: I94e92912ef4c24adb524ccf2cf28553115d6781b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit 2736e908e9da05ed8a03a8f163237ec68606e1a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
CTFontDescriptorCreateMatchingFontDescriptors has been observed to
return nullptr, so we need to handle that explicitly.
Fixes: QTBUG-113698
Change-Id: Ic9fa574c14068fcae98fe8e6ceddd8a4f7008210
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9526a7693604c5513a08a4ab08c0c691c3003f39)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since qt_noop() is supposed to be a no-op, it should not affect
constexpr'ness and noexcept'ness of functions and expressions it's
(indirectly) used in.
That requires that it be constexpr and noexcept itself. Add the
keywords, but guard against use from C. We can't use our Q_ macros
(which would enable noexcept for C, too, on some compilers, because
qcompilerdetection.h depends on qtnoop.h, and we don't want the
circular dependency.
Change-Id: Ie5441c423b7942a6c956345126fc7aec99907d25
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7bad2902f84a44da00a8cbc8e3acbec3b26c6866)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A class-level [[nodiscard]] used to be the only way to get a waring
for code such as
QMutexLocker(&mutex);
with original C++17 means. This was because a few of our compilers
would warn about the presence of [[nodiscard]] on ctors, which is
really the semantics we want: we don't want to prevent users from
passing QMutexLocker out of functions and users of those functions
from ignoring the return value, if they so choose. That should be the
choice of the author of the function returning such types, not ours.
So QUIP-0019 makes class-level [[nodiscard]] conditional on proper
rationale in the user docs (or the commit message in case of private
API). Since none of the existing uses really strikes this author as
particularly convincing, remove them all.
All these classes have gotten Q_NODISCARD_CTOR on all their ctors, so
we continue to provide the same true positive warnings, minus the
false positives when returning from functions, at least on the
majority of compilers (and it's not as if all compilers interpreted a
class-level [[nodiscard]] as a trigger to warn on the initial example
of this commit message).
Task-number: QTBUG-104164
Change-Id: I163356486e7c80f9d69bf67023010a88233fe662
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 01e1dc273d0fd95e4e4f57ae0af1862196f72bd6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Map QNetworkError::HostNotFoundError and QNetworkError::ConnectionRefusedError
to ProxyNotFoundError resp. ProxyConnectionRefusedError when it originated
from the communication with the proxy server.
Fixes: QTBUG-68821
Change-Id: I21b91f2667ba0cd329d4ece1fe543472cdab2d22
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 69de333e1fbb3b866ab77a9d6a4ad26d0796633b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously, Qt would always ignore user's custom QSurfaceFormat
settings and this behavior makes user have no way to control
the preferred OpenGL version when running on WASM. And after reading
the wasm platform plugin code, I don't see any reason why we should
limit ourself to the default OpenGL version. And I've tested this
patch locally, Qt still work normally if I set a newer OpenGL version.
Change-Id: I0cfb831d6a722fe61cc85808a6d9e3098c73d82e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 33a9cbef657d598589500d2eecea192b83f79b3c)
QGtk3Theme uses the GTK button foreground as a default for the
WindowText color role. When a GTK3 theme has no specific color for the
entry text, this can lead to text on certain assets looking darker
and thus disabled.
This discontinues usage of the button foreground for the window text.
Finding the WindowText color role in QPlatformTheme::SystemPalette now
follows the following logic:
(1) GTK normal entry text is used if specified. This is the preferred
option, copying GTK behavior.
(2) If (1) is not specified, the GTK default text color is used, making
WindowText equal to Text.
(3) If neither (1), nor (2) are specified, the WindowText color role is
taken from qt_fusionPalette, where it is also equal to Text.
The SystemPalette is used as a default template for all other control
or widget speicific palettes. The rules above therefor apply to all
screen assets (unless they use a JSON file to specify a their
individual WindowText).
[ChangeLog][QGtk3Theme][SystemPalette][WindowText] Default to GTK
Entry Text / Normal Text / qt_fusionPalette
Fixes: QTBUG-114600
Change-Id: I4c96ac7d096526faf4c2feee436753990c6c9f92
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 574a47dd5a89e7cecf4fbf592dd0d5b216c3b0a6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Explicitly check that at least CMake 3.21 is used when building Qt or
when using Qt in a project.
This only affects macOS and iOS builds.
We check for 3.21 instead of 3.21.1 as described in the documentation
to avoid an error like:
Policy VERSION range "3.21.1...3.21" specifies a larger minimum than
maximum.
Until the technical limitation is addressed, if someone does end up
using 3.21.1, another existing check for "unsuitable" cmake versions
(as opposed to minimum required) will let them know they should use
something newer.
Amends 1cf3295cef321c9a587af2f2de7740c0cd3ca743.
Fixes: QTBUG-114869
Change-Id: I2a479baaa63cfbe23af187cf0796e1c00042692b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 9ef864f56f1a049237f599b65684fa6d5ce06f55)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Pins the vtable to a single TU and therefore prevents duplicate
vtables, -Wweak-vtables warnings and false-positive dynamic_casts.
This requires exporting QGenericRunnable, which hopefully won't
also export the nested class.
Task-number: QTBUG-45582
Change-Id: Ie1f29d25b0dcdee7654c33c497e8e0350d12e311
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit be1b589cb9f147762a5a73d2b3a44778b7ae7502)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Mobile Safari generates touch pointer events with negative
pointer id's, which causes processTochEvent() to skip
the event instead of synthesizing a mouse event.
Ensure that the id's are always positive by taking the
absolute value of the event.
Change-Id: I1514329dc76ecc4b9103f7deca9642aaf304df8b
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 7a31911b795a3d07c6cba3af8436c3a38673689e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Newer msvc gives C4309 warning for 'initializing':
truncation of constant value
Warning would go away if we had 'enum foo: unsigned'.
Disable the warning for problematic enums is not enough
as it also complains about headers coming from windows sdk
like:
C:\Program Files (x86)\Windows
Kits\10\include\10.0.22621.0\shared\wtypesbase.h(395): warning C4309:
'initializing': truncation of constant value
Note 10.0.22621.0 is the latest sdk already.
Do not disable language extensions for header clean target.
This reverts commit 8bf602518d8440542329d867c1a710b66ae12c36
Task-number: COIN-1059
Fixes: QTBUG-114931
Change-Id: Ifc3883f88a6bd52794a37dc640eca99c158a40e0
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 2dcc30592bccd2e6990b25b89490f3c1fe293d78)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Behave identically to Vulkan, i.e. create a view that spans all array
elements. (except when the range is set)
This becomes relevant with multiview, where the depth/stencil attachment
the render target must be set up with a texture array as well, similarly
to the color attachment. But applies even to D3D11, even though it is
not common to use a texture array there, but it's possible.
Task-number: QTBUG-114896
Change-Id: Ieda8475500b0553f8c14aa9ecad57001b9714d49
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit e126558b9b4d4bf8f06ed7bf84dcfe3922801663)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We were storing the DPR as int; change to qreal.
Task-number: QTBUG-114175
Change-Id: I7dc7df82f584cddbbb3f690f1df74e7a30369ab2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c0e48ed645f68e714e982064540d710676a0738b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Made this change because there was no example of the interaction
between QBindable and non-bindable properties.
Task-number: QTBUG-114689
Change-Id: Ief7662f8af5e6fab32491418fa35f0daa937819d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 19b0800555e7850682a6556c0569e1e2ea963c79)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When moving a window with keyboard shortcuts, popup menus currently do
not follow along. Allow this to happen by accounting for a window's
transient children, and moving them after the owning window has finished
its move.
Fixes: QTBUG-106483
Change-Id: Id51a7c0163e4fdd2d139565f2bf500a3fc997488
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 530d092eae0579bbb88e95f853715cac214da636)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use the new argument to bundle the OpenSSL prebuilt libararies so that
ssl operations are actually tested at runtime.
Task-number: QTBUG-110025
Change-Id: I0d73fed463a1724a9e0ee84ba603aa2ff1bc649b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit f667445006c52f26103540ae18964a0015a297db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The new argument would allow bundling the prebuilt OpenSSL libs
into the test apk so that SSL can actually run. It expects the CMake
argument OPENSSL_ROOT_DIR to be set ( we set that in Coin configs).
Task-number: QTBUG-110025
Change-Id: I4c82796635ca89f5511255ae26182f41a504b026
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 9d5a8162a5a168972c7aaf39b130da6a72dc13e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replace const char * based connect statements by modern API and remove
'_q_' slot prefixes.
This requires explicit disconnection in the destructor -> add.
Replace bool traps for layouting and removing buttons by enum classes.
Replace if/elseif event handler by switch.
Replace iterator typedef with auto.
Encapsulate logic to ensure defaulting to first accept button in a
member function for better readability.
Remove dead code.
Move private header declaration from cpp to a new _p.h.
Task-number: QTBUG-114377
Change-Id: I8a2bc355e3816c3c826c10cd96194c89bf0ae510
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit df735d794fd2e545c18b9e345e833422bcd64329)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There are two temporaries, reply.arguments() returns a temporary QList
and list.at(0) returns a temporary reference to the first element. The
local reference variable would only extend the lifetime of the temporary
object it's bound to, list.at(0), but not the temporary list itself.
Even though this a false positive in this case because QList is
implicilty shared, the compiler can't tell the difference and the fix is
simple.
tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp:1845:21:
warning: possibly dangling reference to a temporary
[-Wdangling-reference]
1845 | const QVariant &retval = reply.arguments().at(0);
| ^~~~~~
tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp:1845:50:
note: the temporary was destroyed at the end of the full expression
‘QDBusMessage::arguments() const().QList<QVariant>::at(0)’
1845 | const QVariant &retval = reply.arguments().at(0);
| ~~~~~~~~~~~~~~~~~~~~^~~
Change-Id: I03d54b56769cbd0f9f1165e4679ec4947267181a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3a9526468c134b68b64b9a3bb6278d47c266e381)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So no-one 'fixes' the test by pinning synchronizer.futures() into a
named variable or collapsing the two lines into one. Both would break
the premiss of the test.
Amends e8dcbaaaf61ee2164db61e70a5d61d7a5b849371.
Change-Id: I7a98c382a7db0bf3ff369dcaf61af0942796d6a3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 70a7a695fdbaccd042aa4371cbb231ced2d9b499)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Vcpkg detection is enabled by default, but we did not have a flag to
disable it, and it was not showing up in config.summary either. By
adding a -vcpkg flag, we get to use `-no-vcpkg` when necessary, as well
as adding an entry to config summary indicating whether vcpkg is in use
or not. Besides `-no-vcpkg`, one can pass `-DQT_USE_VCPKG=OFF` to cmake
command in order to disable the automatic vcpkg detection/integration.
[ChangeLog][configure] vcpkg detection, and integration can be disabled
by passing the -no-vcpkg flag to the configure command, or by passing
`-DQT_USE_VCPKG=OFF` to the cmake command.
Change-Id: Ide8da70a7b473ec23995104d162356e75e6d1240
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b3f27f75b638c6eb8494d681cd4df50dd34bcac0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This fixes a crash while parsing an XML file with garbage data, the file
starts with '<' then garbage data:
- The loop in the parse() keeps iterating until it hits "case 262:",
which calls fastScanName()
- fastScanName() iterates over the text buffer scanning for the
attribute name (e.g. "xml:lang"), until it finds ':'
- Consider a Value val, fastScanName() is called on it, it would set
val.prefix to a number > val.len, then it would hit the 4096 condition
and return (returned 0, now it returns the equivalent of
std::null_opt), which means that val.len doesn't get modified, making
it smaller than val.prefix
- The code would try constructing an XmlStringRef with negative length,
which would hit an assert in one of QStringView's constructors
Add an assert to the XmlStringRef constructor.
Add unittest based on the file from the bug report.
Later on I will replace FastScanNameResult with std::optional<qsizetype>
(std::optional is C++17, which isn't required by Qt 5.15, and we want to
backport this fix).
Credit to OSS-Fuzz.
Fixes: QTBUG-109781
Fixes: QTBUG-114829
Change-Id: I455a5eeb47870c2ac9ffd0cbcdcd99c1ae2dd374
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 6326bec46a618c72feba4a2bb994c4d475050aed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For easier debugging, e.g. to print out value.len and value.prefix.
Change-Id: Ib0eed38772f899502962f578775d34ea2744fdde
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 1a423ce4372d18a779f3c0d746d5283d9a425839)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The syncqt tool was originally designed to run at build time, as a
part of dependency chain of Qt modules. This works well unless we need
the code model of the Qt project in IDE, since Qt source code actively
uses header aliases, and creating them at build time breaks the code
model until the initial build is done. So we made syncqt the configure
time tool to not break the developer experience.
It's more likely that developers build Qt using command line or don't
need the code model before the first build. So running the tool at
configure time should be optional.
QT_SYNC_HEADERS_AT_CONFIGURE_TIME switches the "mode" of the syncqt
tool from build time tool to the configure time tool. Without the
option enabled build procedure runs all the syncing targets at build
time only. The exception are the developer builds, if the
'-developer-build' option is enabled, QT_SYNC_HEADERS_AT_CONFIGURE_TIME
is set to TRUE by default. This gives better development experience for
the developers that don't use the code model in their IDE or don't
require it before the first build is finished. Also this build time
mode is preferred for the CI or similar build procedures where code
model is not required at all.
By default, the option initialized from the
QT_INTERNAL_CONFIGURE_FROM_IDE CMake variable.
TODO: The option is forced to TRUE for the static Ninja Multi-Config
builds. See QTBUG-113974 for details.
[ChangeLog][Build System] When building Qt from sources, syncqt and Qt
header files are now created at build time, not configure time. This
should speed up the configuration step. You can set the CMake variable
QT_CONFIGURE_TIME_SYNC_HEADERS to ON to use the previous behavior,
though. The old behavior is also preserved if cmake/configure is run
from inside an IDE - Qt Creator, Visual Studio Code, and CLion are
currently detected.
Task-number: QTBUG-111163
Task-number: QTBUG-109792
Change-Id: Ib61bda9546e58492be874a8591c37e100313d02c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit a8cf976ce6c82192bdf2d4b310e9ba0ea75bd0b0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This amends 79ac43053798763828d51c79f6368465b1db1c87.
Change-Id: Id68daff20de11361a1bb20071266e8adafe5e9c4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d1f3ffc80b0e15a4342fd0e5a334f42e378d401b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As requested in code review. Big improvement, code-wise.
tst_Sleep::wait() was failing on the CI, so be more accurate by using
QElapsedTimer::durationElapsed(), which returns nanoseconds.
Change-Id: I5bed6d6bd768adfdecab2475e6cbe245c20aabd7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8ace5b26aa7d0b0e800655089c6405d67dbaca12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We have been using as default DH parameters the 1024-bit MODP group.
This is now considered insecure, and applications should use the
2048-bit at a minimum [1]. This commit therefore replaces the parameters
with the 2048-bit MODP group from [2].
To double check the data, use openssl asn1parse to verify that the prime
matches. For instance:
1) put the encoded string in a `encoded.txt` file (c&p from the source,
removing the double quotes)
2) put the hexadecimal value of the 2048-bit group in a `reference.txt`
file (c&p from [2])
3) compare the output of openssl asn1parse with the reference. For
instance like this:
$ diff <(openssl asn1parse < encoded.txt | grep -m 1 INTEGER | perl -pe 's/.*://; s/\n//') <(perl -0777 -pe 's/\s//g' reference.txt) && echo OK
OK
[1] https://datatracker.ietf.org/doc/html/rfc8247#section-2.4
[2] https://datatracker.ietf.org/doc/html/rfc3526#section-3
[ChangeLog][QtNetwork][QSslDiffieHellmanParameters] The default
Diffie-Hellman parameters are now using the 2048-bit MODP group from
RFC 3526.
Change-Id: I47133cd78ba0e954b8f93a3da09fa2c760c9f7a8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 3ec24e329c9ef6802786a37f30ddd8982e903480)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Just handling attachments with a render buffer set and only one
attachment is not what other backends do. They support all attachments
and also the cases of multisample (2D) textures and multisample texture
arrays.
By extension this allows multisample 2D texture arrays. (GL 3.2+/GLES
3.1+) This was previously not working probably since the correct texture
target was never used.
Change-Id: Ibe929faaf86824a596f9794240d1becc51f68e43
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 07d900dd57648aeabf4c95250581c1a04dce88a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We were basically timing the qSleep, which is pointless. We don't need
to verify that qSleep(X) spends at least X time. Because it also
doesn't. Somehow, QNX can execute 1000 ms sleeps in 996 ms.
Amends commit 30e5ff3ff223d665fbed3baf2d08ad3fcf2b8455.
Change-Id: I46b5dede27114be29724fffd176a66c1799075b7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7d0431bb8bb32606e416fbdb67fe7d3d20fc9d8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If moving a window from a screen to another using keyboard shortcuts,
the screen change detection happens after the handleDpiChange() call
which essentially makes Qt think the window stayed on the old monitor.
Instead of checking against currentScreen DPI, check against savedDpi
which should not have this problem.
Task-number: QTBUG-106483
Change-Id: Ic30dc1b16bbaf9306a086c8d3042f5341d3848c1
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 1d3b06a1abb715efc38f88ecd369f96d6e8cadd6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Other parts of the code are expecting int.
Change-Id: Iea73412c874adb2e6589e9b11607f313e1747d19
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 60f34fc9e368010a5eaae920e5e306e59abf8e73)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The dark mode related changes for windows didn't update disabled and
inactive group palettes, and this makes text in certain context
(such as menu bar) appear with enabled color. The windows theme API
populateLightSystemPalette() is responsible for this and it updates
palettes for color roles and certain inactive scenarios but not for
disabled.
This patch set makes existing systemPalette(Qt::ColorScheme) to be
available in QWindowsTheme and it updates palette depending on color
scheme. From now on, this API updates palettes for windows native
style. Its to be noted that window native style use light palette
irrespective of color scheme.
Fixes: QTBUG-114821
Change-Id: Iff4f35900293b8e7030ec121ca21856daa094dc0
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 491534006ec0b648e70269d33ccd7b79faddef7f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is what maps to the Vulkan and Metal backend. Taking the
frame slot from the other swapchain was a mistake. It should use
the frame slot from the current swapchain.
Fixes: QTBUG-114826
Change-Id: I1585088ce9a963f1710168d3ebc0d2e5f1e9ab21
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 1c4dbd14ae2f335f6148b1355f88d75c1a79cc35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When a QTextEdit/QPlanTextEdit window loses focus and receives
PaletteChange event, the ColorGroup that controls the palette for
the QWidgetTextControl will be set to 'Inactive'. However, the
QTextEdit does not update the palette when the window is activated again.
This can become more noticeable in applications where different colors
are used for the 'Inactive' and 'Active' ColorGroups.
Change-Id: Idd4dcc55b2bf8e671e7dd9cbd040782e1c3bf1a3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4afcdc488f4e77f599406efe990e8534d38daf31)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QSqlResult::boundValues is a const member function, but returned a non-
const reference to a QList<QVariant>. This is a bad and potentially
dangerous API, as callers can modify the list stored in QSqlResult.
Move that API into the removed_api translation unit, remove it from
Qt 6.6 on and replace it with two suitable overloads where the const
version returns a QVariantList by value, and the non-const overload
returns a mutable reference.
Driver implementations that used to call the const overload to get a
mutable reference are now calling the non-const overload instead
(those calls are all made in the non-const exec() or equivalent driver
implementations).
As a drive-by, replace "vector" with "list" in the documentation.
Change-Id: I6e4fd8f5749b939cdb609bf5876735e9b30b2b5a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 3f72b0d5fc70d3cf7daa4badccd5a40fc8b0726a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends 55fe46fd58c73a7a22374694a1b45ec2a0e6fdc5. Before that change,
key release events were ignored as the QLineEdit::event reimplementation
continued to call QWidget::event, and as QLineEdit didn't override
keyReleaseEvent, the default implementation in QWidget got called to
ignore the event.
Restore that behavior by explicitly calling the QWidget implementation
after updating QLineEdit-specific states, and add a test case.
Fixes: QTBUG-114654
Change-Id: Ic8aa35a1c915b446aece47aaf03ef5cf1884b936
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 8afe4faf298798783278f992d14fb78cecee9588)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Gerrit says it refuses to color lines that exceed 500 characters, so
let's split this line to get colors back.
Change-Id: Iab6d37332e27ecdeaf1420da6fa242ca65f0aab5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 02ca59c4c89199ae6bd68d117507f01b984e60a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Under some circumstances, MSVC seems to complain about SlotArgumentCount
being unused
qobject.h(210): warning C4189: 'SlotArgumentCount': local variable is
initialized but not referenced
note: see reference to function template instantiation
'QMetaObject::Connection QObject::connect<void(__cdecl QAction::* )(bool),
main::<lambda_1>>(const QAction *,Func1,
const QtPrivate::ContextTypeForFunctor<main::<lambda_1>,void>::ContextType *,
Func2 &&,Qt::ConnectionType)' being compiled
This is nonsense, as SlotArgumentCount is used in the next line, to
construct the list of signal arguments, but the workaround to declare
the variable as [[maybe_unused]] is trivial.
Add a connect statement to the test case that creates such a connection.
This does not produce any warning with or without the attribute (and if
it did, the build would fail for CI configuratinos setting -Werror).
Fixes: QTBUG-114781
Change-Id: I4ee6f7d57c2836ef3dd9741d037d48181af2cdec
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 2b9ef2eb44c084d39ef8324cfe1ae42a98b3038f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The use of Q_ASSERT(false) is bogus as we don't need to test here, but
want to signal unreachability.
Q_UNREACHABLE_RETURN allows us to tell the compiler that the point
can't be reached while also getting rid of the no return error.
Task-number: QTBUG-114689
Change-Id: I007cd243055237bcc21772a4130a6c1a44fd882d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit ce39beea0cd49bb93b0e345194265dd8081094cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The platform theme's icon loading logic may still have changed, even
if the theme name has not, so we still need to invalidate the theme
cache.
Change-Id: Id3635c235fadb007df86d93ce3beb5622d26b8bf
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit e9276d7497afeba3e116cb1044d37c341294780f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The fallback logic in QIconLoader::updateSystemTheme() has been
updated to match QIconLoader::ensureInitialized(), by using the
systemFallbackThemeName() directly, rather than the possibly
user set QIconLoader::fallbackThemeName().
Change-Id: Ib5aab62bbfb22683d3bddf87c4e798eca4a5af62
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 89fe1085903cab969ed65f05c7004e18a47d935a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We cache the system theme name in QIconLoader, so when a theme change
comes in we need to update the system icon theme name regardless of
whether a user theme has been set.
The updated system theme name will not be reflected through the
QiconLoader::themeNamed() unless the user theme is cleared/unset.
Change-Id: Id949e55e2fa12e40818ba54cf2a10ce48fe10815
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 883c3dc8c8c014528e77ecbc4b4ed7d7504afa42)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We still need to consult fallbackThemeName() when computing the
parent list for an individual theme, as the Freedesktop Theme Icon
spec mandates that the "hicolor" theme comes last, but we no longer
need to do explicit fallback to fallbackThemeName() if a theme is
not found.
Change-Id: I6c0b5a45d8258c5b6eaa761402944a735b1606ba
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit addde7843f0bcbf7da8171e5146d8f1822ee0428)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The use of fallback icons should not depend on a theme being set.
[ChangeLog][QtGui][QIcon] QIcon::fallbackSearchPaths() will now be consulted
for fallback icons even if the current theme name is empty.
Change-Id: Ia8d14062de7c53601fd9dac30f87a9e672aa2207
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit dde45bcefb1626c26de310a95321bb5e8e4c0014)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We would previously only use the fallback theme for themes that did
not exist, or for themes that did not declare any parent theme.
We now unconditionally use the fallback theme, even for themes that
declare their own parent themes, so that a QIcon::fromTheme("foo")
that doesn't exist in the current theme, nor any of its parents,
nor in "hicolor", will still be looked up in the fallback theme.
The reason this seemed to work in the existing tests was because
our test themes inherit system themes such as crystalsvg and gnome,
and we didn't provide a hicolor theme. Any of these themes missing
would lead us into the code path where we use the fallback theme
for a missing theme, masking that fact that we had not added the
fallback theme to the list of fallbacks for the theme that had
explicit parents declared.
The logic has been moved out of the theme parsing and into an
accessor in QIconTheme, so that we're not caching the fallback
theme lookup.
[ChangeLog][QtGui][QIcon] QIcon::fallbackThemeName() will now be
used as fallback even for themes that declare a parent theme.
Change-Id: Ib0ce1dfe97030f23893460ed624073a719a3ebd1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f4dca7c512ab3f8860f711de971af1fea76a1665)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Setting a fallback theme will affect the lookup strategy, so we need
to invalidate earlier lookups.
Change-Id: I962245ddb3a20b7798d5ce831ed8a369b0ab76b4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ae36c1dc9c395e010334532319faaf4e3a911365)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QThemeIconEngine takes care of creating a new icon engine when
the icon theme key changes, so we don't need to invalidate the
entire QIcon cache.
Change-Id: Ie3bca00a9146d1f429b2a6f8ab0b39e15834d158
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4dacaaf15a51860f3a7a2d72ca033ccc38165de1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Our logic in the edit menu tap recognizer for determining whether the
tap should trigger the edit menu only looks at the bounds of the input
area, and as long as the tap is within these bounds we trigger the edit
menu.
This doesn't take into account that there might be controls laid on top
of the input area, for example a button, where we don't want to trigger
the gesture.
The only related logic we have is a heuristic that checks whether the
cursor ends up moving as a result of the initial press, in which case
we treat it as the edit area "accepting" the touch press.
The proper fix to this is to handle the gesture recognizer delegate
callback gestureRecognizer:shouldReceiveTouch:, and do hit testing
there, but we don't have any machinery for that in our IM protocol,
nor in QWSI.
As a workaround, we treat the gesture recognizer as having failed,
even when we do detect a tap that should open the menu, so that the
recognizer doesn't eat the touch event. We then open the menu manually
instead of relying on the gesture recognizer changing state. This
should be safe, as sending a touch/mouse event down to the input
area should normally be a noop.
The workaround does result in a slight visual wart when clicking
buttons that live inside input areas, as the edit menu temporarily
opens, but the menu is quickly hidden again as the focus object is
transferred to the button. Compared to the current situation, where
the button is visually pressed, but doesn't do anything, and we
bring up the edit menu fully, this is an improvement, even with
the wart.
Note that the original problem outlined in this changed is not an
issue in practice for Qt Widgets, as we synthesize mouse events
from touch events, and (wrongly) synthesize a mouse release in
response to the touch cancel triggered by the gesture recognizer,
so the button is still activated.
Fixes: QTBUG-113975
Change-Id: I41e850f20d69ad8e3247949644a389e1c61c4dcf
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 843ce2759ea1698171cc4c5fad64d8cc0690cea8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Prior to 30276cec3d47f4f4fa847fea90214ec5c28d54ed all the recognizers
were managed together, so we could safely condition teardown of them
all by checking for the presence of one of them.
Now that we selectively enable only some of the recognizers, we need
to have more granular teardown logic. For extra safety, we tear down
each one individually now, even if some of them are still managed
together.
Fixes: QTBUG-114416
Change-Id: Ie99388cd8abb7543c17df5b6b5a88e86ff86df7e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit 46d69b6ca45ad9218a27f7db8fccba8a8f655ecc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The CMakeUserPresets.json file can be used to simplify configuring Qt,
particularly with tools such as Visual Studio and Visual Studio Code.
As opposed to the CMakePresets.json, the CMakeUserPresets.json should
only contain user specific configurations, and should never be checked
into source code management system.
This file is already ignored in the top level Qt super-project, but to
facilitate working with each individual submodule, we should also have
this .gitignore in each submodule.
Change-Id: I383417c7fe9d803aeb0385ba83e8c9cee6181602
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
(cherry picked from commit 5546f2df538c06f5e7cc3e218f03a9a0ef2d830e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It has no purpose (like Alt+Enter is not functional anyway when we
created the swapchain for composition), and with D3D12 there is a
warning printed (with the debug layer enabled?) about this. So move
the call to the appropriate branch.
Change-Id: I266ae6835bcc49b3ba8d84e5d08ab9115c6401e0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 300da03e3a0b80797e8cb9ddae90233244704691)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Make it so that what we query with regards to 1.1, 1.2, and 1.3 features
are stored for later use. This will be relevant for e.g. multiview where
the multiview field will need to be checked when deciding if the feature
is supported at run time.
All this is only really compatible with Vulkan 1.2 and newer. Vulkan 1.1
does not have the 1.2 approach, i.e. there is no
VkPhysicalDeviceVulkan11Features
in Vulkan 1.1 (!). That is a struct added in Vulkan 1.2. In 1.1 one had
the feature (extension) specific structs, such as
VkPhysicalDeviceMultiviewFeatures
in case of multiview. That we do not bother with at the moment.
Then again that's nothing new. The existing code to enable all features
with a few exceptions, that's already tied to the 1.2+ way of working
with physical device features, and not quite compatible with a pure
1.1 (not 1.0, not 1.2+) implementation (which should be hopefully rare
out there).
Change-Id: I661f2634651d28edd9b5feec66a423220920f894
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit fc3ee08737ab53b8ad033e50b3b14fc8bba4bca1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Only for dev and 6.6, includes D3D12.
6.5 has its own dedicated version of the patch.
Fixes: QTBUG-114775
Task-number: QTBUG-114115
Change-Id: I36c96e046ba611b228fd5c320e5780ca4d180165
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit e7405dc14acc4f35d60e58f4f76b745dfd86f131)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A number of users have explored the behavior and complained about it.
Lets add a \note explaining this. The function in charge is
QThreadPool::stealAndRunRunnable(QRunnable *), which is a private
function, exclusively used by:
QFutureInterfaceBase::waitForResult()
QFutureInterfaceBase::waitForFinished()
also update the documentation to reflect these changes accordingly.
Fixes: QTBUG-112351
Change-Id: I839858cb449063d8af9bef64d2f35a6816a419b0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 0235de994be7e04aca3456f1260b18313dd45b74)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Most of the QWS (Qt Windowing System) classes from
the Qt 4 times are cleaned up in Qt 6. Any existing
QWS API documentation should be marked \internal.
Task-number: QTBUG-35605
Change-Id: I24201406114feaf8af21403b09375a2ee9a4709e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 4af07d6e54091e7a9e413b92b943eee41cb67bb8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is required when using the preload functionality
from qtloader.
Change-Id: Ib1bf8788b87834ba0ff80d563897040e093a16b9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit c2988de88d54ddd63d270964e4561a9fce10d11e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This property can take a either a WebAssembly.Module
or a promise to a module, and we don't have to specify
the exact type in the property name.
Change-Id: Iebaf52178253afe8c93cf78bbe0853461bf48b67
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
(cherry picked from commit bc340abe877199af640d16f1fbeaf4b96c36fe14)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If the length of the quaternion was slightly larger than 1,
the resulting quaternion would be invalid, causing
getAxisAndAngle() to fail.
Fixes: QTBUG-114313
Change-Id: I8f0616e74590dd6cfee0ce913d214c8e280c4df4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit de9e978532ef5a3c212426f0e46de9059377968d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In the iOS theme, we determine the color scheme based on the the last
UIWindow of the application, but listen to trait changes in the
QUIWindow class. However, the last window of the application is not
always a QUIWindow. Sometimes it can be a temporary UIWindow created
by the system for transitioning or other effects. These kind of windows
do not always follow the appearance of the app and the main window
(QUIWindow), so we were sometimes ending up with the wrong color scheme being reported.
This was happening when the app was put into background for example,
which causes the traitCollectionDidChange method to be called and query
the userInterfaceStyle of the last window to determine if the color scheme was changed. The queried window would sometimes end up being of type UITextEffectsWindow, etc. and report the wrong appearance.
To fix, always make sure to get the appearance from a QUIWindow.
Fixes: QTBUG-114571
Fixes: QTBUG-113169
Fixes: QTBUG-114191
Change-Id: Ic0b29c02c8e8100996d5cd31b37e6a5b839f5fb1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 551cbc5b15b46ca4b298a9dfe946f834e0cd2fed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Set `QT_COMMAND_LINE_PARSER_NO_GUI_MESSAGE_BOXES` before trying to run
qt tools for correctness. This is to suppress QCommandLinerParser from
showing a message box when console is not available.
Task-number: QTBUG-114530
Change-Id: Ib3d264a799a5da1f620d2bebe55539bafc43da0f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 45e17162ba9f030c067553c5c5e7fe8ec56c10aa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Spack, like VcPkg, sets the `CMAKE_FIND_FRAMEWORK` to `LAST`, as a
result, similar to VcPkg, when Spack is used, FindGSSAPI opts for
`gssapi_krb5` which is not what we want. By dropping the `gssapi_krb5`
from the list of alternative names we can resolve this without much
tinkering with internals of these package managers.
Fixes: QTBUG-114537
Change-Id: If517c409511f58e3bed78316a2030393dc249a40
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 1bf144ba78ff10d712b4de55d2797b9256948a1d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add an environment variable to be able to stop QCommandLinerParser
from showing GUI message boxes when console is not available.
Task-number: QTBUG-114530
Change-Id: I52500a2177894bc0bf2d20f9723ce3e8fe87420f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit cdcead0ab2a83b268e6cf1109b9af5f0abc31728)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As mentioned, separate debug info will always be generated when building
with `-release -force-debug-info`.
Fixes: QTBUG-108015
Change-Id: I49e79177ca833007b932b58a76261c07acd52ca6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 059f4dc6f85525a07d0985ee90f845bd6208693b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... like QUIP-0019 suggests.
The main problem here is finding these classes. We don't have markup
for RAII classes, so I had to find them by name. This patch is based
on the output of
git grep -we Q[A-Z0-9a-z_]+er
extracting the matches and piping them through sort -u, then removing
a lot of suffixes like Manager and Handler, then visually inspecting
the remaining list.
Task-number: QTBUG-104164
Change-Id: I59b18d8d0a0237fcc11047857adc39b984ad7fcb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 31d834a1c0d83d22fcf74624577013a558ad1974)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's a named constructor of a smart pointer class. QUIP-0019 says
constructors of such classes should be marked as [[noexcept]]. It
doesn't (yet) say anything about _named_ constructors, but it makes
sense to include them, too.
Task-number: QTBUG-104164
Change-Id: Ia4b43e4f819ce45d71274019c919fd98cc97878b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 51b97626857f13e785aae61c1beb16dc39601cd2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The lock() function, added for std::weak_ptr compatibility, sounds
like QMutex::lock(), but is, in fact, a const function. QUIP-0019 says
such functions must be marked [[nodiscard]]. For symmetry, also mark
toStrongRef() and toWeakRef() as [[nodiscard]].
Change-Id: Ifb6e447d2cd96fedd9a78decdfac6bc57c1d282a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 81d357ff8a7af8704ba5657caef04f28e7099625)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When a dock widget is hovered over a QDockWidgetGroupWindow, a gap item
is inserted at its potential docking position. Since only one item at a
time can be moved with the mouse, only one such gap item can exist.
QDockAreaLayoutInfo::insertGap() therefore contains an assertion, that
kicks in if a second gap item is inserted.
QDockWidgetGroupWindow::hover() checks if the dock widget is hovered
over a gap item. If that is the case, no additional gap item is
inserted. The check fails if a gap item exists in the group window, but
the dock widget is hovered over another part of that group window.
This can be the case if the group window already contains more than
one dock widget: By inserting the gap, the group window's size changes,
one of the existing dock widgets receives another hover event and a
second gap insertion is attempted.
This patch adds QDockAreaLayoutInfo::hasGapItem() to check if a gap
already exists. The method is queried in addition to prevent a second
gap insertion.
An autotest has not been added, because gap items appear and disappear
during hovering. The improved functionality can be tested manually with
the mainwindow example.
Fixes: QTBUG-112491
Fixes: QTBUG-114542
Change-Id: I9ea64e729873a86eb98ea950fbb066817fc25a07
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit b26cdbd8777bf1348c7967138e59836990233121)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The signal can deviate from QWidget::isVisible().
This patch clarifies the signal's documentation.
Since its name suggests that it is in sync with QWidget::isVisible(),
A TODO comment is added to consider deprication in Qt7.
It appears to be more reliable to listen to hide/show events.
Fixes: QTBUG-48161
Change-Id: I43aa16c2ecb4877abd8effb7da8e07576438d6d2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 7993321e7620941f3106acb977243c51aa27ceec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QHeaderView::mouseMoveEvent started autoscroll without propagating the
event's mouse position to QAbstractItemViewPrivate::draggedPosition.
This data member always containing QPoint() has lead to right drags not
causing an autoscroll at all. Left drags with a scroll offset just
kept scrolling until the offset was 0.
The missing propagation has been added.
As a drive by, dead code has been removed and the local variable pos
has been constified.
Fixes: QTBUG-113573
Change-Id: I7b194dfc71abea6f2bbaaae18270c80eb15afb4d
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 787b4c1506aba7e83d861e178329a18c6ec34322)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To draw a CE_ItemViewItem QStyleSheetStyle::drawControl lets parts
of the element being drawn by QWindowsStyle, others by baseStyle().
If the ItemViewItem has an icon, it can lead to the icon being drawn
twice: Once by QWindowsStyle, respecting options set in the stylesheet.
Once by the baseStyle(), not respecting stylesheet options.
When the style sheet modifies the icon's position, the icon will be
drawn at this position as well as on the default position.
This patch prevents an icon to be drawn by baseStyle() when it has
already been drawn by the QWindowsStyle.
Fixes: QTBUG-110942
Change-Id: I8622dfe95bef13b196a3e38025fac1cc92f097c9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 30cf6ed32f3e38c8623cbafbb25b4ce558d370f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Without this patch, the compiler will complain about can't find
"qshaderdescription.h" when using "qrhigles2_p.h" from outside of
Qt, which breaks user project compilation.
Change-Id: I9e201d82890c92ddd2f6aad48eef0edc9a7c46ef
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 055bc81bd14aacde68c6404c0ec5f8346a22d105)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
They both check __has_cpp_attribute(nodiscard), so keep them together.
Move the fall-back (empty) definition to the block that does the same
for all other such macros.
Mention that both P1771 ([[nodiscard]] for ctors) and P1301
([[nodiscard("reason")]]) use the same numerical value.
Amends 959800f6de137f6a77c7d5a2741a5bae0638cbd9.
Change-Id: I0ef913b6076ffa4058220b542303591de6fefde7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 58352e7f9aece796b4d95fddc027e817ef640785)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The following private APIs are either RAII or smart pointer classes:
- QAutoPointer
- QBoolBlocker
- QFdContainer
QUIP-0019 says to mark RAII and smart pointer class ctors
[[nodiscard]], so do that.
Task-number: QTBUG-104164
Change-Id: Ibc77e6603fadf18ea28428a49635f46a5680b777
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 25e20d5537b2a7682c34a9837076530ad220b3b5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's not a real leak in that the string data is being freed on program
exit (or, more recently, QPixmapCache::clear()), but it can lead to
lots of memory being bound for much longer than expected when users
put in new QString keys without attempting to retrive them again. It
can also lead to problems with QStringLiterals lingering around until
after their underlying data has been freed. A bug in the Fusion style,
generating new string keys for identical state, exposed this
misbehavior, and one way to fix the resulting issue for the user is to
make sure that QPixmapCache doesn't leak QString keys.
The Fusion style issue with generating non-repeating keys for use with
QPixmapCache should also be fixed, eventually, but this patch
relegates that to an optimization issue (the caching is effectively
non-existent), the resource exhaustion is gone now.
The issue exists because the QString keys are internally mapped to
QPixmapCache::Key's by way of a QHash<QString, Key> cacheKeys data
structure. When the QCache, indexed by Key, not QString, decides to
evict an entry, the Key is invalidated, but no-one was removing the
corresponding entry from cacheKeys. So make the existing releaseKey(),
used to invalidate copies of Keys referring to evicted pixmaps, do
that, now. So as not to have to scan the whole cacheKeys QHash for the
right Key, store the QString key, if any, inside the Key, so
releaseKey() can retrieve it and use it for O(1) erasure from
cacheKey.
This allows removing the previous work-around in clear()
(6ab0d25a09f5aeb7a5a062f7fd44e95ca761e21e), greatly simplify
object(QString), and requires to rewrite all code that holds iterators
or references into cacheKeys over an insertion into or removal from
the QCache. Two (insert() and remove()) have already been done in
prequel commits, so only flushDetachedPixmaps() was left.
Fixes: QTBUG-112200
Change-Id: Ic93b0ed388ae963267fe242b491c6c941d146b99
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 56644240851443b1259bff2098d221068dd3e8b5)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
And take the opportunity to clarify what the QtVforkSafe namespace is
doing. Amends commit e71c226d6f188abd811b28d3cb7529343f52d61f.
Change-Id: I443cf0c8a76243eead33fffd1767f3fa390a7cdd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
(cherry picked from commit c4a0a76deca0bc5082fb561004bc0d29a8de9978)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It should be possible to build a test in any configuration
by building Qt in that configuration, and then building
the test with qt-standalone-test.
Not all Qt configurations will be able to run all tests,
(due to exec() calls and similar) but that's OK - some
tests don't have exec() calls, and we want to be able
to run tests for a given configuration to figure out
how well it works.
On CI we want to use batching and asyncify, so it makes
sense to tie usage of asyncify to batching.
Change-Id: I05553d250a45c1831f43dc71a43ef02d01d70535
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
(cherry picked from commit 70f5d396be1c7d20784ef93a59a73099a02e0f5b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Found in API review.
Amends 959800f6de137f6a77c7d5a2741a5bae0638cbd9.
Change-Id: I00877ce7030c638765b495089899c022deb31a27
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 4968f8418f65dca54078c3565de8db3b777686c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QFutureSynchronizer is a RAII class. QUIP-0019 says that RAII class
ctors should be marked as [[nodiscard]].
Task-number: QTBUG-104164
Change-Id: I0b6710f2b9a14d67f64150f240f819b8336e0929
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit f403ef428efab5af857e85d9d28c5f7b64603ec0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When setFuture() was handed an element of m_futures, it would hold the
reference to past the clear(), which invalidates said reference.
Fix by taking the future by value instead of by cref.
While append() is not affected, as QList::append() already guards
against aliasing, do the same change there, both for consistency as
well as to optimize the common case of passing rvalues. It also means
we can use the rvalue overload of QList::append(), skipping the alias
analysis in the lvalue QList::append().
[ChangeLog][QtConcurrent][QFutureSynchronizer] Fixed a crash in
setFuture() if the argument was already a member of
QFutureSynchronizer::futures().
Change-Id: Ic0b212b9f265a746df9a6beb6272a5415d131442
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit e8dcbaaaf61ee2164db61e70a5d61d7a5b849371)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Just in case someone includes the private headers outside of Qt.
Change-Id: I79232d2bab7604c71c31226a67ec3ef40210d161
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 952f6f2e915a90d55ff38b532a3692e87f151e33)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is not scalable. Instead of putting parts of post-1.0 vulkan_core.h
into this header, apply the appropriate ifdefs instead.
Change-Id: I21a9d6f7c51169efa7b66705545bae192ed30c14
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
(cherry picked from commit 497c0f1b0d920a934147f1bd3abcd40daa67828f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In Schannel it is not guaranteed CertificateBlacklisted will be the
first error emitted. And it really does not make a difference anyway.
Change-Id: If041f913db9e78ac54e6f8bb2ba1bda110e7d64a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit e09b1373c2b761f20cd930f95119306d59068c80)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since they don't contribute to the width of a string then we may
accidentally end up ignoring the potential left-bearing that the first
non-zero-width glyph has.
Task-number: QTBUG-113679
Change-Id: I8e89a428acf5d0a3da0255c50778ccc773ff20e1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 8469b369287609ed7b179ff846d64c8b408498ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Code points is what you get when surrogate pairs have been joined
Change-Id: I86c4131de5782ce1e6342217947a603ca16bb521
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 054a64ce67421b213df73a9bcfda3fa6e9c6e64f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... and make it a hidden friend.
This avoids ODR violations when, because they can't use ours (private,
and not exported), users try to produce their own version of
qHash(Key).
[ChangeLog][QtGui][QPixmapCache] Made the qHash() overload for
QPixmapCache::Key public (was: private) API.
Change-Id: I324ed001c0ae0a251ac2e1d04713013452ffff9c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7fa3267fda6cff720cca44e829f9a39789031a54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Just de-inline the original function instead of merely moving its
implementation into an out-of-line function.
Amends 408fbd3f2d7a6b87521f5b3c27ecf6341dc06e13.
Change-Id: I6860a10e0a7d876ce1837f196b1fb4165779540a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 91efd6116665bd71f7932adcf7a589204c239276)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... to hold the optional QApplication.
Saves a memory allocation, and is more readable.
Amends 408fbd3f2d7a6b87521f5b3c27ecf6341dc06e13.
Change-Id: I390b9cfa367d01feb59bb5deadc5383c8e678749
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 2389b93b7991e96dc189e44cf5ea7ca894224d30)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... instead of %s and qPrintable()
Less operations, less code expansion.
Amends 408fbd3f2d7a6b87521f5b3c27ecf6341dc06e13.
Change-Id: I5a3d2e79623bd32c348a2d655e3a2c8d98eca1e3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 1e626c135b7376bdbc6b2a27124afe66a802dfb0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fixes QDoc warning: 'Documentation for class has no \inmodule command'
for both classes.
Change-Id: I59eb5f5b935ea30f756d655158a06f390d2ebc54
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 77f7c3a45d83ed14dbe92ed7ae2f8ccc95d2eed1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A \target defines a global doc linking target across all Qt modules,
and they may interfere with link targets local to module documentation.
As we no longer link as heavily to qmake manual after moving to CMake,
remove the \target commands. The section titles remain as valid link
targets; arguably, duplicating a \section1 title with an identical
\target name was unnecessary in any case.
Replace all \l command arguments that used the \target for linking
with the actual section title.
Fixes: QTBUG-114073
Change-Id: I6e595a77268cbd6ddb5d004501bc6df178c3883d
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4aac1ca91fa74c4539d79388a324c3f8ce12aa51)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Of course we managed to rely on a GLSL feature that is only
in GLSL 130 and newer, not 120 which is what the default 2.1 OpenGL
contexts support on macOS.
Change-Id: Ib75e750ea15d59e51b2207669068fba7719a48b1
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 204c91c971dd2432af96e3586a706cdbc530e6f2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is in line with how QMetaType handles QMetaTypeInterface*. You can
retrieve a const pointer to it.
Task-number: QTBUG-113690
Change-Id: Iaf3c10603dc6049a5553987c90006807867abc0d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 937751f427fd0cfd8d5f9a8722309e4870eb5e7d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Previously, failure handlers did not propagate cancellation. This would
lead to crashes when a QPromise was cancelled without having generated
any result. Subsequent continuations would be invoked and try to access
the result (which was nonexistent) and then crash.
This patch propagates cancellation through failure handlers to prevent
subsequent continuations from being called in the first place.
Fixes: QTBUG-114606
Change-Id: I23b28a8e70a76e1ba6416be4440360c6dbaef2a3
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 855c4484693015cb6498f2183d95de1377d49898)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This was used as a work-around for Q5MutexLocker's UB downcasting
QBasicMutex to QMutex, and for some unspecified performance
improvements.
Now that Q6MutexLocker is a template, the two are almost
token-by-token identical, so we can remove this work-around and use
QMutexLocker directly.
Partially reverts aea500d5d76864bb1a3918e338ca6806e1766e41.
Change-Id: I57ef5c53999869aa3454fbbaad884c1d18591b2a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8d39b2165596f0aaae0e5841eb4c849cf4ee1bb0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Implement insert(QString, QPixmap) in terms of insert(QPixmap) to
avoid duplicating code and to separate concerns: insert(QString,
QPixmap) is now only dealing with the cacheKeys, insert(QPixmap) is
only concerned with the Key-based lookup.
Task-number: QTBUG-112200
Change-Id: I30394da43a5e93b7bd41ef9ce9c7aea044523c30
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit aa8e8e94b99dfff8613bcbcc8ac6de5d0d8bcb12)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The previous code used `cacheKey` as the name of an iterator, which
made the code hard to understand.
Instead of renaming that to the more idiomatic `it`, use QHash::take()
to get an actual `cacheKey` back, and then delegate to
QPMCache::remove(QPixmapCache::Key) for the actual removal.
Task-number: QTBUG-112200
Change-Id: I9311c19f12a05cad694702672f17ae19ba339b04
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c2bcba93a67ed980021304c3bbca5556b4cc3add)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
They're RAII classes, and QUIP-0019 says RAII class' constructors
should be marked [[nodiscard]].
Task-number: QTBUG-104164
Change-Id: I0080f5b6a3cea346c0860e00958a8c204849040e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit ffed431293cb0fcb85bdda2e1c4db9bda79a00fc)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
It's a RAII class, and RAII classes should have only [[nodiscard]]
constructors.
Task-number: QTBUG-104164
Change-Id: Ia83fa003677a839734208b12bde2c6287c1b79a3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 8cad4c2903d014bb755bd2349f9c4d127a87cc7a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We should not export non-polymorphic classes wholesale. Only export
the non-inline functions instead.
There are no implicitly-declared special member functions in this
class that could cause problems, so we don't need to delay until Qt 7.
Task-number: QTBUG-104164
Change-Id: I2e98782160cccb9c0f59a68e67ffd29fec42b728
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 2a76cf81811c9406c75726d7743a28ec79fadb37)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The existing implementation as a member function QDALI::op<<(QDebug)
cannot possibly work, as the implicit `this` argument comes first in
this case, while for streaming operators, the QDebug object must come
first.
Rewrite as a hidden friend and apply QT_NO_DEBUG_STREAM protection as
a drive-by.
Amends faec937756810bbc478da677efb0dca4531a6222.
Task-number: QTBUG-114542
Task-number: QTBUG-112491
Change-Id: Ida400d335491896ec49f2c0f9601a8430eebcd4d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 46aa713c34c7bc90f3981b3d723591149572203c)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
QDockAreaLayout items can be widgets, gap or placeholder items.
They appear and disappear during hovering.
This adds a debug operator to make troubleshooting easier.
Task-number: QTBUG-114542
Task-number: QTBUG-112491
Change-Id: I0fa5d3c96ab91838f28ad7cec3c049fd39f47576
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit faec937756810bbc478da677efb0dca4531a6222)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
CMP0099 changes the way of LINK_ONLY genex works. With CMP0099 set to
OLD LINK_ONLY genex only links the exact library binary/archive without
propagating other interface options from the target. This feature was
exploited by PlatformXInternal targets to avoid propagating of their
linker options. Nowadays when CMP0099 is forced to NEW by Qt scripts,
including user-facing, we cannot rely on LINK_ONLY genex.
Introduce _qt_is_internal_target property that is set for all Qt
executables and explicitly limits the propagation of the linker
options from PlatformXInternal targets.
Fixes: QTBUG-113641
Change-Id: I3a0ecddb65886e435073feb24c1b47035130ba70
Reviewed-by: Alexandru Croitor (OOO) <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 28c9625d00d084cfc226c979be52231df7f5d3e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It was used as a work-around for constructor-level [[nodiscard]]
missing in C++17, but a) compilers are free to implement [[nodiscard]]
for constructors in C++17 (P1771 was not considered a normative
change, just a clarification of the existing wording), and b) prevents
useful code that returns such types from functions.
Task-number: QTBUG-104164
Change-Id: I440b418d58e86118e84689adb06d239ca598afcc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 21c344a221c1d7712a04d990958b211e2dd8a263)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This works around around the difference in class-level [[nodiscard]]
behavior between Clang and GCC. While Clang already warns about
QClass(~~~args~~~);
when QClass is marked as [[nodiscard]] at the class level, GCC does
not, and requires the ctor to be marked as [[nodiscard]] instead.
Fixes: QTBUG-104164
Change-Id: Ifd7076ee422fb9472ae8bbba43d9bfeee1968a78
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 603d6351cc32d07a5e4c349d6dc3db0889c3b120)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QObjectPrivate::getPropertyAdaptorSlotObject called
connectionsForSignal.
Calling this function is only safe after it has been ensured beforehand that the vector has size > signalIndex. As getPropertyAdaptorSlotObject
is not supposed to modify the vector, it does not resize the vector and it could consequently end up with an out-of-bounds read.
To avoid that issue, we instead first check if the vector can
potentially contain an entry for the signal. If not, we simply return
nullptr, and avoid the call to connectionsForSignal.
The issue and its fix can be verified by running the modified
tst_qproperty test with ASAN enabled. The test is modified in the
following way:
- We first create a signal connection to a dummy slot. Otherwise,
connections.loadRelaxed() would return a nullptr, and the problematic
code would never be reached.
- We add enough signals to ensure that the fooChanged signal will
actually be out of reach (which means >= 8 signals, as the initial
capacity of the vector is 8)
Running the test without ASAN will most likely not result in a failure,
as then the out-of-bounds read will simply read garbage, and the most
likely result is that the cast below will fail.
Change-Id: I18a3c4f52769c2b6491a685abb84f6fcfb44e4d8
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 96e1381a0a61a5b26f7147516f107765dbfc083e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Right-clicking in a QKeySequenceEdit opens the usual context menu for a
line edit, which generates a focusOut event. QKeySequenceEdit finishes
the recording when it loses focus, which includes deselecting the text.
We should not finish or deselect if the focusOut event has focusReason
FocusReasonPopup, as otherwise users cannot copy the text (keyboard
shortcuts don't work for that, obviously).
Task-number: QTBUG-114624
Change-Id: I0b3c535c189151daa29cf17640493f3353e6394b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 89566bf7491cd717a6f64a0a8b82306309bb0701)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It is possible for an application to trigger the unexpected result of
NSModalResponseContinue from our call to NSAlert::runModal, by showing
and hiding a modal dialog first, and processing events explicitly. This
at best only flashes the native message box, at worst it triggers an
assert from our processResponse function evaluating that response value
as impossible (via Q_UNREACHABLE).
We should never call processResponse with NSModalResponseContinue,
but instead keep the modal loop running and the dialog visible.
So introduce a wrapper to NSAlert::runModal that keeps calling that
method until we get a result other than NSModalResponseContinue.
Writing an auto test for this failed; a simple test didn't reproduce the
assert; trying to place the opening of the native message box into a
lambda that would be called by the event loop (simulating the button
press from the bug report's reproducer) resulted in the native message
box never closing and the test blocking (and still not triggering the
assert).
Fixes: QTBUG-114546
Change-Id: Iab25eff55c48b103287d1881ac355e6cdd190f7a
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 2c458a82213ae568ad708e07ee9ed5f4e494a800)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix the argument prefix that is used in the cmake_parse_arguments call.
Change-Id: Ie02bdf7d2769ce084b0d173c1e8152ca6fc4fe53
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4e74fa811907ba981304bed27b093d67106e9986)
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Currently items can get stuck in a hovered state when all fingers are
lifted from a touchscreen. This is because we don't react to the
WM_POINTERLEAVE event from Windows. With this patch we translate a
WM_POINTERLEAVE event to a LeaveEvent to remove the hover state from
QtQuick items.
Fixes: QTBUG-62912
Change-Id: I8a6fb6b7ec77457854a75e20277565d1eb89bab6
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit ef7d809eaf3be2e162a274b48a6ac8051a51e86d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We so far only handled them if they came at the very start of the method
declaration.
This patch ensures that we also handle them after the meta-method tag
(but before the actual type).
Unifying parseFunction and parseMaybeFunction to avoid the need to
munally keep them in sync is left for another day.
Fixes: QTBUG-111330
Change-Id: Ic94edb69f04b9150aea2c8e6d004a8b9e5cf12ec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 44b5ad01f0da55a351e0855e1173acfbef77221d)
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Warning C4275 non dll-interface class 'QJsonValueConstRef' used as base for dll-interface class 'QJsonValueRef' UniRemoteAdapter C:\qt\Qt6.5.1\6.5.1\msvc2019_64\include\QtCore\qjsonvalue.h 219
Fixes: QTBUG-114629
Change-Id: I443cf0c8a76243eead33fffd176930f96c43eb47
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 674aa084c2d561d2377d8f8a8de1e3e7e60666f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The logic for invalidating a theme QIcon when the platform theme
changed, or when the user set an explicit icon theme, was tied
to QIconLoaderEngine, so any platform theme implementing
QPlatformTheme::createIconEngine() with a custom icon engine
would not take part in this cache invalidation.
As we want users of QIcon::fromTheme to be agnostic to where the
icon is actually coming from, and have a consistent behavior for
the various QIcon APIs for setting explicit themes, the logic
for invalidating the themed icon has now been moved up one
layer, to a new QThemeIconEngine, that is responsible for
lazily creating the actual engine based on the name. The
engine proxies the actual icon loading through to the
real engine via a new QProxyIconEngine helper class.
Change-Id: I474589981f751d7467e3073533cba542182f2d36
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a452e2254644ffbed289fdf051eaf41d7e6a3b0d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Move the implementation qRequireVersion() to prevent having
to include qdebug.h which pulls in many other headers.
Amends b5d874e36fd39fa6e57ff27db27ae0b029949749.
Fix missing include introduced by
3a553507a134bee1562d34ebbf786a053d36fc05.
Task-number: QTBUG-114214
Task-number: QTBUG-97601
Change-Id: Iba68ffca95061666d9458ffa5700d07c7669da5b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 408fbd3f2d7a6b87521f5b3c27ecf6341dc06e13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On FreeBSD, the environ variable doesn't come from libc, but is instead
inserted during linking. See ccf74b592809e0c5a613eff27d6431a4c659e368
(5.6) for more information.
But instead of allowing undefined symbols in QtCore, let's use a weakref
to environ so this one symbol is allowed to be undefined. It won't be,
but the linker doesn't know.
FreeBSD appears to be the only BSD to require this. We used to apply the
same linker option to OpenBSD in Qt 5, but neither the OpenBSD or nor
the NetBSD ports trees[1][2] carry a patch for this, so I don't think
it's necessary.
[1] https://github.com/openbsd/ports/tree/master/x11/qt6/qtbase/patches
[2] https://github.com/NetBSD/pkgsrc/tree/trunk/x11/qt6-qtbase/patches
Change-Id: I63b988479db546dabffcfffd17661c839014771a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 166e7922695e9b145e0ce33e3674a1716021a1e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There is a chance that an unused variable warning will be treated as an
error, and in that case, this check will fail, and as a result FindEGL
will fail.
Fixes: QTBUG-114431
Change-Id: Iaac49589144dbe4172ec58c6705a9f899c25f01f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 14b01b0aadfac07e2a87cea4af0b09b874ffa100)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Don't show a blank frame on app startup.
The wasm update request system supports two types of update
requests: Expose and UpdateRequest. It can happen that both
types of request are made for a single window, in which case
the current code prefers UpdateRequest, since those must be
delivered in order to keep QWindow in a consistent state.
However, if the window is visible but not yet exposed then
delivering the update request will not make the window paint
anything, and we end up with a blank frame.
Ideally this should be handled elsewhere and QWindow::requestUpdate()
should not be called for non-exposed windows, but in the
case does happen then sending an expose here allows us to
recover.
Change-Id: Ib53050c33ad1769ea9b9ad678896af15f87a7ecb
(cherry picked from commit 4c18ebbc1c0bddca4b19a585d2d3a5dafdefc4a3)
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
This is very useful for debugging.
Change-Id: I4861afb9bd2b4e757a962d81583a8b12958f9f1c
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 9e0cb768cd3098e6de253913621887351f719d72)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Both the DOM and XML stream versions of the XBEL bookmarks example had
a frank.xbel in their EXAMPLE_FILES, but there is no such file. So
asking qmake to include it is spurious.
Task-number: QTBUG-111228
Change-Id: Iec08042d181fc09c2c428685ce841a13161ab273
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 8e1b60b33126a48acb0af14d938ceeb3b79f8891)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The XML stream reader and writer accept QAnyStringView arguments these
days, so passing a QLatin1StringView is entirely sufficient. This
makes static functions to provide access to unique QString instances
redundant. Linkers are allowed to uniquify the literals the "..."_L1
reference.
Task-number: QTBUG-111228
Change-Id: I7f37e97631e11683b9ddd3842fc6233547bed5ff
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 202b1dca5d96f225d9e576d5f9e83696c3e02b5a)
Pass one function's return as a parameter to another directly.
Use a ternary expression rather than conditional initialization.
Use initializer-list construction instead of appending to an empty
QStringList; and inline the result where it's used.
Task-number: QTBUG-111228
Change-Id: I781aedba8dcc4251193b55d82fe684c9b5da241a
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
(cherry picked from commit 5fd4a65d95ac1f23af9583da752b1a0fb2646afe)
As readXBEL() does call readSeparator(nullptr), the latter should cope
with being passed nullptr as item.
Task-number: QTBUG-111228
Change-Id: I786e4438b566438448b5d54ff6442c27f1255aa8
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
(cherry picked from commit 705e4e63c6ce26507d930428b8cf0d0f137bf3e5)
Some of our tools don't have the `-h`, or `-v` flag, or it could be
that the `-v` flag also prints the entire `--help` as well, e.g.,
`androiddeployqt`. When running in Jenkins, this may lead to a message
box being shown and consequently stopping the build. By customizing the
flag per tool, and limiting the TRY_RUN to tools that support `-v` or
`--version`, we can avoid this.
Also removed TRY_RUN from `macdeployqt` which doesn't need it anyway.
Amend 41b32cd2c4706fa280fc779d5dec132ee9edf0f6
Fixes: QTBUG-114530
Change-Id: I78e3344d2553c0050c285ae86f2310bd373c6c57
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 69d74afd43adac796efb3ebb1f7e73da64010cb5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The Qt Widgets Application example was moved to manual tests,
and no longer contains the snippet identifiers. Fix \snippet
and \quotefile commands to quote similar code snippets from
other examples or snippet files.
Fix also the following documentation warnings:
* No such parameter 'parsingMode' in QUrl::fromEncoded()
* Missing image: rsslisting.cpp
Change-Id: Ibc989e83abc49837db08628facaf8e5f72b2f123
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 17ddf2a6a52bab5d406bea560591961a7527929b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The method is more than a plain getter, so keep it with the other
logic of the class.
Change-Id: I34aa185a51f04e3db3c1918f9723e53f33e5e9e1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit f3c2cf47fc35262dee0c4732ada6f334009cabf3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The GTK platform theme (and possibly others) emit theme change
when the named icon theme changes, but that was not propagated
to QIconLoader.
We now call QIconLoader::updateSystemTheme(), but note that
if a user theme has been set we ignore the system theme update
and will end up with a stale value, even if the user theme is
later cleared. This will be fixed in a follow up commit.
Change-Id: I40b537f3618f44d396db0c7ca67e515dfcdfba44
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 3025dc597fd1026b7c1aae55fd576fda154ff1c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
By setting 'qhp' to true, QDoc will warn if qhp configuration is not
provided.
Task-number: QTBUG-114181
Change-Id: I26bce80e888d0b0bd270ecdcc6c0774298076a4b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 4729e1e720f1e25eff2793c28e1643a220f66c2b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We should sync external headers for 3rdpary projects
like freetype and harfbuzz-ng and keep the directory
structure.
Fixes: QTBUG-113416
Change-Id: Ie66edb9a21cff37ca6c8c68b6d225de6d8bbad81
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 65b0bc0eed10307cb2ab0a0c45eb6787bed96614)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We should not export non-polymorophic classes wholesale. Only export
the non-inline functions instead.
There are no implicitly-declared special member functions in this
class that could cause problems, so we don't need to delay until Qt 7.
Change-Id: I204d703498bf42465ea122d1f31c443ea439bd6e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit ba501285b5156c0562282a950008c6aa45b9ce9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I don't know why the compilers didn't shout here, but what _should_
have happened is:
- qSwap<quint64>() gets instantiated
- the unqualified swap() call inside gets resolved to std::swap()
- std::swap() is not constexpr in C++17, so qSwap<quint64>() silently
gets its constexpr dropped
- error, due to the use of non-constexpr function qSwap() in constexpr
function bswap()
There's no way through the function that doesn't hit the qSwap(), so
that is also not the explanation. And, indeed, replacing qSwap() with
std::swap() gets me the expected error...
Before compilers get the idea, rewrite the code to not require
swapping.
Amends 686c02224c03735356bdab987bf62644eb34cc34.
Change-Id: Ie1364bb2fd148bf995a8ffd321f77a6021176928
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2bd8e63690569711452e9c56274ffe2bf91f8f5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Explicit calls to Q_INIT_RESOURCE are only needed for
resources embedded in static libraries. See also
https://doc.qt.io/qt-6/resources.html#explicit-loading-and-unloading-of-embedded-resources
Change-Id: I06a24d1c04369eedc78ca60a6ca02ce33907d9e7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit eed17b3634a99b6f6f751830c6443094dd6b600b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Remove the local __PPS target and make PPS::PPS itself the
imported target. This is not only simpler, but also hopefully resolves
an issue with static builds, where PPS::PPS was not properly promoted
to a global target, leading to linker errors.
Fixes: QTBUG-108794
Change-Id: Ia9334a27312ba9bfeec964f6bd6a82652e5f9d37
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b63bf9832959fbb9fb9b6f1546366e582d5c1f36)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
After the "CMake: make compile options consistent for Qt created libraries"
revert, this part of the code also get reverted, however, it's not
related to the revert reason: the user project's deprecation behavior
is changed. So restore this code. We need this code to make sure
we use the same parameters when compiling QtLibraryInfo, otherwise
some compilers may complain about it, such as clang-cl.
Change-Id: Ie50d4f820be3a2e950dd87902d794f1d2681b7a5
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 71c9b9f05b9e3d0d655db33e75207a90509849e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's a RAII class, and RAII classes should be marked [[nodiscard]] at
the class as well as the ctor level.
Task-number: QTBUG-104164
Change-Id: Ie88023ba7c57dad7c2116c1c19a80b908b3a9f4d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 123118f82958bb48cb9cf5f46b72c0298fe8c7f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Having the generic qt_itemFired: as action would result in the whole
submenu tree closing if an item with a sub-menu was clicked on. This
is not how native applications behave. They respond by immediately
opening the submenu, or do nothing if the menu is already open.
By using submenuAction: as the selector we achieve the same behavior.
A complication here is that for some reason we defer associating the
submenu NSMenu to an NSMenuItem until QCocoaMenu::setAttachedItem(),
instead of doing it in QCocoaMenuItem::setMenu(), or even as part of
QCocoaMenuItem::sync().
As a result, AppKit's NSMenuValidation logic will conclude that the
item does neither have a submenu, nor a valid target/selector combo
to be validated, and will explicitly disable the item. This can be
debugged by passing -NSTrackMenuValidation YES to the application.
To work around this we explicitly enable the item once we have set
a valid submenu for the item.
Fixes: QTBUG-114199
Change-Id: I7178e7687066b3fe082454c512ec9c7eab3bded4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c8473c090367496885410ce70c0305b6d2b56ce7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Declaring it as an explicit dependency should hopefully make
the compilers order the object-files to be linked in the
correct order.
Task-number: QTBUG-114243
Change-Id: I723fee468e58786f66d1bba50bc4086beb50adb1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 230c53ad9d7046e61b37ce63a6bc68449393bb7b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In case the current GTK3 theme has no monospace font defined, a
monospace font requested by a Qt application can trigger a GTK warning
"Theme parsing error: <data>:1:0: Expected a valid selector".
The warning is triggered by Qt requesting "{font-family: monospace;}".
In this case:
=> ensure fallback to GTK standard monospace font
=> request "* {font-family: monospace;}" to avoid the warning
Task-number: QTBUG-112896
Change-Id: I24a8da62908af9b153245f53026af60e63a600d7
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 8d1304f4f2cbc8e7e0f1b9c48236dde548b2bc8d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's a RAII class, and RAII classes should be marked [[nodiscard]] at
the class as well as the ctor level.
Task-number: QTBUG-104164
Change-Id: I77260dc00d51d62ed1064e13f566d04e88d28ef9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 16a19a4f4ab207eba4ba6da987b31628b51903b0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's a RAII class, and RAII classes should be marked [[nodiscard]] at
the class as well as the ctor level.
Task-number: QTBUG-104164
Change-Id: Ie877e261cfe602410d9d9bb3acc658d0bb7c4e72
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 6fc908c001a274360d3ff431ba16a1df9d8af089)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- Use mime types in the file dialog handling
- Use per class includes
- Use the configure system instead of QT_NO... defines
Task-number: QTBUG-111228
Change-Id: Iea915604e89d3005270f0eb83eca882855589a44
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 723e331f0a811294e43207db162698c3ff8fde51)
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
These APIs started out as private APIs in qnumeric_p.h, but have since
been made pseudo-public in qnumeric.h. The qnumeric_p.h versions just
forward to the qnumeric.h ones, so just use the latter.
This is in preparation of removing the {add,sub,mul}_overflow
versions, which, despite being defined in the unnamed namespace, don't
sport the q prefix, so potentially clash with global symbols.
The change is a simple textual search and replace, manually excluding
qnumeric_p.h.
Picking to 6.5 to avoid cherry-pick conflicts going forward.
Change-Id: Ic0f7c92f7c47923317109e8a9dc06fa66bdff2c2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit b209f943d2611fa4ac2dd9c64b1a014182b59a3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If flags use CMake scopes that propagate them to user libraries, it may
lead to an issue, if user projects are built using different compiler.
We need to guard these flags to make sure that they only will apply to
respective compilers.
Change-Id: I0fd5847447bd8373e8e07f64dae11f27f48c915d
Reviewed-by: Alexandru Croitor (OOO) <alexandru.croitor@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
(cherry picked from commit a2b6c2f3437bf1779da787e719bea08bc6f28622)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a left-over from when setFamilies() and setFamily() were
setting two different properties, for compatibility reasons.
There is no longer a special step for the singular family, and the
sentence is also a bit obfuscated, so we just remove it.
Change-Id: Ia3c244d41f550a5062de8de63053770258dcacba
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 0ed324314bf151894be9bdd8272adbbc63c2b0ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
currentTextChanged is emitted when the current index changes
and the current text doesn't.
This can be the case, if
- old and new index have identical text values
- an item is removed below the current index
[ChangeLog][Widgets][QComboBox] emit currentTextChanged only,
if currentText changes.
Add a corresponding test in tst_QComboBox::currentText().
Fixes: QTBUG-113717
Change-Id: I847874f0792b29a2841e50bb82d06ad496fb02c3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 9195438a5fd88c676b0fc4abd429bcffa6f97e24)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
After 140ca89a3c2b8d78889d27217f977cd4de10041b commit, the path of the
QSettings default file location changed. That caused the problem with
updating the app (old settings file is not used anymore). That is why we
should still use old (.config) directory for QSettings file if the file
exists.
Fixes: QTBUG-109405
Fixes: QTBUG-109369
Change-Id: I8ce53e0a80e4c2d16802b27b000ab3fbed198628
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit beaaa0bf02fee696b03f2839bea8e0e6bc685a62)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- Use modern string literals (use QStringLiteral instead of
QLatin1StringView for strings that go into the DOM API).
- Use mime types in the file dialog handling
- Streamline code
- Remove mentions of SAX
- Use per class includes
- Do not use QObject::tr()
- Use the configure system instead of QT_NO... defines
- Fix some doc text typos
Complements 3dd3268ded4dd74c64d7ec726fd534375ab9f018.
Task-number: QTBUG-111974
Change-Id: If0dc7b61e729d0a71f37743efc9b82e285d3f451
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 3a553507a134bee1562d34ebbf786a053d36fc05)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Clang's macro deprecation pragma was introduced in Clang 14,
shipped with Xcode 14.0.
We can't version check Q_CC_CLANG here, as qcompilerdetection.h
hasn't been included at this point. Nor would it have helped much,
as we would have had to do so for each individual define we wanted
to deprecate, since mentioning an undefined define in the deprecation
pragma is an error. And we can't wrap the pragma in another macro
that conditionally expands to _Pragma either, as the input argument
is a define that needs to be passed on as is, without expanding it.
So the simplest way to support < Xcode 14 is just to silence
the unknown pragma warning.
Change-Id: Icf95042e6186deb212cd1793eb12ba32206ce34b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3c12c3d58c5e27a5792eb85de994539c17ef2c38)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The HDR info is independent of the current format anyways.
Removing the format check allows code to use hdrInfo() as
a signal for whether to set a HDR format, instead of having
to set the format, then query hdrInfo(), and then setting
SDR again if needed.
Change-Id: I99b57335003d06af227f2a7078560c2a483b049b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 5ea0256b07495977a1f2740f6b2d99984cf927dc)
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The code is mostly an implementation of a model based on QStorageInfo,
shown in an otherwise uninteresting tree view.
Change-Id: Id6ce70d71ddc9bcd6e82a9ee12f5e1af159eac7a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit a89f575be3a410a06165dc19961b1a260a67464d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The example seems incomplete, is undocumented (and unused in shippets,
in spite of tags being present), and generally full of comments that
give the impression that this is for manual testing rather than showing
best practices.
Change-Id: Ie615420e493cc6bb461c5d9ff8d4ae82bb3591db
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit b908c5cf28923a3ae2d9262361a9810bc57cc9c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The relevant bits are a two-line snippet.
Change-Id: Id1731e5bc6585b1d1fd684817b39d19ad0a8a9cc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit ce13dc8c2f73408ce2897f4bd044560955e38145)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
`TYPE` argument is not a thing, and if it is there, QT_BUILDING_QT is
set to `TRUE;CACHE;TYPE;STRING;When this is present and set to true, it
signals that we are building Qt from source.` instead of `TRUE`.
Change-Id: I24784e9aead4929d408d06bce72d3f33ee21eb63
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5d12d9846a9436b4ef4e1f8ac42d081d60568ecf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The replace() implementation overwrites the passed Key key with a new
version, const_cast'ing away the const from the key passed by
reference-to-const. This is UB if the Key was originally declared
const.
Deprecate the function.
Also inline the const_cast, so compilers can readily detect the UB
even if users don't enable deprecation warnings. Due to the severity
of the issue (UB), immediate deprecation is warranted. There appear to
be no in-tree user of the API outside of tst_qpixmapcache.cpp.
[ChangeLog][Deprecation Notice][QtGui][QPixmapCache] The `replace(key,
pixmap)` function has been deprecated, because passing a `const Key`
to it results in undefined behavior. Use `remove(key, pixmap)`
followed by `key = insert(pixmap)` instead.
Change-Id: Ic5060ce3271f2a1b6dc561da8716b452a2355d4c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 78cdd9a64dc0cd666e5c8daafa7477c29641420d)
Between the find() == 0 obfuscation (since fixed) and this unchecked
replace(), it took me way too much time to figure out what was going
on: the key passed has been invalidated by the setCacheLimit(0).
Now that we QVERIFY that the replace() _fails_, it's much easier to
backtrack and figure out why it does so and why, consequently, the
following find() is also expected to fail.
As a drive-by, reorder two lines so the grouping becomes clearer
(blocks now both headed by setCacheLimit()).
Change-Id: I434b65fc13c3fed6512036efeb98d738eeb2a13d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0e96dd3464bc2e03d66ebb574a7a5352942ffdb2)
None of the existing tests failed when I started to return a valid key
from a failed insert(QPixmap), so add a test that would fail.
Change-Id: I74f23d2ec4c04151f8f1266c0c503713d4642f3a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e409d771d922b9772a0ecb4da575c6fd6f95676f)
It wasn't obvious to me, at least, and I only found out about it when
I failed to construct a test failure based on this.
Change-Id: I339132d7bb2cb8a76f0f1feec37891d6131c4d7b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 588ca25e4a31642bf8d18cd1948c50fa514ac0a7)
QMenu's causedStack maintains a list of menus on the way to the menu,
and might contain nullptr if one of the entries was a tear-off menu
that got closed (and thus destroyed, due to DeleteOnClose).
If the entry we get from the stack is nullptr, fall back to the passed-
in parent widget pointer, and test for nullptr before accessing.
Add a test case that crashes without the fix.
Fixes: QTBUG-112217
Change-Id: I958182db47c3cc8733e1780f7efef43881ffae11
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f0049873d2ce0742a2df7ce265db70ca8baa8442)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We observe failures in CI on QNX because the measured timeout is ~995ms
rather than the expected 1000ms. Start the timer before the thread
starts to guarantee that at least as much time elapses as the thread
waits before writing the second byte to the pipe.
Otherwise, the thread might be sleeping already when the timer starts,
and then we can't rely on any measurements.
Change-Id: I6072569a987f5e952b0953e0e394a223f891fd25
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
(cherry picked from commit 30e5ff3ff223d665fbed3baf2d08ad3fcf2b8455)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The conan experiment has ended, and the file is only bitrotting
nowadays.
Change-Id: I8408265f7db7e52803b1f532d08a11387ea978cb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 9decda9063790ad1782d4a623a6a2857e857ebf9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
And add some additional parenthesis for extra safety.
Amends f7c8ff511c30dc4310a72b3da4b4a345efe1fba0.
Change-Id: I4ca8b70f6adb876a10f82685ba9800021218d418
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
(cherry picked from commit e84c0df50f51c61aa49b47823582b0f8de406e3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These are already defined in AvailabilityVersions.h in the SDK,
and we expect people to build Qt against the latest SDK available.
The corner case of requiring defines for upcoming/beta SDKs can
easily be handled by using the version number directly, which is
the recommended practice anyways.
Change-Id: Ica296118ee17608b8c43f9338c3083189083474c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 569c78162a739afcb2605dd253fde60a75014c86)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Availability.h from the platform SDK should take care of this these
days.
Change-Id: I23dd821682db66a1f22b1240d485f4a9cc877cd8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 329db8b64f17c8ef013c586cea1f1c5b49c4a4b7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If we have only one item, we're not using beginDraggingSessionWithItems
which requires us to manage our own drag loop, and instead use good old
dragImage, which takes care of the drag loop on our behalf.
In both cases we end up in draggingSession:endedAtPoint, so we need
to explicitly check for the existence of a manually managed drag session.
Amends 8a359343621fa83941946cb4e661b54ca7a1c4cc.
Fixes: QTBUG-114236
Change-Id: Ifa9110945e191c4ffebe099e3e4edf9c571ab376
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f1011bd2ed3747880e08791fddbb63f73b0faffe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In that case, just like when os_log mirrors to stderr by itself, we
want to disable Qt's fallback stderr handler.
Change-Id: Ia373b19788edbce616d4f0d3d9f0b217ddc1e5c0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 366923b597a56d9a5fa4ac04876ac65c1e0a4d59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The UIAccessibilityScreenChangedNotification will result in iOS resetting
its state, focusing the first a11y element on the screen. We shouldn't
tie clearing the a11y cache to this notification, as those are two
separate actions.
In the case of adding or removing individual elements, we still likely
need to clear the cache, but can inform the system of the more granular
UIAccessibilityLayoutChangedNotification to have it re-read the a11y
tree.
We still handle additions and removal of a11y elements with Window
or Dialog roles as UIAccessibilityScreenChangedNotification, as these
likely involve major UI changes.
The implicit UIAccessibilityScreenChangedNotification on QIOSWindow
destruction has been removed, as it's assumed iOS will automatically
refresh its a11y tree when a UIWindow is destroyed, and in any case
it's up to the individual clients of QAccessible to send the relevant
QAccessibleEvent to inform about the situation.
Fixes: QTBUG-100094
Change-Id: If7d5cb961743e5ca97d45553b05ae5e92f82d275
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit b006d6d9dea11ac788a54ee3ffd13a9463003a32)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These are no longer in use in Qt.
Change-Id: Id07bc0e09a414754493562d3a48df55cc28c5049
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit af47a197a59675149db208088b4fe072215901dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Knowing the maximum potential component value can be useful
to potentially (sic) opt out of an HDR code path if the maximum
color component value will be too low to make the additional
processing overhead worth it.
Change-Id: Ib1e1b7a745b236e1d137a1e7daf1248f1572e184
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 183629e3ef9286332fdefa15dbce1b1495ef079d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Although QRhiSwapChainHdrInfo uses 'max' for this value, it's used
by Qt Multimedia's QVideoWindowPrivate::render() as the current
maximum, so we need to reflect UIScreen's currentEDRHeadroom
rather than potentialEDRHeadroom (the absolute max), the same
way we reflect maximumExtendedDynamicRangeColorComponentValue
and not maximumPotentialExtendedDynamicRangeColorComponentValue
from NSScreen.
As we don't support HDRExtendedSrgbLinear on < iOS 16 there
is no point in providing a heuristic fallback based on the
iPhone 12 spec.
Change-Id: If071bb64f269ce16886206df05eb9f27d260bf15
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 74319d05b1e8e2b5dcf226ef11bc66776460fa3f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The function was part of the Cocoa style for checking the metal
look (not Metal the graphics API), but has long been removed.
Change-Id: I366b952db4ae82b8ecc442f1ce61e7f53cacfe80
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 716df4965e75ff9e87278ea6753a4a311ce2c3bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Use new api calls for calculating pixel size and physical size
of multi-display setups after some existing apis have been deprecated
in Android API 30 and 31. Also, do the physical size calculation outside
of the supported modes loop.
As for the physical size, this patch still uses xdpi/ydpi for the
calculation instead of densityDpi as suggested in [1] because from
testing few scenarios, the results returned from xdpi/ydpi are more
consistent with physical device specs.
[1] https://issuetracker.google.com/issues/194120500
Task-number: QTBUG-112742
Change-Id: I0c8ef5185c8b6463830b528374954c324a32d657
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit c0e0b56055e2ed0155d4e2402319dd8f8f134e10)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This amends commit f9c87cfd44bcf4b90cb45354252ef19f647b0469 to reset the
signal block mask too, not just the signal handlers. For this, SIGPIPE
is not treated specially.
Change-Id: Ib5ce7a497e034ebabb2cfffd17627289614bf315
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 062b2ac71bac1e0449eff7f8f02cb0020ad39991)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I've investigated the functions we call in the child side of a vfork()
for implementations that do more than simply place the system
call. Where wrappers exist, they are usually related to handling of Unix
signals or PThread cancellation. The implementations investigated are:
- Bionic (Android)
- FreeBSD
- glibc (Linux)
- MUSL (Linux)
- NetBSD
- OpenBSD
Relating to thread cancellation, NetBSD implements it with an internal
API that does not include Unix signals and Bionic doesn't implement
thread cancellation at all. Their wrapper functions are harmless.
The rest do use Unix signals to implement thread cancellations (called
SIGCANCEL everywhere except OpenBSD, where it's SIGTHR). Therefore, they
all block the application attempts to mask this signal or change its
handler (if they're not buggy). FreeBSD's and MUSL's do some locking in
their implementations[1][2] we really want to bypass, therefore we must
bypass their sigaction() wrappers.
The investigation also showed that the glibc[3] and NetBSD[4] abort()
implementations to be slightly unsafe, but we don't use them
ourselves. We're also adding QProcess::failChildProcessModifier() so
users won't have to resort to abort().
[1] https://github.com/bminor/musl/blob/master/src/signal/sigaction.c
[2] https://github.com/freebsd/freebsd-src/blob/main/lib/libthr/thread/thr_sig.c
[3] https://codebrowser.dev/glibc/glibc/stdlib/abort.c.html
[4] https://github.com/NetBSD/src/blob/trunk/lib/libc/stdlib/abort.c
Task-number: QTBUG-113822
Change-Id: I9201d9ecf52f4146bb04fffd17651123800e15a4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e71c226d6f188abd811b28d3cb7529343f52d61f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Pipes are unnamed FIFOs, so they're basically the same.
The difference here is that open() blocks on opening a FIFO until both
ends of the FIFO are opened. This helps us in synchronizing the two
threads and thus ensuring that that the read() system call deep inside
QFile does, indeed, block.
We see this with strace -T on Linux:
[pid 662956] openat(AT_FDCWD, "/run/user/1000/tst_qfile_fifo.2575572361", O_RDONLY|O_CLOEXEC <unfinished ...>
... aux starts up ...
[pid 662957] prctl(PR_SET_NAME, "QThread") = 0 <0.000004>
[pid 662957] openat(AT_FDCWD, "/run/user/1000/tst_qfile_fifo.2575572361", O_WRONLY|O_CLOEXEC <unfinished ...>
[pid 662956] <... openat resumed>) = 4 <0.000133>
[pid 662957] <... openat resumed>) = 6 <0.000011>
[pid 662957] clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=500000000}, <unfinished ...>
[pid 662956] read(4, <unfinished ...>
[pid 662957] <... clock_nanosleep resumed>NULL) = 0 <0.500183>
[pid 662957] write(6, "\2", 1) = 1 <0.000033>
[pid 662956] <... read resumed>"\2", 1) = 1 <0.500311>
Change-Id: I63b988479db546dabffcfffd1766d7a48819b149
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 01872d06d9a09c83f28b3ecebcb06f0ed81c5622)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When using move-only types, continuations args are set using takeResult
function, which has the side effect of invalidating the QFutureInterface
associated with the promise/futures by:
1. setting isValid to false
2. setting the state to NoState
And when the promise is destroyed, it tries to run the continuations if
`finished()` is not called, which is done by checking the Finished bit
in the state. But since the continuation has been run before, and the
state has been set to NoState it tries to run the continuation again
causing a segfault. Multiple solutions come in mind:
1. don't run the continuation if the state is NoState, but this would
break the case when an empty promise is destroyed
2. check inside the continuation if it has been run before, and if so
don't run it again, but this seems hacky since we don't want the
continuation to be run twice, and it should break if it did.
3. when invalidating the promise leave the state as is, and change
isValid only to false, which changes the current behavior, but is
still compatible with the documentation which states only that
isValid will return false if takeResult is called
I chose option 3
I also extended some tests to test for move only types, and added a test
that continuations run when a promise is finished. This simple case
would segfault before with move only types.
Fixes: QTBUG-112513
Change-Id: Ie225ac4fdf618e4edfb0efd663d6c7fd6b916dbd
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 1f22fc995a36193cd67e8190858bb33614d149f4)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If a foreground style has been defined in the style sheet,
QStyleSheetStyle populates its brushes for the color roles ButtonText,
WindowText, Text, and the widget's foregroundRole with the foreground
brush. PlaceholderText is set to the same brush with a modified color.
That sets their resolve bits in QStyleSheeetStyle's palette and
prevents these color roles from being inherited by the widget's
palette - in contrast to all other brushes.
This patch makes the brushes mentioned default to the widget's palette
if they are set there. It adds a test in tst_QStyleSheetStyle.
Fixes: QTBUG-93009
Change-Id: Ie3df9dbd17b96fa72beee90792fc7eca1933cdbe
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c4635c0d5822d0e95ceca867fffb9ba86a2b7bfe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This no longer is range-length preserving now, so adapt the
documentation.
For the non-contiguous iterator case, it's actually ok to always
resize(0) and then append(), because, unlike for QList and QVLA, the
resize(0) doesn't actually iterate the container to destroy
elements. It just sets some members and conveniently detach()es for
us.
The char8_t case is even more complicated, since we can, atm, not
include qstringconverter.h into qstring.h, yet qstringconverter is
required for stateful UTF-8 decoding in the input_iterator case. So
that's postponed to yet another patch, and maybe won't make it into
6.6. But I feel it's important to have at least one
non-length-preserving version of assign(it, it) in before release lest
users come to rely on this documented (and de-facto) feature of the
the step-2 assign().
Fixes: QTBUG-106198
Change-Id: Id458776e91b16fb2c80196e339cb817adee5d6d9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 05e388013098887eb66090b8f145ef92d60657db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is just confusing. QPixmapCache::find() already returns bool,
comparing it to a literal zero just makes it hard to read.
Change-Id: I43c000890377cca2111daa48799f10cc99aad8cf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6032845ca2fc69fb67971ea9f7e06588ffcbe9f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Android's toolchain file, ie., android-legacy.toolchain.cmake assumes
that the default build is a Debug build, and it adds the `-g` flag to
CMAKE_<LANG>_FLAGS, as a result, our release Android build always
contains debug symbols. In this patch, I basically move the `-g` flag
from CMAKE_<LANG>_FLAGS to CMAKE_<LANG>_FLAGS_DEBUG, and
CMAKE_<LANG>_FLAGS_RELWITHDEBINFO.
Fixes: QTBUG-111901
Change-Id: I31eadb07d9172c923e8beaf0ac6c6e34fe1ebefb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 9d8a04cd1fd0a0c4ec891a9497512e4bbbaead9d)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The method has been named expandingDirections() since the very
initial git commit for Qt 4.8 ... So high time to fix the
documentation.
Change-Id: If5d7189ebbe439bd0b0e95d51e77c08ee52c3471
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
(cherry picked from commit ef7e65e19a0ddf74a0cd72e59a83b9543426322b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
\c prevents qdoc from linking to the relevant function documentation.
Change-Id: Ieaa38b1feba816e911b17445a9436f64c234522a
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 53fa325f4c4ae5721a4858eeec33ef79d19d1acf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
I think this needs to be more prominent, as I noticed during the testing
that it could cause issues if it gets lost in between the config
messages, as we knew of course.
Task-number: QTBUG-113463
Change-Id: I2ece498a8d3604362a49cc10499b92b0d2764fb9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9a5de496f1ff37b345010dd70304b2408f273322)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The screen's DPI need to be accounted for when calculating
the size in mm from pixels. This was missing after multi-displays
support was added for Android.
Amends fbf586db2c587e7ba83cf1bfe8e5b912310d6bdb.
Fixes: QTBUG-112742
Change-Id: I31814faa8de68e5193757d52e264b8ed90ae56b6
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 436923a76c4c60ad7271a66821768b06573310ce)
QString uses UTF-16 encoding and thus "unicode characters with
code values above 65535 are stored using surrogate pairs,
i.e., two consecutive QChars.". [1]
When the character inside of text is retrieved using the
GetCharacterAtOffset method of the AT-SPI Text interface,
use QStringIterator to retrieve the character's actual
codepoint instead of returning an invalid/incorrect one.
[1] https://doc.qt.io/qt-6/qstring.html
Fixes: QTBUG-113438
Change-Id: I07108481716329fd23a92c88892eaedd3f9defc6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit c7b925757f9b55924b788a2f08d777baa0e63250)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
...to only return true for HDR formats that are sensible for
Direct 3D. There are currently no other formats, but new ones
may get added in the future.
Change-Id: I4fc6d605da8f6bf2644a4e5c355ab8f1c62ad68d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 8a1915e04e2969a358aa5004bbd511cd92ce7372)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Although the header is available, and the compiler reports that the
standard library supports memory_resource, the feature is only
available on macOS 14 and iOS 17, as reported by
https://developer.apple.com/xcode/cpp/
As long as our deployment target is lower we can't unconditionally
use this feature. It's not clear whether the expectation is that
consumers of the standard library on these platforms will have to
runtime check their uses of these APIs.
Task-number: QTBUG-114316
Change-Id: I50c1425334b9b9842b253442e2b3aade637783ea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f7c8ff511c30dc4310a72b3da4b4a345efe1fba0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit 389507a047e0ec0721535052df6ddf957fbb95b3.
Reason for revert: The original patch unintentionally changes
the deprecation warning behavior for user projects. Merging
the current change will resurface the original static qt build
bug until a new fix is developed.
Change-Id: I29b41b43fdd76b19bc46439470e04443dc2b8ddb
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Yuhang Zhao <yuhangzhao@deepin.org>
(cherry picked from commit e3c6754760b23a9d6e7879c037f72bf768674572)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Unity Build was missing from the `config.summary`. This fixes that.
Task-number: QTBUG-109394
Change-Id: Icd9898956ec1a5332297272130bce27d4d2675ca
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 958c12273af07b04f087c322efdc57fc5f84a091)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We now add NOMINMAX to PlatformCommonInternal target which will be
linked to everything else, so min/max will not be defined upon the
inclusion of `windows.h`, or other headers.
Change-Id: I10016720dac7ce015e929885b7368ee86d8b6918
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 1dfa922606e497918e57a6a06f96ee63b7fb163e)
In cases like `C:\` or `C:\D\E F G\`, we had the issue were Windows'
path separator was acting as an escape and was corrupting configure
arguments', so, we were ending up with `-DCMAKE_INSTALL_PREFIX=C`, or
were cutting the argument list short, and ended up ignoring some of the
arguments.
Change-Id: I433af61d5c143cc37a64dcf8ac82a1a78ce543a5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b738ad7e3afd41c6d43d8b434fe221ab9b27bff1)
QTextDocumentLayout could get into an infinite loop when the
contents exceeded QFIXED_MAX.
Specifically, QFIXED_MAX is used as meaning "one infinite page"
which means that newPage() will just return when it sees this
page height. If the page actually grew larger than this, though,
we would treat it as a page break and enter a loop where we try
to call newPage() to create new pages and never return.
The layout engine cannot support documents this large, so we detect
the case and then just finish the layout loop early when it is
encountered.
Fixes: QTBUG-112968
Change-Id: I485303d714d112119a971c43e0086bf6d3d23e9f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 1dc88a1b5f826219a58cefc03b4118917be2da96)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In 6ba003f73295b896aa6dc1fba099daadb4760209, we added support
for transforming bitmap fonts in Freetype by rotating the rendered
glyphs as images rather than using FT_Set_Transform(). However,
we enabled this for all transforms, even the ones that were only
doing translations, which is unnecessary and also caused some
issues. We restrict the condition to only cover rotations, scales
and shears and let translations be handled as before.
[ChangeLog][Text][Freetype] Fixed an issue where setting a
translation matrix on text using a bitmap font would cause
rendering artifacts.
Fixes: QTBUG-114229
Change-Id: Ib3f2870e57c881364c85432a7937f15f3664eda7
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 90e3f0bd73e5fea6e0ed3fec65e3a5864d5e132f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
To stay compatible what the OpenGL-based code did before Qt 6.4.
Fixes: QTBUG-113811
Change-Id: I80d89b21dcace9b5c361b964d56f29e996940c24
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit ec27b99c2a16994127f77d76eb1fb466c390aee9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
...for Qt 5 compatibility. It seems both Qt Gui and Quick calls
the QOpenGLFramebufferObject helper for blitFramebuffer with
the default GL_NEAREST argument for the filtering. In Qt 6 we
must use the same if we want to ensure pixel-perfect compatibility.
Task-number: QTBUG-113811
Change-Id: I03c69448265e7b0d73f021d71135a1725e96fcbc
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 6ec01168d1c517bedf8039ba27f8059ca29478f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fix the treatment of the sRGB flag. That is independent from the value
of format(), and should be checked regardless of wanting a HDR swapchain
or not. On Android for instance Display P3 with RGBA8 or RGBA8_SRGB is
one of the formats offered. While we do not support this right now,
it is an example of a "HDR" format that still uses a color buffer
format where a dedicated sRGB format is available and must be
chosen according to the specified swapchain flags.
Change-Id: I2d97689fa5af7c08486702ae690f2230d06db469
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 526744ba6536175f9a19ffdf6ff1ee068f9522a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When enabling the logs, printing hdrInfo() to qDebug
in Qt Quick is something that is done before calling
createOrResize() on the swapchain. (logically since
this is still at the point of configuring the swapchain
settings)
Thus the correct thing to do is to only access m_window,
not the backend data's window.
Change-Id: I3004b0c4a4fdb09cb07a9c0e3c503f79c699c562
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit bee7d2c61026089371249ab03e1a788604abf99b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On Windows, we will try to run our host tools after a successful build.
If the build fails because of a missing DLL, we will be able to throw an
error with some direction on what might be the cause, and how to resolve
it.
Fixes: QTBUG-113273
Change-Id: Iba548829bc41fbee95cef288faaf7edca118ee33
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 41b32cd2c4706fa280fc779d5dec132ee9edf0f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This seems to work with prepend(char), but not with prepend("data"),
cf. QTBUG-114167.
Task-number: QTBUG-114167
Change-Id: I7aa4dca7c2b5938c2e5ad416231945c23140d659
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit e4682408b036b95d4edfb7e324c8e6835230d263)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So I can use it in tst_QProcess itself.
This also modernizes it a bit by using __builtin_trap() where available.
On x86-64, this expands to the ud2 instruction.
Change-Id: Ib5ce7a497e034ebabb2cfffd176288433378731b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f992402f15fd117bb5ccf9a484bf31fd4f4967e2)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It seems to be the preferred constant in other OSes. In particular,
OpenBSD does not appear to have ELFOSABI_GNU[1]. Found while researching
if commit 9caac0f176040b4da48d3ea289683b0b082cf729 was still necessary
for OpenBSD.
This reverts commit ded2fd9ff4fea06af881229bacaeff5d0ecfa6de, which
implied NetBSD 9 doesn't have ELFOSABI_GNU either.
[1] https://github.com/openbsd/ports/blob/master/x11/qt6/qtbase/patches/patch-src_corelib_plugin_qelfparser_p_cpp
Change-Id: I63b988479db546dabffcfffd17662020d722af20
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 4e2f8bad0a4e83ac6890bf6f38f26d9857c0d79b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Found in the OpenBSD ports patch collection[1] while researching if
commit 9caac0f176040b4da48d3ea289683b0b082cf729 was still necessary for
OpenBSD. They should upstream their changes instead of working around...
[1] https://github.com/openbsd/ports/blob/master/x11/qt6/qtbase/patches/patch-src_corelib_plugin_qelfparser_p_cpp
Change-Id: I63b988479db546dabffcfffd17662042c7130f7c
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit b1816c2718acf9743d842e4b02dd314d8252cb78)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Restrict the permissible value_types to those QStringView can take,
plus QLatin1Char. All of these implicitly convert to QChar and give
the correct result, even when converted char-by-char.
Task-number: QTBUG-106198
Change-Id: Icb44244cb08af391161c4309467d4e0d2d3d3d62
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
(cherry picked from commit f5ed163c19c4a165a61e6fbfdaf5ee39b5587a0c)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Found at https://github.com/openbsd/ports/blob/master/x11/qt6/qtbase/patches/patch-cmake_QtRpathHelpers_cmake
There are a lot more patches there whose purpose I can't tell. This is
the only CMake one that I do understand. They should upstream those
changes to us with an explanation, instead of carrying patches...
Found while researching if 9caac0f176040b4da48d3ea289683b0b082cf729 was
still necessary for OpenBSD.
Change-Id: I63b988479db546dabffcfffd17661fdd376bf8c8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 604eb6f4cdf61bf02a2e6e2ec2bbb58d0567364c)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- The following error occurs when trying to use these example codes:
"error: expected primary-expression before ‘!=’ token"
- Rename "map" to "hash" in the QHash snippet
Amends 7d542e1daf09caadf6d3e36c4b09bdf94952c5a1.
Change-Id: I1ad5b799f444bf074dbfb44223c00770ecf456c7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 4e367fa17bca5ec9cc7456f9ce2a81466b34027f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Introduce message helper functions for get/set, sparing the translators
having to translate the data types.
As a drive-by, use UUID/CLOB/BLOB consistently.
Amends 0efd8854c4b32ec0b011efbf6b3a1990fe684e32.
Task-number: QTBUG-111219
Change-Id: I7a137c3797947523af5478b3add6ee0a26b295d7
Reviewed-by: Fredrik Ålund <fredrik.alund@mimer.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit de3795c2a67a60691b1bb6b58908a16860dfc77a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's quite common that macOS and iOS share backends, for example due to
the functionality being part of one of the Apple core frameworks. In
this case the support isn't directly tied to the Darwin kernel per se,
so let's use a more general define to refer to the union of Apple
based features.
Change-Id: I71cac5ec1d74cd86eba67a64b20846e48c9f05c5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f34c5215f45a242962835c1174d79912a56e5410)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Accounting for the case where `MODULE_ROOT` is set to `.` which then
makes the `get_filename_component` command to return an empty string;
consequently, we cannot find the `config_file.txt`, and cannot process
the features correctly.
Amend f4bf7982a679312146546fabfb086e801c2bbc37
Fixes: QTBUG-114085
Change-Id: I55c7529be6caba4691adec80efca8021bd03c500
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 076b4bed9f418f97f9fb29fce4f948f0d98854c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Monitor index detection changed from comparing deviceNames to comparing
serialNumbers, to prevent the case where two monitors with identical
names might overwrite one another.
Fixes: QTBUG-112829
Change-Id: Ibfad08e178774396c4b347acfcfbdb83ed4fe332
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit f4d6d04898bcc239f4b271330ba778de69bbd893)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Small adjustment made to previous patch to fix the following issues:
- restoreGeometry not being updated after moving the window from one
screen to the other with keyboard shortcuts.
- restoreGeometry's size not being changed when moving screens if
WM_GETDPISCALEDSIZE isn't sent.
Task-number: QTBUG-112814
Change-Id: I9dd2340137ce57a731f8881d476e902323887e62
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 245c2b621f5942861b7f827bfc8a859b9efb9b72)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When a floating dockwidget's title changes, it is rendered as a
window title. When the title changes while floating, the change will be
reverted to the pre-change title when the dockwidget is docked again.
This patch explicitly propagates the window title, if it has been
programmatically changed while the dock widget is floating.
It adds test functionality in tst_QDockWidget::floatingTabs().
Fixes: QTBUG-113591
Change-Id: I96fa69fb27ad1a85f4ea9ce44c0a22290259fca6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c153066baaa88718ed45b68230d81285eb436d3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We override the old encoding because it wasn't UTF-8, then we use a
fresh call to nl_langinfo(CODESET) when reporting the encoding that
"is not UTF-8", except that we've just fixed that so it is now.
Store the old encoding in a std::string before we change it, so that
we can report what it was rather than what we changed it to.
Amends commit 3690c202f959a505e0f0bcd4a7b19f235b04d015
Task-number: QTBUG-113371
Change-Id: I5f7c3648890cb0abf1d4769af24715686762c176
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a7c87be8883458d151e3fe7fa1a8511212af41d4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The system locale backend on macOS uses system APIs to format dates
and times in localized ways. Those system APIs appear to know more
about time zones than the time_t functions (which artificially cut off
before 1900) are willing to tell us. As a result, QDateTime is left to
guess the offsets in use before 1900 but the locale-formatting takes a
correct offset into account, which can lead to QDateTime and the
locale-aware APIs using different offsets. This is further compounded
by the system APIs taking into account the calendar transition from
Julian to Gregorian. We can't do much about the latter.
Previously we were formatting dates by passing the start of the day to
the system APIs (which take a date-time, albeit using a "Date" name
for the type), along with a date-format that ignores the time of day.
For dates before 1900, if the system APIs know the offset in use was
less than that in use in the early 1900s, QDateTime (using the latter)
gets the start of the day slightly earlier than where the system APIs
know it is, so the day before is the date at that time. Use noon on
the day in question to avoid this problem, at least for zones that
didn't do whole day offset-shifts (crossing the date line) before
1900. Document the problem and the limited extent to which we can
solve it.
Task-number: QTBUG-54955
Change-Id: I5be1bfdb3013433ee248846533ef73af39f173f5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 9155a07667a3e3e7ac59382a59ba615d7211a322)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of passing a QLatin1StringView to QStyleHelper::uniqueName(),
which takes a QString, allocating, and then using QStringBuilder to
append something to the result of uniqueHelper(), allocating again,
pull the appends to before the call to uniqueName(), folding these two
allocations into one.
Task-number: QTBUG-112200
Change-Id: I501dd4a3df4b9f5267ca931b550d521f4dafe493
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 362b5b84281ac4f31237166763f565e331876887)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of holding three QPointF's in a QPolygonF, which will allocate
them on the heap, use QVarLengthArray<>, which will allocate them on
the stack instead.
Task-numbber: QTBUG-112200
Change-Id: If078e5a9a5cb82fd03b511e28cceb88bd42996f8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d6ce0bad67c6961dc87469db7ac81144a52e875f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QPixmapCache maintains a mapping from QString to QPixmapCache::Key, in
the form of the cacheKeys QHash, but QPixmapCache::clear() didn't
touch it, leading to the string data (as well as the Keys) being
retained after any possible use. This can lead to memory slowly being
eaten up, as reported in QTBUG-112200, and prevents a periodic calling
of QPixmapCache::clear() from being a work-around for the issue in the
bug report.
Fix by clearing cacheKeys in QPixmapCache::clear().
This is designed as a low-risk enabler of a work-around, not a fix for
the issue. The work-around enabled by this is periodic calling of
QPixmapCache::clear().
[ChangeLog][QtGui][QPixmapCache] Fixed QString key data not being
freed on clear().
Task-number: QTBUG-112200
Change-Id: Ica6fa0e27e1b47b8df58d5e996378a2ececa5f9c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 6ab0d25a09f5aeb7a5a062f7fd44e95ca761e21e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a minimal version of qtloader. The load function accepts
the same arguments as emscripten runtime with a few additions:
- qt.environment
- qt.onExit
- qt.containerElements
- qt.fontDpi
- qt.onLoaded
- qt.entryFunction
State handling has been removed in favor of making the load async
(assume loading when the promise is live).
Public APIs getting crashed status, exit text and code have been
refactored into the new qt.onExit event fed to load. No need for
keeping the state in the loader.
The loader is integration-tested. A test module with test APIs
has been created as a test harness.
The runtime APIs exposed by Qt (font dpi and screen API) are handled
by the qtloader seamlessly.
Change-Id: Iaee65702667da0349a475feae6b83244d966d98d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit b9491daad0ed1c4b9c74e0c3b23f87eb7ad4f37d)
If I'm not mistaken we would like to leave this to Xcode, if so, we can
use `$()` to make our intention more clear in the code.
Change-Id: I3867f68f371a1cf1a5db5e639ec740f2546ccd75
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit a471324a03a0b83e657325ee22f032b273e84102)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If an application sets the current index and resizes the tab widget
before showing it, then the scroll offset might be calculated based on
an old size. Since after ca15f650a1a914bb9a41131109c46c4e52c5ebb1,
resizing explicitly avoids scrolling, this could result in tabs ending
up scrolled outside of the tab bar when showing the tab widget.
Fix that by explicitly making the current tab visible in the tab bar's
showEvent handler, which recalculates the scroll offset based on the
actual size.
This is only reproducible with a tab widget, which lays out the tab bar
for each change and resets the tab bar's layoutDirty flag. Add a test
case there.
Fixes: QTBUG-114204
Change-Id: I1e9506b9dde1dd892291d108dd2c7b675ef99509
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Jonas Kvinge <jonas@jkvinge.net>
(cherry picked from commit 2a7da1b3c8c4096d7c2b09f3fcc58e9cf47867cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit 3c6c3eccd1f91bd1ae0a518318ef264f8eff63f5.
Reason for revert: They do appear to be needed, and removing them
changes behavior: QTBUG-114206
Fixes: QTBUG-114206
Task-number: QTBUG-114238
Change-Id: Iac75bbc1ef14fe89f4282bd58fe996f9a09b8506
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4d261c1b544330c5481b2ac2e42fbab764255ab5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If we don't have a valid Symbol to get a line number from, or if the
symbol.lineNum is -1, print a shorter message containing only the file
path. Printing: '/path/to/file👎1' isn't useful (and looks wrong).
Change error/defaultErrorMsg/warning/note() to delegate to one central
method, so that they all behave the same; e.g. previously warning() and
note(), guarded against printing "-1" for the line number, whereas
error() didn't.
This also makes it possible to use error() for reporting other issues
(e.g. the size of generator.strings list exceeding INT_MAX, which will
happen in a later commit).
Change-Id: Iddc96e08315fae415be6a84928f845d7bceb4c5f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 9cb08c4c0de1685551c18e3b7958a00afa2a4c6a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
And using qsizetype in some places.
::pathconf() returns long.
Found by using -Wshorten-64-to-32 clang compiler flag, or adding that
flag to the flags clangd uses.
Change-Id: I9f9abd3d4d6fe73f525eec869ceabc799317f3d6
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 8d77ee0f2b042af7aec43e1e83eb26d92c2f8234)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Using:
- range-for and iterator-based loops
- QList constructor that takes a pair of iterators
Found by using -Wshorten-64-to-32 clang compiler flag, or adding that
flag to the flags clangd uses, e.g. adding this to clangd's config file
(see https://clangd.llvm.org/config):
CompileFlags:
Add: [-Wshorten-64-to-32]
Change-Id: I13ae65e09ab59a59f9e5c189ea27e4e16527df2d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 3ee289e40d1a7d3582cb1a3a304e681d2085bb82)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2023-06-05 20:35:35 +00:00
2120 changed files with 57022 additions and 42171 deletions
message(FATAL_ERROR"Attempting to evaluate feature ${feature} but its definition is missing. Either the feature does not exist or a dependency to the module that defines it is missing")
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.