Commit Graph

71663 Commits

Author SHA1 Message Date
Safiyyah Moosa e7247e9acd Doc: Add alt-text for Qt Network examples
QDoc generates warnings for images that do not have an alternate-text
associated with it. Alt-text is required for to increase accessibilty
options.

This patch adds alt-text to images in the Qt Network

Fixes: QTBUG-135122
Pick-to: 6.8
Change-Id: I690f1d381ef5a9052e189dd1f3906243df557da0
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit ae6ba06e55)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-30 00:23:09 +00:00
Juha Vuolle 2dbc92e4ac Compile calendarbackendplugin only if widgets are enabled
The example links against widgets unconditionally => add
proper build-time guard

Task-number: QTBUG-136101
Change-Id: I62ea42a04f7ff421753a0fc7a30cd969cfaff6e2
Reviewed-by: Magdalena Stojek <magdalena.stojek@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 5776865f7c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-29 14:00:26 +00:00
Juha Vuolle 26e385d881 Fix tst_qlocale compilation when jalalicalendar is disabled
The 'syslocaleapp' test helper application was built only when
jalalicalendar is enabled. The tst_qlocale on the other hand
depends on 'syslocaleapp' if process-support is enabled.

Thus if jalalicalendar was disabled and process-support
enabled, the CMake configure fails because tst_qlocale won't meet
its 'syslocaleapp' dependency.

Fix by building a more limited version of the syslocaleapp when
jalalicalendar isn't supported, and adjust the testcase accordingly.

Pick-to: 6.8
Task-number: QTBUG-136101
Change-Id: Ic809b0124d47754105ca09b69e2b3c12856ba63a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 3bbe9d8ec7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-29 14:00:20 +00:00
Marc Mutz 21cd27b3b9 qDecodeDataUrl(): fix precondition violation in call to QByteArrayView::at()
It is a precondition violation to call QByteArrayView::at() with
size() as argument. The code used that, though, as an implicit
end-of-string check, assuming == ' ' and == '=' would both fail for
null bytes. Besides, QByteArrays (but most certainly QByteArrayViews)
need not be null-terminated, so this could read even past size().

To fix, use higher-level API (startsWith()), consuming parsed tokens
along the way.

Add a test that would crash in debug mode before the fix.

Amends the start of the public history.

[ChangeLog][QtCore] Fixed a bug in the handling of data: URLs that
could lead to a crash if Qt was built with assertions enabled. This
affects QNetworkManager and links in QTextDocument.

Pick-to: 6.8 6.5 6.5.9 6.2 5.15
Change-Id: I4331c88051dfbb0a18fe7da4f50858c707785d09
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 4d839093b4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-28 23:55:06 +00:00
Alexey Edelev 814587f3cc Fix typos in qt_internal_add_plugin in the TEST_PLUGIN related warning
Amends 40def71797

Change-Id: I807b1b7db8c2d473355759c1db12cc2a9ead802d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit d60930be38)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-28 17:36:34 +00:00
Tim Blechmann e9216d9826 Network: avoid interface as parameter name
`interface` is used by win32 headers. avoiding it fixes unity builds on
windows.

Pick-to: 6.8
Change-Id: I1d3f89a201f44f6e4eed5977d1b80f675078d430
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 7491628061)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-28 16:09:48 +00:00
Tor Arne Vestbø 8866613373 Quote CMAKE_OSX_SYSROOT when checking for simulator SDK
With CMake 4.0 the CMAKE_OSX_SYSROOT is no longer automatically set
based on the CMAKE_OSX_DEPLOYMENT_TARGET or host platform, so the
variable will be empty by default.

Pick-to: 6.8
Change-Id: Icad8e044a9d58e995882672b27340c83eb0ae0a8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 91ec68313a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-28 14:32:32 +00:00
Ali Kianian 9842c84f36 AssetDownloader: Provide network errors and SSL errors
Network errors and SSL errors are provided as invokable methods.
The end user can collect the errors after download is finished.

Task-number: QTBUG-136035
Pick-to: 6.8
Change-Id: Ic8bd9b84d331752c096998683b44b85be3cd6b10
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 124f05bd10)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-27 18:04:35 +00:00
Juha Vuolle fd608b6a6b Allow configuring Qt without highdpiscaling on Windows
When highdpiscaling feature is disabled, a default dummy
QHighDpiScaling class is compiled in. This dummy class missed
the roundScaleFactor() method used by qwindwswindow.cpp, causing
a compilation error.

Pick-to: 6.8
Fixes: QTBUG-135893
Change-Id: I754878b9bbd55f68f07a19618fc275f89f7f839f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 581e39b35f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-27 21:04:32 +03:00
Juha Vuolle cca73cecb0 Allow configuring Qt without clipboard on Windows
Most feature guards were already in place, this commit adds the
missing ones.

Pick-to: 6.8
Fixes: QTBUG-135890
Change-Id: I1fbfad6552b2896d867a29134a2add693dbd136f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 4790a06b16)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-27 21:04:29 +03:00
Eskil Abrahamsen Blomfeldt bb8acc8e0e Upgrade Harfbuzz to 11.1.0
[ChangeLog][Third-Party Code] Upgraded Harfbuzz to version
11.1.0.

Pick-to: 6.8 6.5 5.15
Task-number: QTBUG-136054
Change-Id: I388586c887a3ae30ecc7b07bb0b6a5c12d3b6caf
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 395451e15f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-27 18:04:28 +00:00
Edward Welbourne b069dda4da Tidy up some QTimeZone code and comments
Correct a member comment in LocaleMetaZoneLongNames.
Remove a superfluous else in QUtcTimeZonePrivate::displayName().
Add a TODO comment to QUtcTimeZonePrivate::isTimeZoneIdAvailable().

Pick-to: 6.8
Change-Id: Iddc144a267ca8fb33a6577e8d671ef3da53ca525
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7983b9bd9a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-27 18:04:26 +00:00
Edward Welbourne bccbf1be13 Fix spacing and indentation in QTimeZone code
Petty tidy-up, just to disentangle it from other work.

Pick-to: 6.8
Change-Id: Ifa7543585af35e494185be8faf637e3d48670c4b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit bb8c1b85af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-27 18:04:25 +00:00
Juha Vuolle 12de520677 Make autotests configurable without Widgets on Android
tst_android depends on widgets, and parts of the test
needs to be excluded if Qt is configured without them.

Pick-to: 6.8
Change-Id: Iaca5b4228c0a7bd7c3a2efe9da04f354ac7e7c1c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit bdacb87cef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-27 18:04:24 +00:00
Edward Welbourne bc039f3253 Modernise and refine details in tst_QTimeZone
Use constexpr and const where we can.
Use Qt-defined string literals in a few more places.
Include GenericTime in a displayName() test, and make overt that we
are simply discarding the returns, with no further testing.

Pick-to: 6.8
Change-Id: Id120fdfe66267b01ff019fe13ac80f37390c106f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4702868677)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-27 18:04:21 +00:00
Juha Vuolle 233f2340bd Fix namespace build when networkproxy is disabled
The QT_BEGIN_NAMESPACE macro was inside the "#if networkproxy" code
block, whereas the QT_END_NAMESPACE was outside of it.

When networkproxy feature is then disabled, the file will only
effectively have the QT_END_NAMESPACE macro. This fails to compile
when the build is an actual namespace build.

Pick-to: 6.8
Change-Id: Ic0b0fd2d086811664a4f66e2c46424d370641355
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 8d659669b2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-27 21:04:15 +03:00
Juha Vuolle b2ad8f05ba Fix tst_qnetworkreply compilation when networkproxy is disabled
Add a feature guard for test function relying on networkproxy.

Pick-to: 6.8
Task-number: QTBUG-136101
Change-Id: I69d97c84fb7d68f33f4b74fc8fd6665b1b8d6717
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 11b54b85ce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-27 18:04:14 +00:00
Juha Vuolle 518507bcfa Add explicit QPalette include to tst_qtextdocumentfragment
Test case relies on transitive include and fails to compile if this
include chain is broken e.g. by disabling features.

Pick-to: 6.8
Task-number: QTBUG-136101
Change-Id: Id34c9f8ec86468aaf4dda116be8d46591ebd9185
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 2542d79281)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-27 18:04:12 +00:00
Jerome Pasion d5e902751a Doc: Add link to Export Controls page in the OpenSSL overview
-A new Export Controls page has a larger overview
-Edited parts of the section

Fixes: QTBUG-134259
Change-Id: Iaceb2501eeb848544f8004bfae03a3cdf36908af
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
(cherry picked from commit 03efecf818)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-27 18:04:10 +00:00
Edward Welbourne 7549a5c388 Isolate an "enough like C locale" test and use consistently
Various checks for whether a locale was suitable for use of ASCII
offset formats were expressed in terms of QLocale::C. One was wrongly
expressed in terms of isDataLocale(), which is meant to be true for
the locale the backend thinks its data is suitable for. Write a new
method of QTimeZonePrivate to check for this, accepting en-Latn-* as a
good enough match, and deploy where it's the right test.

Pick-to: 6.8
Change-Id: Ieab129eb5c252732b8916fce017ec0a22684eba8
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 023a8d48e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-27 18:04:07 +00:00
Ahmad Samir 585cdfbd17 QMetaObject: remove commented out normalizeTypeInternal() declaration
It is out-of-sync with the actual implementation in qmetaobject_moc_p.
we could change the parameter types, but it will only go out-of-sync
again if the implementation is changed in the future. So just remove the
whole comment.

Amends 916460929d and
4dbac23e53.

Change-Id: Id41d2818266cf22765f0ae7f11265c0e840d5af3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 637a2a2983)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-27 18:04:03 +00:00
Shawn Rutledge 4ebb0413f1 QTextMarkdownImporter: spell CRLF literal correctly
Amends eced22d725

tst_QTextMarkdownImporter::frontMatter(yaml + markdown with CRLFs)
now does explicit replacement of LF with CRLF: git may convert the file,
so we can't rely on the CI test system checking out a true copy of
yaml-crlf.md; but QFile::open(ReadOnly | Text) ensures that we will
have LF line endings, not CRLF.

Pick-to: 6.8
Task-number: QTBUG-135284
Change-Id: I7eee5f41e7aea902a59ac06238e591ece016d2d3
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 66595c3efe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-25 20:08:08 +00:00
Alexandru Croitor c3eaa283c3 CMake: Skip walking empty targets in __qt_internal_walk_libs()
If one of the interface link libraries of a target is
  "$<LINK_ONLY:$<BUILD_LOCAL_INTERFACE:Foo>>"
this will be exported by cmake as
  "$<LINK_ONLY:>"
in the exported INTERFACE_LINK_LIBRARIES property.

When walking the dependent libraries of a target using
__qt_internal_walk_libs(), this value will become empty after
unwrapping the LINK_ONLY genex.

In such a case, we should skip further processing of the library.

Otherwise in some weird unknown conditions, CMake might consider the
empty name to be a valid target, and cause errors when trying to read
properties from it.

Amends ad7b94e163

Fixes: QTBUG-136039
Change-Id: I143dec697e10530379486462697cd299940ee463
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 9bc8ce6608)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-25 16:40:04 +00:00
Ivan Solovev b7ad2f3a9f Cleanup tst_qdatastream
Make NColorRoles constexpr and use static_assert() to verify that it
has a proper size.

Pick-to: 6.8
Change-Id: I40351e4815e248fe8cc07e906099172d5be531d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f12115e97c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-25 16:40:04 +00:00
Marc Mutz 0bd5917b8b Mark QtPrivate::StreamStateSaver's ctor as [[nodiscard]]
As a RAII class, QtPrivate::StreamStateSaver's ctors should be marked
as [[nodiscard]].

Amends 3c93286f08, but not picking all
the way back since 959800f6de
(Q_NODISCARD_CTOR) was only added in 6.6.

QUIP: 19
Pick-to: 6.8
Change-Id: If39fd79d21c52d60481973a416ae5f7da1858f7a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6079d7cd9c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-25 16:40:04 +00:00
Marc Mutz 2a62697645 Remove traces of QDataStreamPrivate
It's no longer used since 9b2835e464.

Pick-to: 6.8
Change-Id: I8a075e9d645290af3a7fe5b9b2fa7a5a7a7b4909
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 2471115715)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-25 16:40:04 +00:00
Edward Welbourne b5b172e34f Correct initialization of justAfter in QLocale::uiLanguages()
It's used to determine whether a non-equivalent prefix of a locale
gets added at the end of the block of equivalent locales, or at the
very end of the list. Thus it should be initialized for each prefix as
it is processed, not before the name is trimmed to its first prefix.

Added the test-case that caught this.
Amends commit cbf49f735e

This should work as-is in 6.9 but may be hard to back-port to 6.8.
None the less, I shall try for the latter, too.

Pick-to: 6.8
Task-number: QTBUG-131894
Change-Id: I75ab27153133d2608cf57f0bc998c1e3d0d1432c
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0278a80d68)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-25 16:40:04 +00:00
Alexey Edelev 9e1cfb6ad9 Fold set_property call for Android executables
Small QoL improvement. The folded set_target_properties call looks
nicer.

Pick-to: 6.8 6.5
Change-Id: Id60e8c346672733a805e09420c754a24bcae82dc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 44a43b0aba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-25 16:40:04 +00:00
Alexey Edelev 662670febd Add support for _qt_internal_configure_file(GENERATE ... INPUT
Allow generating files from template file. The signature first
expands the '@' wrapped variables in template file and then generates
the resulting file using file(GENERATE command.

Pick-to: 6.8
Change-Id: I0b4cf557da1d5161ffcde1c44aea98c440427980
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 5c30ae2c9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-25 16:40:04 +00:00
Alexandru Croitor 1dc962cbe0 CMake: Clean up leftover attribution values during SBOM generation
When processing multiple attribution files to collect all attribution
ids, the values of the previous iteration extracted keys were not
reset.

This caused the values to leak to the next processed attribution id
target if the specific id key was empty.

Make sure to clean up the values before parsing the next attribution
key.

Pick-to: 6.8
Change-Id: I386fc9c09276c49207382b06605efeb0d939b6da
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 3c80dd518a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-25 12:12:51 +00:00
Alexey Edelev 7537bfbadf CMake: Fix SBOM PROJECT_COMMENT CMP0174 related warning
We should only pass PROJECT_COMMENT if it has a value.
We also need to escape semicolons, because the project comment might
contain the qt configure line, and that might have passed arguments
like -qpa offscreen\;xcb

Pick-to: 6.8
Change-Id: I934cf75c376b3466ba91a433d009e6eaa77a60fa
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit ea575585e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-25 12:12:47 +00:00
Giuseppe D'Angelo 72e6a5fec0 Examples: fix a couple of nodiscard warnings from QFile::open
In one case, the code simply checked for isOpen afterwards; refactor
it to use QFile::open's result. In another case, a file was opened
from the resource system, so add a check.

Pick-to: 6.8
Change-Id: I5f4c22dd5ce678f15c9c1609c4228d50a2b32a1d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit eeead68995)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-24 11:11:24 +00:00
Eirik Aavitsland 005e2c7876 Doc: QPropertyAnimation does not update target property when stopped
When stopped, an animations's currentValue can change as a result of
changes to the the start- or end value. The target property will not
be updated, however.

Fixes: QTBUG-125586
Pick-to: 6.8 6.5
Change-Id: Ib03133db80e92b4d73a1140e9a94d6d7a6b68fc4
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
(cherry picked from commit 25fbbb5612)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-24 11:11:24 +00:00
Juha Vuolle 942b23f922 Make Qt for Android configurable without 'clipboard' support
Fixes: QTBUG-135675
Pick-to: 6.8
Change-Id: I844cd96f977bd0b5536606cf0c2449a87502231a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 323f408be6)
2025-04-24 14:11:24 +03:00
Juha Vuolle c9921d069a Make Qt for Android configurable without 'accessibility' support
The code was already partially behind the feature flag, but not fully.

Pick-to: 6.8
Fixes: QTBUG-135693
Change-Id: Iad76221837aa37b90b3be998afc41ce9bbc05c55
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit f5b5f16bfa)
2025-04-24 14:11:23 +03:00
Marc Mutz 111549dca0 Mark QtPrivate::StreamStateSaver's ctor as explicit
A QDataStream* is not a faithful representation of a
QtPrivate::StreamStateSaver, so the ctor should be explicit.

Amends 3c93286f08.

Pick-to: 6.8 6.5 5.15
Change-Id: I63f8fa19070960bf70c965ffbc270070d10eacd7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit bb38a2929d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-24 11:11:23 +00:00
Juha Vuolle eccceef934 Suppress unused lcQtGuiDrawHelper warning
Put lcQtGuiDrawHelper logging category declaration behind the same
feature flags as its users, to suppress a warning when neither
feature is defined:
qdrawhelper.cpp:38:27: warning: unused function 'lcQtGuiDrawHelper'

Pick-to: 6.8
Change-Id: Id6eab4e9ab7313475eedfeb20d8d29f84a47f291
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 40595f8063)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-24 11:11:23 +00:00
Juha Vuolle 8b1b3866ba Fix namespace build when cssparser is disabled
The QT_BEGIN_NAMESPACE was inside "#if TEXTHTMLPARSER" code block,
whereas the QT_END_NAMESPACE was inside a nested "#if CSSPARSER"
block.

Therefore if cssparser was disabled, the file will effectively
have just QT_BEGIN_NAMESPACE, and the build will fail (if it's an
actual namespace build).

Pick-to: 6.8
Change-Id: Ibd750a71c154cb9596a7227327b7d5b3ab307001
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 8f940ca197)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-24 11:11:23 +00:00
Juha Vuolle 8e078d8fd2 Fix tst_qimage compilation when deprecations are removed
Put both declaration and definition of tst_qimage::mirrored() behind
the same deprecation flags.

Task-number: QTBUG-136101
Change-Id: Ib54ee21f7944f1e2b7f9fe35aea9fd8d9e908f95
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 262a92244b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-24 11:11:23 +00:00
Juha Vuolle 103c1c3a4c Fix tst_qtextmarkdown compilation when textmarkdownwriter not available
Place the calls to QTextDocument::toMarkdown() behind the same feature
flag as toMarkDown() function itself.

Pick-to: 6.8
Task-number: QTBUG-136101
Change-Id: I7468f6172cab613695504d7c50075169b46c4bc9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 3f5023aada)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-24 11:11:23 +00:00
Assam Boudjelthia b3a550d976 Android: release deadlock protector from requestPermissions()
Note this would ideally use androiddeadlockprotector.h, but since
it's living under the plugins directory it won't be accessible for
this code without some refactoring.

Fixes: QTBUG-133841
Pick-to: 6.8 6.5
Change-Id: I9b62e7a9809ba5e0782a82b9c07d122de544aece
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit e8aa9ff638)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-24 11:11:23 +00:00
Juha Vuolle d6865ad65d Make Qt for Android compile without permissions -feature
The permissions were partially behind 'future' feature flag.
Instead put permission code behind the actual 'permissions'
feature flag, and require 'future' feature if permissions
are enabled.

Fixes: QTBUG-135617
Pick-to: 6.8
Change-Id: I573cca6a56c19bfc32a3f1df72a009cbe05ad2fb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 965af8548c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-24 07:21:18 +00:00
Magdalena Stojek f6591e6638 Refactor QXmlStreamWriterPrivate constructor to modernize initialization
Apply NSDMI and move initializations to the constructor initializer list

Fixes: QTBUG-135897
Pick-to: 6.8
Change-Id: I7adff41fa006669677df457704d20c02f1af7197
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 3265f40939)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-24 06:43:04 +00:00
Christian Ehrlicher 4a8350da23 SQL/OCI: do not shadow QSqlCachedResultPrivate::sql
Rename QOCIResultPrivate::sql to QOCIResultPrivate::stmtp to avoid
shadowing of the sql member from base class.
Remove some useless casts as a drive-by.

Task-number: QTBUG-136024
Change-Id: I2a5951991039c4de7aecc29f9161dede7b4f3473
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3208ad494c)
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2025-04-24 06:40:43 +00:00
Antti Määttä 54d6769456 Fix recursion in QLoggingRegistry
QLoggingRegistry relies on any Qt code it uses not having category
logging in it, because it causes a global variable to be recursively
initialized. This has been the case so far, but with CTF tracing
enabled, there is Qt code that uses category logging if the first
tracing event originates from a logging category, causing the tracing
library to be loaded.

It is undefined behavior to recurse into the initialization.

Here is the backtrace of the situation:

QGlobalStatic<QtGlobalStatic::Holder<()::Q_QGS_qtLoggingRegistry> >::instance
QGlobalStatic<QtGlobalStatic::Holder<()::Q_QGS_qtLoggingRegistry> >::operator()
QLoggingRegistry::instance
QLoggingCategoryWithEnvironmentOverride::registerOverride
QLoggingCategoryWithEnvironmentOverride::QLoggingCategoryWithEnvironmentOverride
QtPrivateLogging::qt_lcDebugPlugins
locatePlugin
QPluginLoader::setFileName
QPluginLoader::QPluginLoader
loadPlugin
initialize
_tracepoint_enabled
QtPrivate::trace_QObject_ctor
QObject::QObject
 ...
QFile::QFile
loadRulesFromFile
QLoggingRegistry::initializeRules
QLoggingRegistry::QLoggingRegistry
(anonymous namespace)::Q_QGS_qtLoggingRegistry::innerFunction
QtGlobalStatic::Holder<::Q_QGS_qtLoggingRegistry>::Holder
QGlobalStatic<QtGlobalStatic::Holder<::Q_QGS_qtLoggingRegistry> >::instance
QGlobalStatic<QtGlobalStatic::Holder<::Q_QGS_qtLoggingRegistry> >::operator()
QLoggingRegistry::instance
QLoggingCategory::setFilterRules
main

Add a recursion guard in the QLoggingRegistry that causes
QLoggingRegistry::instance to return null if recursion occurs.
The internal code appears to handle nullptr well, while external code
should always receive a non-null pointer.

Fixes: QTBUG-135326
Pick-to: 6.8
Change-Id: I91f1ff341b096031930004cca8421f2ee0bab9b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 07255301ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-24 06:38:17 +00:00
Christian Ehrlicher a223eca4ae Windows11Style/WindowsVistaStyle: don't modify SE_ItemViewItemDecoration
The windowsvista style increased the width for SE_ItemViewItemDecoration
by 4 pixels which lead to a non-square area for the decoration item.
Since the item is painted centered on the given area, this did not
change anything for squared pixmap-based icons. But when using a svg,
the image is automatically stretched to fill the complete area.
Therefore a svg is not painted quadratic but stretched which is not what
a user expects. Looking for other usages of SE_ItemViewItemDecoration
did not reveal another usecase for this so it should be safe to remove
the handling within windowsvista style.

Fixes: QTBUG-131955
Change-Id: I65f8e2afd1c2fb310d6a23b1405a920adcbf42c3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 298e811922)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-23 15:15:37 +00:00
Christian Ehrlicher 4e94132fb0 SQL/OCI: Fix usage of QOCIResult::d_ptr
The refactoring in 82681fd8a2 added a
d_ptr of type QOCIResultPrivate. This shadowed the d_ptr from
QSqlCachedResult and an unitialized QOCIResult::d_ptr variable which in
the end made the whole plugin unusable.
Fix it by removing the unneeded d_ptr member.

Fixes: QTBUG-136024
Change-Id: I5ecacba8079eadbfae25a32720b43b4465c096d8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 87bbcddb1d)
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2025-04-23 15:15:34 +00:00
Christian Ehrlicher 1e6d93e614 SQL/MySQL: Add milliseconds in formatValue()
MySQL does understand ISO 8601 formatted datetime strings with
milliseconds so use Qt::ISODateWithMs instead Qt::ISODate within
formatValue().

Pick-to: 6.8 6.5
Task-number: QTBUG-95071
Fixes: QTBUG-136042
Change-Id: I182475c706c8eda0e3f97e23d98d3f91e372244a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5b6cbb9c4e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-23 15:15:30 +00:00
Tor Arne Vestbø 06cec0646c Don't stop QPlaformWindow updateRequest timer until after delivery
Delivery of the update request may be circumvented temporarily by the
platform window, or the user may request another update during the
delivery, so wait to stop the timer until we know we don't need it
anymore.

Pick-to: 6.8
Fixes: QTBUG-135950
Change-Id: Ie6d1f0f726b66ab6a8036f281b46e525084d90e8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 2e6032188f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-23 13:41:14 +00:00
Eskil Abrahamsen Blomfeldt 50ef11616d directwrite: Fix embedding fonts in PDF
For a reason still unclear to me, the PDF engine refuses to
embed fonts if the file name is empty (so fonts that are loaded
directly from byte arrays typically). It could be that this in
itself is outdated.

However, embedding fonts that are loaded from the file system has
worked so far, but in Qt 6.8 we moved to the DirectWrite engine on
Windows and this stopped working there.

The reason is that our custom file loader did not support tracking
the file name and thus it would always be empty. This is experienced
as a regression and can only be worked around by manually selecting
the GDI engine instead (with the limitations that implies).

We fix this by implementing the loader as a IDWriteLocalFontFileLoader
instead, which supports the API which we currently use to retrieve the
paths of system-wide fonts.

Pick-to: 6.8
Fixes: QTBUG-134695
Change-Id: I1411b0617fd1c113c7c28154968c234920f5289e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 09805f355c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-04-23 09:32:48 +00:00