Commit Graph

69222 Commits (05dfd8a0bdf8b8ab3c3347e546e18346ee81dffe)

Author SHA1 Message Date
Axel Spoerl 05dfd8a0bd tst_Gestures::conflictingGesturesInGraphicsView(): use dynamic size
The test function assigns a hard coded rectangle to gestures and uses
the default size of a graphics view at the same time.
The leads to flakiness, where the gestures can't be delivered when their
size is out of bounds of the view's geometry.

Assign size size dynamically, according to the view's geometry.

Task-number: QTBUG-130811
Pick-to: 6.5
Change-Id: If75f59d15f84e610b4ec987daa2a06ce62539228
Reviewed-by: Frederic Lefebvre <frederic.lefebvre@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6995709992344ac608f2b2a19b2c3883019bfaeb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 18:34:20 +00:00
Joerg Bornemann 997b7d5454 a11y atspi: Fix wrong signal/slot connection
This amends commit 38251c36edf11316a2467169b1d491bf13520fd3.

QDBusServiceWatcher doesn't have a checkEnabledState signal. Use the
correct serviceRegistered signal.

Fixes: QTBUG-131009
Pick-to: 6.8.1
Change-Id: I3f0cdb53929c263d05438b1f5324b51163346d49
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: <ales.astone@gmail.com>
(cherry picked from commit 9f539ab9c111ee30ee1e35ee5927b3bfbb040bda)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 18:34:14 +00:00
Alexey Edelev 3db58b2b4f Add the missing check of IntegrityPlatformGraphics_REQUIRED_LIBRARIES
This will allow merging the updated toolchain, otherwise qt5 fails
to find OpenGL and friends. The whole block will be removed once the
toolchain file is merged.

Task-number: QTBUG-128455
Change-Id: If355b1c6360dba7b3567023430785c6d109f9fe8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit c0b9dc00145a6d2123b99ab8b1de692af5ead39a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 18:34:14 +00:00
Pieter Dewachter 828ece4743 Improve performance of QTabWidget::clear
The current implementation of QTabWidget::clear is quite poor because it
deletes the tabs from first to last. When I was playing around, I found
out it's much faster to delete from last to first (with a lot of tabs it
goes from two seconds to 200 milliseconds in my testing). I assume this
has to do with the redrawing of all remaining tabs for each removeTab
call, while this is not necessary when removing in the reverse order.

Also, disable the stack widget's layout while we remove all tabs to
avoid unnecessary event posting, and disable updates of the stacked
widget as well as the tab bar.

Change-Id: I04972de05ab71f98da7f74412aaadc69a36efc32
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 8717c1752f9b72ac7c028b722f0a068e84e64eca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 18:34:14 +00:00
Eskil Abrahamsen Blomfeldt 214101b1b3 Remove assert in QImageTextureGlyphCache::fillTexture()
The assert assumes that we are calculating the transformed bounds
of a glyph with exactly the same parameters as the image of the
glyph is later transformed.

However, when calculating the new bounding box of the glyph in
alphaMapBoundingBox, we do:

  t.mapRect(QRectF(gx, gy, gw, gh))

And then round the width and height up.

When we transform the image of the glyph, we do:

  t.mapRect(QRectF(0, 0, gw, gh)).toAlignedRect()

Note the origin is at origo and we align the rect. This can lead
to the actual transformed image sometimes being larger than what
is returned from alphaMapBoundingBox().

We could change alphaMapBoundingBox() to match the behavior of
the image transform, but it has a risk of missing some corner cases,
especially given that the same code paths are used for scalable
bitmap fonts.

In the end, just removing the assert is safe, since there is a
qMin() protecting against buffer overruns later, and there does
not seem to be any visual difference from actually calculating
the correct bounds.

[ChangeLog][Freetype] Fixed possible assert when transforming
bitmap fonts.

Pick-to: 6.5
Fixes: QTBUG-130930
Change-Id: I0406e6f45e0d436a5248dd986703bb3a9288b9f4
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit fd75a66f3f65f6c8e8bfb933260676b5c18f2df1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 15:39:28 +00:00
Eskil Abrahamsen Blomfeldt 3a0e4b6147 Freetype: Fix transformed text when subpixel AA is on
6ba003f732 fixed transforming
bitmap fonts for the case where 8 bit antialiasing is used.
This is the case when a transform is set on the painter by
the user, but for some reason it is not when high-dpi is
enabled, triggering QTBUG-111796.

An attempt was made at fixing this by drawing the
untransformed glyphs into the cache and then transforming
them as they were put on the screen. This worked with
Qt Quick, but the raster engine does not support this and
instead falls back to QPainterPath rendering in that case.
So b492582b9c caused a
regression and was reverted.

A simpler fix which works for both Qt Quick and QPainter
is to draw the pre-transformed image of the glyph into
the cache for 24-bit AA, same as for 8-bit AA.

In addition, this changes the transformation to nearest
neighbor instead of interpolating, because bitmap fonts
are typically intended to look crisp and it also matches
how native rendered fonts are scaled in Qt Quick.

Fixes: QTBUG-111796
Change-Id: I2d9fd9d98d32820e677916c3d1c744331a72175b
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit b6247ced7e83af4d51ba20be8068f28cc8c006bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 15:39:28 +00:00
Ahmad Samir 60065cc08e platforms/windows: fix deprecated C++ 20 implicit capture of this in [=]
With MinGW, GCC and Clang `[=, this]` is acceptable in C++20 mode, but
MSVC on the CI still builds with C++17. So use `[&]`, the other two
variables used inside the lambda are (const) built-in types, taking by
reference is the same as taking by copy.

Amends a90d99d8da9b2be2e6b8e981cd9dabfb1641e985.

Change-Id: Ib1c746ccf1c02b2ee3891eca5bddd7e47f559dc5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit bac7f20acd37911813bd774afea55823b8320aa2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 15:39:28 +00:00
Alexandru Croitor 79507816fa CMake: Run finalizers for test-like executables on all platforms
Previously we ran some finalizer functions for tests and manual
tests, only for specific platforms, and via different code paths.

This change introduces a new unified way of running all finalizers for
all test-like executables, including benchmarks.

To ensure a smoother transition, the new way is opt-out, and the old
way can be enabled by setting the QT_INTERNAL_SKIP_TEST_FINALIZERS_V2
variable to true in case we encounter some issues in the CI.

The finalizers are only run for test-like executables, and not all
internal executables, because there are some unsolved issues there.

One particular case is in qtdeclarative where that will create a cycle
for qmlimportscanner to depend on itself.
A proper solution here would be to have some kind of mapping or
mechanism to exclude finalizers for targets where they would try to
run themselves.

Task-number: QTBUG-93625
Task-number: QTBUG-112212
Change-Id: I52b3a1c02c298c4a18ce2c75d7e491ae79d191a0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 25f575e8513a7e49ac73c7e1cb24dcaf3803358e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 15:39:27 +00:00
Alexandru Croitor feaeb68a20 CMake: Mark benchmark executables with a property
This will be used in a follow up patch to identify them.

Task-number: QTBUG-93625
Task-number: QTBUG-112212
Change-Id: I39d5eb9f79ac67af0808efeda4d7f4e0a6908cc9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit df040fb1115071fbea80213814b7dc34b17ba085)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-11-11 16:39:27 +01:00
Alexandru Croitor c53a9d9ffb CMake: Add the android finalizer to Core also during the qtbase build
This will allow running the finalizer properly for Android tests in a
qtbase built with in-tree tests.

This is similar to what we do with the
_qt_internal_add_qml_deploy_info_finalizer for the Qml module.

Task-number: QTBUG-93625
Task-number: QTBUG-112212
Change-Id: I233ce229054b5ce15783cf06b9a69aaa68eb8847
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit a72dacce214e394da33529f2501e14c21b13c763)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-11-11 16:39:27 +01:00
Alexandru Croitor e4549375c9 CMake: Remove deployment file check in android test runner args query
The QT_ANDROID_DEPLOYMENT_SETTINGS_FILE was originally queried and
checked as part of the following commit
080f9ad160
because it was meant to be passed to the test runner executable.

The deployment file argument stopped being passed to the test runner
as part of 29b17fa335 whereas the
check was left in the code.

This check causes problems when trying to allow running deferred
android finalizers for tests, because the deployment file is set only
in the finalizer, but the check for the deployment file existence is
done earlier when trying to get the test runner arguments.

Remove the query and the check for QT_ANDROID_DEPLOYMENT_SETTINGS_FILE
because they prevent the above use case, and also don't serve any
purpose in the given function scope.

Task-number: QTBUG-93625
Task-number: QTBUG-112212
Change-Id: I6e620e452359c94cc7896a98ac5872221f6bb9a2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 412e08106c050cd6b3f6bdf4d9303850c32f6232)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-11-11 16:39:27 +01:00
Laszlo Agocs e81a2d03d8 rhi: gl: Maintain Qt 5 compat wrt disk cache behavior
Task-number: QTBUG-126608
Change-Id: Id78d6fbdfec6d69bfec2fe9deab82e84f2588b29
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit 38279dea558b06cef6c1d345962df3063fd12c5b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-11 15:39:27 +00:00
Mate Barany a5022c1917 Add type annotations to CldrAccess
Task-number: QTBUG-129613
Change-Id: I8a00cca718554909b7ab9dcad15cc9b9ac702e94
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit defd1549de9a26607e888fae8d82029633ca6d17)
2024-11-11 12:57:11 +00:00
Jøger Hansegård ecb0161693 Document why code that looks like dead code is necessary
Change-Id: Id0cf7213fac2d6397af4171b0fead42ee4139301
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 16911606e1d951cd6310dce7623563f8669c25b6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-09 20:00:08 +00:00
Jøger Hansegård e04d9276b9 Remove TODO statement from QWinRegistryKey::stringValue()
QWinRegistryKey::stringValue is more readable than
key::value<QString>().value_or(QString()).

This patch also adds developer documentation for the function.

Change-Id: I6a760db77a50ca9fa810196e14af14068df8aee3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 16ca13e148445b5a18ea768c096dfedfbacce3c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-09 20:00:08 +00:00
Jøger Hansegård 8a23001ca6 Replace QWinRegistryKey::dwordValue with QWinRegistryKey::value<T>
QWinRegistryKey::value<T> returns an optional<T> which can make code a
bit more readable than the std::pair<DWORD, bool> return value from
QWinRegistryKey::dwordValue.

This implements part of the "TODO: Remove once all usages are migrated
to new interface." comment in QWinRegistry class because it allows us to
remove the QWinRegistryKey::dwordValue function.

Change-Id: If568de4e31778e91ce7aadadb4aac90e41222826
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7a63a25ef71fbbe7b3eaa6ecb9a26c3e497e582a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-09 20:00:08 +00:00
Volker Krause 5e72d97436 Respect Android's 24h time format setting
Android allows to explicitly chose the 24h format even when the selected
locale would not usually use that.

Change-Id: I6181d343a12d8d264c369341ef753d872f573121
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit e1f83e0ffbbd079b41e5a903e35d6cd6a62e6f99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-09 12:59:37 +00:00
Christian Ehrlicher eb1402fe13 Doc/QCheckBox: remove outdated paragraph
Remove an outdated paragraph which mentions some 'important inherited
functions' - the list is outdated and therefore wrong, and no other class
has such a paragraph.

Fixes: QTBUG-130916
Change-Id: Ia1d98da35564d542ca2758070cc1d5b5525b6faf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 423496dcfbcd3a779653a4186a3b49ef8b5d2d7f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-09 12:36:31 +00:00
Christian Ehrlicher 03ea1ebbe5 QCommonStyle: sync CT_SpinBox with subControlRect()
The size calculation for CT_SpinBox was out-of-sync with the rects
calculated in subControlRect() for SC_SpinBoxUp/Down.

Fixes: QTBUG-115451
Change-Id: I140346fa1980e0cf95e0a07499f43467b721f01e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 60c665d0b320324affa76702b5e5de3d37117809)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-09 12:36:30 +00:00
Christian Ehrlicher 9493166694 Fusion style: cache pixmap for PE_FrameGroupBox
Don't load the pixmap used for PE_FrameGroupBox on every call to
drawPrimitive(PE_FrameGroupBox, ...) but store it in the QPixmapCache.

Change-Id: I5be6ce8a18cfc17c72dd5217efd5f446ba10ea64
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 12e8a7173569d03a98fcd47c593a09e55a96801d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-09 09:26:48 +00:00
Timur Pocheptsov 1171144f48 tst_QSslServer: check if SecureTransport will block the test
which happens when we build with SDK 14 (where there is not property
for importing PKCS12 in memory only) and then run on macOS 15
(where our trick with a temporary keychain is not working anymore).

Task-number: QTBUG-130500
Change-Id: I05845fa23dec70d48251f5e4d93084a574d67d92
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c9d1f18d0b88f3a4c60bf9a1342459fd67f42dbe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-09 09:26:40 +00:00
Marc Mutz 5a9c513231 QPromise: fix documentation re:setException() after cancel() or finish()
The implementation checks the state and returns without storing the
exception when its canceled or finished.

Add tests for both situations.

Done-with: Ivan Solovev <ivan.solovev@qt.io> (analysis and phrasing)
Pick-to: 6.5 6.2
Fixes: QTBUG-128405
Change-Id: I4610a022ea12e1bc9ce24cb17b972b5b9e051f0a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 6efec3850da188d3bba075185aa6e5c264c815eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-08 21:43:11 +00:00
Volker Hilsheimer a11b0a3d29 QCocoaDrag: reset the stored NSView when it gets destroyed
QCocoaDrag stores the last NSView that received an input event, which
becomes a dangling pointer when the NSView gets destroyed. Inform the
QCocoaDrag when NSView's destructor runs, so that it can reset the
pointer (and reset the NSEvent pointer as well) when the destroyed
NSView is the stored one.

With this change alone we'd end up triggering the Q_ASSERT later on in
QCocoaDrag::drag, as m_lastEvent is now nil so the NSWindow will be nil
as well. QCocoaDrag::drag cannot do anything useful if m_lastEvent is
nil, so exit early.

Pick-to: 6.5
Fixes: QTBUG-116554
Change-Id: I5949d728d05adcf3d4a32c91f7e181393bef0422
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 720ce9b97b767fdf36eaf78107b23bd017e191f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-08 20:20:01 +00:00
Joerg Bornemann eda1e4b84f CMake: Fix CMP0177 warnings
CMake 3.31 introduced CMP0177 that warns if an install destination is a
not-normalized path. Fix this by normalizing the offending paths before
using them.

Change-Id: I1586bf192a4fd26108aa0448431f19e69df8aacd
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 14fc7f0852903109fed8357e2df9edc851f31b65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-08 18:52:25 +00:00
Joerg Bornemann d697e685d8 CMake: Fix CMP0174 warnings
CMake 3.31 introduced the policy CMP0174 that triggers a warning if a
single-value argument is passed to a function without a value.

We did this doing this when forwarding arguments in code that doesn't
use _qt_internal_forward_function_args yet, e.g. in qt_internal_add_app:

    qt_internal_add_executable(...
        TARGET_PRODUCT ${arg_TARGET_PRODUCT}
    ...)

Forward the warning-triggering arguments with
_qt_internal_forward_function_args now, because that only forwards used
arguments.

In the future, we can offload more forwarding work to the
_qt_internal_forward_function_args command and simplify the forwarding
code in qt_internal_add_app and qt_internal_add_tool. This patch only
fixes the worst offenders for now.

Change-Id: Ie786691e4b236decf4c62f4dd0751ed76b721177
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 18a217af4a50afd707ed2caed4880d0da19ee120)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-08 18:52:24 +00:00
Owais Akhtar d9a3b03b47 Disable QGraphicsEffect when QComboBox added inside QGraphicsProxyWidget
The QComboBox dropdown doesnt render when its added to a
QGraphicsProxyWidget and any QGraphicsEffect is added to it.

Fixes: QTBUG-128916
Fixes: QTBUG-128329
Change-Id: I7f9b7ceea9afa819fcd4785250859ea7b7c85f69
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5fc968ade3120fe7f9d0d01988254fd1fb855262)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-08 18:52:21 +00:00
Lars Schmertmann 7d540dab57 Android: Avoid lint warning
The usage in manifest was accidentally removed in
963a31c0f4. To avoid this warning
more explicitly we add "tools:ignore" to the XML files. This
is a false positive because we use it in
src/android/jar/src/org/qtproject/qt/android/QtActivityBase.java.

Pick-to: 6.5
Change-Id: I2fe1d0930b81b3c33e7b6b1ad6f6e152dc3e0740
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 709eb77ff0f32792beb18d3edea9e0aa4436f481)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-08 18:14:55 +00:00
Assam Boudjelthia e9c2d04970 AndroidTestRunner: print ANR details if detected
Re-shuffle the way logcat is handled, so now fetch the logcat by
default after the test run, then manually filter out the test pid
logs. Then try to look in the logs for potential ANR cases, if
found, add also logs belonging to the system_service pid which are
responsible for printing ANR details and usually the reason for the
ANR as well. At last, look for logcat crash marker that ndk-stack uses
and pass only that portion of the logs to ndk-stack command.

Fixes: QTBUG-130818
Change-Id: I162d9d884a977e8f66a3253e33eebad4453c95cb
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit 5c68af9e1481f56fae962e865a9600dc64c465b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-08 17:24:33 +00:00
Lars Schmertmann 46d27038d4 Android: Remove unused string
Remove string "unsupported_android_version" from string.xml. The
resource `R.string.unsupported_android_version` appears to be unused.
The usage was removed in b8e404f6d0631e04d30a864dc68b0574bfca90f1.

Pick-to: 6.5
Change-Id: Ifc936c070dabe4bc31d45bbb6b261890d5c2e536
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 0534a566a7d79a674931aefa6cc96a8e9343a1b3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-08 14:29:22 +00:00
Morteza Jamshidi d610103126 QDoubleSpinBox: Use QLocale to omit group separators
Instead of removing group separators after conversion, we can omit them
using QLocale. The decimal point and group separators can be the
same character, if the user configures the system locale accordingly.

Add a test that compares the text shown by the spinbox with what the
locale would do. Since the C locale sets the OmitGroupSeperator number
option by default, cover several cases to verify that we explicitly
set the correct number options based on the QDoubleSpinBox property,
and implement a customized system locale that returns the same
character for group separator and decimal point.

Fixes: QTBUG-77939
Change-Id: I257ea44ed988c70cb4fc0cfc81c3b366c0a431eb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 34b5e43e6259c6362c642a244ceb26d482f35b82)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-08 12:32:26 +00:00
Wladimir Leuschner d8ed810029 QWindows11Style: Draw QRadioButton with QPainterPath
The drawing of QRadioButton in QWindows11Style was performed with
overdrawing, leading to problems with the transparent background color
for QGraphicsWidgets. This patch draws the ring of the RadioButton using
QPainterPath, to avoid overdrawing.

Fixes: QTBUG-130828
Change-Id: I4b278f7f720b55e11c550977b666410d85b65382
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 57361de3a9814808bb575f8d01c1b12cbed9dbe9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-08 11:36:03 +00:00
Marc Mutz 0ac0ca8124 tst_QPromise: QSKIP when !QT_CONFIG(cxx11_future)
Don't just silently succeed.

As a drive-by, keep the skipped code visible to the compiler.
QThread::create() is universally available since
4a5f3c8b93, so the skipped code ought to
compile.

Amends ac6a9f9bfa.

Change-Id: I193ecf802ffbfd103747aa34eb307fb1a814a94e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4e1b20893aeeb9580bc6b52ac4baea297675bfee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-08 08:51:05 +00:00
Marc Mutz c7771366e5 [docs] QPromise: don't recommend legacy smart pointers
Use unique_ptr instead of QScopedPointer and shared_ptr instead of
QSharedPointer.

Amends 68de38ded1.

Pick-to: 6.5 6.2
Change-Id: Ic5c4c4962be69aecd4312dbdbfa84deb8a3c1e57
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 076445ec0d888f74498b4beadced58edce434ee9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-08 06:14:45 +00:00
Michael Weghorn 5b258d7451 a11y atspi: Send AT-SPI signals with correct signature
The AT-SPI2 XML spec for all signals/events [1] that Qt emits
specifies the DBus arguments signature as "siiva{sv}".

Qt however was incorrectly sending arguments with an "siiv(so)"
signature instead, by sending the QSpiObjectReference as last
argument.

Fix this by sending the events with the proper signature, using an
empty QMap<QString, QVariant> for the properties (that translates
to an "a{sv}" type for DBus).

[1] 33b45aea12/xml/Event.xml

Fixes: QTBUG-130843
Change-Id: If023763626be3d17b091466b17829d62d29fdede
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit fdf87fdce1c8b926b1c1ee9254aa4b0fc1840d82)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-07 22:00:12 +00:00
Thiago Macieira 0c2c9ca7f4 QThread/Unix: replace some uses of pthread_self() with our code
This code predated the existence of the currentThreadId() and
isCurrentThread() functions. Our implementations are slightly faster.

Change-Id: Id2b20a7f06e0c2a1bc35fffd4fb4dcf3f20769cd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 8a8e91a7c141994c331d2b9da7d9c5e2129c70b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-07 22:00:12 +00:00
Thiago Macieira 4f85eed8e3 QThread: avoid unlock/lock/unlock in ~QThread if state is Finishing
This is a corner-case scenario but valid because we tell users they can
destroy the QThread object right after finished() has been emitted. But
emitting finished() does not mean the launched thread has actually
exited: it may still be in Finishing state for an arbitrarily long time.
Completely aside from what else may run from other libraries, we only
destroy QThreadStorage and the thread's event dispatcher after
finished() has been emitted.

This commit avoids the unnecessary mutex unlocking in the destructor,
then QThread::wait() locking again, only to unlock yet again so that it
can perform the necessary low-level wait calls. The same for the return
path: wait() locked again to check the state, then unlocked, only for
the destructor to lock again. Now, QThreadPrivate::wait() is responsible
for returning with a locked mutex.

Change-Id: I87adffb89f275accea18fffd6b4293861ea7cf39
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 6bd271cf74d6d57816531f688c82c51d29f1be91)
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-11-07 15:00:11 -07:00
Thiago Macieira 90c436dd1e QThread: make finish() and cleanup() non-static members
Looks cleaner.

Change-Id: I77148a15c316ea0eaf63fffd9358d952c5b9e1d0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f94c9b0f3a060fa98c270d5ccab3055e77ebc35f)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-11-07 15:00:11 -07:00
Thiago Macieira 334a3922c0 QThread/Unix: refactor to split QThreadPrivate::finish() in two phases
Commit 1ed0dd88a3 moved the finish()
functionality from immediately after run() returns to the time of
thread-local destruction, to make sure that user destructors didn't run
after our cleaning up. But as a side effect, it made other user code run
too late, after some thread-local statics had been destroyed.

This is a common practice, which causes the destructor for worker to run
too late:

    worker->moveToThread(thread);
...
    QObject::connect(thread, &QThread::finished, thread, &QObject::deleteLater);
    QObject::connect(thread, &QThread::finished, worker, &QObject::deleteLater);

This commit splits the cleanup in two phases: QThreadPrivate::finish(),
which runs immediately after run() and will call back out to user code
(finished() signal and delivery of deleteLater()), and cleanup() that
cleans up the QThread{Private,Data} state and destroys the event
dispatcher. That destruction is the only call out to user code.

I've removed the complex mix of pre-C++11 pthread_setspecific() content
and C++11 thread_local variables in favor of using one or the other, not
both. We prefer the thread-local for future-proofing and simplicity, on
platforms where we can verify this C++11 feature works, and because it
allows us to clean up QThreadData and the event dispatcher as late as
possible. (There's some code that runs even later, such as pthread TLS
destructors, used by Glib's GMainLoop)

Unfortunately, we can't use it everywhere. The commit above had already
noticed QNX has a problem and recent bug reports have shown other
platforms (Solaris, MUSL libc) that, 13 years after the ratification of
the standard, still have broken support, so we use pthread for them and
we call cleanup() from within finish() (that is, no late cleaning-up,
retaining the status quo from Qt 4 and 5). See QTBUG-129846 for an
analysis.

Drive-by moving the resetting of thread priority to after finished() is
emitted.

[ChangeLog][QtCore][QThread] Restored the Qt 6.7 timing of when the
finished() signal is emitted relative to the destruction of thread_local
variables. Qt 6.8.0 contained a change that moved this signal to a later
time on most Unix systems, which has caused problems with the order in
which those variables were accessed. The destruction of the event
dispatcher is kept at this late stage, wherever possible.

Fixes: QTBUG-129927
Fixes: QTBUG-129846
Fixes: QTBUG-130341
Task-number: QTBUG-117996
Change-Id: Ie5e40dd18faa05d8f777fffdf7dc30fc4fe0c7e9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4fabde349f16b59f37568da2a4c050c6dd53a34e)
2024-11-07 15:00:11 -07:00
Ivan Solovev 8478831214 tst_QPromise: fix handling of failures from nested functions
The commit 1f22fc995a introduced nested
functions without properly checking their return status with
QTest::currentTestFailed().
Later, commit 855c448469 used the same
pattern.

Fix all the affected tests by wrapping the function calls into the
pre-existing RUN_TEST_FUNC macro.

Both commits were picked to 6.5, so do the same with this patch.

Pick-to: 6.5
Change-Id: I3e11bf5724d9b89c75a4e5c73c96f9566c36b5cd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 4c00337ccb8e4266fa5a4af4fba40e5b62aba81b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-07 22:00:10 +00:00
Volker Hilsheimer d2ee5811d0 QCocoaDrag: consistently update the last view and event pointers
As pointed out in the qcocoadrag.h header, we need QCocoaDrag to record
the original event and view when handling an event in QNSView. For that,
NSView's handleMouseEvent implementation called setLastMouseEvent.

This was not done for tablet or touch events, although both of those
event types might initiate and participate in drag'n'drop operation. Do
that consistently now, and rename the setter accordingly to
setLastInputEvent.

Task-number: QTBUG-116554
Pick-to: 6.5
Change-Id: I9646adbec3a2301ebca123f0f25328db63c782a8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 0a40266788021aaa2f501aeef6db2e222669c6e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-07 22:00:10 +00:00
Marc Mutz f47c8354b1 tst_QPromise: don't rely on move-only lambdas [2/2]
For some reason, 4d6cf54664a98e01d4caab42431c62d6deb9f86e didn't treat
all lambdas, and no-one noticed.

This patch completes the task by transforming the remaining lambdas to
be non-move-only.

Amends 4d6cf54664a98e01d4caab42431c62d6deb9f86e, whose commit message
is pertinent to this patch, too, but not repeated here.

Pick-to: 6.5 6.2
Change-Id: I6dfe6eb438065e16fcb7ab1f2efcb64c0146bb6c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 5c3dc2ecb97b69eb12e06c499ddb50666be60be6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-07 22:00:10 +00:00
Wladimir Leuschner 2c1a23f3c8 Windows QPA: Make frameless window respect WORKAREA
Windows that have only set the WS_POPUP style do not take the WORKAREA
into account and maximize to fullscreen geometry. This patch maximizes a
WS_POPUP window to the size of the current working area, which can be
smaller than the screen geometry.

Fixes: QTBUG-129791
Fixes: QTBUG-130865
Pick-to: 6.5
Change-Id: I4c5beb0cd69c7ea4c585785a579a9d66bab12cc6
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 90be6609bdfc14df6aec52cbbba6adb4a610301e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-07 19:46:29 +00:00
Lucie Gérard 27ae8dbab4 Add REUSE.toml files
Those files are read by reuse to complement or override the copyright
and licensing information found in file.

The use of REUSE.toml files was introduced in REUSE version 3.1.0a1.
This reuse version is compatible with reuse specification
version 3.2 [1].
With this commit's files,
* The SPDX document generated by reuse spdx conforms to SPDX 2.3,
* The reuse lint command reports that the Qt project is reuse compliant.

[1]: https://reuse.software/spec-3.2/

Task-number: QTBUG-124453
Task-number: QTBUG-125211
Change-Id: I01023e862607777a5e710669ccd28bbf56091097
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4c83657448f66ac0ee46900aff2e5a230eda49b0)
2024-11-07 08:38:49 +01:00
Christian Ehrlicher fc96ce3a2b QDateTimeEdit: use correct size hint when calendarPopup is enabled
When calendarPopup is enabled, a QComboBox instead a QSpinBox is drawn
but the size hint for QSpinBox was used which resulted in a too small
width for the widget (depending on the underlying style). Therefore use
the size hint for CT_ComboBox in this case as it was already done for
mac.

Fixes: QTBUG-11967
Change-Id: I817bdc99ae5d1189b9f0451a857022abe64b3bf8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0a1c1711453697a88eee7fdb6f4cf082bfd433e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-07 01:13:51 +00:00
Thiago Macieira 590ac5b4a1 tst_QObject: don't leak QtDeclarative::theData
Change-Id: I347f7558a3b278590b11fffdc48877791c29ca60
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ee3933a3ddb032e8d62eb5ac920f9450e7dc2f45)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-07 01:13:51 +00:00
Alessandro Astone 50aaa93c85 a11y atspi: Watch for enabled status change
On log-in this may be disabled and only enabled later; that prevents
clients like plasmashell to enable a11y features.
We need to watch changes to the org.a11y.Status properties and enable
the a11y integration on-demand.

As the in-line comment said, qdbusxml2cpp does not generate NOTIFY
signals for DBus properties, so use the raw PropertiesChanged signal
to receive those notifications.

Downstream bugs:
- https://bugs.kde.org/show_bug.cgi?id=495096
- https://bugs.kde.org/show_bug.cgi?id=495098

Pick-to: 6.7
Pick-to: 6.7
Change-Id: I4d0adf61af875464d3cd47759631d2a3aac664f0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit 38251c36edf11316a2467169b1d491bf13520fd3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-07 01:13:50 +00:00
Marc Mutz 78dfb5f196 QDomNodeList: mark op==(Private) noexcept
It is, because it only compares a pointer and a string, both of which
are nothrow_equality_comparable.

Also remove the unused (even in C++17 mode) inequality operator
instead of marking it noexcept, too.

Pick-to: 6.5 6.2
Change-Id: I0ce62df02ffc98252d17cef659cc6dc2a90ae2cf
Reviewed-by: Rym Bouabid <rym.bouabid@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 3fce04157dbba1232d96821dbb166c6a5dc467a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-07 01:13:50 +00:00
Timur Pocheptsov 3502790551 tst_QNetworkReply: add more checks for blocking keychain
There are more tests that create TLS server and can potentially
fail in case SecureTransport backend is in use.

Task-number: QTBUG-130500
Change-Id: Iaf2071c19f3cc0d3617bfc8c484b464c1a212d5a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 81e7d3f95a1646d91d126596d0d7d6acf106298a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-07 01:13:50 +00:00
Wladimir Leuschner 61c67cf499 QWindows11Style: Fix sorting arrows in headers
Fixes: QTBUG-126345
Change-Id: Ifb0bb46329a909fd113318f61ca37ba01f4d873d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 81642477d979e00f9507df37184e75d9ed98ee2f)
2024-11-06 15:46:44 +00:00
Volker Hilsheimer cd48b781d1 StyleSheet baseline test for TreeView: include one with empty area
So far, the entire tree view was filled with items, so we didn't see how
the empty area below the last item was rendered. Take a screen shot of
the tree after giving it twice the space it originally has to get some
empty area included as well, without breaking existing baseline images.

Task-number: QTBUG-123632
Change-Id: I50714c0b3b04f4b1844e52063d0c0c77ff2d7154
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 4be99b1900f3ba7414a9acbc4777a669fcbd8e3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-06 15:06:19 +00:00