Commit Graph

11165 Commits (590ac5b4a1881561ae1cf95dc1da6949eef2778d)

Author SHA1 Message Date
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
HIDAKA Takahiro f3f9b2ea8a iOS: Replace usage of deprecated QPointerDevice APIs
Replace usage of QPointerDevice::setType to constructor.

Fixes: QTBUG-129981
Change-Id: I757ec3cde7815363539b8cfe3fd7ae46993ce33e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit cc24213bdb286b200ad1c637ed244c48a2a32495)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-05 18:53:17 +00:00
Christian Ehrlicher b63615ca6c Windows11Style: fix sizehint for QComboBox
The size hint for QComboBox relied on the vista style but the painting
was completely different. Therefore swith to the base windows style and
add the extra margins used in the windows11 style.

Fixes: QTBUG-130824
Task-number: QTBUG-11967
Change-Id: Ic533140793cdd4e640c49f6d73e9bb73bcbb83da
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b6ca35f65372cc8519a418d6a5291cafd809f7c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-04 22:30:19 +00:00
Christian Ehrlicher 81ba262a62 SQL/Mimer: simplify uuid conversion
Simplify converting a QUuid to a rfc4122 representation by using the
built-in toRfc4122() function and don't allocate a temporary QByteArray
when converting it back from rfc4122 to a QUuid.
As a drive-by make sure to not detach when converting a QByteArray to a
blob.

Change-Id: Ib8fc7744952377d14ef39c0d901a6a8419eb018d
Reviewed-by: Fredrik Ålund <fredrik.alund@mimer.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 814e4e1cbe6e4a625625942c70b394aa6455fb19)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-04 22:30:19 +00:00
Tor Arne Vestbø 1696091c5b macOS: Update NSOpenGLContext drawable on beginning of frame if needed
If the size or DPR of the window we're drawing to with QOpenGLContext
changes we need to call [NSOpenGLContext update] to recreate the backing
texture.

We were doing this in QCocoaGLContext::makeCurrent(), based on the
assumption that clients would always call makeCurrent() before drawing,
which is a documented requirement of QOpenGLContext:

  "To be able to support certain platforms, QOpenGLContext requires
  that you call makeCurrent() again before starting rendering a new
  frame, after calling swapBuffers()."

However RHI doesn't follow this rule, and skips makeCurrent() from
QRhiGles2::ensureContext() if the context is already current.

This was causing issues when moving a window between screens with
different device-pixel-ratios, as we were correctly rendering to
the window with the updated DPR, but we had not resized the target
texture to match.

Changing QRhiGles2::ensureContext() might be an option, but nowadays
we have QPlatformOpenGLContext::beginFrame(), which is guaranteed
to be called (by RHI, not by generic QOpenGLContext clients).

To cater for RHI we now call [NSOpenGLContext update] also from
the beginFrame callback.

Fixes: QTBUG-114873
Pick-to: 6.5
Change-Id: I9461135109fb1473ef9965f72f52beeb41b03680
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 48c176e1b891428af504087b117a72bcaa806930)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-04 19:42:24 +00:00
Volker Hilsheimer 945c8bf54d Cocoa: Use sheetParent to close sheet instead of transientParent
If the window that the sheet (as created for a modal dialog) lives in
has already been destroyed by the time the sheet is hidden, then we used
to trip an assertion. Instead, always use the sheetParent, which is
still alive.

Add a test case that asserts without the fix.

Fixes: QTBUG-128302
Change-Id: I4c399b73e2552bab79358c5505f403efa8e4f80b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 332f49f2d8c5675bab8bde6acfb377d567961d4a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-04 17:48:56 +00:00
Wladimir Leuschner 6e6d42a3b3 QWindows11Style: Respect background color for flat QPushButtons
Fixes: QTBUG-128781
Pick-to: 6.7
Change-Id: I634d42566ea6249b125da537ac7e60fbd8475635
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 0b1275f630b5d03f314bc02879301df95b3f1940)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 19:34:31 +00:00
Wladimir Leuschner f1bab31ff5 QWindows11Style: Don't set FramelessWindowHint for QScrollbar
QScrollbar is a widget and not a window, therefore there is no need to
set the FramelessWindowHint

Fixes: QTBUG-128518
Pick-to: 6.7
Change-Id: I687c708cd4f59c6f09d0ad3c2d3ddcf62c33b11a
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 7b146e530adc913a1ed49b4d2ba17de787089261)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-02 19:34:29 +00:00
Tor Arne Vestbø e72c7e6a6a macOS: Account for selection when computing input-method ranges
Text insertion from an input method such as Writing Tools can come in
without there being any marked (preedit) text. In this case, if there
is a selection, Qt's input-method protocol specifies that the receiver
should remove the entire selection before processing the range of the
input-method event. But we were not taking selection into account when
computing the range passed to QInputMethodEvent, resulting in inserting
the text at the wrong location.

We now consider both marked and selected text when sanitizing and
computing ranges. For now we assume that there can't be selected
text and marked text at the same time, and we also assume that the
incoming replacement range is not a subset of the selection range,
as this would mean we would need to extract parts of the selection
into the commit string up front.

Change-Id: I8948735a10265f92c01bc4e01870a7870fb1081f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 500d19bb54c8fff58b169bb3c5a9aaaa5277151f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 08:42:53 +00:00
Tor Arne Vestbø 1537fdb01e visionOS: Use PRIVATE for Swift CMake properties in platform plugin
Change-Id: I7c7462ea179a484befbc9eaf8943de8963c0926a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 9ef87298e58396e493558d307ef318098068ec67)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-11-01 08:42:49 +00:00
Wladimir Leuschner d3f26e2bbd QWindows11Style: Reduce menubar height in QTabWidget
Due to increased menubar height, an attached menubar to QTabWidgets was
shown as >> indicator. This patch reduces the size of the menubar, in
case it is attached to a QTabWidget.

Fixes: QTBUG-130399
Change-Id: I0e71156cacd6acc51ede353b3b4ddf09d9c0260f
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 9a06060e9ba0711ed458c19c274b7903f3d89d65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-29 01:10:26 +00:00
Wladimir Leuschner 9107817eac QWindows11Style: Calculate Spinbox size based on CommonStyle size
Use the calculation from Commonstyle and add the increased padding and
horizontally layouted buttons to the horizontal size hint.

Fixes: QTBUG-130288
Change-Id: I7932b782e7873a0178091a51379f17453eb585fd
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 96d46cad43517adefa2eb7cb8819a0b2cc9241e6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-25 13:19:29 +00:00
Wladimir Leuschner e00084e163 QWindows11Style: Adjust ArrowRect offset for RTL QComboBox
Adjust the arrow rect, so that the arrow is not outside of the combobox
frame in RTL mode.

Change-Id: Ieddda7be4959a37a4c47ab9fe8e4d6bae4e91f04
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit d5afa192a32ac7187621f37b5f8baaf2388730dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-25 13:19:06 +00:00
Wladimir Leuschner 197c3e61fe QWindows11Style: Reduce textedit padding and align combobox texts
Horizontal padding for textedit controls is reduced from 8px to 4px.
To align the QComboBox label with the list flyout, the combobox label
got additional 4px padding.

Fixes: QTBUG-130125
Change-Id: Ieb4a8c9dab7fbe594134261b738060acfe7fdcb5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit c8fa7408a0c15054a6a50c28c0c21845134a4a13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-25 12:39:51 +00:00
Wladimir Leuschner fae0899efe QWindows11Style: Grey out disabled Widgets in light theme
Disabled widgets were drawn in the same colors as active widgets, making
them hard to distinguish.

Fixes: QTBUG-130123
Change-Id: I723a1d5d3a90d56cc3e82148939ae3eaacd01ed4
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 9523b97eb9146e308b25ef19394c48ec636a73ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-25 12:39:44 +00:00
Wladimir Leuschner 0cb772c6c3 QWindows11Style: Add menu indicator to QPushButton
In case a menu was associated with a QPushButton, draw a triangle
indicator that shows, that a menu will open up.

Fixes: QTBUG-130122
Change-Id: I798499c1484ed66662fa3ce7f3d1aeccd3f40ad7
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 1347ca99a30364ca9973448111a9bf40173fd81e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-25 12:39:38 +00:00
Wladimir Leuschner 71cba1359e QWindows11Style: Add checkbox offset to ItemViewItemText
Add the width of a checkbox to the starting starting x position of the
ItemViewItemText in case the ItemViewItem has a checkbox.

Fixes: PYSIDE-2897
Fixes: PYSIDE-2906
Change-Id: I233e2bfd28836ae5578aadfe9332193848ac5a7f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 877b29a78e38ff7c6af2d63d93e6a554544bf278)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-24 22:18:46 +00:00
Christian Ehrlicher df1118b4e0 SQL/PostgreSQL: fix comment for formatting QDateTime
The comment to convert a QDateTime to a PostgreSQL compatible string was
outdated. Adjust it to the current state and make clear that the
PostgreSQL documentation is unclear here.

Task-number: QTBUG-129983
Change-Id: I46e45082f2154881ab34278c5e9887cb2274dd64
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit d6a7e51fa36c51a39c609ff0b2cd8bc10bd01e86)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-23 05:39:23 +00:00
Tor Arne Vestbø 037e14dd07 macOS: Add support for context menu keyboard hotkey
macOS 15 introduced the ability to trigger context menus via a keyboard
hotkey (Ctrl+Return by default). We now catch this hotkey, propagate it
as a normal key event first (in case the application wants to handle it
by itself), and trigger a QContextMenuEvent if the system determines that
the action should result in a context menu.

[ChangeLog][macOS] The context menu keyboard hotkey available on macOS
15 is now propagated as a QContextMenuEvent if the corresponding
QKeyEvent is not accepted.

Task-number: QTBUG-67331
Change-Id: I3a64a9a18d2caf767fc32637d314a06465aae88f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit e7c8c2ccc859f8083fb3bf442647b0a315cf1b60)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-22 16:24:30 +00:00
Tor Arne Vestbø 8b9c25998f macOS: Release main thread transaction block as soon as we're done with it
Since 9122d826d2 we're presenting drawables
on the main thread, even those produced on the Qt Quick render thread, if
we are part of a displayLayer call, as we're then presenting the Metal
layer within a Core Animation transaction.

We do this by assigning a block to the layer, that we then call on the
main thread in displayLayer. This block retains the drawable, so when
we're done calling the block we need to dispose of the block as soon
as possible, to avoid stalls due to running out of drawables.

To improve on this we add a local auto-release pool around the clearing
of the main thread transaction block. In the case of displayLayer we
need to take care to also include the referencing of the transaction
block in the auto-release pool, as that makes a separate auto-released
copy of the block (and hence also the drawable).

Task-number: QTBUG-129839
Change-Id: I7663862c63977adab7b1f22a136416c8bc910c6e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 72e4cb96700cd93213d5c3ecb14cd92f4c069c65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-21 14:14:01 +00:00
Axel Spoerl 5abc6e9ccb QWindowsWindow: Refactor corrections related to task bar on top / left
33874a9424cd03c21ca9986a39c383b3689f03d2 corrected a size-contrained
window's position when maximized. Restoring such a window's size
moved the window downwards as well, if the task bar was on top. With
the task bar on the left, such maximizing the window caused parts of it
to be off screen to the right. These bugs affect only Windows 10,
because Windows 11 only allows the task bar to be at the bottom.

Factor out all corrections to QWindowsWindow::correctWindowPlacement().
Correct placement when restoring size of a maximized, size-constrained
window.
Correct width of a height-constrained, maximized window.
Correct height of a width-constrained, maximized window.

Change-Id: I9a1e0cf4708e8c579595fdbdc7f16b927be53b05
Done-with: Johannes Grunenberg <nerixdev@outlook.de>
Fixes: QTBUG-129405
Fixes: QTBUG-129679
Task-number: QTBUG-123752
Pick-to: 6.5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 06fcb3dfe69e175f94d112ecef45b091598f5ae5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 10:09:36 +00:00
Alexey Edelev 6c1f4c6c56 Guard the QDateTimeEdit usage with the respective feature check
QDateTimeEdit and the respective header are available only when the
'datetimeedit' feature is enabled.

Amends bfe8ac4ebff7a1e8114068f2f46e73c588735690

Fixes: QTBUG-129481
Pick-to: 6.7
Change-Id: Ia9595bb17b47fd7221742665f1242a5f85ed6c0d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 00bcf5a867d0414cd894e46d085feef94aa317b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 06:49:53 +00:00
Tor Arne Vestbø 11c8b80f4b macOS: Avoid creating 0x0 size IOSurface in backing-store
During screen attach/detach, we may end up in a situation where the
window has a 0x0 size, and we end up painting to the window, in which
case we were trying to create an IOSurface of size 0x0. This resulted
in the creation failing, triggering an assert.

We now guard the surface creation with a check for the backing store
size being non-empty, and for empty sizes we fall back to a plain
null-QImage for our paint device.

Fixes: QTBUG-128731
Pick-to: 6.5 6.2
Invaluable-research-by: Viktor Arvidsson
Change-Id: I06ea582c87fb0d359387ef9495451801612701c9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 58caa18d2ff1a67e16f960f5bd6b804cdaec4063)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 06:49:27 +00:00
Christian Ehrlicher 993fa70777 Windows11Style: add two helper functions to avoid code duplication
Add and use the two helper functions
 - buttonFillBrush() returning the correct fill brush for a button
 - buttonLabelPen() returning the correct pen for a button

Change-Id: I6ee0dbe2490ad5c875b75d13b48371b5e798c290
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 436abff5cce198bb90c90e92104922373a3f99cd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 06:49:13 +00:00
Even Oscar Andersen 2bd01602dc wasm: Fix tooltip visible
Fixes a problem where tooltips only worked for the first instance
activated.

(cherry picked from commit d69348ed4d659f9408ce74f3b08ee7e9104dde00)
Fixes: QTBUG-129234
Change-Id: I45619b1ca8001b74b148b98a8795000630dcacf7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-10-18 06:07:13 +00:00
Tor Arne Vestbø 5baa0d759b iOS: Don't intersect window maximized/fullscreen size with nil UIWindow
When making a QWindow maximized or fullscreen we intersect its final
geometry with that of its UIWindow, as in the case of split-view or
floating windows on iOS the UIWindow size will be smaller than the
corresponding UIScreen.

However, after 76ebf51bc0 we no longer
track UIWindows via UIScreen, and instead manage them as part of the
UIWindowScene. Unfortunately the default scene that iOS manages is
created and connected after returning from didFinishLaunching, which
means that during main() there is no UIWindow. Attempts at manually
connecting this session before main via activateSceneSessionForRequest
were not successful, as we don't support multiple window scenes (yet).

Intersecting the window geometry to this non-existent window during
setWindowState() would result in an initial 0x0 size for windows.
Which would normally be okey, because once we have a UIWindow we re-
apply the window state, resulting in new QWindow geometry.

However the initial 0x0 size can in some rare scenarios trigger
QWidgets into setting the Qt::WA_OutsideWSRange attribute on the
top level widget, and due to a possible bug in QWidgetWindow, this
attribute is not reset once the QWidgetWindow receives an updated
resize event.

As a workaround for the widget issue, and to restore the semantics
of receiving an initial valid size of the window, we skip the logic
of intersecting the geometry with the UIWindow if we don't have one
yet.

Note the for visionOS and iOS applications running on macOS we
rely solely on the UIWindow for geometry, which means that this
issue still exists in those environments as long as the underlying
widget issue is not fixed.

Fixes: QTBUG-129472
Change-Id: Id81c356446f6e69f8a1eda59272ac04f02cc005f
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit b78baf634c6c2b8165432bf1e22a96abb2016f42)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-17 23:40:16 +00:00
Tor Arne Vestbø e3594963f3 macOS: Reflect QWindow's color space after creation
If an explicit color space has been set, we assume that we can apply
that to the CAMetalLayer or IOSurface we use when blitting our content.

If not we want to reflect the NSWindow's color space, which will in turn
reflect the NSScreen color space.

Task-number: QTBUG-129499
Change-Id: Idc465af39dafc80be0edd014abc55eb501ae1f89
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit a3a691c5a359ad1c3f76248c270273ec13fe96fd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-17 23:40:16 +00:00
Christian Ehrlicher 8ebf6dcd12 SQL/PostgreSQL: fix parsing timestamptz return values
When setting the timezone explicitly to something different to the
localtime (e.g. UTC), the strings returned for timestamptz columns
contain a '+xx' annotation which resulted in a parser error.

Fixes: QTBUG-129983
Change-Id: I4f5e45860e88a5c44b2f1409dae667984ac90913
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 00edd47762df96614a38f1362c2131e539e43abd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-17 23:40:15 +00:00
Tor Arne Vestbø 0af10419ab macOS: Implement NSViewContentSelectionInfo protocol for Writing Tools
The protocol is documented (in the header) to be used for context menu
placement, but is also used for placement of the Writing Tools dialog.

We don't have a way to request the selection rectangle via our input
method protocol, so for now we have to use some crude heuristics based
on the cursor and anchor rectangle. This quickly falls apart for multi
line selections, but should not be any worse than the behavior we have
today where we effectively report the entire QWindow rect, placing
the Writing Tools popup outside the window. With this patch we at least
place the popup relative to the focus widget.

Change-Id: I28053aab93a42133ae2ccc552fcb4172bf55a634
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit ae788f5508a11c8f3f7e3d89b3536f7ec9786639)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-17 19:30:34 +00:00
Tor Arne Vestbø 868e5de059 macOS: Document firstRectForCharacterRange:actualRange
And add a note about the missing logic for when the range is non-zero.

Change-Id: I31e8ab55afa022aa4d72c3f23920b3f5beba9fc6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9f326390d91a7c721770d0f8bf7ed88c7fe72d20)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-17 19:30:34 +00:00
Tor Arne Vestbø f6fa4c4145 macOS: Handle NSAttributedString in insertText:replacementRange:
The text being inserted is not necessarily an NSString, but can also be
an NSAttributedString, as seen e.g. when Writing Tools inserts a
replacement.

Change-Id: I03585008d105332abd3b470f24305664766213f0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit c467edcf0ac8d5aa4c36b2f512e3c762cbd5d373)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-17 19:30:33 +00:00
Christian Ehrlicher 47ae9e4c2c Windows11Style: Fix MenuItem drawing
The drawing for CE_MenuItem had some issues:
 - it did not work in rtl mode
 - it removed 10px on the right to hide issues with e.g.
   sizeFromContents()
 - the checkmark was not properly centered because the wrong rect was
   used

Fixes: QTBUG-129716
Change-Id: Ibe2e5e66367ac0a803788b74175776d95f489c80
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 30d90b4ccad83ab1f23dab7cd72b7e228c299895)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-15 22:15:05 +00:00
Christian Ehrlicher a0f5289db1 Windows11Style: Cleanup drawing menu items
Cleanup of PE_PanelMenu/CE_MenuBarItem/CE_MenuItem:
 - don't calc rect if not needed
 - remove unused code
 - don't set pen which is not used afterwards

Change-Id: I5585a7299317d176d94480905aff0567e8f16444
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 804ec477e5532309e61d616e0ea13412ad410948)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-15 22:14:59 +00:00
Christian Ehrlicher 395647a7b7 Windows11Style: correctly draw submenu indicator in rtl mode
In rtl mode the submenu indicator arrow must point to the left.

Change-Id: If483252e3447c1657291a17e47c2f69de5d61839
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 9f7f7e3708c64ab4c693317b0ee117e272f0f442)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-15 22:14:52 +00:00
Christian Ehrlicher f3bcce4d2d Windows11Style: don't use deprecated glyphs
The glyphs for Segoe Fluent/MDL2 in the range 0xE000 - 0xE5FF are marked
as legacy and deprecated. Therefore replace them with the recent glyphs.
 - 0xE001 -> 0xE73E (CheckMark)
 - 0xE010 -> 0xE96D (ChevronUpSmall)
 - 0xE011 -> 0xE96E (ChevronDownSmall)
 - 0xE013 -> 0xE974 (ChevronRightMed)
 - 0xE018 -> 0xE70E (ChevronUp)
 - 0xE019 -> 0xE70D (ChevronDown)
 - 0xE108 -> 0xE73C (CheckboxIndeterminate)

Change-Id: I1251230fcd49c2a77a569ed97b9108597554c7ca
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit b44ecf0237e0cca2beb7c5e6600afd252f7e51c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-15 12:21:58 +00:00
Wladimir Leuschner 93ac15fcdb QWindowsVistaStyle: Use lighter color for disabled GroupBox label
The default windows theme does return the same color for enabled and
disabled groupboxes. This patch changes the color to
pal.color(QPalette::Disabled, QPalette::ButtonText) in case
GetThemeColor returns the same color for GBS_NORMAL and GBS_DISABLED

Fixes: QTBUG-129979
Change-Id: I4557040017354323593449df596b8e56784c07e0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit b3971d29c0291b9f69b12000c9158af5e0fb3edf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-15 05:01:09 +00:00
Volker Krause 768c49a7e9 Android: Send locale/language change events on system locale changes
This enables applications to retranslate or otherwise update their UI
when the Android system locale/language settings are changed during
their runtime.

Change-Id: Id482ca146080d9f3e74990f64e686f6b3504887c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 83483b8b200ab5cedf659f418c7296719902ddc4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-12 06:24:20 +00:00
Christian Ehrlicher 26cf464e48 Windows QPA: add icon for zoom-original
zoom-original can be mapped to "Zoom" (0xe71e) icon as can be seen here: https://learn.microsoft.com/en-us/windows/apps/design/style/segoe-fluent-icons-font

Pick-to: 6.7 6.5
Change-Id: Ia13776d2f6007dada51bb06d2a5472cc9cdbb370
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit ab6f11600974c803d807f2550d6dd7723749f75f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-12 06:23:56 +00:00
Marc Mutz 729a30a9df De-inline dtors of QAbstractEventDispatcherPrivate subclasses
... pinning the vtables to a single TU each, instead of duplicating
them for every user.

Task-number: QTBUG-45582
Change-Id: I3b7bce14567dc8be89795a48f6871eb24fe908aa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lena Biliaieva <lena.biliaieva@qt.io>
(cherry picked from commit 2e2f5093912faf612f0be72289180b167d6326a7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-11 15:19:09 +00:00
Lorn Potter 8375adcbe4 wasm: add dragleave event handling
Fixes: QTBUG-129149
Change-Id: I946f43e3a696c801a60a9a209a70ccaf57252a60
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 8a93093271329f1fb867c0627e63f61ed7330860)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-11 01:03:25 +00:00
Bartlomiej Moskal b60db83faa Android: Allow to open Keyboard without touch
After changes in f4050cc5ea commit, the
keyboard can be opened only when internal m_currentEditText is set (what
is happening only on touch). Because of that, the keyboard cannot be
opened just by setting focus on an item like it was before.

To allow open the keyboard not only after touch, QtWindow needs to be
informed about each focus change.

Fixes: QTBUG-124360
Change-Id: Ic3ca4451f53df55bfb1f3e300078fd1916e77155
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 2971dbfe062de6b0be3ed9f251f9506bd45d5854)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-09 21:34:58 +00:00
Wladimir Leuschner 31367fd2c8 WindowsQPA: Respect ENV and cmdline darkmode overrides
Currently the commandline and environment parameters (windows:darkmode)
for setting the darkmode handling are ignored when the application
starts. This patch adds a condition to
QWindowsTheme::effectiveColorScheme that checks whether darkmode
handling was explicitly overridden and initializes in the constructor
the m_colorScheme with the result of passing Qt::ColorScheme::Unknown
toeffectiveColorScheme.

Fixes: QTBUG-127135
Change-Id: I365d26c66fdb3a754832cb7c579aeebecab093fd
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 2ced94b4100c03c5feb7d5b1c0006c9fc451e944)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-09 15:00:23 +00:00
Wladimir Leuschner b33e0eac97 QWindowsVistaStyle: Fill menu popup with theme color
The background for menu items is not drawn and can lead to a transparent
background when switching from QWindows11Style to QWindowVistaStyle at
runtime. This patch fills the background of menu items with
MENU_POPUPBACKGROUND.

Fixes: QTBUG-125474
Change-Id: I246db15ec821f9bc46ba410293c41b7e24548716
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 3de6d6fd348668ff5179504e950ce20b15075391)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-09 15:00:13 +00:00
Christian Ehrlicher 333a4ca7dd Windows11Style: allow usage also on windows 10
There is no reason to limit the usage of the windows 11 style to win11
or above - it works perfectly on windows 10 when using the correct font.

Change-Id: I179d2c017cdad130a134f45c2f0dfadc052a39f0
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit c9306baa825c4070e37aa46aff00aa1905bf1681)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-09 14:55:13 +00:00
Even Oscar Andersen 4bda9b977e wasm: Handle theme colors
Changing color themes did not work since the results from
qt_fusionPalette is cached by default.

The solution is to track changes and call qt_fusionPalette
when necessary.

Fixes: QTBUG-129399
Change-Id: I77824098349be5e5264fa9e230a949e3ccd6f14f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit ff645479e7489de5a88c71c0215748d84be3de9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-07 09:52:41 +00:00
Assam Boudjelthia ca304ec1bf Android: delete androidContentFileEngineHandler in terminateQt()
Similar to other Android file engine handlers.

Change-Id: I63591e09312e439eee1e7bdd71a65d3df4cefbae
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit cd5d30fa3368ab9cf995ed934ea737f3e569e9ce)
2024-10-07 07:25:34 +00:00
Bartlomiej Moskal 5ee47a970a Android: Override new methods in InputConnection
InputConnection interface got new method like [0]replaceText and some
overloaded (setComposingText, setComposingRegion and commitText) that
need to be override by QtInputConnection

[0]https://developer.android.com/reference/android/view/inputmethod/InputConnection#replaceText(int,%20int,%20java.lang.CharSequence,%20int,%20android.view.inputmethod.TextAttribute)

Task-number: QTBUG-120238
Pick-to: 6.7
Change-Id: I72a35ff6bf8cdc10d782b24efb6c99b92b33926d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit dbd5af6231c9182ef370eca2e06c485591d715b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-05 20:21:25 +00:00
Christian Ehrlicher 8058a77340 Windows11Style: cleanup CC_ScrollBar
Cleanup CC_Scrollbar:
 - call subControlRect() only when it's really needed
 - use QStringLiteral to create static strings
 - calc rects only when really needed and then directly in one step

Change-Id: Ibe7944feb813ef3e7f6aea976579d192bafbcce9
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit ffa0e9c19c3cdf3b299357dd263e7413010a62a9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-05 17:15:43 +00:00
Christian Ehrlicher 55a8806e22 Windows11Style: cleanup CC_SpinBox
Cleanup CC_SpinBox a little bit
 - avoid unneeded QPainter::translate()
 - avoid uneeded QPainter::save/restore()
 - don't modify frameRect when not needed
 - merge up and down drawing to avoid code duplication
 - use QStringLiteral to create a static string

Change-Id: Id8bc8d5085b6681b48ea3388941d21a11c0345ba
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 5cd4434389870d43baa1325ba97c5776baff65f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-05 17:15:37 +00:00
Tuomas Vaarala 305b461157 Enable platforminputcontext in QNX QPA without PPS
Platforminputcontext is needed for Qt Virtual Keyboard to work thus it
needs to be enabled without to condition to PPS. PPS is removed in
QNX 8.0 and the condition would never be met. It is safe to enable
platforminputcontext without condition for QNX 7.x as well since it is
needed for Qt VKB anyways.

Fixes: QTBUG-129436
Change-Id: I82230d1411e54713a2dabadf5a8dff3ca5455fbb
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
(cherry picked from commit 4d908a3b5e305462bf7e234db0fe1e42e866e8ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 11:03:34 +00:00