70808 Commits

Author SHA1 Message Date
Edward Welbourne
d1f0e924e9 Correct description of 3rd-party CPU cycle counters
Pick-to: 6.8
Task-number: QTBUG-132871
Change-Id: Ia0a467297393be72ff7d39b7333ad86e09057dff
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit a419db7160f2070de9ae52e80dcfff05304d9229)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-22 09:36:54 +00:00
Edward Welbourne
72c674d253 QMimeType::comments(): skip locale-name-trimming
Pruning the part of a locale name after the first '_' should now be
redundant, as QLocale::uiLanguages() now includes the resulting
truncations. It may do so later in the sequence than the pruning used
here, where the pruned version either might be a bad choice (due to
being in a script incompatible with what we started on, e.g. pruning
pa_PK to pa, which uses a different script) or would also arise from
some later, more specific, entry (as when uiLanguages() is expanded
from {en_NL, en_150}, where checking en immediately after en_NL would
bypass the more specific en_150 when present).

Change-Id: I4c7c199ca16a8e4803843547c5a689cea11af1f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9574e8cbef06b3b55d1f651b09d134aef7150aba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-22 09:36:38 +00:00
Ivan Solovev
8e4ca03733 qtformat_impl.h: do not include <version>
We intentionally include <version> in the most low-level Qt
header, so that all other headers could just assume that it
is always available.

In this case it is already available from qtconfiginclude.h,
which is included from qtconfigmacros.h.

Amends 20b6ebea84997ecd70d37640f68232c60cc7231f.

Found in Qt 6.9 API review.

Change-Id: I430c7392b5237ec582708e3ae1170eabc7c3a402
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9a3199fec2673e591811a4775ec8a00073c9f433)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-22 09:20:07 +00:00
Shitong Xu
3b5fcd4901 QFileDialog: the lastVisited not loaded correctly
Url passed from the QFileDialogArgs will never be invalid, it will
always be the value that user passed into or the lastVisited or the
working directory. And because of this, the fixes code of QTBUG-70798
will never be invoked, and the `lastVisited` will never be initialize if
nativedialog is in use.

I wrote an init function to initialize the `lastVisited` global
variable, to make sure the value will be loaded correctly

Fixes: QTBUG-70798
Pick-to: 6.8
Change-Id: Id05f63db7b4738e6317721741111882a565437e3
Reviewed-by: Xu Shitong <xushitong@uniontech.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 34f1b6b6d1dd7c37f2d71c0032ddc0c83360c11c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-22 02:25:17 +00:00
Liang Qi
7ab7d88e8a platforms: rename QGenericUnixServices to QDesktopUnixServices
The implementation follows XDG Desktop Portal mostly, and is for
desktop, not generic unix.

Task-number: QTBUG-130884
Change-Id: I88456abb37b8b23cfec00ee8eac8ffee9a65ed9f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3e29267df0e2f332290caad69e5bd5cfd61cf3da)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-22 03:25:17 +01:00
Liang Qi
78da1f8d00 Use QPlatformServices instead of QGenericUnixServices on embedded
Including bsdfb/directfb/eglfs/integrity/linuxfb/vkkhrdisplay.

QGenericUnixServices is mainly for desktop usages which uses dbus
and xdg things.

Task-number: QTBUG-130884
Change-Id: I003ec780aa039610cb5c36cd67cabbf173d8f642
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit f8d0e4798c0d2985dbe5f8515a8281c9109ef6c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-22 03:25:16 +01:00
Liang Qi
2a4604e59e QGenericUnixServices: avoid dbus calls on non xdg envs
Fixes: QTBUG-130884
Pick-to: 6.8 6.5
Change-Id: I2525293f776676cda63e61c3c5093045dbafcf38
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 1969b1a90a79dad049694bd1540f8627d5f26875)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-22 03:25:16 +01:00
Liang Qi
dcac89b5c7 qpa: lazily populate the services object except xcb
In order to optimize the footprint of QPA plugins, we avoid to
create QPlatformServices object in QPlatformIntegration constructor.
It benefits embedded platforms and others.

Task-number: QTBUG-130884
Pick-to: 6.8 6.5
Change-Id: I5c0d2616ace9fbc0e077eece32d8836b40fc83dd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ff51ea5418d131248b07e327513b41dad1231f37)
Reviewed-by: Liang Qi <liang.qi@qt.io>
2025-01-22 03:25:16 +01:00
Marc Mutz
cebb2dd068 Short live q20::exchange()!
We have weaned ourselves off of qExchange(), which, however, has C++23
semantics (is constexpr and noexcept), while we only require C++17 atm.
At the same time, we have more and more uses of a constexpr exchange(),
iow: the C++20 extension.

We have the qNN namespaces for this, so let's use it: Add
q20::exchange(), with C++20 semantics (constexpr, not noexcept), and
use it to port the only remaining qExchange() user (since ported to
2×std::move() to make the header compatible with QT_NO_QEXCHANGE),
QScopedValueRollback.

No user requires the C++23 noexcept on the function (compilers will
figure it out, because the std::exchange is fully inline), and we
can't provide a q23::exchange() even if we needed to, because the
author of P2401 forgot to ask to update the value of
__cpp_lib_exchange_function...

Fixes: QTBUG-133038
Pick-to: 6.8
Change-Id: I003df445001d1c5ab02402119c5e5106aa156263
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b5ed7fb203335cef7b7b4f70f4130b07166cecf2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-22 02:25:16 +00:00
Thiago Macieira
c88a8c78bd tst_QProcess: remove duplicate DisableCrashLogger variable
Amends 90bc0ad41f9937f9cba801b3166635f6f55e0678.

Pick-to: 6.8
Change-Id: I3faad81a5748ed0942d4fffd93c82124fc18b751
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 08cd38078e11988530251240096b3686e26dd783)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-21 23:17:54 +00:00
Thiago Macieira
5dbe3ecde8 QMutex: improve codegen for non-futex lockInternal()
Amends commit ff9da1db0b0963f967f45ab430ec40a3051b70b4.

QDeadlineTimer's Forever constructor is constexpr inline, while the one
taking an integer is neither. In an LTO build, the compiler might have
realized that it's constant, but let's be sure.

Pick-to: 6.8
Change-Id: I2c07caec660e05efe695fffd6ac8ec3120258a96
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit ef73a5f175f8d51a0bacbdd30cacbd3b6d151d36)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-21 23:17:45 +00:00
Thiago Macieira
1290935fab QMutex: replace QT_MUTEX_LOCK_NOEXCEPT macro with constexpr trait
This says better what it is and I'll use the trait for the unlock
operation.

Change-Id: I46752ca2ee71297d77e5fffdddaa193b6c86dbbc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 85ebb9d52a413f205046f864a2823e3f0819ed9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-21 23:17:44 +00:00
Thiago Macieira
993c3fc35b QCoreApplication/Win: add a better way for ActiveQt to override qAppFileName
Right now, the DLLMain in qaxserverdll.cpp calls GetModuleFileName() on
the hInstance for the DLL and passes the path to QCoreApplication to
override the path. This adds a way for it to simply pass the hInstance
handle, which will automatically cause qAppFileName() &
QCoreApplication::applicationFilePath() return the DLL's path, which in
turn influences the default QCoreApplication::libraryPaths().

Change-Id: I3cc172288c54c3938566fffdfb62985000ce2e9c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 507024317fec0c1deeb62c8c2ba5a43af7d65f21)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-21 23:17:30 +00:00
Thiago Macieira
2ed35fe889 tst_QMessageLogger: disable Android once and for all
The messages said "This test crashes on Android" bu tit appears the
problem is not a crash, but that the executable can't be executed. The
file appears to be present and yet execve() is producing ENOENT (No such
file or directory). That probably means it's the interpreter stored in
the ELF header's dynamic section that is not found.

Fixing that is SEP[1].

[1] https://en.wikipedia.org/wiki/Somebody_else%27s_problem

Change-Id: I3025825c5e00f47a5a40fffd53c47131db3676dc
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 40ad963e1a22dbf3eea96f6a17bf6cbb28294649)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-21 21:27:47 +00:00
Nicholas Bennett
d07c24d1ba Docs: Add that Qt Print Support is not available on Android
Created a list and added Android to the existing mention of iOS.

Fixes: QTBUG-132742
Pick-to: 6.8
Change-Id: I6e906980d28b54daf18c019eb9299a9d67daef3d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit afa34d5f3773dec4fb2a7d524100a6f7a307e3e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-21 20:17:00 +00:00
Giuseppe D'Angelo
b223437124 QEasingCurve: fix (de)serialization in QDataStream
The serialization code did stream out a function pointer as an integer,
and then tried to set it back -- effectively, it has *never* worked
since the beginning of public history, unless
serialization/deserialization were done within the same process.

While we cannot support streaming custom easing functions, we can
recover the non-custom functions from the type, which was also streamed
out; setType will take care of that, and we'll just ignore the
subsequent field in the stream.

If one tries to stream out a QEasingCurve with a custom curve, what do
we do? I've decided to just print a warning and stream _something_ out,
so I can keep some degree of behavioral compatibility and aggressively
cherrypick this patch.
AFAIK, there's no support for such a scenario in QDataStream: all
out-stream operators have a wide contract, and there's no Status flag
that meaningfully represents this case (and I doubt anyone checks QDS'
status while writing into it).

Change-Id: Ifa80cf3a9003cab074ddf112022c09b364497007
Fixes: QTBUG-132575
Pick-to: 6.8 6.5 6.2 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 78a46bf16b7061bfd77b7b3bcf392c28ee788bfc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-21 20:16:58 +00:00
Alexandru Croitor
858bb5df19 CMake: Build executables in single-config debug-and-release builds
If qtbase is configured with -debug-and-release -force-debug-info,
which maps to '-GNinja Multi-Config'
'-DCMAKE_CONFIGURATION_TYPES=RelWIthDebInfo;Debug'

and then qtopcua is configured with -GNinja -DCMAKE_BUILD_TYPE=Release
building the 'all' target would not build executables or tools.

That's because the targets have their EXCLUDE_FROM_ALL property set to
exclude any non-first multi-config, and Release doesn't match
RelWithDebInfo.

Such a scenario can happen for our multi-config windows builds, when
someone tries to build a repo not with qt-configure-module but rather
with cmake directly. They would then not specify the same build types
or generator, which can happen when opening in an IDE like Qt Creator.

Make sure to also check if the current generator is a multi-config
one, in addition to whether QT_FEATURE_debug_and_release is ON, before
adding the genex to the EXCLUDE_FROM_ALL property.

This allows building and installing executables and tools in such a
scenario, because in a single config build, the genex would not be
added, even if QT_FEATURE_debug_and_release is ON.

Pick-to: 6.8
Fixes: QTBUG-132609
Task-number: QTBUG-132338
Change-Id: Iaee1a0afb19df97ee1263dbaf27c8e29fc127831
Reviewed-by: Jannis Völker <jannis.voelker@basyskom.com>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit baddc0a1958c8ea9cb946465c93ecdd62bde9d3d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-21 20:16:55 +00:00
Eskil Abrahamsen Blomfeldt
c2e528ef42 Update Harfbuzz to version 10.2.0
[ChangeLog][Third-Party Code] Upgraded Harfbuzz to version
10.2.0.

Pick-to: 6.8 6.5 5.15
Fixes: QTBUG-132855
Change-Id: I542c054ccdc311b17363456c693a2057c2e496c1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 308ee2738f24d5f01fc8914f071735ad91716947)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-21 19:21:39 +00:00
Friedemann Kleint
84ad506420 Standard dialogs example: Fix compilation with QT_NO_CAST_FROM_ASCII
Add missing tr(), use literals.

Pick-to: 6.8
Change-Id: I35387e29ce1b08f9df0ade5ee743b33561639f7a
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit 3e1707d43068d43b078a2e626a0c46ff78da997b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-21 11:26:05 +00:00
Friedemann Kleint
82e7d1e56e Standard dialogs example: Fix some clang-tidy warnings
- Use auto * when initializing with new
- Initialize variables
- Fix static invocations
- Use per-class includes
- Minor cleanups

Pick-to: 6.8
Change-Id: I137bc7dfad63bc55a1b1bbc3f42d758bbfdb86ba
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit f388ca8841ad25cf79e5fdf8fa3e9d2f4de48ebc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-21 11:26:04 +00:00
Friedemann Kleint
a97091d699 uic: Write Palette/Gradient code with fully qualified enumerations
Task-number: PYSIDE-1735
Change-Id: Ica05108d8802f235fd067095072547c1461e7387
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit e90115b5f7dafb1d6acd347634b14e12b6ff88f1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-21 08:24:01 +00:00
Shawn Rutledge
3bcc785d0c Avoid dangling d-pointer deref in QWidgetWindow::handleMouseEvent
If you drag-and-drop a OpenGLWidget in Designer, the main window gets
re-created when the OpenGLWidget is instantiated. So in general (in
rare cases), at the end of QWidgetWindow::handleMouseEvent() we might
have a different window, and therefore can't reliably call
QWindowPrivate::maybeSynthesizeContextMenuEvent() without checking for
a valid pointer.

Amends 84a5f50c7766c99f62b22bb4388137e0aa8dd13d

Fixes: QTBUG-132912
Change-Id: I7b220b4daceab988aadabf9427ef6b2d5624e00d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 1accd2421686b387daa115b3a46974fce0fdb118)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-20 19:48:29 +00:00
David Faure
cfe906856b Docs: remove \internal in the docs for encodeMetricF()
The documentation for QPaintDevice::PdmDevicePixelRatioF_EncodedA
refers to encodeMetricF() which was nowhere to be found in the
documentation because it was marked as internal.

Pick-to: 6.8
Change-Id: I37707bc641d359f367f77c958043b6dfa33d4dcb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3ff989acaf84405a472605140e4035b993380bce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-20 19:48:26 +00:00
Alexandru Croitor
5165a8bacc Remove unsupported linker script objc_namespace.sh
According to the discussion in QTBUG-132398, the script stopped
working in newer Xcode versions, and also didn't cover new
Objective-C language features.

Remove the script to avoid confusion.

Pick-to: 6.8
Fixes: QTBUG-132398
Change-Id: I37b96ac6a77af1fcc4221591cb1f6320fa9a024b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 6404714183b3fcf93ac27482c5a3193a4f93767d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-20 17:51:38 +00:00
Alexey Edelev
9521b51eef Replace qt_record_extra_qt_package_dependency with qt_register_target_dependencies
qt_register_target_dependencies does the same thing as
qt_record_extra_qt_package_dependency but in more convenient way.

Update the qt_register_target_dependencies signature and adjust naming,
it now accepts PUBLIC and PRIVATE multi-value arguments and called
qt_internal_register_target_dependencies.

Use it and deprecate qt_record_extra_qt_package_dependency.

Pick-to: 6.8 6.5
Change-Id: I0594cf699ec1e3af7210dd7450fa3f81c1f565ae
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 8272b747d3b91e15fda2b76326221a26fb2245d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-20 17:42:01 +00:00
Alexandru Croitor
b51ee7068c CMake: Use a unique resource identifier in simpletreemodel example
To avoid the following error:

 The custom command generating
    .rcc/qrc_editabletreemodel.cpp
  is attached to multiple targets:
    editabletreemodel
    editabletreemodel_tester
  but none of these is a common dependency of the other(s).  This is
  not allowed by the Xcode "new build system".

Pick-to: 6.8
Fixes: QTBUG-131631
Change-Id: I1c5d0702596a4f8f723d9080bc5304d6ad06853b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 9f593791988da197dbe956669b8a4647dc50124a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-20 17:42:01 +00:00
Mårten Nordheim
ce820174ee 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.8 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>
2025-01-20 14:06:09 +00:00
Eskil Abrahamsen Blomfeldt
e958f05aec Request actual font family request in final color font fail safe
When we're trying to resolve a font for color emojis, we will
prefer any color font over the selected font (since a normal
font may have monochrome glyphs for emoji characters and that's
not what we are after).

If there are no color fonts on the system at all, we need to do
a final match where we ignore whether the font is in color or
not and just return it anyway.

In this final pass we would find the first best match among the
fallbacks (typically the first one), but never actually check
the font that was requested in the first place. This was a
mistake. Unless it does not exist, we should just return the
requested font family.

Task-number: QTBUG-132377
Change-Id: Ie53a6bd665ebdaaca92bf0c33fabf5195e1aa5fe
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit b154af082c8679fa09f325735025d98df9a8dcff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-20 14:06:09 +00:00
Assam Boudjelthia
10b88f3f20 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
Pick-to: 6.8
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>
2025-01-20 14:06:09 +00:00
Eskil Abrahamsen Blomfeldt
87330d4bd7 FontConfig: Fix detection of color fonts
There were two mistakes in the code that intended to detect
if a specific font was a color font in the FontConfig database.

1. The "int n" parameter in FcPatternGet*() is not an array size,
but an index, so it should be 0 and not 1.

2. We need to add FC_COLOR to the list of properties in our pattern
when populating the database, otherwise we will just fail to match
it and none of the system fonts will be listed as color.

Fixes: QTBUG-132377
Change-Id: Ib3c112e8a354abacd05679c62283a1f1abfb40ee
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 2e1db6541777ee076195ff9e793e4e83afd81539)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-20 14:06:09 +00:00
Thiago Macieira
f9bdb80ef1 De-duplicate the disabling of crash dialogs in our unit tests
The code was duplicated in multiple places.

Pick-to: 6.8 6.5
Change-Id: If2ab30b7afbf6d2f99c9fffd999218802b734d5e
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit b119fee87d5579dc1c4bfc2f508b0e3a75d69fa3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-20 03:24:39 +00:00
Thiago Macieira
b69650be3e QThreadStorage: remove unused moc-skipping guards
QT_MOC_CPP is not the same as Q_MOC_RUN, which moc's preprocessor still
sets. It appears Qt 3's qmake set it when ALLMOC_HEADER was set... a
feature that doesn't appear in Qt 4 (but exists with cmake_automoc).

MOC_SKIP_{BEGIN,END} appears in Qt 3's moc, but not in Qt 4's. But they
weren't in qthreadstorage.h at the time, so I guess they were added in
the 4.0 development cycle when QThreadStorage changed, but before moc
was rewritten (which deleted the Qt historic repository's oldest file,
moc.l).

Change-Id: Ibfff778c9f4d17af006dfffd8545fb24b495ecdd
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit bec49144f809ef8c5c61099ce46241c16b20b180)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-20 02:52:26 +00:00
Ivan Solovev
2db67cb4b6 QtTypeTraits: fix order of the includes
Amends 08c6cc62c743e172fbf064ccaad1159b2a1fb850.

Found in Qt 6.9 API review.

Change-Id: I1ed29a913e34ecf093a98c2053c319f0edfb9135
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0d047ca713ac66fe8ba94194441cd2e98cb76698)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-19 13:40:22 +00:00
Volker Hilsheimer
afc00d2b9b Doc: fix linking issue in QHeaderView; reflow
QHeaderView has no resizeMode property, only a ResizeMode enum type that
is then used in the sectionResizeMode API.

Fix that reference, reflow the paragraph, and apply some light editing.

Amends 9e3a96189d9db8a458e65cd5078509afe7a160db

Change-Id: I240c3f64fd45c96f4d3ba95c2086a638468e137f
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
(cherry picked from commit 988a3cd95da4b5875c7116141f2b22acf3e20502)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-19 13:40:22 +00:00
Ivan Solovev
e4d59b698e Fix docs for new QDebug streaming operators of std containers
Added the missing function declarations to the #if Q_QDOC part of the
header. Also fixed a typo in the std::unordered_map docs.

Amends 850d4895be565931d18c92e5e2f9a33b7f26de6d,
0c96528e8d43ad4309bdca14b179a5045984655a,
a9fe57fefaac0cb047e4c02e0b8c8f8327e0a58c,
and a8c9a5617c72ad2e55bf497df6ff2c2e141cbdef.

Found in Qt 6.9 API review.

Change-Id: I792023b506e2afdbdca4bca3197887e50c98a788
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 256b56f581a66acde829a2f47b3d0f6ed464fb44)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-19 13:40:22 +00:00
Ahmad Samir
55f8c072a3 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.

Pick-to: 6.8
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>
2025-01-19 13:40:22 +00:00
Allan Sandfeld Jensen
4d34eee362 Fix CMYK8888 on big-endian platforms
Pick-to: 6.8
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>
2025-01-19 13:40:22 +00:00
Thiago Macieira
7920772663 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.

Pick-to: 6.8
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>
2025-01-19 08:30:37 +00:00
Thiago Macieira
cad8c1e6a7 QCoreApplication: move the QRecursiveMutex into QCoreApplicationData
There's no need for it to be a global, if the data isn't either. I have
a vague recollection of the data also being globals back in the
day... (they used to be plain QStringList pointers).

Change-Id: Ie5f1a71d0b20a0195822fffd992101c94824a07f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit a314e4b98513d4b5cd89d05e74f93c2b16ebc168)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-19 08:30:36 +00:00
Thiago Macieira
a2792a934f Move the libraryPath tests from tst_QApplication to tst_QCoreApplication
Those aren't GUI tests. I suppose they've been in tst_QApplication since
Qt 2 or 3, when there was no QCore/GuiApplication yet, and were never
moved.

Change-Id: I30b3c1a309ba2c720210fffd045ebd0bcfa803fe
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 9fe44e4779cf421de7f33f867be8e55d291c16ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-19 08:30:36 +00:00
Thiago Macieira
62b1336c55 QJson: Remove QT_JSON_READONLY
moc (and thus the bootstrap library) has needed JSON output since Qt
5.15 (commit da284ef10e0ef80776b9fc9b7bb0e6dc8d71ba63 "Add support for
machine-readable JSON output to the MOC").

Change-Id: I4b8cf51c092eb35cc383fffd48d120f0cb2c56b0
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Johannes Grunenberg <nerixdev@outlook.de>
(cherry picked from commit 029bb47e12d63e186663714c3776d3654285496b)
2025-01-19 00:30:36 -08:00
Marc Mutz
2a5d850e48 Move the <version> include from qcompilerdetection.h to qtconfiginclude.h
The idea of b2ed29b8d9b33dcece83000aee28073dd27f1cd9 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
61935786c30b0209811fa32f7a02f138da8570b2 (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 22029a76c37d8d670479d523684a84f7966ed434.

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 b2ed29b8d9b33dcece83000aee28073dd27f1cd9.

Pick-to: 6.8 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>
2025-01-19 05:57:53 +00:00
Jonas Kvinge
dc4f7e3ffa QXRenderGlyphCache: Add QColor parameter for QFontEngineFT::loadGlyphFor
Fixes build after commit 39df9e1858a4115bc19b6a4dee5d687c5ee00d21

Pick-to: 6.8
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>
2025-01-19 02:23:45 +00:00
Alexey Edelev
09590ee995 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 b0b34c56a99130bfc9c82cb006653ce6b8f0516e

Pick-to: 6.8
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>
2025-01-18 07:17:52 +00:00
Tor Arne Vestbø
ee97f24ef4 macOS: Ignore stderr in tst_QProcess::terminateInChildProcessModifier
As we produce crash reporting via Swift on macOS 15 now.

Pick-to: 6.8
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>
2025-01-18 07:17:50 +00:00
Soheil Armin
8d97598e9c 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
Pick-to: 6.8
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>
2025-01-18 07:17:47 +00:00
Soheil Armin
b141854d76 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
Pick-to: 6.8
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>
2025-01-18 07:17:46 +00:00
Volker Hilsheimer
0246c56005 Fix doc warning
Amends 4d31372a869d6734258eb7c081375581b367759e.

Change-Id: I685a0687e8519f92602857a8259260e3b081864d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 5c783083f5cab0af577fea4dd71e1b3f1e7f5f66)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-18 07:17:45 +00:00
Ivan Solovev
7a579851c2 Provide docs for std::array QDebug streaming operator
Amends b294927a1270f7d0c5aaf0bbe93b617ac995e149.

Found in Qt 6.9 API review.

Change-Id: Iab64d52c506030dd755d61edc376bb47865478ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit b9a5a7852caf5c1296776351efa1781dbce04bbf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-18 07:17:43 +00:00
Ivan Solovev
65e70cec0b QCommandLineParser: convert MessageType to enum class
Amends bad618606d64e943e3fa78e7d1dbc8e1fab55480.

Found in Qt 6.9 API review.

Change-Id: I424fc1f80e36343f1aef4b05c551579ec0f04eba
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9a1a828ae535645f98d0ba9fc7c0c429097a2ac4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2025-01-18 07:17:42 +00:00