70653 Commits

Author SHA1 Message Date
Volker Hilsheimer
15a1b718e6 JNI: handle narrowing before creating a new Java string
Emit a warning if the string we get is too large for Java, and cast
the size to jsize before calling JNI.

For consistency, replace the Q_ASSERT in QJniArray's size check to use
the same logic.

Addresses header review comment; code was not handling this case before
it got moved into the inline helper either.

Change-Id: I00d68509be8b5f7304dda2e824fa0ced0f8f8d48
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 9d35561f6f6be125369e6020ce95a73b4aa6b51f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-17 21:55:10 +00:00
Bartlomiej Moskal
fdf4738be3 Android: Unblacklist textMargin test from tst_QLineEdit
Older devices may have lower screen resolution. In this case, the
hardcoded width may not work as expected. For example, all text may
not fit in QLineEdit.
This was the reason why the tst_qlineedit::textMargin test failed on
some Android devices (especially x86 emulator with Android API 29).
When the left and right margins were set to 20, all tested text did
not fit in QLineEdit. When we clicked at the beginning of QLineEdit,
we clicked on the second character of the text. The cursor was moved
to position 1, which caused the test to fail.

This commit updates textMargin test to make sure that tested text will
fit in to the QLineEdit.

Task-number: QTBUG-87417
Fixes: QTQAINFRA-6897
Pick-to: 6.8
Change-Id: I35352ac1e6f975e72d5c9638f8520f8ddd1d56ae
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
(cherry picked from commit 0a017308cca154b6f906c6e143fb33fe109316bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-17 14:53:37 +00:00
Bartlomiej Moskal
4ae1b626ef Android: Unblacklist tst_QLineEdit selection tests
Using the left/right keyboard key will deselect the text but also
move the cursor. In this case, to be consistent with the test, the
cursor must return to the previous position. This allows to
unblacklist tests:
  - undo_keypressevents
  - leftKeyOnSelectedText

Task-number: QTBUG-87417
Fixes: QTQAINFRA-6890
Fixes: QTQAINFRA-6895
Pick-to: 6.8
Change-Id: I8a6d7cca332fe365ca820a67c23d9cd3fc36fc43
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 43f2fdc25cfd356292636ea1f8160cf62bab4018)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-17 14:53:37 +00:00
Eskil Abrahamsen Blomfeldt
5f98cc3ecd Add some additional debug output to font matching
The font matching process consists of multiple passes, so to help
us keep them apart, this adds some informative output to explain
where we are in the process.

Change-Id: I54f0712cc8600d2b1e1bf4b8688e2ae198e0453b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit d2c8c12183a7f085643ee2d1fa7cd1677256b148)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-17 11:23:54 +00:00
Eskil Abrahamsen Blomfeldt
41698bb5c1 FontConfig: Don't register hardcoded fonts as color fonts
This amends 16850709306589a2433c0038605d365a6b6bedad. The patch
aimed to pass false for the color font parameter, but got it in
the wrong position, so it passed false for the pixel size instead.

The registerFont() function is a real mess, and it should be cleaned
up, but this at least fixes the immediate bug.

Task-number: QTBUG-132821
Change-Id: Id54989960aa5f86d3c79423d004530bb6a4fa475
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 0107e05e50761dd29a3d968baa9f502ade41e064)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-17 11:23:54 +00:00
Eskil Abrahamsen Blomfeldt
5441057cc1 Freetype on Windows: Detect system color fonts
For populating the freetype font database on Windows, we're using
GDI, which does not support color fonts. Therefore we were
registering all system fonts as monochrome, which was okay, because
our Freetype backend did not actually support the color font format
used on Windows.

Since 29a1c57183958b3951db4e7ba9504918a3caa761 we now support COLR
fonts, so they should be added with the correct properties.

Since GDI does not provide this information, we create a temporary
freetype face from the font file when resolving the family during
matching.

Fixes: QTBUG-132255
Change-Id: Ib62632de7fe8d9dc533abe4ae2368090a382cca7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 81e596c24fc106439ce4135478a2d18d23fdbaac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-17 11:23:53 +00:00
Soheil Armin
bbcf5a4191 Android: Fix incorrect JNI call from QAndroidItemModelProxy::sibling()
The return type of the QtAbstractItemModel.sibling() method is
a QtModelIndex Java type.
The JNI call from QAndroidItemModelProxy::sibling() is using
<jobject> as return type of QJniObject::callMethod(). This will
result in a non-matching JVM function signature.

This change replaces jobject with JQtModelIndex as the QtJniType.

Pick-to: 6.8
Fixes: QTBUG-132841
Change-Id: If157858f1ed49e25c8fbdfb9bb5c1fc2b7052826
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 190c85b706ee80bc92d6419676dca0dbfa60587b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-17 11:23:53 +00:00
Alexei Cazacov
813ea954b3 Docs: Describe QTextFormat::TextUnderlineStyle property
This commit describes the QTextFormat::TextUnderlineStyle,
TextVerticalAlignment, and TextOutline properties and their allowed
values

Task-number: QTBUG-126954
Pick-to: 6.8
Change-Id: Ib961331d9a06edb2bedf0a6b93afebef0cd467cb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 0ec4447d7a535e1d593f3a5db94f0dcd98fe61ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-17 08:05:30 +00:00
Thiago Macieira
c804fc386b QMessagePattern: merge and improve %{time}-printing code
All modern compilers implement divisions and modulus via multiplications
and shift, so the codegen is practically the same (three multiplications
in total). But the new code allows more than 136 years of uptime (49710
days).

Drive-by fix indentation in nearby line.

Change-Id: Iea806bd7dfac1f852c66fffd41c2ac6660e7cc65
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 61924c622acc5afd1e01dd65702e09a063928c5f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-17 01:43:36 +00:00
Thiago Macieira
715ae29080 QMessagePattern: replace Q{Elapsed,Deadline}Timer with std::chrono
There's nothing wrong with those two, but we don't need the middle men
to the monotonic clock. This also reduces the sizeof QMessagePattern by
one quint64 (QElapsedTimer is 16 bytes in Qt 6).

Change-Id: I0eb171f03ee8f3a7148bfffd5534a7f3daba3a01
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 9dc294143d8fab498268f88c176b1af16de9b2ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-17 01:43:35 +00:00
Thiago Macieira
5dc84d6a21 QCoreApplicationPrivate: move translation NSDM to improve packing
This way they aren't in the middle of a block of booleans.

Change-Id: Iba067f6f23db7c059cddfffdc27231dd09b6898e
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 4daed2877251b861ce9f7ee5a09dc035518e1d9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-17 01:43:35 +00:00
Thiago Macieira
dc1a5ac3e4 QMessagePattern: add Q_ASSERT to setDefaultPattern() and improve codegen
Amends commit e04f109456bbcb184963b8ed71944b958b35c201.

This function does not free the pointers stored in literals, so add a
couple of assertions to indicate that it's only safe to call from the
constructor. And that being the case, we can update the tokens
unique_ptr in two steps, which makes the compiler not attempt to call
delete[] on the previous pointer.

Change-Id: Ibe76a7df795e9c6d6191fffdf45e3b3ef6f0f344
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit b86bcf5c25d0072300a8b0a4b5cfe942cabf53ad)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-17 01:43:35 +00:00
Thiago Macieira
0b0d6b6d36 QCoreApplicationPrivate: make the type member 8 bits
So it packs better with the booleans around it.

Change-Id: I330164b99fcbbf9e9629fffd52bcbb38bec4ac0e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit ede95ef7e916ffb946878477938c304a5dc206d3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-17 01:43:35 +00:00
Tinja Paavoseppä
2bebec177d Android: Quit hosting Context only when app is entirely Qt
When quitting Qt, only quit the hosting Activity or Service if it's
primarily a Qt app, i.e. Qt is in the driver's seat. When using QtQuick
for Android, i.e. Qt is just a View, we do not want to forcefully quit
Activities, that is up to the app code.

Task-number: QTBUG-123711
Pick-to: 6.8
Change-Id: Ib98700be8693c3d30a296998b863b0f224c9bf69
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 3bcf55daa597888fcf0997e7ce2edd1d4c730a2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-17 01:43:34 +00:00
Tinja Paavoseppä
fbc78ff287 Android: Do not start Qt app if it has already been started
Call startQtApplication() in QtView even if the Qt libs
have already been loaded, to make sure the app gets started
also when the Activity is recreated. Check whether Qt app
is already running inside the method itself to avoid hanging up
because of trying to start it twice.

Task-number: QTBUG-123711
Pick-to: 6.8
Change-Id: I3b009e4c2f40af9f258ce32b7e181c3faa21c194
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit be33f2d3233fb787d5251ba7d0876962efe49075)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-17 01:43:34 +00:00
Tinja Paavoseppä
35e027fb62 Android: Create new QtThread when needed
When we quit Qt in an Android app, we also quit the Java thread created
to act as the Qt main thread. This works well for normal Qt for Android
apps, where the lifetime of the Qt part and the whole Android app is
essentially the same. However, in QtQuick for Android Qt can be just
a part of the entire app, and the lifecycles are not directly tied.
Hence, we might want to quit Qt when the part of the app that has it
is not active, and restart it when the Qt part of the app comes
active again, and for this we need to create a new QtThread.

Set the QtThread variable to null when it has been terminated,
and if it's required again, create a new instance.

Task-number: QTBUG-130610
Pick-to: 6.8
Change-Id: I430e195fd319a20c9627ed98d6f30858cebc49c4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 7c7b63f3e85436125baf2211bc5e10556736241b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-17 01:43:34 +00:00
Tinja Paavoseppä
41047e8b2c Android: Separate JNI initialization from JNI_OnLoad
Currently, we create references to Java classes and objects
in JNI_OnLoad. However, that is done only once, when the
Android QPA plugin is loaded, and in case we would like to stop
Qt entirely and then start it again, we want
to reinitialize all these things. Move these initializations to
a separate method, and call it before starting the Qt runtime and
app.

Remove the synchronization block guarder by m_mainActivityMutex
in QtNative.startApplication(), as it calls startQtAndroidPlugin()
which now will call activity() if the JNI needs to be
reinitialized, leading to a deadlock as that method is guarded
with the same object.

Task-number: QTBUG-130610
Pick-to: 6.8
Change-Id: I826dfb9b032a6c615f2408d484d1f4f0ea528d02
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit 9f8e49360c33d5fb8e39322f3abe9544d38baae6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-17 01:43:34 +00:00
Marc Mutz
e54ece9dbb QSet: remove misleading bool comparison with 0
Q6Hash::remove() returns a bool, not an integer, like Q5Hash::remove() did.

Pick-to: 6.8 6.5
Change-Id: Ia2907c7a2a4177f9b5ad05ca1ef3b9a5baa8137a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 441a96ba16794dc8621219be705800480654e9e8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-17 01:43:30 +00:00
Ahmad Samir
e26acf0f27 Replace qdebug.h include with forward-declarations in private headers
Only one header so far.

Amends 731538fdd469452e721b568fcbd808b437332008.

Pick-to: 6.8 6.5
Change-Id: I7449b4f91d8b44f4efab71d4d0fe259022d847a4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 22ab256e37e34988bdd405782ad09bb3eed37bf3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-16 20:44:59 +00:00
Ahmad Samir
099fcbb56d Remove unused qdebug.h include from private headers
Change-Id: I03c951d03ab2410298878d0689c0d50bdd4eedf2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 9a1260e3f9fecf3d47cf4f3ad658becd752562f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-16 20:44:55 +00:00
Liang Qi
a46cb99c69 widget: clear WA_OutsideWSRange when needed in QWidgetPrivate::create()
which follows the behavior in QWidgetPrivate::setGeometry_sys().

Pick-to: 6.8
Fixes: QTBUG-129698
Change-Id: Ia85e9470111eea9e3392cdf38c3da2db232ef065
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit def4f827da98d3027c86a8dae27811729767d36a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-16 20:43:43 +00:00
Volker Hilsheimer
ef2207ae48 API review: add revision and docs for QWindow::safeAreaMarginsChanged
Change-Id: Ie43915510449880bc5a054b9cea7fdd8f48db9b9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 4d31372a869d6734258eb7c081375581b367759e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-16 20:43:36 +00:00
Thiago Macieira
37dbdd9b58 QCoreApplicationPrivate: use std::unique_ptr for origArgv
Change-Id: Id03feb55d3c3899aa4fffffdc0b3ee7b0742f9e8
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 981c2e8b746a9fb41164e6911d1609119bf1c600)
2025-01-16 12:42:25 -08:00
Thiago Macieira
b9e8a966ea QCoreApplicationPrivate: use NSDMI to initialize the members
This removes the need for #if in the initialization list and the ugly
whitespace-before-punctuation syntax.

Change-Id: Id33ec83e574360f65c9bfffd22b8cb450156477b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit f68df05a77afd58d60a80b16bd062d0e9e6d42a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-16 20:42:18 +00:00
Ulf Hermann
a256dba802 Core: Remove duplicate QtPrivate namespace
The logging category macro already puts the logging category into the
QtPrivate namespace. There is no need to wrap it into another QtPrivate
namespace.

Fixes: QTBUG-132111
Change-Id: I99a7aa16662e3515c5f96d6736d47c1d0e45034c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 4f05eac0a88959ff0faa4d6b194d9dd8eeb3f4b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-16 19:41:44 +00:00
Wladimir Leuschner
a2b68996b2 QWindows11Style: Make disabled menu item non-selectable
QWindows11Style inherits the stylehint policy for
SH_Menu_AllowActiveAndDisabled from QWindowsVistaStyle, although the
inactive selection is not visible. This patch makes disabled menu items
non-selectable.

Pick-to: 6.8
Change-Id: Ib59988cfad444f9f8203628d4b3e1f72d6775b46
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3f42d2baacf3d227a001e49d74ea97f7ab551ae1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-16 09:27:22 +00:00
Eskil Abrahamsen Blomfeldt
3780e0edc1 Support COLRv1 fonts in Freetype backend
COLRv1 fonts are not automatically rendered by Freetype, but
is currently gaining traction and the default emoji font on
Android 15 is in this format.

What we get from Freetype is a scene graph that we can render
ourselves. This patch implements a recursive renderer for the
graph.

One current limitations is that conical gradients are not fully
compliant with the spec. I have so far not been able to find
any fonts where conical gradients are used, so this is left
as a semi-supported feature for now. It's certainly not
needed for the Android emoji font.

Pick-to: 6.8
Fixes: QTBUG-130909
Fixes: QTBUG-131116
Change-Id: I2484743602ad16f01318ecd6de2b245b38a8f566
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 9e5887a5d4f2344aa5f62325be9d63ff3d8f18db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-16 06:50:44 +00:00
Christian Ehrlicher
ce1a9d8bc9 WindowsTheme: Draw icon overlay manually instead of relying on the api
Fix drawing the link overlay icon - we must not set the device pixel
ratio here as we don't know the exact value.
Also fix some styling issues introduced with the previous commit.

This amends fd7bc16e9fbdc63bd22ba90d0c20b36ccffd2bae.

Pick-to: 6.8
Task-number: QTBUG-131843
Change-Id: I382527d17e8187bfae7cf40f352e6f87965671a1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit f4b64f9c12a6351008a08bfeb4540481edf9f1d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-15 16:24:37 +00:00
Isak Fyksen
842f433471 Replace QPair/qMakePair with std::pair in qtbase/gui
Task-number: QTBUG-115841
Change-Id: Iebd96760ff7b3d7674816553312ba8dc3229c86a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit caf22e481d41d09d608cf1c94dfb740c419d81db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-15 12:38:06 +00:00
Alexey Edelev
49bf0afdc7 Move qt_internal_sort_android_platforms to public android helpers
The function is used in semi-public API and should in
QtPublicAndroidHelpers.cmake.

Amends de40931eba2cf09a8c97c9a75c6d23c77748f44c

Change-Id: I3946ecb091584ac5406b3eb4d2024210398f26a3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit b0dc47aa447beaf4ab4bad39edeae06275c48f74)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-15 12:38:01 +00:00
Isak Fyksen
2b2271bea3 Replace all QPair/qMakePair with std::pair in qtbase/widgets
As a drive-by replace QList::append and operator<< with emplace_back,
to avoid repeating value_type.

Task-number: QTBUG-115841
Pick-to: 6.8
Change-Id: I6fb790f959b41b0feb49e3a0f0b6b3631e24a232
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 71d114588d9312e89195a32357ec402fc22b062e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-15 12:37:49 +00:00
Topi Reinio
562e74e3b4 Doc: Modify \tabcontent..\endtabcontent macros
QDoc markup following the \tabcontent macro should start a new
paragraph. As HTML-specific macros are injected directly into
the output, QDoc's doc parser is not aware that the macro should
start a new paragraph.

Turn the macros into generic, non-format-specific macros,
expanding to \div and \enddiv commands that wrap the tab
content.

Pick-to: 6.8 6.5
Change-Id: Ie8313af391b1a38ef74592acac3198fef5b7b310
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit 5c0b08a20dd14f7fd8632495aa911fe427f58f7f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-15 12:37:46 +00:00
Alexey Edelev
697b769360 Small _qt_internal_find_tool_dependencies optimization bit
Set __qt_${target}_find_package_args once per the
_qt_internal_find_tool_dependencies call. It doesn't make sense to call
set it in loop, since variable doesn't depend on loop parameters.

Pick-to: 6.8 6.5
Change-Id: Ia1024625b870364a1db8e07f61bf7ea6ab4e9f84
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 80932ed80b5ec809b42be63c8f719290da56f288)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-15 12:37:43 +00:00
Giuseppe D'Angelo
3fda22bd8a Tasktree: fix FTBFS due to unique_ptrs on forward-declared classes
Some classes have circular dependencies:

* RuntimeIteration depends on RuntimeTask
* RuntimeContainer depends on RuntimeIteration
* RuntimeTask depends on RuntimeContainer
* TaskTreePrivate depends on RuntimeTask
* RuntimeContainer depends on TaskTreePrivate

Although there are a few std::unique_ptr deployed, the code at the
moment does not fully solve the problem: the classes have an inline
destructor, and the dependency has only been forward declared, resulting
in a build error.

Make some destructors out-of-line, and define them (as defaulted) late
enough so that all the graph of classes has been seen, in order to fix
the build.

Pick-to: 6.8
Change-Id: If150b92154061e915ebac920806717d2288c0638
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 71e53405a309684e4adcb8669a5f3d04319ad767)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-15 12:37:32 +00:00
Cristian Le
1ae6883162 Fixup: Add *_check build targets for auto cmake tests
- `PARSE_ARGV` should have been 1.
- `module_includes` target needs to be unique
  See gerrit comment of previous change, and
https://gitlab.kitware.com/cmake/cmake/-/issues/26580

Amends: 8f2f4ad4688df4963982c489c80b84e115cda29d

Pick-to: 6.8
Task-number: QTBUG-98640
Change-Id: I82b85813f282ba1d5b4c938e59558e32647d4d86
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9f805b5bf7dc61a032a7ec79fd514c932103f1de)
2025-01-15 13:37:25 +01:00
Cristian Le
566db56dd3 Add *_check build targets for auto cmake tests
Similar `*_check` targets are created in `qt_internal_add_test`.
This change extends that implementation to auto cmake tests.

Note: These generated targets do not have additional dependencies, on
the build targets, unlike those generated by `qt_internal_add_test`.
You would need to (re-)run the build first separately and then run the
`*_check` target.

Fixes: QTBUG-98640
Pick-to: 6.8
Change-Id: I387f09570b6a4a345756133870c2eb9ef1cf3cf8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 8f2f4ad4688df4963982c489c80b84e115cda29d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-15 13:37:24 +01:00
Alexey Edelev
bead73f2f3 Fix restoring of CMake environment in _qt_internal_execute_proccess_in_qt_env
Use the correct variable name when restoring the environment.

Amends e388c1caeb1ccdb88b9a9801be9cd6328d8a7987

Task-number: QTBUG-128420
Pick-to: 6.8 6.5
Change-Id: I03ee3481a4638969edd75ce6ad233e8a94d5c563
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit ccbec262c220cbe990a68611e39dca9662b71777)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-15 12:36:49 +00:00
Ahmad Samir
11f94598da Replace qdebug.h includes in public headers with forward-declarations
qdebug.h includes many Qt and STL headers, so if you include a Qt header
you get all those transitive includes, which may affect build time.

- Where appropriate use the printf-like syntax of qDebug() and co.,
  these don't need the QDebug streaming operators
- qfloat16 is used in an inline member function, so include it
  explicitly

[ChangeLog][Potentially Source Incompatible Changes] Various Qt public
headers don't include QDebug any more; if you need QDebug's streaming
you'll have to include it in your code.

Task-number: QTBUG-132439
Change-Id: I750587e17a3b38fa226cd3af8eaccc8da580f436
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 185cba6e95a006d2548f20599f84390e5a3ad653)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-15 11:28:28 +00:00
Michał Łoś
1a98e24d0c Skip QResourceEngine cleanupTestCase on VxWorks
COIN is using patched std::optional header for VxWorks, which is based
on 23.09 version of this system, and fixes few compilation and runtime
issues, unfortunately it introduced runtime error as well. This error
causes std::optional to not destroy contained object in destructor,
which is a source of fail in tst_QResourceEngine::cleanupTestCase().
This fail was quieted down using QEXPECT_FAIL for VxWorks, due to exact
reason being unknown at the time.

It was found out that unpatched version of std::optional header in
VxWorks 24.03 fixes most of issues found in 23.09, so there is no need
to use old header. Additionally it cleans contained object in destructor
properly, so this is the one that should be used. In order to use it,
COIN will need to refresh VxWorks images, but this in turn will fail
this test with XFAIL.

Replace QEXPECT_FAIL with QSKIP in tst_QResourceEngine::cleanupTestCase
for VxWorks, update comment accordngly.

Once unpatched optional version from VxWorks 24.03 will be used on COIN,
skip will be removed entirely.

Task-number: QTBUG-130069
Change-Id: Ib446d04b2fabb027dad7af909ac00b7b30e76b53
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a10acaca0887541207ad5607680d7864d317cf4b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-15 10:24:22 +00:00
Assam Boudjelthia
c465681a86 Android: use the correct ABI folder to load uncompressed libs
It's possible that the first ABI from Build.SUPPORTED_ABIS would return
an ABI that's not packaged in the APK, for example if an armeabi-v7a APK
is run under the device supporting arm64-v8a, in that case the returned
path would be that of an arm64-v8a while it's not actually packaged
inside the APK.

Fixes: QTBUG-132155
Change-Id: I0f311accee246fa2d1d0b8aaf424d034b4b2d04c
Reviewed-by: André Klitzing <aklitzing@gmail.com>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit a5f80b4732d33dd36414a6ffbd49a9efc7c87a0a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-15 00:11:09 +00:00
Eirik Aavitsland
d968aacde1 Update bundled libpng to version 1.6.45
[ChangeLog][Third-Party Code] libpng was updated to version 1.6.45

Pick-to: 6.8 6.5 5.15
Change-Id: I8e3f7c889608e8071888239ed0b6003911d1a39f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit fd6f593c7ffb67566b8efbe1b657dd7824f3b9e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-14 22:56:24 +00:00
Edward Welbourne
ee65d651a4 Add tests that zh-TW now correctly prefers zh-TW over zh translation
The bug, QTBUG-121418, was actually fixed earlier by commit
84afaafc9c6968dd76fcadc5392065d340543521 (or, for 6.8, commit
8c40e8cf12bb931149367677c56816864265249c), but escaped our attention
at the time.

Fixes: QTBUG-121418
Pick-to: 6.8
Change-Id: Ie24eb172674189079aede7a39584ea760aac1b0c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 12f8ebf5cbdc9089564a93001926d20908bd1785)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-14 22:25:02 +00:00
Ahmad Samir
6d0f277a40 Every private header should include at least another private header
To get qversiontagging_p.h included. See:
https://codereview.qt-project.org/c/qt/qtbase/+/494388/comment/fed896c4_9e7cae6e/

Pick-to: 6.8 6.5
Change-Id: Ifcc7f9cb0ed57f1af9d3283309498546a81fbb17
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 16fc1e07784e294cdd75bbab216c2479ae171221)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-14 17:57:56 +00:00
Giuseppe D'Angelo
c82464ea75 QShortcut: fix build under QT_NO_CONTEXTLESS_CONNECT
QShortcut has a constructor that takes a _parent_ object and a
function to invoke, and it will internally connect its activated()
signal to that function. This connection will not provide a
context object (the parent is not used to this purpose).

Given it's not clear what the context should be if any (the parent?
`this`?), I'm not at ease at just supplying "something" as the context.
Instead, hide the constructor if we're under QT_NO_CONTEXTLESS_CONNECT.
There's another constructor where the caller can supply a context.

Change-Id: I21befcc86eeb07e65eadee1222757ecc5bab1d2c
Pick-to: 6.8
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ade3bb1c5224a9155a2a2f965fa70740aa9ec8a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-14 17:57:54 +00:00
Eskil Abrahamsen Blomfeldt
37c389c779 Implement COLRv0 support in Freetype engine
COLRv0 fonts are both scalable and in color, which was not
previously handled in the Freetype backend because it only
supported color fonts with embedded bitmaps. This patch
simply correctly detects the scalable color fonts and
render them through the same mechanism as other color
fonts.

[ChangeLog][Freetype] Added support for COLRv0 format color
fonts.

Pick-to: 6.8
Task-number: QTBUG-131116
Change-Id: I290e7525c24b4cf2ec872a366e5193f54712a3a4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 39df9e1858a4115bc19b6a4dee5d687c5ee00d21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-14 14:16:58 +00:00
Giuseppe D'Angelo
72d0b8f709 QStringConverterBase: make it move-only
The class declares a protected destructor, which interferes with the
RO5. The only subclass in qtbase is move-only; QTextCodec (in
Core5Compat) is not even movable.
Make QStringConverterBase move-only as well.

Pick-to: 6.8
Change-Id: I20d16df79f7ad8e7e7a8af339954cfa2d1482e96
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit eb533c81b8aa55f89605bb1d091afe4df4db763c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-14 12:34:56 +00:00
Piotr Wiercinski
f7efdfac36 wasm tests: Add option to run Chrome in headless mode
Running Chrome in headless mode helps to circumvent
a lot of issues with GPU driver/Wayland interactions
that we encounter in CI.
Run Chrome in headless mode if corresponding environment
variable is set.

Change-Id: I1cf290f484054766e2b99d99045e7b39d5662210
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
(cherry picked from commit 213a2610d821b93429d6519dda11ab0e7b5cae84)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-14 12:34:54 +00:00
Ahmad Samir
92afa1eaf8 network/*/removed_api.cpp: include qdebug.h explicitly
Since the removed API uses QDebug. Requested in code review.

This is needed for a subsequent commit (removing qdebug.h from public
headers when possible), but I split out to its own commit to ease
backporting.

Pick-to: 6.8
Change-Id: I76980634b9ebbae7cf010d99f5095aa94a825824
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit c0fcb2db242a40cdcc2bbfd00332390b64cab439)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-14 12:34:52 +00:00
Jøger Hansegård
99d401220c Compare QUniqueHandles using comparesEqual and compareThreeWay
This fixes an issue where comparing pointers to object is only defined
if both pointers point into the same array.

Task-number: QTBUG-132507
Pick-to: 6.8
Change-Id: Ib7ccb30001add38ad25b62c848a01cd53566d8bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5dcdeeebbc08be8845cdb5a0e586b7a864b7f16f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-14 07:20:13 +00:00
Mate Barany
3fa33cf1f1 Update qtimezonelocale_data_p.h with correct CLDR v46 data
The data for the CLDR update was generated from an incorrect xnr.xml
that has contained an extra &lt; and hence the generated
qtimezonelocale_data_p.h is also incorrect.

Update qtimezonelocale_data_p.h with the correct CLDR v46 data.

Task-number: QTBUG-130877
Change-Id: Ibc87e137b1519be470704ed519c0988333625af5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 95abc38ba6e586c8e491593ebe4c4b4ee32a79e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-13 23:40:00 +00:00