Commit Graph

11063 Commits (699f72278952cecf44976da0a044a698ced76171)

Author SHA1 Message Date
Christian Ehrlicher 19706de70e QPA/Windows: Avoid confusing warning about empty QPixmap
Fix the condition to really don't call scaledPixmap() on an empty
pixmap.
This amends db328ca975bc63f3baf3d021dcff1ea37fa6b6a0.

Pick-to: 6.7 6.5
Task-number: QTBUG-122755
Change-Id: I10470704fff162f699a936f7b61451c02e3bf4e9
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c1d2de095e420315c626fc08d6d6a5e2a34a1870)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-16 17:34:29 +00:00
Christian Ehrlicher e7c7402802 SQL/ODBC: Fix calling SQLGetData() for old drivers
Some old drivers don't return SQL_NO_DATA when all data was fetched
which resulted in an infinite loop. The previous check does not work
when we receive chunked data and the driver returns fewer bytes than the
maximum buffer size.
Therefore simply check for SQL_SUCCESS since according the msdn docs,
SQL_SUCCESS_WITH_INFO must be returned when there is more data to fetch.
This also avoids an additional call to SQLGetData() here.

Pick-to: 6.7 6.5
Fixes: QTBUG-119753
Change-Id: I42ed194f3955a650e63615615fe82d785f324228
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-08-13 17:39:40 +02:00
Tor Arne Vestbø 75f798129a wasm: Only show resize border if direct parent window enables it
A top level window with a window frame will have the has-border class,
and hence a resize border, but child windows of that window shouldn't
have their own resize borders.

Ideally we wouldn't generate these non-client-area elements for child
windows, but changing that requires more work, as it involves creating
and destroying these elements on the fly if a window goes from being
a child window to a top level and vice versa.

Change-Id: I64ec27d87df952419284354b50420df8e48824d8
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit 9322f80c3cde118aec803e6b2c86197b1b5dbb67)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-13 06:47:43 +00:00
Tor Arne Vestbø 7017dc6d37 wasm: Re-evaluate window flags when reparenting window
We apply CSS classes to the qt-window in setWindowFlags based on
whether it hasFrame(), hasBorder(), etc. Which in turn depends on
whether the window is a top level or child window.

As a QPlatformWindow may be created while a QWindow is top level,
and then reparented into another QPlatformWindow, we need to update
the window flags, and re-sync the CSS classes, as otherwise we end
up with child windows with shadows and tile bars.

Change-Id: Ibbb3d2230a880057053d7b12f93257d9b250aa6f
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
(cherry picked from commit e6db07c4e7cca41a94dd787d9a4938abab7918ac)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-13 06:47:18 +00:00
Liang Qi 9f0c48c6b1 xcb: ignore bigger size window icon when size exceeds limit
In the absence of the BIG-REQUESTS extension, the maximum
request length is only 65535, with DPR=2, a 128*128 icon size
will be (128*2)^2 = 65536, which exceeds the maximum
request length.

See also the official doc for xcb_get_maximum_request_length.

https://xcb.freedesktop.org/manual/group__XCB__Core__API.html

uint32_t xcb_get_maximum_request_length(xcb_connection_t *c)

In the absence of the BIG-REQUESTS extension, returns the maximum
request length field from the connection setup data, which may be
as much as 65535. If the server supports BIG-REQUESTS, then the
maximum request length field from the reply to the BigRequestsEnable
request will be returned instead.

Note that this length is measured in four-byte units, making the
theoretical maximum lengths roughly 256kB without BIG-REQUESTS and
16GB with.

Fixes: QTBUG-127392
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: Iee53f579802e8bc54ed1519bc5b5591b5e5700e1
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 0ed5d4d674c241f7affa3b87feb948c26e11d5cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:39 +00:00
Tor Arne Vestbø 1ccaae4c14 Android: Create QtWindow as initially hidden
QWindows are not visible when created, and require a setVisible(true)
call to be be shown. Android Views on the other hand are visible by
default.

This mismatch caused problems when a foreign window was parented into
a QWindow that was yet to be shown. If the foreign window child was shown,
it would show up on screen, due to its QtWindow parent, as well as the
parent window's QtWindow both being visible.

Technically this problem also applied to normal Qt child windows, but
because these windows rarely render unless isExposed() returns true
they would not show anything.

We now initialize QtWindow to being hidden on creation, and let QWindow
handle the order of when the window is made visible.

The QAndroidPlatformForeignWindow::setVisible code had to be adjusted,
as it doesn't call into the QAndroidPlatformWindow base class, where
we normally handle the visibility toggling of our QtWindow layout.

Change-Id: I3debba5f42609d687dc88f7f92c89055cfa6c5f1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 6faf18aceb21a4c5e06d0dfe87b9fbaa037f80fd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:01 +00:00
Tor Arne Vestbø c9dcb28824 Android: Don't set geometry when creating surface or adding native view
The window geometry has been propagated to the QtWindow layout already
via setGeometry() already, so we don't need the additional plumbing
for createSurface and setNativeView.

It's enough to set the layout params of the inserted View to match
the parent (the QtWindow in this case).

Change-Id: I40b44282e80ed04b109ffc1958144cb3e3edd11d
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9d398a18c24ab0a16ceb0346fc20b8eebf95410d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:01 +00:00
Tor Arne Vestbø 8a8df25f32 Android: Always apply initial geometry from QWindow to QtWindow
We shouldn't rely on the QWindow geometry being propagated through
other means, so we should always propagate the geometry when
initializing the QAndroidPlatformWindow.

Change-Id: I489b059ffae7a209005edaaff3674c1f39273bee
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit 6e52d010535b87300bacd54c0c21fba7cc926eaa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:01 +00:00
Tor Arne Vestbø 555242e637 Android: Unconditionally set geometry when asked to via setGeometry
The geometry() of the platform window may match the incoming geometry
at the point of the call, but the native geometry of the Android layout
and view might not, so we still need to propagate it to the platform.

This matches what other platforms do in QPlatformWindow::setGeometry.

Change-Id: I5f04a323412ce2ce9561cace1f0cec461c133e28
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 02734b644e0ae566163da68dd51623943d41fb13)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:00 +00:00
Tor Arne Vestbø 35f3ba214b Android: Remove unused member m_oldGeometry
The usage was removed in a02ea26b46.

Change-Id: I91ec688b7388ea62b2b69745747f83112eaae439
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 5edeaa0720c04cb619db92a98bdcc0401774d9df)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:00 +00:00
Tor Arne Vestbø 10cf8c8fde Android: Simplify QAndroidPlatformWindow::setGeometry plumbing
Instead of splitting the geometry setting into setGeometry and
setNativeGeometry we can leave setGeometry to do the right choice
of whether to propagate the geometry to the QtWindow layout or not.

Change-Id: I30291dbf7079df76f4d3a54d6ea3c9c3f1329c90
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit b3e60c5acfaf809f376f66d6ab7f98ca644b0fce)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:00 +00:00
Tor Arne Vestbø f8ae1a4ab1 Android: Remove m_surfaceCreated check from setNativeGeometry
As long as we have a QtWindow we should be able to set its layout
parameters. Adding surfaces or native views later on will adopt
the QtWindow's layout params.

Change-Id: I08591e18f95bfe1e85358bb68507145d35630486
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit 79ae28d9ace358c20c716ced0d0d9471b500e0cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:00 +00:00
Tor Arne Vestbø 913552ad0b Android: Create QtWindow before applying QWindow geometry during init
During QAndroidPlatformWindow::initialize() we call setGeometry, which
may end up in QAndroidPlatformWindow::setNativeGeometry() via one of
the QAndroidPlatformWindow subclasses, i.e. GL, Vulkan, or foreign
window.

We currently bail out from setNativeGeometry if !m_surfaceCreated,
but this is only a workaround for the m_nativeQtWindow not being
alive yet.

As long as we have a m_nativeQtWindow, we should be able to set the
layout parameters of that QtWindow, independently of whether it has
a QtSurface or is hosting a foreign Android view.

As a start, move the QtWindow initialization earlier in initialize().
The isEmbeddingContainer() check can go at the top, as we shouldn't
do any modifications to a window that's purely used to act as a
container when embedding Qt in native Android apps.

Change-Id: Ia3f0b33e6729f5399946d86799f39877d058511b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit e2ce1f724f56db8072033665d066ad34f4d4c702)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:00 +00:00
Tor Arne Vestbø b9022081b0 Android: Don't add QtEditText to foreign windows
We don't handle input on behalf of these windows, so we don't need
a QtEditText for them. Any Qt managed child QWindow added to a foreign
window will get its own QtEditText as normal.

Change-Id: I32daa83f22487aadca7509379595b6c82b29ea4a
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit eea00824bdbc6740261d2b78821e31c1f21c9c0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:00 +00:00
Tor Arne Vestbø c45da998ad Android: Initialize window in QPlatformWindow::initialize() override
During the QAndroidPlatformWindow constructor we can't safely call
virtual functions of QPlatformWindow and expect them to resolve to
subclasses, e.g. QAndroidPlatformForeignWindow. Importantly, this
means we can't check isForeignWindow() during construction.

QPlatformWindow has a dedicated initialization function for this
use-case, so use that instead.

The existing order of between QAndroidPlatformForeignWindow and
QAndroidPlatformWindow has been kept as is.

Change-Id: I2a08326fae6a3b079cd153c50a13794310ac3d74
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 7150c79d0ee10d6aca330e6a0862b0fbfec071fc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:10:00 +00:00
Alexandru Croitor 07dc649747 CMake: Fix build of oci plugin on arm macOS with the classic linker
When using Xcode 14, or 15 but with the classic linker on arm macOS,
the linking of the oci plugin fails with:

 ld: file not found: @rpath/libnnz.dylib for architecture arm64

Even though the file is present in the expected location.

This seems to be related to the use of the -flat_namespace flag, which
was originally added in 2003 for Qt 3.1, to avoid an issue with the
linker not finding the environ symbol.

These flags doesn't seem to be necessary anymore to successfully link
the plugin.

Remove both the -flat_namespace and -U,_environ flags when building
the plugin.

Amends 3ada49976a06ae251911fd8cd734f697fe4ddab4 in the historical qt
repo, which is not available publicly.

Pick-to: 6.7 6.5
Fixes: QTBUG-127342
Change-Id: If522cacb92aceff35d36d3bcfd3c1f838c134ada
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 3642ce6e4b1912a774cc55c9a6a85ecf716d7080)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-05 22:38:48 +00:00
Volker Hilsheimer 0f89dbb571 Windows: Use pixmaps at 1.0 scale for icons in the QPA menus
The Menu type from Qt Quick's libs.platform module on Windows uses the
Win32-based menus implemented in the Windows QPA backend. Those are not
High-DPI aware, so we cannot use a scaled up pixmap for the menu icons.
The native Windows icon engine returns scaled pixmaps (defaulting to the
QGuiApplication::devicePixelRatio value if not explicitly specified), so
we have to explicitly ask for pixmaps with scale factor 1.0.

Pick-to: 6.7
Fixes: QTBUG-127551
Change-Id: I191915127890ae265b169d5cd8d6c9f058e36a13
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit fdfb360f4f60cbdb9ce7f29f424dad70f0679b17)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-03 11:15:42 +00:00
Volker Hilsheimer 4fe0e5dbc4 Icon engines: don't paint on a null-pixmap
If the pixmap created is null (perhaps because the size is null), then
don't paint into it. It might crash as we might end up with an invalid
device context.

Task-number: QTBUG-127085
Pick-to: 6.7
Change-Id: I03b3beabe02f150a2970013c15842369d3a27596
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit b2b4bc2f2fb5de53e262c88023f278f782b80de5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-01 00:43:13 +00:00
Petri Virkkunen 45f361e97e Android: Warn user if backend register does not have requested interface
Just in case, warn user if they are trying to use callInterface on an
interface that does not exist (probably has not been registered)

Change-Id: I1a4b2226cfecd139e36ab6386ea2fe868bd73f3f
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 6643e97a89f06f0c32c3dff8b2c343eaa76c0e85)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-29 09:12:04 +00:00
Mate Barany 406ddb88f8 Do not use global static non-POD variable for backend name
Replace it with a static variable that is inside a static
function.

Found by an Axivion scan.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: Ic85b683fddb18a389f1d461e4f7ab6b08bf8c3ec
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 51dbdb6f9bf41fa2d7a30c598e9bdc61eaece281)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-26 16:43:58 +00:00
Morten Sørvig 00a1bdfbe1 wasm: set input element position on startup
Follow-up from commit c844a7a5.

The input element was taking up space on the html body,
and was offsetting the Qt app content, making it partly
invisible.

The element already has position: "absolute" which should
remove it from the layout, but it looks like it needs
to have a set position as well on some browser for that
to happen.

Pick-to: 6.7
Change-Id: I618d2561eb32e181797034d0b3005d716d4f6136
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Inho Lee <inho.lee@qt.io>
(cherry picked from commit 59645a409b4b2a68a329b61d7e5837b6fd651a48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-24 16:49:20 +00:00
Gary Wang 44a17e9a36 QJpegPlugin: also recognize jfif suffix
Currently QJpegPlugin can load JFIF image without issue, but didn't
register jfif as recognized suffix. This add the support for jfif
suffix and will load the image as regular JPEG image.

Qt image formats plugins doesn't care about the extra metadata provided
by image itself, so it's fine to simply use the existing QJpegPlugin
to load JFIF image files.

Change-Id: I880d7603f356fbb01af7de8e4fb62fa010a0fd1f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 68f58ce198a794e7b2890f1127c99e0395d105a5)
2024-07-23 09:15:31 +00:00
Christian Ehrlicher 28e8a377f1 QWindowsScreen: use correct return value of SetupDiDestroyDeviceInfoList
SetupDiDestroyDeviceInfoList() returns TRUE (1) and not ERROR_SUCCESS
(0) so an assertion is triggered falsely on destruction.
This amends 5183ca14344c04015b32ef407e4cdad1b370c841.

Pick-to: 6.7 6.5
Task-number: QTBUG-127168
Change-Id: I03ea601e35c0cbcf44080379853e33362568122c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit fcaaebd5c8d5323f050fdcf07d16dc37bdba197b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-22 21:18:26 +00:00
Axel Spoerl b572a85b68 Remove GTK3 native menu
QGtk3Menu relied on gtk_menu_popup, which is deprecated and no longer
supported from GTK 3.22 onward. This renders GTK applications
inconsistent, if GTK >= 3.22 is used.

GTK native menus aren't special. They do not blend in with e.g. a main
window or QML ApplicationWindow drawn by Qt itself. There is neither a
performance, nor a visual disadvantage of drawing own menus by Qt.

Remove support for native windows in the GTK3 platform theme.

[ChangeLog][Platform Specific Changes][Linux] Due to deprecation of the gtk_menu_popup() function, we no longer use GTK menus on Gnome: they are now rendered by Qt.

Fixes: QTBUG-124561
Fixes: QTBUG-126598
Pick-to: 6.7 6.5
Change-Id: I031751fb6e070444e99ab2bcac4c622ac509b4c9
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7ffb4c16955a60ffc0f32d990c70476c49ed0b0b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-21 12:42:33 +00:00
Morten Sørvig 71f80cff34 wasm: make the "a11y enable" button cover window
Adjust the button geometry to match window geometry.
Screen readers may visualize the geometry, and this
makes it clearer that the button is relevant.

Setting the clip looks to be sufficient to keep the
button visually hidden, even if the canvas (which would
normally be ordered in front) is missing.

Change-Id: Iff268cd2d8f52eead9be88e8cb460b0b445781a9
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit e6c77a0b7eba75e8837dc7bcd98dbc1ba95318f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 13:42:24 +00:00
Wladimir Leuschner 4b4c5b06a0 QWindows11Style: Use QProgressStyleAnimation for QProgressBar
Currently for an indeterminate QProgressBar in QWindows11Style, a busy
drawing is triggered, consuming more CPU resources than necessary. This
patch avoids the busy drawing by using QProgressStyleAnimation, which
only triggers a redraw for specified Fps.

Fixes: QTBUG-127112
Pick-to: 6.7
Change-Id: I46da8ffcb849563c771dbc72af4c7e8b306b4802
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 384acdc1cf2cc6472c9eb9d2d79077736ded0e92)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 10:11:40 +00:00
Christian Ehrlicher f18862e91d SQL/IBase: Don't let open() fail when lastError() is set
Since QSqlDriver::lastError() always contains the last error, it is not
a valid source to check if the last operation failed or not. Therefore
remove the check for lastError() when initializing the timezone mapping
- the function is optional since an old database might not contain the
timezone mapping table which is perfectly fine.

Fixes: QTBUG-127175
Task-number: QTBUG-125467
Change-Id: I22ea75c004654cead9a4461d2eaccfcbe8a116be
Reviewed-by: Andreas Bacher <andi.bacher@outlook.com>
Reviewed-by: Hamish Moffatt <hamish@risingsoftware.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 9844da5036d7a7a185ddd4eb3fa59bc4ede9e5d7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 06:33:42 +00:00
Christian Ehrlicher 0ff64a5b99 SQL/MySQL: honor schema when retrieving table record
Honor the schema when retrieving the table record - otherwise we might
end up getting the data for the wrong table (same tablename but wrong
schema).

Fixes: QTBUG-127129
Task-number: QTBUG-122723
Change-Id: Ia3e9293dbdc77da760dd4d0702104048187fad5f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 920dfb2f443042777ea9547ff7a8beef56e90d92)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-19 06:33:35 +00:00
Volker Hilsheimer d2730bc303 Logging: use qCDebug/Warning/Info when for categorized logging
When building qt with QT_NO_DEBUG/WARNING/INFO_OUTPUT set, then the
qDebug/Warning/Info macros expand to `QMessageLogger::noDebug`. That
helper is not defined to take a logging category or category function,
so using `qDebug(lcX, ...)` breaks the build. The correct way to emit
categorized logging is to use the qCDebug/Warning/Info macros.

Task-number: QTBUG-125589
Pick-to: 6.7 6.5
Change-Id: I968b0e826871a09023c11fec9e51caa5a2c4dc0b
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
(cherry picked from commit 1e1c68017338c89265d6664a27f4137fc8960473)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 01:49:15 +00:00
Axel Spoerl 678dccb7ac Revert "Update window state in QWindowsWindow and QXcbWindow geometry setters"
This reverts commit 99c8ffb9f2. It fixed
QTBUG-104201, which in essence pointed out a state mismatch between
widgets and platform windows on Linux (X11 and wayland). Mismatches
occurred in the margins between calls to QWidget and async screen
rendering: While the widget layer reported the expected size, the
platform layer did so only after the rendering thread had finished.

As mentioned in the comments of QTBUG-104201, the state mismatch is
predictable, temporary and consistent.

By bridging the time gab, an async operation was made to look
synchronous. That gave more comfort to application developers. By
oversight, it broke code that relied on the platform window state
reflecting physical rendering. This has caused QTBUG-126479 as a
regression.

Both purposes can't be served at the same time: The platform window
state either reflects rendering, or the expected state. It's therefore
justified to revert.

Reason for revert: <Causes QTBUG-126479>

Pick-to: 6.7 6.5
Fixes: QTBUG-126479
Task-number: QTBUG-104201
Change-Id: I22380a6a463822a1cb4be90a44d2775954c7ca82
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 7d7be38d95eb82ef3e0be5250440072d8b5bc4b2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-17 01:49:09 +00:00
Nodir Temirkhodjaev e90a61ca49 qwindowsscreen.cpp: Fix memory leak of SetupDiGetClassDevs()
Use SetupDiDestroyDeviceInfoList() to delete the returned device information set.

Fixes: QTBUG-127168
Pick-to: 6.7 6.5
Change-Id: I810e0f284e0d53d9b84d8c64022e566d6b740ab4
Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5183ca14344c04015b32ef407e4cdad1b370c841)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-16 11:32:18 +00:00
Christian Ehrlicher 68608585a5 Windows style: paint treeview indicators with correct dpr
The QTreeView indicators in windows style are drawn with the help of
windows themes. Sadly, indicators have to be drawn in the explorer
style.

This was already done correctly for visible windows. Hidden windows, however, using this drawing method, were not dpi-aware.
As a consequence, the dpi of the primary screen was used for drawing. This lead to wrong results on a second monitor with a different dpi.

Create a hidden window for every screen and use this for the painting
instead.

The fix can't be covered by an autotest. It will result in baseline test
mismatches, which must be accepted as new baselines.

Fixes: QTBUG-126533
Change-Id: Ie86cdb69f4cef1b293a5ac65541e5ada12959180
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 7f08822c499f624246d3f4c35dd97a7ba81d85ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-13 23:00:44 +00:00
Wladimir Leuschner d1e523c8b6 QWindows11Style: Make ItemViews respect alternating row colors
Fixes: QTBUG-124564
Pick-to: 6.7
Change-Id: I2665ecb253d0413d57e67d598593e8064b1ab84e
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 5d73d64f3eaab51518a4385e2a0a3cec8be91769)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 08:33:05 +00:00
Bartlomiej Moskal 5ee0a2124c Android: Change the touch points numbering
Start numbering Android touch points from 1 instead of 0.

The QPointingDevice was added in Qt6. This means we don't need to worry
about unique IDs for each touch point.
Different IDs are needed for multi touch. The touch point ID of each
physical finger must be unique and immutable as long as either finger is
still pressed.

Theoretically, it doesn't matter from what value we start the numbering
of touches.

The problem with numbering from 0 is that the touch point can be easy
overwritten. It is enough to create QSinglePointEvent (like QMouseEvent)
and by default touch point with 0 ID will be cleared and lose all
current data.

Because of that, Android's touch point numbering will start from 1
instead of 0.

Pick-to: 6.7 6.5
Fixes: QTBUG-112287
Change-Id: I83a4678a0751bdb7a5ff5353ec49866d4cca5f05
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit cb3b972bb128e0ee9e4e18a49119934eee4f7c6e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-11 08:27:23 +00:00
Nicolas Fella f57d5c492d FileChooser portal: Store directory as QUrl instead of QString
Otherwise we lose the scheme when reading it back as QUrl

Pick-to: 6.7 6.5
Change-Id: Ice6e083611c93641ef33f00fa48f1b32dc25f718
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 46ffca13fb0705c54ad05bc2c1a37f7d5fb5132d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-07 23:00:39 +00:00
Tor Arne Vestbø f31e7385c1 macOS: Respect QWindow frame positioning on first show
When the QCocoaWindow is created it picks up the QWindow geometry,
and applies that to the NSWindow it creates. But since we haven't
created an NSWindow yet for the first step, our logic to adjust the
window geometry when the positionPolicy is WindowFrameInclusive is
a noop. As a result the NSWindow gets a client geometry corresponding
to what the user requested as the frame geometry.

To fix this we hook into [QNSWindow setContentView:], where we apply
QWindow properties to the NSWindow after creation.

The tst_QWindow::positioning test has been split out into a separate
framePositioning test.

Pick-to: 6.7 6.5
Change-Id: I85fe6ad10aee8346202de3d55d6b2cd89915c5df
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 31ec108dd08d6381a15e49b6fbec9337705c3b2a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-07 09:02:39 +00:00
Tor Arne Vestbø ea1978c7f9 visionOS: Report size of root view as screen size
Even though we've decoupled QIOSScreen from managing UIWindows, we still
have one UIWindow per screen, so we can pull out the bounds of that root
view to determine Qt's screen geometry.

Change-Id: I05993ad6d629dd2158681dd17355b7e216bfbb49
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 16483487c4e37546cf296a72e137d49d28b55e05)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 20:22:02 +00:00
Mate Barany 16b0042dc6 Use non static data member initialization on errorcode in QSslContext
Address the "A constructor must initialize all data members of the
class" warning.

Found by an Axivion scan.

Task-number: QTBUG-125026
Pick-to: 6.7 6.5
Change-Id: I46a7dd358d107670846fa35c0b02d2591258438d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 69bf95e2e05fb1ded0d74a7ebc5fa112e0854a5c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:32 +00:00
Christian Ehrlicher 03e6f3859a SQL/ODBC: properly set SQL_ATTR_CURSOR_SCROLLABLE
Setting a query in forward-only or scrollable mode was done with
SQL_ATTR_CURSOR_TYPE in ODBCv2. Nearly all ODBCv3 drivers also honor
this value but some don't and need the ODBC v3 conformant
SQL_ATTR_CURSOR_SCROLLABLE attribute instead. Fix it by setting both
attributes.

Fixes: QTBUG-126118
Pick-to: 6.7 6.5
Change-Id: I6d974b7b3e94113b0a87f1cc7f8cff0deb53642b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 730de6fbb09f082f32dfa355502551a0d6b8ae34)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:30 +00:00
Christian Ehrlicher f7f5795ec7 SQL/ODBC: ignore empty connect options
Don'tprint a warning on empty connect options/when no connect option is
set. This ammends 5a03e5c51b.

Change-Id: I83ba8a34a3c08dc596c81ccb494f50af80f9b57c
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 385c9397712b771e0f2c3f0a6322f0f624f09a8a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 15:55:30 +00:00
Wladimir Leuschner 33c7170fcb QWindowsUiaProvider: Check for empty narrator string
In case of password fields, the narrator may return a emptry QString,
this was not checked when using operator[]. This patch explicitly checks
for an empty string returned by the QWindowsUiaProvider.

Fixes: QTBUG-126822
Change-Id: I9e2c3cfc5fb6dc9a7dd7badff4280f60b24c0a4b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 1ee349bf9d249ea45bc01c45473db44b9d335eed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 13:38:32 +00:00
Wladimir Leuschner b64031a6d1 QWindows11Style: Remove frame from ToolButton in QToolBar
Remove the frame of ToolButtons in QToolBar area when not hovered or
selected

Pick-to: 6.7
Change-Id: I11bd7b513871d6d1e0d9bfba761acf061f50e524
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 85c4084331a1049d3e2377f5516cd0d93819ac04)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 13:38:18 +00:00
Inho Lee 8d41b5a772 wasm: Revamp QWasmInputContext
1. Use QWasmInputContext by default
2. Use QInputMethodEvent instead of KeyEvent

Todo:
    1. Platform dependent preedit control
        especially when cursor moved with preedit.
        (Tested on Android, Linux, Windows)
        (Firefox still has a problem but it's not clear
        why PointerEvent doesn't happen.)
    2. Apply existing text to inputMethodQueries.
    3. Test on touchscreen devices.
    4. Test on IOS devices.
    5. When dragging selection, freezing
    6. Support context menu

Fixes: QTBUG-107139
Fixes: QTBUG-124932
Fixes: QTBUG-117096
Pick-to: 6.7
Change-Id: Iceb6af3489b3d1195ad58cf8f3deb91275fd1bf4
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit c844a7a5429e74d7cefb9774f288dbaa76fc2bbb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-05 08:10:29 +00:00
Volker Hilsheimer c6a2d3155c Mac style: remove appearance observer
We have one in the theme already. If that observer gets called we update
the palette from the system, and let the style polish the palettes. So
we can clear the cached cocoa controls when the palette gets polished.

Change-Id: I1dcfba67ca0d60f79741c0a0cf0d07c9fd217a9e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit cb9f5b5d0a538e69dbb099c5c8069fa8716e03cf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-03 15:03:12 +00:00
Jan Moeller 2bc0647805 iOS: Always insert created a11y elements to the cache
By having all known a11y elements in the cache, the iOS Screen Reader will
stay up-to-date with the UI elements that are currently present.
Do ensure this behavior, the ctor is made private.

Fixes: QTBUG-126622
Pick-to: 6.7
Change-Id: I23452ffd60128889a49e5844a6fc17d45683cee5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 9a6c32bed15ed3aa13ff82e15ac6834d6e7bdc3b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-02 17:04:15 +00:00
Wladimir Leuschner 2a10643d44 QWindows11Style: Change appearance when Button is disabled/hovered
Fixes: QTBUG-126503
Fixes: QTBUG-125781
Pick-to: 6.7
Change-Id: Ib3e1ff2cab2c82c04445d238861766dd93237ce0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 3aca4589b06c6614538c9d96cd1c38e548499e82)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-02 17:03:37 +00:00
MohammadHossein Qanbari 4b7ad06dc4 Gtk3 Theme: Fix disabled colors for texts
Previously, disabled text colors were a darker version of the normal
text color. However, when the text color is black, the darker version
is also black, making the disabled text indistinguishable from the
enabled text.

To fix this issue, a source struct called `MixSources` has been
implemented. This struct contains the mixing sources. For disabled
texts, a mix of the background and text color sources creates a more
sensible appearance, making the disabled text look more like the
control's background color.

This solution does not require access to the system's color scheme, as
the disabled color depends only on the background and foreground colors.

Fixes: QTBUG-123449
Pick-to: 6.7 6.5
Change-Id: I469e4fc05ddd4851120b89646bd7ab17a3ee2c00
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 21a070052716c8ce1c471817b985f43e5b19af0c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 23:23:47 +00:00
Jøger Hansegård 267e378d14 Simplify VARIANT handling using a QComVariant RAII wrapper
The QComVariant RAII wrapper automates lifetime management of VARIANT
structures and elements that it contains. For example, it will
call IUnknown::AddRef if a COM interface is assigned to it. It will also
clear all held resources at destruction.

Task-number: QTBUG-126530
Change-Id: I543d236293d25cbc70ff25046e553351eccfb850
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 717580c1985dd0804363bafb8822f82dacfb3f90)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 23:23:47 +00:00
Jøger Hansegård 51f7513bc0 Replace bStrFromQString with a QBStr RAII wrapper
This makes transfer of ownership explicit. The code is from ActiveQt.
If this patch is accepted, it can be removed from ActiveQt.

Task-number: QTBUG-126530
Change-Id: I613004ba784f87a9b935b2bbaead2205243c3033
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 93686386c078e2be03fb8bc42dee60a9e36fc23f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 23:23:47 +00:00
Jøger Hansegård f5ff1096ec Use ComPtr smart pointer to make transfer of ownership explicit
With ComPtr, transfer of ownership is explicit in the code because we
see the 'Detach' function being used.

Task-number: QTBUG-126530
Change-Id: I815c22f21b4a9b174d0d49ceb014bbffe41b6e82
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit d7edf2894c94271c3794a85ecf24a24ce92d2fcd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-07-01 23:23:47 +00:00