Commit Graph

11235 Commits (724716ea335605dc1f9287c7cd9f88c709f6993c)

Author SHA1 Message Date
Christian Ehrlicher 94fe6f04f1 Windows11Style: Misc cleanup for drawControl(CE_ItemViewItem)
Cleanup CE_ItemViewItem branch in drawControl():
 - use local rect instead rect, vopt->rect or option->rect for
   consistency
 - move out viewItemPosition comparisons into local booleans
 - fix coding style
 - merge two QPainter::drawLine() calls into one

Task-number: QTBUG-131585
Change-Id: I7cd2f96a2a733a55d5e7fb5956c59bd043317cb2
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 44edab7c84be101025dc6f9a74f87944ea3a22e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 37effa5dd3b7345ceff38f55ce5b563d2748962c)
2025-01-15 00:10:00 +00:00
Christian Ehrlicher a349c0fd2b Windows11 style: fix drawing horizontal progressbar in rtl mode
The progressbar content calculation assumes that
subElementRect(SE_ProgressBarContents) returns a rect at 0/0 which is
not the case for progressbars in rtl mode. Fix it by moving the topLeft
edge to 0/0 and translating the painter accordingly

Task-number: QTBUG-132459
Change-Id: I614589c9094b0da3c02867b45570d4dfdca61a18
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 314a5b972646a4f2ef9c1f49ddfd335f546336ab)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit bf535c4c66b8d39e7c9a067155bdf2f6ea26a924)
2025-01-15 00:09:59 +00:00
Christian Ehrlicher 70c663a925 Windows11Style: enable mouse tracking for QTableView
Mouse tracking is needed for windows 11 style since it is using
QStyle::State_MouseOver to draw the cells.

Fixes: QTBUG-129242
Change-Id: Ib79ac5a8c14ac8c70365e87120f80b4e4ee4c5b9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 85333b3d8cb89bf58c6c6c0db7c3db5c95b4cbfc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5ff8c2eb00aedc3fec76fe63e4914a6b4e5f32bd)
2025-01-15 00:09:59 +00:00
Morteza Jamshidi 3ca7571b4b Draw icon overlay manually instead of relying on the api
Even with SHGSI_LINKOVERLAY flag set, loaded Icon with
SHDefExtractIcon doesn't have any overlay, so we draw
it manually.

Fixes: QTBUG-131843
Change-Id: Iae4c2da12104a361b9a8cf05c78adcdb698f1f82
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit fd7bc16e9fbdc63bd22ba90d0c20b36ccffd2bae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 59861df8ce4c7c69cdf1c7a8738eeac81ff2d8c2)
2025-01-15 00:09:59 +00:00
Morteza Jamshidi 4df1256cff Windows: Add Key_Backtab as possible key combination for Shift+Tab
In windows Backtab key event always comes as "Shift+Backtab".
So in order for Backtab key to be recognized as a shortcut sequence,
we also consider Backtab without shift modifier a possibility.

Fixes: QTBUG-94890
Change-Id: I20a7b404b57d8df5bea23765257a178f2e098ed0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 4d9f99c4ea70cdae58c80e1bfdbabefe3abb455f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6d8afaac84f995cfb008bd2d3eb59fe4fe10dd69)
2025-01-15 00:09:59 +00:00
Assam Boudjelthia 6e32a2e065 Android: improve fullscreen and maximized states handling
Rework fullscreen and maximized/expanded states handling
by simplifying and re-organizing the code, removing some
unnecessary code. Also, use newer APIs and handling the
cutout regions.

For expanded mode, use transparent instead of translucent
so that the user can decide what color to use if needed,
and in any case using the translucent flags is deprecated.

You might still notice some artifacts as in QTBUG-88676,
a fix for that is outside the scope of this patch.

When going off of fullscreen mode one some cases you might
notice a white/black black at the bottom and that's because
QtRootLayout.onSizeChanged() is reporting wrong available
size which is also an existing issue and outside of this
scope.

Fixes: QTBUG-96105
Fixes: QTBUG-101968
Fixes: QTBUG-127394
Fixes: QTBUG-121820
Task-number: QTBUG-109878
Task-number: QTBUG-119594
Change-Id: I586775a1d0414ec0adbc968d50b9c1a1ce466422
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 0abcb9bef8a7cb85df006adfed51bc9258868ed2)
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
2025-01-14 17:23:09 +00:00
Assam Boudjelthia b9c61b0f68 Android: move setSystemUiVisibility() to QAndroidPlatformWindow
Move calls for handling system UI visibility to QAndroidPlatformWindow
where they belongs.

Change-Id: I3802cf9d205ee6678f71b787c5ea4804d3aaeb29
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit a2385e5c9dc9b07cb43264bf0309a80992f80ad8)
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
2025-01-14 17:23:07 +00:00
Assam Boudjelthia 5ac4704c51 Android: check Qt::ExpandedClientAreaHint when setting size
No need to also check for Qt::WindowMaximized, if we're using
Qt::ExpandedClientAreaHint, we would expect the full size to
be used.

Fixes: QTBUG-110878
Change-Id: I52db0224aa96409a8f2d984e01192001f9b42440
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 10805e7d8af0bcbcba12bc896a01d645e1648741)
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
2025-01-14 17:23:04 +00:00
Ahmad Samir 8ba1f4ab8a Include climits explicitly instead of relying on transitive includes
Pick-to: 6.5
Change-Id: Ib55b337aa6e0a93c7ac7ee9bf492784cc81808d7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 158f2c95c8b69f586bd1155fc5993bdb61f76e77)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 27f16490fa40a4751f420070cbf75f8af0c1f3d4)
2025-01-14 03:15:05 +00:00
Christian Ehrlicher 712192b9cd Windows11Style: adjust size of flat buttons
Flat buttons were larger than normal buttons - therefore also add
marginsRemove(QMargins(2,2,2,2) for the flat case too.

Task-number: QTBUG-132433
Change-Id: Id010d45bf85c5d7d09ff8db8bda44b1be7d85297
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit a930fb758d71ef6bf353e8fd8078de2335c32085)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b7e0a7bfdebfcce46084164c971ad6ab9363184f)
2025-01-14 03:15:03 +00:00
Jan Moeller d4e2c76ae8 Check for valid QAccessibleInterface before invoking action
To avoid illegal access, the change ensures that the QAccessibleInterface
is non-null and valid before accessing its QAccessibleActionInterface.

The check for the validity was also added to existing code which
previously only checked for the QAccessibleInterface not being null.

Fixes: QTBUG-132059
Change-Id: I69fc4f9bb052ded8f188032d324666d0c00b9c3c
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 279c891ddf0ad10dd86c8fc836ce385df57593c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a30613197731cd77dd4dac8e3d7d8205718c37f0)
2025-01-13 13:49:22 +00:00
Richard Moe Gustavsen f38f377526 iOS: remove registered undo/redo actions upon qiostextresponder dealloc
QIOSTextResponder add actions to its own NSUndoManager. But
we need to remove those actions again when the responder is
deallocated, otherwise it can lead to a crash in UIKit when
swiping between apps.

Fixes: QTBUG-123843
Pick-to: 6.5 6.2
Change-Id: I404751bc50692a960e568ff2eb0f1754da0cec31
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 42f29da7a5b6c6969c169e9a868696a968ca930d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 9db6df1a56e79c13f942e29a28a607284bcd20ca)
2025-01-13 13:40:42 +00:00
Wladimir Leuschner fb3e74615d QWindows11Style: Align QSpinBox rect to match QLineEdits rect
The content rects for QSpinBoxes were smaller than QLineEdits rects for
UI elements that should have the same size. This patch increases the
content rect for QSpinBoxes.

Task-number: QTBUG-132261
Change-Id: I59e752b719399c5845ab3ef81c6e271deda16273
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit a53e095882551caf3684a1f6a205b6c7d76a8913)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 4c2f439001f49c9aa380d16f0e1fa7e574e03fe8)
2025-01-13 13:30:31 +00:00
Wladimir Leuschner 5e4b33f39d QWindows11Style: Decrease bottomline frame thickness for QToolButton
Decrease the bottom line frame thickness for QToolButton by using
fractional coordinates.

Task-number: QTBUG-132261
Change-Id: I77a3acdd20c694dce38d809db9c3051949a98fa3
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 3e9baca7d2197bfc10d20de6f326e2749a8f781e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit f8adee805b9cb673ed66ffa22f5bb1896439e6b3)
2025-01-13 08:34:55 +00:00
Wladimir Leuschner 4b763eab23 QWindows11Style: Increase QComboBoxSize and align subline
Increase the size of QComboBoxSize and align the subline for editable
QComboBoxes with the begin end end of the rounded corners.

Task-number: QTBUG-132261
Change-Id: I235ec1ceb94a5e87f373b007ac31d0d8a83cf600
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 23c16c611cfeee55ce38e928989b346c697270b0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 840cf0a43a3242c7e5fd6769efe37c5d6e3b400e)
2025-01-13 08:34:49 +00:00
Jøger Hansegård afa9ae9b0c Add missing noexcept specifiers for QUniqueHandle handle traits
Handle traits should be simple, and not require exceptions. This patch
will allow us to improve the noexcept correctness of QUniqueHandle.

Change-Id: I84d92818a2fcea5b98e09c0b7dc08b251751396c
Reviewed-by: Tim Blechmann <tim.blechmann@qt.io>
(cherry picked from commit 3c57c7357422bdfda60f56901a7590b258915b6b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 8adfacca6184d439c5febd71a6c78db3edce87c6)
2025-01-06 12:16:31 +00:00
Lars Schmertmann cc7574cba7 Android: Fix freeze on start when the activity was destroyed before
This can be tested by enabling "Don't keep activities" in the developer
options. With this option Android will immediately destroy the activity
when it is moved to the background. In this case registerBackends will
be called the first time before the BackendRegister was created. Because
m_backendsRegistered was set to true even if it failed, the final call has
no effect. So we need to ensure to set m_backendsRegistered only if a
BackendRegister is available.

Fixes: QTBUG-132085
Change-Id: I2ea1c0e0737c982594ceb06cbaf540399c45e3f4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9903242ecab82c1ed72dcaf90e90a171c942a84a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 850ed0222f8ff1808ad5508ccf4bc6bfa78d061f)
2025-01-05 16:19:05 +01:00
Ahmad Samir 5fc8ca9cdd src/plugins/*: fix GCC -Wextra-semi colon after member func definition
Task-number: QTBUG-132101
Change-Id: I947fdb66df9b6d86c60139046166395e4ae42127
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 997abb0520cdfbde60e0fe4fdb133e15e24ce871)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 5171b7f4886ead3577fad61f6b2675efc8c3848f)
2025-01-01 04:02:36 +00:00
Samuli Piippo 5b7ebe3cc4 egldevice: allow DRM device path to be overridden
The backend-provided DRM device might not be the right one,
so allow kms config to override it.

Task-number: QTBUG-131887
Change-Id: Ied744ae7015eae64f4556f1528e0dbe8ae69d206
Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@qt.io>
(cherry picked from commit c3bbbb22b8bc920e4937cf640fd1d2df3b0f9205)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 884c33835556c2485596be4bb53e57e6c37e202f)
2024-12-30 17:34:53 +00:00
Wladimir Leuschner b7a63351a4 QWindows11Style: Adjust Subline for QLineEdit to fit rounded corners
Reduce the size of the subline for QLineEdit to fit the begin and end of
the rounded frame corner.

Task-number: QTBUG-132261
Change-Id: I879f30c2bdc6601fef4738aeec71d7ab7bcee22c
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 5e656b9ea3c192f389b7e4f7aa2ae6b010cec306)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 4eaaf89db5bf25d30ea2b336a6cd0f4287849d53)
2024-12-25 10:22:13 +00:00
Christian Ehrlicher 7ce5b4f486 QWindows11Style: Adjust position of MDI subwindow icon
The y position for the MDI subwindow icon was not calculated correctly
so the icon was not painted vertically centered.

Task-number: QTBUG-130673
Change-Id: I5f9023820a4e4b4288017869ac4088fe2669ce50
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6e29a94b547fbafa69e97ac02aeb33edad63f2ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 1319dcf472b97652883f01bdb411e7719d1cc2e4)
2024-12-20 22:03:03 +00:00
Christian Ehrlicher e38834a020 QWindows11Style: adjust text rect for CC_TitleBar
The adjustment for the textrect was wrong - the bottomRight point must
be moved by -1/-1, not 1/1.

Task-number: QTBUG-130673
Change-Id: I6c099fdd9a03188e7a5c7852b1912ed9b2801f7a
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2c85e5d22215f24bd46d07a1183393e52702493f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ecc31955f1ded212c334c87195bd1dca040d2565)
2024-12-20 22:02:56 +00:00
Christian Ehrlicher 4f60aa4b7c Windows11Style: adjust subline color in editable widgets in dark mode
The color of the subline in editable widgets was black in light and dark
mode. Fix it to use white in dark mode to make it visible. Move it out
into own helper function since it's used in at least three places.

Task-nubmer: QTBUG-131585
Fixes: QTBUG-131586
Change-Id: Icca2b142a1ce0c3d7f722baa6d3635bae5950e1c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 66d42b62b6f01205cf1db72e56ecb5166554e373)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit eab71ff6b0d4bee0b872e5ba38a52f9406df40e2)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-12-20 15:34:32 +00:00
Tim Blechmann 54007382fc Cocoa: emit config error when using 15.0 as deployment target
QCocoaScreen uses removed APIs, which cause the code no fail compilation
with CMAKE_OSX_DEPLOYMENT_TARGET=15.0.
Adding a compile-time check to detect this early.

Task-number: QTBUG-128900
Pick-to: 6.5
Change-Id: I7eeb60f5769af6b1622efd1e0637e85a038b7930
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b6f3695a80f5abfbcfb0ebb5b03358b8e7bbbaf9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 9e22277d28609f951405b98fd9441378fe728f76)
2024-12-20 13:30:00 +00:00
Christian Ehrlicher c876e78719 Windows11Style: Fix horizontal scrollbar arrows in rtl mode
The arrows for horizontal scrollbars must be swapped in rtl mode.

Change-Id: I517fcea19837a6438edc261e066930218b71ce28
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 02920ef05a980d9bb670e1f8a4b84e0b6cef13c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 72f48d084095f0fa103bfa6ea70c1b74e4a165be)
2024-12-20 10:40:03 +00:00
Ahmad Samir c0f03f9d2b Fix GCC -Wextra-semi warnings with Q* macros
Namely, Q_ENUM, Q_DECLAR_FLAGS, Q_FLAG, Q_DECLARE_EQUALITY_COMPARABLE.

The sanitize-commit (from qtrepotools repo) git hook already warns about
these.

Change-Id: If53f446c7c19856c4a5be1e0b0156e1892871dae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 8d3601dfe8e6a89cbf0ab0ff8089e232f52c21d2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit dbaef86144372ce17f5c49b61454b2edfa1b2b6e)
2024-12-20 10:40:03 +00:00
Tor Arne Vestbø 596278c7cb iOS: Iterate accessible interface to find window
Many subclasses of QAccessibleInterface implement window(), but
some don't, and the documentation states that the backend (us)
will traverse ancestors until it finds one with a window.

We were not doing that for iOS, which caused a crash for
QAccessibleTabButton, which doesn't have a window.

In case we ever hit the code path where we can't find a
window we also skip adding the nil element to the array
in createAccessibleElement, as that causes an exception.

Amends 7a512d1267

Pick-to: 6.5
Change-Id: I9b758423956e845a01b014022f4d3ab6306be94e
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit 6689921b9da3780676a416324eafcac98ab211a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b3c60bd11fd19a98569285643f5ecad84cd60c29)
2024-12-19 20:21:29 +00:00
Tor Arne Vestbø 1c8b96491d QCocoaDrag: Only update m_lastView when it actually changes
The underlying QObjCWeakPointer used to track the view requires
a bit of bookkeeping, so avoid updating its value unless the
view actually changes.

Change-Id: I6a1aeaf0e6e0eb221d55de00c8f30259832e58fa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2e80e74f37980f62bb915983e61d6734fb416bcd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 9610a7cbdc9d3fe3df116edf9a251dd011ed4693)
2024-12-17 23:26:45 +00:00
Timur Pocheptsov 155e814183 Revert "qnsview_drag: only ignore key modifier while dragging 'within the application'"
This reverts commit 4332cb3134.
The original idea of distinguishing between context (outside/within application)
is not working anymore - it's always outside (except the moment when
a mouse pressed inside the window, which is immediately followed by
'outside application' context). So in fact we never ignore key
modifiers.

Fixes: QTBUG-132091
Change-Id: I560a48ccf8f8ee1a55f812be6af18b1dd7e25c78
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 7740ac36d27740ff9204cc2626f58620b7e214cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit c39a944e7489f18dc6da27c4b751bedc51072786)
2024-12-17 23:26:45 +00:00
Yuhang Zhao 236360b9df Minor improvements of windows style
1. Make some global constants constexpr.
2. Make some file-scope global constants static.
3. Use QStringLiteral instead of plain const char*
4. Add "u" to QStringLiteral's content.

Change-Id: Icbc105366ba40e970b256fe3da41231a6fb5064b
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit ad06099b93d79a954d133d6822517d4d0a10adbc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 7c3723b2a93d7b0263109c0872a61307cd13a7ed)
2024-12-13 13:21:30 +08:00
Wladimir Leuschner 92e454c000 QWindows11Style: Override alternate base color in darkmode
The alternate base color in darkmode was wrongly set to the accent color
instead of a lighter color. This patch overrides the alternate base
color for the QWindows11Style.

Fixes: QTBUG-131976
Change-Id: Ie8f50b0042ca7bf746224275abc0cd255df7a4ad
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 79aa4269bcbbedef8206d79318c199df7c8a3c9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 1a737083f1db32da9f5af45256a3e26b6029d2e3)
2024-12-10 11:35:05 +00:00
Alexander Golubev 2b3d867d9f xcb: fix for multi-X11Screen systems via xrandr 1.5
Fix support for systems with several X11 screens (or "virtual desktops"
i.e. DISPLAY=":0.0" and ":0.1"). Namely, call
QWindowSystemInterface::handle*() only after we settled on which screen
will be primary. Also cleanup some code logic, particularly, make sure
that  QXcbConnection::m_screens is stores screen in a reliable order:
 - Primary screen for primary virtual desktop
 - Other screens for primary virtual desktop
 - Screens for other virtual desktops (primary screen is first)

Pick-to: 6.5
Fixes: QTBUG-110898
Fixes: QTBUG-130714
Change-Id: I3e78e56466998dff4d7da83db45f0ed61463f041
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 64590233aff4f7e9797f37484dbdd6d8465a1ea9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-12-05 10:58:56 +00:00
Liang Qi b63cceb1b0 Revert "xcb: ignore the xscreens which don't belong to current connection"
This reverts commit 2b94453cbd.

This caused a crash when d&d text and etc cross xscreens from qt
application.

Pick-to: 6.5
Task-number: QTBUG-110898
Task-number: QTBUG-130714
Change-Id: Ie272ee96cdd963491bcf37f5448c3f4af3fd6aa7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 45b33133c1c4b6dbabd48fda1c68c25a400fd482)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-12-05 10:58:53 +00:00
Vladimir Belyavsky 497cc1deb8 QCocoaFileDialogHelper: protect more against dangling pointers
This is in addition to 10b5b4cbba,
where we made m_helper QPointer to make sure it was still valid
before accessing it. There is one more place in completionHandler
where we need the same check.

Fixes: QTBUG-131880
Pick-to: 6.5
Change-Id: Id51d2c68db23b897b145ad25dd1c73b3f5eb9cc1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit a794f957c4c17fbcb12a4b78f58240d109c150d5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-12-04 18:55:59 +00:00
Juha Vuolle 4d6a96bb34 Add iOS UIScene related URL handling
Qt adopted UIScene lifecycle in Qt 6.8. As part of that switch,
the application URL delivery also changes to scene-specific, and the
previous QIOSApplicationDelegate URL handling callbacks aren't invoked
anymore.

This commit adds the URL handling to these scene-based callbacks:
willConnectToSession, openURLContexts, and continueUserActivity.
The older callbacks are removed as unnecessary.

With these additions, the application is capable of handling
custom-uri-schemes and https universal links, both when it's already
running, and when it needs to be launched.

Amends: 76ebf51bc0

Fixes: QTBUG-131741
Change-Id: Icacd76e9769f0a559b2052dfb60466a871187321
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c81f805817c82018e133ca140183f7ecee9d6130)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-12-04 14:43:50 +00:00
Alexandru Croitor d6816e4104 CMake: Fix standalone build of sqldrivers with SBOM
The standalone build of the sqldrivers plugin never called the SBOM
project begin and end functions.
This cause an error in qt_internal_add_plugin which tried to read the
SBOM project name.

Replace the calls to qt_prepare_standalone_project and
qt_print_feature_summary with qt_build_repo_begin and
qt_build_repo_end.
This ensures the SBOM project is setup, as well as many other
behaviors that a standalone internal build of a module is expected to
have.

Additionally we need to tell the SBOM project where to find the
licenses for the standalone build. This is done by setting the new
QT_SBOM_LICENSE_DIRS variable to the qtbase license directory.

Fixes: QTBUG-131799
Change-Id: I2e31ecffdff28561d1c4a6b8fbcd8125188d2c48
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit df30953228f0e364e9a3915d97f522efd8e67489)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-12-03 20:38:55 +00:00
Tinja Paavoseppä e4d5537775 Android: Remove redundant JavaVM reference
Task-number: QTBUG-130610
Change-Id: I788a3789b5a5b178b97b5a2c9b7568a7d925e1a8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit c95426619f5788be03c6111c3b21db46b234921a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-12-03 15:27:52 +00:00
Tinja Paavoseppä b7f24ec07f Android: Remove unused ClassLoader reference
Task-number: QTBUG-130610
Change-Id: Ide5d1539f6c608a6d031d28d1942b55b0e9b5407
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 1a6efa0728c03979096dbd669d1244fd715a8f26)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-12-03 15:27:46 +00:00
Kai Uwe Broulik 21166a91e2 WindowsIconEngine: Add icons for bidi ltr/rtl and command prompt
Change-Id: I5757a650b6972f6e4e08267ff5b21333db8cc8b8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3347432beefc5c31a5a874c190d2f840ff12e9cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-12-02 08:59:51 +00:00
Christian Ehrlicher 53a5df8cf0 Windows11Style: fix painting checked QToolButton
A checked QToolButton should be drawn similar to a checked QPushButton.
As a drive-by avoid calculating the paint rect twice and make the code a
little bit more readable.

Fixes: QTBUG-129439
Fixes: QTBUG-129700
Fixes: QTBUG-130822
Change-Id: I573132e804f26b9fa41112267a9f685680cf0864
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b3c0b08eb040bbd76b81a7c6172e3846e8ec0000)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-29 15:36:09 +00:00
Christian Ehrlicher 49cb3203a9 QWindows11Style: simplify CC_TitleBar painting
Move common tasks into a lambda to improve readabilty and avoid
copy'n'paste errors like it happened for SC_TitleBarContextHelpButton.

Task-number: QTBUG-130673
Change-Id: I5cb198b976d459b73e339d066def92d70b71ade5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9a97e78d8310c13212aacd578f5529b5521e395a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-28 14:03:12 +00:00
Tor Arne Vestbø 059cbd17ba Add private QObjCWeakPointer for tracking Objective-C object lifetime
Uses __weak if possible, and otherwise falls back to associated objects.

Replaces manual tracking of QNSView lifetime for QCocoaDrag.

Task-number: QTBUG-116554
Change-Id: I56f2707bbf5aa14a9efd0ec29e37b157e97cfc3e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit fa9449bbe8fb20cbdfc5b1e81181a30e4a7c358a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-28 14:03:12 +00:00
Christian Heimlich 0467b8278e Fix non-portable link to uiautomationcore
548351 changed QWindowsIntegrationPlugin and
QWindowsDirect2DIntegrationPlugin so that their CMake targets link
directly to UIAutomationCore.lib/.a instead of loading
UIAutomationCore.dll dynamically at runtime; however, it did this by
first locating the library via `find_library()` and then using the
absolute path to the DLL import library found. If Qt was built
statically, this would cause that absolute path to be added to the
INTERFACE_LINK_LIBRARIES of their export targets, breaking the build
if moved to another machine where the location of that lib differed.

Instead, simply list uiautomationcore as a library link by name only,
which shifts responsibility of locating the .lib/.a when consumers
build to the linker, as is done for all other Windows system libraries.
This ensures that the library is found correctly regardless of which
system Qt was built on.

Currently this only applies to MSVC due to limitations with
uiautomationcore.a when using MINGW, where the lib is still dynamically
loaded.

Pick-to: 6.8.1
Change-Id: I20011a51935af4093de83fff75efe2141da0655b
Reviewed-by: Zhao Yuhang <2546789017@qq.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit da367d0bffcd58a3217af937d767cf4f392d3c15)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-27 15:44:41 +00:00
Even Oscar Andersen 0c60d2c066 wasm: Fix focus handling
We had input handling enabled as a precondition for setting focus.
This is wrong, we need to have the focus for toggle buttons
and other non-input things as well.
(Also toggle buttons act on spacebar).

Also selects a new active window if the window
that is active (i.e a dialog) is deleted.

Also shift + tab did not always work, fixed
to emit Key_Backtab

Fixes: QTBUG-130371
Change-Id: I3b36a3e200ba9d4b0791865e75235ddfb72bcaa5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit ef8bf4c2cf3d86a869ff8a555d4e390168864144)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-27 06:47:13 +00:00
Isak Fyksen cf64c1b042 Replace QPair/qMakePair with std::pair in qtbase/plugins
As a drive-by replace calls to QList::append with emplace_back,
to avoid repeating value_type.

Task-number: QTBUG-115841
Change-Id: I027d82706f3545dd63c6b8ba89ba66ae938e07f9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 6ed725b3b93d15a45501fecb6f1fa711ef65e17e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-26 11:16:41 +00:00
Vladimir Belyavsky 5df8379b18 Schannel: fix endless loop in TlsCryptographSchannel::transmit()
We've encountered that under some circumstances DecryptMessage may
return undocumented SEC_E_DECRYPT_FAILURE status. It's probably a bug
in Schannel on Win 11, as there is no such problem on Win 10.

In such cases, since we didn't handle this specifically, we can end
up in an infinite loop in TlsCryptographSchannel::transmit() when
`intermediateBuffer` is not empty and `bytesRead` is 0.

To fix this, we just add SEC_E_DECRYPT_FAILURE status handling and
will disconnect from the host and emit the error respectively.

Change-Id: I340669a967be420c74cb01296629f94c4720c958
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit ed0eb386dad22b0984151b92168dcbf9b57c381b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-25 15:18:32 +00:00
Wladimir Leuschner bb4ec722d4 QWindows11Style: Draw inactive MDI window texts lighter
Fixes: QTBUG-130673
Change-Id: I431ac917ac159d54c35b6a8da270f3bac8117019
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit ea88b0e244ab077288bf6915118bf6b6745182c6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-23 17:11:58 +00:00
Even Oscar Andersen f0c7c66b21 wasm: handle isComposing for platforms that support it
Fixes
(Alt + '~') + 'a' -> ã
(Compose) + '\'' + e -> é

A key change is to look at "isComposing" for events
Related bugs:
    QTBUG-107139
    QTBUG-124932
    QTBUG-117096

Fixes: QTBUG-130887
Change-Id: I0d4641d89952e0b4117226994a91e40039ad8a03
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit efa0d60fe465542c8233b1e6d9ed35806967c86c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-22 15:32:25 +00:00
Liang Qi e8b1644d44 xcb: guard crtc before usage
Task-number: QTBUG-131343
Pick-to: 6.5
Change-Id: Ibcf96340e316b6fd667895dcd5d2cd6e4b55e012
Reviewed-by: David Redondo <qt@david-redondo.de>
(cherry picked from commit f8aa1c423e7f878a4a7518438321eb01e552747f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-22 08:45:03 +00:00
Inho Lee 79312a5dc7 eglfs: change the condition to destroy the openglcompositor
With an openglcompositor, only first QEglFSWindow is set
with a flag, HasNativeWindow and when it is destroyed,
the openglcompositor is destroyed, too.
For now, when using openglcompositor, Qt will not check
HasNativeWindow for its nativeWindow because it is not
possible to add a HasNativeWindow flag in an existing
window. And the openglcompositor will be destroyed after
the all the QEglFSWindows are closed.

Fixes: QTBUG-129576
Pick-to: 6.5
Change-Id: I620a904a03d29e8db1738d9392f716b3ebf5b553
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 39bcd4287a6146e6deba9c6a9fdb70298deed427)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-21 14:41:03 +00:00