Commit Graph

69646 Commits (5c9b69feff761d4478b6b3cb3bf007720b8eec50)

Author SHA1 Message Date
Assam Boudjelthia 5c9b69feff AndroidDeployQt: explitly constuct the qmlDomCommand args list
Construct the arguments list explicilty to QStringList to avoid calling
QProcess::splitCommand() and potentially splitting a path with spaces
that shouldn't, this also saves from having to deal with shell quotes.

Fixes: QTBUG-132891
Change-Id: I48f6c219830269c507f146b654bcfa025f0e3203
Reviewed-by: Olli Vuolteenaho <olli.vuolteenaho@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Soheil Armin <soheil.armin@qt.io>
(cherry picked from commit a8d8fb83ccfed09dd35dbab22caceaff963a3415)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 10b88f3f2039e1198a67275d0ee0b669e7b7b45c)
2025-01-20 17:42:11 +00:00
Mårten Nordheim 4437589649 QFile::rename: error out if overwrite fails when changing case on case-insensitive filesystems
The generic copy-and-remove fallback will first open the original file
with a different case, truncate it, and then remove the original file.
Leaving us with no file at all.

Task-number: QTBUG-132785
Pick-to: 6.5
Change-Id: Ia5a41d26c1d6d6bdc231c71acf15bd2ea496c715
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2defca418788ab167fa1ce70e518c9250cb0909f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ce820174ee20a161570a31cdc7f945f535177efc)
2025-01-20 17:42:08 +00:00
Tinja Paavoseppä 758ae0432d 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
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>
(cherry picked from commit 2bebec177dc25c620e79077de8884eacfd9d7962)
2025-01-20 11:43:53 +00:00
Tinja Paavoseppä 4dbdb57358 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
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>
(cherry picked from commit fbc78ff287586349600e508d55fde332def55b6d)
2025-01-20 11:43:53 +00:00
Tinja Paavoseppä dca4361b99 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
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>
(cherry picked from commit 35e027fb62138cb2d1d8c9a14d8c5394a87fbf96)
2025-01-20 13:43:53 +02:00
Edward Welbourne 64534c99e2 Fix typos in qstring.cpp (noticed while reviewing other changes)
Change-Id: Ief8a9c429b5cdf424e0c3a57d15b1fcb4fdc963c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5d5c8d277af77cba069b805074551254c0f0d9c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 7baf9d06b50b3f13643df6aa097a848ee9bd7b6d)
Reviewed-by: Magdalena Stojek <magdalena.stojek@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-01-20 12:43:53 +01:00
Ivan Solovev 48cc0f9612 Refactor hasCompareThreeWay check
Use structs derived from std::false_type and std::true_type instead
of boolean constants. This allows us to make use of std::conjunction_v
and std::disjunciton_v in the conditions, thus making use of
short-circuit evaluation and saving unnecessary template
instantiations.

Still keep the constexpr bool *_v constant for the cases when we need
a signle check only.

Amends 678e9f614bc5a05d2ff16cf916397998e7cdfca1.

Change-Id: If2ab48ef910e97f241f5922d4108a271bc532f3a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 8784ea16a6bc66ac481d5cbf2dd1ece2d57a836b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b2bb9ef0f187a3c3d22c7f7714c038d07f87bb1b)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-01-20 12:43:53 +01:00
David Faure 1467bdb4ea Fix wrong value for 'noon' in tst_bench_qdatetime
12 hours corresponds to 43,200 seconds, not 43,200 milliseconds.
Amends commit 3febcd6286

Pick-to: 6.5
Change-Id: I2eb3abcab18cd87d51ae70b5fbaeac71a8fcd0a8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 0e2656f9371f92db3bb95ee5ba52c44a91e5ce68)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 2a121a9506145943b0ce5296d673afb46199ecea)
Reviewed-by: David Faure <david.faure@kdab.com>
2025-01-20 09:11:02 +00:00
Shawn Rutledge 431d86c8a8 doc: Fix description of QSizeF::fromCGSize
Change-Id: I22c3c5a50d624dc1f6a46aa5f1630c08267c4925
Pick-to: 6.5 5.15
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 9d6614d74cda8eae886f72a688271cdcd3ddcddd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 96fe1136081e6801ac0a6951a1a228314d08124c)
2025-01-20 09:11:01 +00:00
Jonas Kvinge 198e8eb68e QXRenderGlyphCache: Add QColor parameter for QFontEngineFT::loadGlyphFor
Fixes build after commit 39df9e1858a4115bc19b6a4dee5d687c5ee00d21

Change-Id: Ice151b27591470ae81e07953f50e1abf9244ea28
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 55a4c6e9fcb364a899da7dcb4e18f76158e38bb7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit dc4f7e3ffad0a94a59b511b77463cd044c96fe07)
2025-01-20 04:18:40 +00:00
Thiago Macieira 085780b3d8 QMutex: mark the out-of-line, *Internal() methods Q_NEVER_INLINE
With LTO, I'm seeing GCC conclude that it's best to inline the
lockInternal() and unlockInternal() methods into the public ones and
then emit out-of-line copies for those. That's actually sub-optimal, so
force GCC not to do it.

Change-Id: I88c29098757ea6e70c00fffde56989ec05b136bd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit cc4abefb1db3bdfee0d57ea528d55073a4498b4d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 7920772663b7955b5abd269398d58753caf71248)
2025-01-19 23:05:33 +00:00
Allan Sandfeld Jensen 4a451597f7 Fix CMYK8888 on big-endian platforms
Fixes: QTBUG-132875
Change-Id: If7e945607125a5ae5ce1f8323df27ab8481e329c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 7ad2083ec3cbc9dce949e83465973435d0aa992a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 4d34eee3626a52d56458ffa642126abe5d12d104)
2025-01-19 23:05:32 +00:00
Ahmad Samir f4d2babaff tst_QUniqueHandle: silence GCC/Clang -Wself-move warnings
And remove NOLINT(clang-diagnostic-self-move), silencing the warning for
Clang seems to work for clang-tidy too (tested locally).

Amends 03bd9491491881529ad28cd6d672edfdda9a0065.

Change-Id: Ibdf982a728f2c6150f2911173dc3c9246f3662b8
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6f0f39673f5ae9debd9ab59be60c32f00f40c41a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 55f8c072a301c55eda37c2b39dbcb0d579b3f414)
2025-01-19 23:05:30 +00:00
Marc Mutz f36cf92db6 Move the <version> include from qcompilerdetection.h to qtconfiginclude.h
The idea of b2ed29b8d9 was to have the
contents of <version> (if it exists) available in all Qt headers.

Since we broke up qglobal.h into smaller pieces, qcompilerdetection.h
is no longer necessarily included by any given Qt header, which
thwards the original idea.

Try with qtconfiginclude.h, which exists since
61935786c3 (Qt 6.6).

For Qt 6.5, we'll need to add it separately to qtversionchecks.h and
qtconfigmacros.h, whence qtconfiginclude.h was extracted, as well as
keeping it in qcompilerdetection.h, which includes qtconfiginclude.h
only since 22029a76c3.

Amends the breaking of qglobal.h into smaller headers, without being
attributable to any one of the individual commits that made up the
change, or else amends b2ed29b8d9.

Pick-to: 6.5
Task-number: QTBUG-108228
Change-Id: I909196bd767e8d9e016069f1a59994d40e646e59
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4771dc308785ed132198b2c9a3200b7eb26d683e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 2a5d850e4889913462da644f5146f14acf9633a4)
2025-01-19 11:48:13 +00:00
Soheil Armin c5ac6e08fb Android: Handle dotted URI QML Modules in Java code gen
A QML module can have URI that include dot character.
In this change, we refactor the code generator to create
the same hierarchies as a Java package structure. Each
QML module URI will be appended to the base application
package name to form a package that represents the QML
module as a Java package. Then the generated code of each
QML component will be placed in a single file.

This change, also refactor how to generated code should
be written in the file, by buffering the generated code
to a QByteArray first, and then flushing it into the
target file. We also create a marker file inside the
directories of each module, so that we can entirely
remove the directory and all its files before generating
new code during the next build.

Fixes: QTBUG-125891
Fixes: QTBUG-125970
Fixes: QTBUG-125971
Change-Id: Iebce6495d9d29af32c3f1f97274c252444d2864e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 68785b3e59c8a8f4a383051123b87af3d930ff18)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8d97598e9c2a53a49b1fc053ab8e23bb8d16d8ee)
2025-01-18 18:49:24 +00:00
Jaishree Vyas ad98ad04bf Doc: Add setModel(open) option to the documentation
Changed the Model Dialogs section adding open() function.

Task-number: QTBUG-127777
Change-Id: If5086f4e2226c4d032fe1bcfbf2ef550803973c8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 40f7454c919501f3c984c8fe4eeb379b360d4789)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 423659af18ac3c78bf93a6b6160f863ffe9b82b0)
2025-01-18 18:49:21 +00:00
Soheil Armin c47b638c2a Android: Improve qmldir discovery of QML to Java codegen
Recursively find all qml modules, built by this project.
Later, the qmldir of these modules will be used to
generated to code.

The command line argument -i of qmldom tool had
to be replaced with -I. The -i was incorrect as it
expects the qmldir file while -I accepts a QML directory
to be included.

Fixes: QTBUG-125892
Fixes: QTBUG-125970
Change-Id: I4099e488d3d7f4b79566e6ea19eca95f57f7c2fd
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 7ed88eb565d40b195aa868e67777872ef07a5ea2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b141854d76f062b7674c0d055e0139bd40b3bc4d)
2025-01-18 18:49:20 +00:00
Tor Arne Vestbø d629b9574b macOS: Ignore stderr in tst_QProcess::terminateInChildProcessModifier
As we produce crash reporting via Swift on macOS 15 now.

Change-Id: Iab4777b29bcaa66eff9d2f1de63072f5744d56df
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit dbfc3c9c381aa1cc0ab3cf5b758b38fb4499cb39)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ee97f24ef47594c97aaabe034169df7f78a5c884)
2025-01-18 18:49:18 +00:00
Giuseppe D'Angelo 23fab1f62d QTestLog: use the right preprocessor test for C++ features
Use ifdef, not if, otherwise we trigger -Wundef if the feature
is unsupported.

Task-number: QTBUG-132900
Change-Id: I8a779da59bf2c7add14ace6405faf19b7ca48c28
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f04dfa8666662ddefa52a0bd1c8a60be361e4c00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 4f8e1bf151d35a7265464414be17a3e44c312376)
2025-01-18 18:49:17 +00:00
Alexey Edelev 39851d13f1 Fix the unsupported Q_UNREACHABLE_RETURN statement in constexpr functions
GCC 8.x does not treat __builtin_unreachable() as constexpr and
disallows using the Q_UNREACHABLE_RETURN macro. Guard the statements
with the respective checks.

Amends b0b34c56a9

Task-number: QTBUG-125285
Fixes: QTBUG-132804
Change-Id: I88cdbe3bae1a336edc255e3e93e8d948bde253da
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit a57d5b1fd60b6b6848ef8ad9db237941229d7a23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 09590ee995e551e6e5e38c9a0fb586405d3d4c91)
2025-01-18 18:49:15 +00:00
Christian Ehrlicher df99f590d1 SQLite: Update SQLite to v3.48.0
[ChangeLog][Third-Party Code] Updated SQLite to v3.48.0

Pick-to: 6.5 5.15
Fixes: QTBUG-132862
Change-Id: If22497590dededc7b0c6f5dcc8d6d909f1e032a2
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
(cherry picked from commit 952ec8db3a096ddb92e98e408dfe193168efa50a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d5c3460b412307200ed7448e93e9473ced180675)
2025-01-18 18:48:58 +00:00
Bartlomiej Moskal 70417e5c89 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
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>
(cherry picked from commit fdf4738be3a941a14a955aa6931ddfee2145ae58)
2025-01-17 21:55:03 +00:00
Bartlomiej Moskal 7de701b1a3 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
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>
(cherry picked from commit 4ae1b626efaac7b4ae7fba62aacd2838b21ca311)
2025-01-17 21:55:03 +00:00
Edward Welbourne ccffe9b8ca 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
8c40e8cf12), but escaped our attention
at the time.

On picking to 6.8, where the issue is fixed in QTranslator rather than
QLocale::uiLanguages(), omit the truncated entries from tests of the
latter. Also add commit 84afaafc9c6968dd76fcadc5392065d340543521's new
tst_QTranslator::loadLocale_data() "System, mixed dialects" test-case,
which commit 8c40e8cf12 skipped, despite
actually making it work.

Fixes: QTBUG-121418
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>
(cherry picked from commit ee65d651a4cda48a9ed9636aecd45306d0f737d0)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2025-01-17 20:15:04 +01:00
Soheil Armin 4dfbbe66b1 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.

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>
(cherry picked from commit bbcf5a419102f1c9d6e96fc8f75edaf20c7a198e)
2025-01-17 19:15:03 +00:00
Alexei Cazacov d5094535ba Docs: Describe QTextFormat::TextUnderlineStyle property
This commit describes the QTextFormat::TextUnderlineStyle,
TextVerticalAlignment, and TextOutline properties and their allowed
values

Task-number: QTBUG-126954
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>
(cherry picked from commit 813ea954b3e383681c16b90476a81b9d17fb1566)
2025-01-17 11:24:01 +00:00
Tinja Paavoseppä 93cdf9a011 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
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>
(cherry picked from commit 41047e8b2c1a55a582fc5fd8f793f9473740059d)
2025-01-17 08:05:39 +00:00
Marc Mutz 3accb0bc64 QSet: remove misleading bool comparison with 0
Q6Hash::remove() returns a bool, not an integer, like Q5Hash::remove() did.

Pick-to: 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>
(cherry picked from commit e54ece9dbb3e05ab0ec36f10b44e0f20af12a624)
2025-01-17 01:43:42 +00:00
Ahmad Samir 1728d64f6d Replace qdebug.h include with forward-declarations in private headers
Only one header so far.

Amends 731538fdd4.

Pick-to: 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>
(cherry picked from commit e26acf0f277e0a05d7df4d45deeb1000b4ce2aea)
2025-01-16 23:18:03 +00:00
Liang Qi 873fa9cc84 widget: clear WA_OutsideWSRange when needed in QWidgetPrivate::create()
which follows the behavior in QWidgetPrivate::setGeometry_sys().

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>
(cherry picked from commit a46cb99c6903561bafcb9423a0ea88e59e2520c3)
2025-01-16 23:18:01 +00:00
Ahmad Samir 523d4c7fa2 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.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>
(cherry picked from commit 6d0f277a402dfd8c2ae0d810e23e67724f5da5aa)
2025-01-16 19:34:01 +00:00
Eskil Abrahamsen Blomfeldt 258fd48495 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.

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>
(cherry picked from commit 3780e0edc10986a62357cf1db27f99800ba1a05e)
2025-01-16 17:51:30 +01:00
Eskil Abrahamsen Blomfeldt a0b9cb8f0c DirectWrite: Remove ad hoc font resolution through GDI
In b8612eaa2a17e12e31ee28141cff1fb43e54c00e, we added a fail safe
where failure to find the font name through DirectWrite would
try loading it through GDI instead and if that was successful we
would register the family with the database after all.

However, the code assumed that CreateFontIndirect() would return
NULL if the font did not exist. It does not do this, but instead
selecting the HFONT on the HDC will give us a suitable alternative
instead. The result would be that any missing font family would
be registered with the font database through this mechanism, even
if it really didn't exist.

This code was added in an early version of the patch, however,
and it should not actually be needed anymore, since we in later
versions of the same patch also added logic to populate the
GDI-compatible family names
(DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES etc.). This should
take care of backwards compatibility with the GDI names for fonts.

Since the code has been reported to cause problems on some systems,
it's safest to just remove this hack.

Task-number: QTBUG-130313
Change-Id: I7eca893d17796d9cac07391b7b947d28dd7cd920
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 355f54f7d5dd300c73bf203f12e24305d0e227c1)
(cherry picked from commit f5e2166bbd77b9be2fc3a9dfa0660427525d6276)
2025-01-16 14:55:11 +01:00
Wladimir Leuschner 3949933dde 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.

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>
(cherry picked from commit a2b68996b28176388b1f41d2cf88617c79fa3f8a)
2025-01-16 13:55:11 +00:00
Eskil Abrahamsen Blomfeldt 583a81cc1c Don't include bearing of mid-string characters in max width
When calculating the maximum width of a text layout, we
would add the text width of each substring *after* we had
added the negative right bearing of the last character to it.
But the bearing of the last character in a wrapped substring
does not actually add to the maximum width unless it is the
last character of the *whole* string.

Prior to 250117086ff15bba79df8f0e15ee66192edc9ea9 this was
not noticed, because the last glyph in the substring would
typically be a space and the space does not have any
bearings (when doing wrapping on individual characters it
could still happen). After the change, the previous glyph
for which we get the right bearing will be the last
non-whitespace glyph. If this happened to have a negative
right bearing, we would add this to the max width and
end up with a larger max width than we should.

This caused a test failure in tst_qquicktext.

This test prefers the text width without the bearing (i.e.
the *advance* of the substring) unless the line is manually
wrapped or it is the last line of the layout.

Change-Id: Iba1a5ad48d575683672400f0572dfa683a0f2d9c
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit c08a92307d6d9fa9d9d9a1f301e3f2a65374e99a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 610ee0c5040cac4989a1f624e7678f83668e99a0)
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2025-01-16 11:57:47 +01:00
Christian Ehrlicher f889232544 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.

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>
(cherry picked from commit ce1a9d8bc9535319a1a4ccf8f4df988bfa25f665)
2025-01-16 00:32:49 +00:00
Mårten Nordheim 5d42d3b4e4 QHttp2Connection: Fix handling of MAX_HEADER_TABLE_SIZE setting
We need to, following the RFC, send a Dynamic Table Size Update using
HPack once we have acknowledged the setting as long as the new size is
smaller, or if we decide to use the new, larger size.

It's further complicated by the fact that we need to send this update on
the next 'field block' (anything with headers in it), and we may have
multiple SETTING frames come in, and we need to then acknowledge the
_smallest_ one as well as the _final_ one. This is so the decoder on the
peer's side can know that we have set the smallest size, and trimmed our
tables thusly, before going to the larger size.

This could, for example, be used to clear the table.

Task-number: QTBUG-132277
Change-Id: I2b886e125f2c197bc3d42aa0b2bbd308ed2a687c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 57f44d6d882e09f1560f86816fac6ca8d06264fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 55dc2af21db3059600465b194daf08cacd925e05)
2025-01-15 21:53:47 +00:00
Alexey Edelev 64e26282be 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.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>
(cherry picked from commit 697b76936047ba9d83f7d918bbf79b8d170513b7)
2025-01-15 16:24:51 +00:00
Alexey Edelev 6bad61c8ee Fix restoring of CMake environment in _qt_internal_execute_proccess_in_qt_env
Use the correct variable name when restoring the environment.

Amends e388c1caeb

Task-number: QTBUG-128420
Pick-to: 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>
(cherry picked from commit bead73f2f3fa5a2c19db74c2dc0cc7b73c92e056)
2025-01-15 16:24:48 +00:00
Topi Reinio b735ef7aa6 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.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>
(cherry picked from commit 562e74e3b4e5cb6944cfa1ef64a6ee5d9c015c69)
2025-01-15 16:24:47 +00:00
Giuseppe D'Angelo 724716ea33 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.

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>
(cherry picked from commit 3fda22bd8a45bfa5877994962af67e2b6b753043)
2025-01-15 16:24:43 +00:00
Isak Fyksen 626d129aa9 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
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>
(cherry picked from commit 2b2271bea3f94a72adf73aa04395a6b20c404f0e)
2025-01-15 16:24:40 +00:00
Eirik Aavitsland 92b47c2743 Update bundled libpng to version 1.6.45
[ChangeLog][Third-Party Code] libpng was updated to version 1.6.45

Pick-to: 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>
(cherry picked from commit d968aacde10a27d28d236ec62f73fab18d24c522)
2025-01-15 12:56:43 +00:00
Moss Heim bce0cae48b CMake: Fix typo in comment
Change-Id: I6151bd27d5310ac153c7c2c8fbb97a9de68a4f01
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 21bd32b2cc8995d8624cd0fea6f6685827c741c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit aa494a4de7d75b9ef4dd14c780603392e5da91f9)
2025-01-15 10:17:16 +00:00
Giuseppe D'Angelo 41679e0b43 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.

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>
(cherry picked from commit 72d0b8f709c0c73fac6062b5a287ef5630f9b770)
2025-01-15 00:10:00 +00:00
Ahmad Samir b5dfaabc4b 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.

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>
(cherry picked from commit 92afa1eaf8783355a2057849e0614342cc4306d4)
2025-01-15 00:10:00 +00:00
Eskil Abrahamsen Blomfeldt 29a1c57183 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.

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>
(cherry picked from commit 37c389c779188e05bb057d2f7164cba2827d33b6)
2025-01-15 00:10:00 +00:00
Giuseppe D'Angelo 68138cf633 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
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>
(cherry picked from commit c82464ea754e0345859abb54f31b636541669f0b)
2025-01-15 00:10:00 +00:00
Christian Ehrlicher 94fe6f04f1 Windows11Style: Misc cleanup for drawControl(CE_ItemViewItem)
Cleanup CE_ItemViewItem branch in drawControl():
 - use local rect instead rect, vopt->rect or option->rect for
   consistency
 - move out viewItemPosition comparisons into local booleans
 - fix coding style
 - merge two QPainter::drawLine() calls into one

Task-number: QTBUG-131585
Change-Id: I7cd2f96a2a733a55d5e7fb5956c59bd043317cb2
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 44edab7c84be101025dc6f9a74f87944ea3a22e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 37effa5dd3b7345ceff38f55ce5b563d2748962c)
2025-01-15 00:10:00 +00:00
Christian Ehrlicher 78387c078d QStandardItem: correctly set model during insertRows()
When calling insertRows(), the model of the child items was not
correctly updated. insertRow() is behaving correctly.

Fixes: QTBUG-131372
Change-Id: I8b6aef7ab97887c6eb46eb21b992d76e4d59b3a0
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 5bab8448feb2661f871e71d71a95afaffcb1656a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 3536eb32bf7e6b177fe600256dc9efd0ff653e36)
2025-01-15 00:10:00 +00:00