Commit Graph

64425 Commits

Author SHA1 Message Date
Assam Boudjelthia
fa15a465eb Android: cleanup unused java imports
Get rid of all unused java import calls.

Task-number: QTBUG-118077
Change-Id: I9755fafd7edce958187b7e8c9688f2f6b7b59645
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-18 00:00:10 +02:00
Assam Boudjelthia
50b56d015d Android: cleanup up warnings in QtNative code
few cosmetic changes, and warning fixes in QtNative code.

Task-number: QTBUG-118077
Change-Id: I0b064b59005f3cd50cf56221ce2287d72842a65c
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-18 00:00:09 +02:00
Assam Boudjelthia
e35d79d060 Android: fix visibility of some methods in QtActivityBase
Task-number: QTBUG-115017
Change-Id: I12181202b50c74ec079f872a7175aef41bcad998
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-18 00:00:09 +02:00
Morten Sørvig
299dfef52c Don't update DPR on de-expose events
There is no need to run the catch-all DPR update if
the window is not visible.

Pick-to: 6.6
Fixes: QTBUG-117762
Change-Id: Ib4e235fed4b21e5aa2ecafa960ab0900e2b68295
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-17 22:32:25 +01:00
Wladimir Leuschner
f49d715e93 Fix visible state of QRadioButton in Windows11 style with animations off
Change-Id: I870afeb3330fcbe49ce6f16e847af23c3d91b74b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-11-17 22:32:24 +01:00
Liang Qi
25720f5a63 xcb: only set base size when it's valid
In rare situation, base size could be (-1,-1) or (-2,-2) for high
dpi, it will be converted into huge positive numbers.

https://tronche.com/gui/x/icccm/sec-4.html

If a base size is not provided, the minimum size is to be used
in its place and vice versa.

Pick-to: 6.6 6.5 6.2 5.15
Task-number: QTBUG-117702
Change-Id: I900ed82f2291fb454d7e34a0dee27459d0a57240
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-17 22:32:24 +01:00
Mårten Nordheim
d54d28858f Fix build with qt-namespace
Add missing include of global module header.
Drop unneeded global namespace qualifier for constant in
our namespace.

Amends 6017695bfa

Change-Id: I04633030af13df3c3359fc09b08b4a5f031013a9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-17 22:32:24 +01:00
Alexey Edelev
f1a9b04f82 Use the standalone test directory name as the project name
Using this trick we force CMake xcode generator to give the more
specific project name when configuring standalone tests.

Change-Id: Ic679003c574c0407bdc8df9eecf3762db214fd50
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-17 22:27:01 +01:00
Laszlo Agocs
9f3d6e325f Make contextinfo example a manual test
Change-Id: I9023016d50e82bba1fa73632cc1409b3d016f352
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2023-11-17 22:27:01 +01:00
Tinja Paavoseppä
2198fc6a4a Android: Fix broken insertNativeView() signature
Method is trying to infer the signature from the types of the
arguments, but since the argument for the view is a plain jobject
this signature is wrong, method is not found and the view is never
inserted.

Change-Id: I3cbf9bccbcb1e5526f843213ba0f66e5bd1e7107
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-11-17 23:27:01 +02:00
Tor Arne Vestbø
99c70de9a6 Add dedicated child and parent events for QWindow reparenting
When a QWindow is parented into another window, either via its constructor,
or via setParent(), we also update the QObject parent of the window. This
in turn sends ChildAdded and ChildRemoved events to the new and old parent
of the window, as well as ParentAboutToChange and ParentChange to the window
itself.

But at the point when these events are sent, the QWindow parent relationship
has not been fully established. We have not updated d->parentWindow, nor
have we propagated the parent relationship to the platform window.

This is problematic because clients can not use these events to react to
window parent changes synchronously. For example. trying to raise a child
window when added to a parent is not going to work, because at that point
the child window isn't a native child of the parent.

Instead of re-using the QObject events for QWindow, like QWidget does,
by delaying the events or sending them manually at a point when the
window parent relationship has been fully formed, we opt to add new
dedicated events.

Change-Id: I019c14eba444861f537e4f68ab3a82297f843cf7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-17 22:10:48 +01:00
Ahmad Samir
c94bcecb22 QMdiArea: fix initial single-sub-window in TabbedView
This is somewhat of a corner case, where there is a single sub-window,
setViewMode(TabbedView) is called before addSubWindow(), and the latter
is called before show(). The sub-window would be active, i.e.
subwindow->d_func()->isActive is true and QMdiArea::aboutToActivate() is
emitted, but QMA::emitSubWindowActivated() is never called for that
sub-window, resulting in that sub-window shown as
unmaximized/with-a-title-bar instead of as maximized/tabbed as is
expected in TabbedView.

Pick-to: 6.6 6.5
Fixes: QTBUG-114188
Change-Id: Ia7b2cfd07c51867707866a1f99f70129bbdc0e3e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-11-17 23:07:01 +02:00
Axel Spoerl
17372faf3f Remove bool trap in QDockWidgetPrivate::endDrag()
endDrag(false) meant to end a drag with a dock location change.
endDrag(true) meant to abort a drag without a dock location change.

Replace this with a meaningful enumeration.
Define a dummy enum for builds w/o QDockWidget.

Task-number: QTBUG-118578
Task-number: QTBUG-118579
Pick-to: 6.6 6.5
Change-Id: I786f4210f5a3ee67ffcf0dc9285f77a480148569
Reviewed-by: David Faure <david.faure@kdab.com>
2023-11-17 22:07:01 +01:00
Lucie Gérard
4c36bb854c Remove undocumented embedded examples
Task-number: QTBUG-119117
Change-Id: I7fd104742771e2ce6d4ad7afd66e2beca3b4f672
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-11-17 19:39:33 +01:00
Jan Arve Sæther
4bb230f65e QGuiApplication: Fix condition for when doubleclick events are triggered
QGuiApplicationPrivate::processMouseEvent() requires the following
conditions to be met in order to trigger a double click event:
1. The same button should be pressed (kept in mousePressButton member)
2. The time between two press events should not exceed doubleClickInterval
3. Movement between presses shouldn't be bigger than doubleClickDistance

Unfortunately, when we are processing *synthesized* mouse events (from
touch), in order to check criterion 2) we cannot rely on
QPointingDevicePrivate::pointById(0)->eventPoint.pressTimestamp();
because this was already updated in QGuiApplication::processTouchEvent(),
so it does not any longer reflect the *previous* press timestamp, but
the current one.
Therefore we could not reliably calculate the time between the previous
press and the current press (in fact, it never exceeded the
doubleClickInterval condition)

I suspect this occurs with all touchscreens, but at least it was
reproduced with e.g. a NVIDIA Terra / Thinkvision touch screen on
Windows 11 and Dell Express SVC touch screen on Windows 11.

=> Since QGuiApplication is a singleton, add a static local variable to
remember the time stamp of the last processed press event.

Autotesting has been modelled in PS7. However, QTest::touchEvent is
unable to synthesize hardware specific detection latency and stray
touch events, which actually reproduce the issue.
=> Not adding an autotest.

Fixes: QTBUG-112479
Fixes: QTBUG-119032
Fixes: QTBUG-100688
Pick-to: 6.6 6.5
Change-Id: Idc97fb9d49ed334f56d702d420451fc062e9b5a9
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-17 18:23:57 +00:00
Luca Di Sera
a180dc5e27 Doc: Fix template information for a QList constructor
When QDoc parses a project, it parses the source code to extract the
user-provided documentation and perform sanity checkings based on the
code itself on it.

When QDoc parses an "\fn" command as part of this process, it tries to
understand, based on its intermediate representation built on the
information extracted from the code-base, which "documentable element"
the "\fn" refers to.

When QDoc performs this "matching" process, it takes into consideration
only a certain amount of information.
For example, no checking is performed over the template declaration of a
callable.

Due to some upcoming documentation, where two callables are
indistinguishable to the current process, as they differ only in their
template declaration, QDoc will start to take into consideration the
template declaration of a callable when matching.

This implies that an "\fn" command should now provide information
parity, with regards to template declaration for callables, with the
code-base so that QDoc can perform the match correctly.

The documentation for `QList::QList(InputIterator, InputIterator)` is
not in sync with the intended target template declaration.

Hence, add the missing information to the relevant "\fn" command.

Task-number: QTBUG-118080
Change-Id: I576a3b71ba39cec0d51f08f7db9771401e1fa340
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-11-17 19:06:34 +01:00
Luca Di Sera
43aecf7dde Doc: Fix template information for a QScopedArrayPointer constructor
When QDoc parses a project, it parses the source code to extract the
user-provided documentation and perform sanity checkings based on the
code itself on it.

When QDoc parses an "\fn" command as part of this process, it tries to
understand, based on its intermediate representation built on the
information extracted from the code-base, which "documentable element"
the "\fn" refers to.

When QDoc performs this "matching" process, it takes into consideration
only a certain amount of information.
For example, no checking is performed over the template declaration of a
callable.

Due to some upcoming documentation, where two callables are
indistinguishable to the current process, as they differ only in their
template declaration, QDoc will start to take into consideration the
template declaration of a callable when matching.

This implies that an "\fn" command should now provide information
parity, with regards to template declaration for callables, with the
code-base so that QDoc can perform the match correctly.

The documentation for `QScopedArrayPointer::QScopedArrayPointer(D*)` is
not in sync with the intended target template declaration.

Hence, add the missing information to the relevant "\fn" command.

Task-number: QTBUG-118080
Change-Id: Icf4178989952bbc7dac9a0e8b7cfd031eed3a9d2
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-11-17 19:06:34 +01:00
Luca Di Sera
06db30d2b5 Doc: Fix template information in "qsharedpointer.cpp"
When QDoc parses a project, it parses the source code to extract the
user-provided documentation and perform sanity checkings based on the
code itself on it.

When QDoc parses an "\fn" command as part of this process, it tries to
understand, based on its intermediate representation built on the
information extracted from the code-base, which "documentable element"
the "\fn" refers to.

When QDoc performs this "matching" process, it takes into consideration
only a certain amount of information.
For example, no checking is performed over the template declaration of a
callable.

Due to some upcoming documentation, where two callables are
indistinguishable to the current process, as they differ only in their
template declaration, QDoc will start to take into consideration the
template declaration of a callable when matching.

This implies that an "\fn" command should now provide information
parity, with regards to template declaration for callables, with the
code-base so that QDoc can perform the match correctly.

Some of the documented callables in "qsharedpointer.cpp" are not in sync
with the template declaration of their intended target.

Hence, add the missing information to the relevant "\fn" commands.

Task-number: QTBUG-118080
Change-Id: Iadac55e944aa425205b9d1cd8b4189ffacb4a089
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-11-17 19:06:34 +01:00
Luca Di Sera
505ac7007b Doc: Fix template information for a QModelRoleDataSpan constructor
When QDoc parses a project, it parses the source code to extract the
user-provided documentation and perform sanity checkings based on the
code itself on it.

When QDoc parses an "\fn" command as part of this process, it tries to
understand, based on its intermediate representation built on the
information extracted from the code-base, which "documentable element"
the "\fn" refers to.

When QDoc performs this "matching" process, it takes into consideration
only a certain amount of information.
For example, no checking is performed over the template declaration of a
callable.

Due to some upcoming documentation, where two callables are
indistinguishable to the current process, as they differ only in their
template declaration, QDoc will start to take into consideration the
template declaration of a callable when matching.

This implies that an "\fn" command should now provide information
parity, with regards to template declaration for callables, with the
code-base so that QDoc can perform the match correctly.

The documentation for
`QModelRoleDataSpan::QModelRoleDataSpan(Container&)` is not in sync with
the intended target template declaration.

Hence, add the missing information to the relevant "\fn" commands.

Task-number: QTBUG-118080
Change-Id: I08c7adf901fac81bb1c115a5017908cba4656bea
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-11-17 19:06:34 +01:00
Laszlo Agocs
abdef932b8 Android: add opt-out for release package signing
Release and RelWithDebInfo builds always default to passing
--release to androiddeployqt. There is an opt-in variable
(QT_ANDROID_DEPLOY_RELEASE), presumably for Debug builds,
but there is no opt-out for non-Debug builds. Instead,
there is a hack for autotests.

In addition to tests, there are situations during development
where we want to deploy a release build, but do not have or
want to set up the release signing infrastructure. Having a
variable to opt-out is then very useful.

Change-Id: I6c6b9aaccad7d9d4f86745f3ed7d3c475b383ad3
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-11-17 19:06:34 +01:00
Laszlo Agocs
740d3a6b51 rhi: d3d12: Move the setSR visitor logic and data to the command buffer
More logical than throwing it in the main rhi backend object.
In addition, holding on to the generated data from the last
setShaderResources() per command buffer has great value if/when
more granular resource updating is introduced at some point.

Change-Id: I26887423cf66b27995ec92ae9965d99a40267066
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-11-17 20:06:33 +02:00
Laszlo Agocs
9ea3947df9 rhi: d3d12: Mark CBV root parameters as DATA_STATIC
CBV and SRV descriptor ranges default to
DATA_STATIC_WHILE_SET_AT_EXECUTE with RS 1.1.

Due to how constant buffers (that back
Dynamic+UniformBuffer QRhiBuffers) are implemented,
DATA_STATIC is more appropriate, leaving more optimization
opportunities. The buffer contents will not change once
setShaderResources() is called (which is what issues
the SetGraphicsRootConstantBufferView()). In fact
the buffer contents should not be changing anymore during
the whole render pass recording (begin..endPass).

Change-Id: I5901a6d9608fb7c61f04f9d6a3a9acebce37a673
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-11-17 20:06:33 +02:00
Laszlo Agocs
445fb40081 rhi: d3d12: Do not waste time on sorting the binding list
Nothing is relying on the binding list being sorted based on the
binding number. In many ways the D3D12 backend is very similar
to the OpenGL one: the srb merely holds some flags derived from
the binding list and that's it really, no native resources or
other content are owned directly by the binding set objects.

Change-Id: I35d652c9738308bff691095e43aea9706031dd90
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-11-17 20:06:33 +02:00
Marc Mutz
ccc46d8f89 QPartialOrdering: mark isOrdered() as const
Because it is.

Amends 405244fe30.

Pick-to: 6.6 6.5
Change-Id: Icc7bb1a000e89b63254ca5c306325d01603eb1d4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-17 19:06:33 +01:00
Wladimir Leuschner
413d79656a Draw all borders for QScrollBar in Fusion style
Fixes: QTBUG-116400
Change-Id: I0409202652032c5662d4e324a157a444272fbb16
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2023-11-17 15:41:31 +01:00
Volker Hilsheimer
4373c4436a iOS: add helper to convert UIImage to QImage
Going through the UIImage.CGImage flattens the image to monochrome.

Change-Id: If74c33badb4e94253b3bf21b6d69bb9f521d6bff
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-17 07:05:14 +01:00
Alex Henrie
54656da9ac QMimeDatabase: handle buggy type definitions with circular inheritance
This fixes an infinite loop reported by a user who had both the
definition of text/javascript from shared-mime-info 2.3 and the
definition of text/javascript from shared-mime-info 2.4 installed at the
same time. In 2.3, text/javascript is a subtype of
application/ecmascript, but in 2.4 application/ecmascript is a subtype
of text/javascript. Having both at the same time resulted in circular
inheritance.

https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/258#note_2167707

[ChangeLog][QtCore][QMimeDatabase] Added code to detect and break
circular inheritance loops in the MIME data, which were causing infinite
loops

Pick-to: 6.6 6.5
Change-Id: Ic207b1593a49c7bb88e4fd810d8f88aa630087ce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2023-11-17 02:50:11 +00:00
Dimitrios Apostolou
569320f402 Blacklist tst_Android::orientationChange because it's flaky
Task-number: QTBUG-119205
Change-Id: I2e143198dc1192747900fd38988a4819969fd662
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-16 20:22:38 +01:00
Assam Boudjelthia
37add5dcb8 Android: skip tst_qwidget::render()
Task-number: QTBUG-118984
Change-Id: Ie9f30608ae96dd53900501d7b5f90c38ca6bc40f
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-11-16 21:07:46 +02:00
Alexey Edelev
1c82e92202 Make sure we initialize moc rcc and uic for manual test targets
If manual test target is created using the standard Qt API but not
qt_internal_add_manual_test command, we need initialize autotools
for these targets. Add the generic functionality that ensures that
autotools are inialized for all manual tests.

Pick-to: 6.5 6.6
Change-Id: Ic048760390174d1be2f01096d70e84458f1c870f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-11-16 14:34:17 +01:00
Michael Weghorn
3d58715e6f a11y: Implement QAccessibleSelectionInterface for QAccessibleTabBar
So far, there was custom handling for exposing the selection
of tab bars on Windows via UIA, s. QWindowsUiaSelectionProvider.

Implement QAccessibleSelectionInterface for QAccessibleTabBar,
so selection is exposed via the platform a11y bridge on all
platforms.
(This makes the custom handling for tab bars
in QWindowsUiaSelectionProvider obsolete for qtbase's own classes,
but there are 4 more uses of the QAccessible::PageTabList role in
qtdeclarative that might need a closer look before dropping
the custom handling from QWindowsUiaSelectionProvider.)

For consistency, also set the selectable/selected state for
the tab buttons (that are the selectable children of the
tab bar).

Sample use via AT-SPI on Linux using Accerciser to interact
on the a11y level (check the current selection, then select
the second tab):

1) run the qtabbar example (tests/manual/qtabbar)
2) start Accerciser
3) select the tab bar in Accerciser's tree view of the
   a11y hierarchy
4) query for currently selected item, switch selection
   from "Tab 0" to "Tab 1" by using the following commands
   in Accerciser's IPython console:

    In [10]: sel = acc.querySelection()
    In [11]: sel.nSelectedChildren
    Out[11]: 1
    In [12]: sel.getSelectedChild(0)
    Out[12]: <Atspi.Accessible object at 0x7fe01ce8a240 (AtspiAccessible at 0x43928c0)>
    In [13]: sel.getSelectedChild(0).name
    Out[13]: 'Tab 0'
    In [14]: sel.selectChild(1)
    Out[14]: True
    In [15]: sel.getSelectedChild(0).name
    Out[15]: 'Tab 1'

Equivalent on Windows using NVDA's Python console:

1) start NVDA
2) run the qtabbar example (tests/manual/qtabbar)
3) click on the first tab ("Tab 0") in the tab bar
4) press Numpad_insert+control+z to start the NVDA Python console and
   capture snapshot variables
5) query and use the interfaces using NVDA's Python console:

    >>> import UIAHandler
    >>> tabbar = focus.parent
    >>> selectionpattern2 = tabbar.UIAElement.GetCurrentPattern(10034).QueryInterface(UIAHandler.IUIAutomationSelectionPattern2)
    >>> selectionpattern2.CurrentFirstSelectedItem.CurrentName
    'Tab 0'
    >>> selectionpattern2.CurrentLastSelectedItem.CurrentName
    'Tab 0'
    >>> selectionpattern2.CurrentItemCount
    1
    >>> selectionitempattern = tabbar.children[1].UIAElement.GetCurrentPattern(10010).QueryInterface(UIAHandler.IUIAutomationSelectionItemPattern)
    >>> selectionitempattern.Select()
    0
    >>> selectionpattern2.CurrentFirstSelectedItem.CurrentName
    'Tab 1'

Fixes: QTBUG-104602
Change-Id: I49b05bb84852c86a2b8669d7843fe173caf28e18
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-11-16 14:34:17 +01:00
Michael Weghorn
b0bcf47569 a11y atspi: Ignore malformed text attr instead of crashing
If the attribute does not follow the required
"name:value" syntax, ignore it, rather than crashing
if it doesn't contain any colon.

Same issue as spotted by Jan Arve Sæther during the review
of a QTBUG-118106 related change that would have introduced
the same issue in UIA code.

Pick-to: 6.6 6.5
Change-Id: Id391502ed7aec7f09ef2826a456f2e4737af045e
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2023-11-16 14:34:17 +01:00
Liang Qi
f2c5b846e0 xcb: update WM_TRANSIENT_FOR on transientParent native window recreation
It follows f9e4402ffe.

Fixes: QTBUG-105395
Pick-to: 6.6 6.5
Change-Id: I399c448517b7dbdc28ba33f75ae43102836a8998
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-16 14:34:16 +01:00
Liang Qi
5896314ff3 xcb: make QXcbWindow inherit QObject
Pick-to: 6.6 6.5
Change-Id: I418305f1e66bdf90b8bda724976916e320012961
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-16 14:34:16 +01:00
Christian Ehrlicher
a0260c6a36 QColorDialog: use std::array instead QPolygon
Use std::array<QPoint, 5> instead a dynamic QPolygon since there is no
dynamic allocation needed here.

Change-Id: Iaa6fce9e0e769f2a5dd47de083208457b430f3c3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-16 06:15:25 +01:00
Christian Ehrlicher
b1e16ec1e8 Windows style: use std::array instead QPolygon
Use std::array<QPoint, 5> instead a dynamic QPolygon since there is no
dynamic allocation needed here.

Change-Id: Ica31d22a7b0d44efb901e230f14a00e2ce0a2c0a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-16 06:15:24 +01:00
Tasuku Suzuki
92a9df5d05 Fix build with -no-feature-menu
Change-Id: If207eac9a237986d51de4665b2f6749fb4e8e2d2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-16 11:31:15 +09:00
Tasuku Suzuki
d5dbafca1f Fix build with -no-feature-dockwidget
Pick-to: 6.6 6.5
Change-Id: Ie6d4e9a2dcfa6da5392bfb2507aafc57b6511ba3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-16 11:31:15 +09:00
Eskil Abrahamsen Blomfeldt
98ca28f7a6 Upgrade to Harfbuzz 8.3.0
Pick-to: 5.15 6.2 6.5 6.6 6.6.1
Fixes: QTBUG-119150
Change-Id: I80f21f6f27cce14a1e91e822c3681ec491491ff1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-16 02:55:10 +01:00
Volker Hilsheimer
f4c32f729c Cocoa: implement QScreen::orientation
Get the rotation value from the Core Graphics API, and map it to the
Qt::ScreenOrientation values.

Change-Id: I9bc9f37f34e00affee15e6ce0eace70d853eab0c
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-16 02:55:10 +01:00
Friedemann Kleint
cea33d7387 uic: Use fully qualified enum value for remaining cases
Task-number: PYSIDE-2492
Task-number: PYSIDE-1735
Task-number: QTBUG-118473
Change-Id: I4e5e328b0757145df2ceb550e2f90a64be91d5e9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-11-15 23:40:24 +01:00
Friedemann Kleint
effe9bd026 uic: Write fully qualified enum values for QMainWindow enumerations
Task-number: PYSIDE-2492
Task-number: PYSIDE-1735
Task-number: QTBUG-118473
Change-Id: Ief50914bae3cc8e55f61113e8c8b6d6d24fe2c0f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-11-15 23:40:24 +01:00
Marc Mutz
39ce0e3982 Fix \since of QWeakOrdering and QStrongOrdering
Amending c6fe64b17c, which (thankfully)
didn't make the 6.6 feature-freeze cut.

Change-Id: I6c206020af3ba752422cc9f1adaebd7bbbd96024
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-15 23:40:24 +01:00
Friedemann Kleint
2e82796022 uic: Prepare for encountering fully qualified enum values in new .ui files
This means checks have to be rewritten using endsWith().

It mainly affects the QSizePolicy handling whose values originate from
different sources, including numbers. To address this, refactor the
code to deal with unqualified enum value names and introduce a helper
function that fully qualifies the enumeration when writing out.

Pick-to: 6.6 6.5
Task-number: PYSIDE-2492
Task-number: PYSIDE-1735
Task-number: QTBUG-118473
Change-Id: Iccbb884777aa9c696fbf48f9d7329353ef945b0f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-11-15 23:40:24 +01:00
Marc Mutz
e6febd05d9 [doc] QBENCHMARK_ONCE: fix typos
... and remove a prematurely-ending parenthesized remark.

Pick-to: 6.6 6.5 6.2 5.15
Change-Id: If0a2f482c45128739ed6cea1d8385ea34f45b094
Reviewed-by: Isak Fyksen <isak.fyksen@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2023-11-15 23:40:24 +01:00
Marc Mutz
b08ba96fd0 QBENCHMARK: mark loop operations as noexcept
Tell the compiler that next() and isDone() cannot throw, so it doesn't
need to create exception handling code. This might yield more faithful
benchmark results for micro-benchmarks.

As a drive-by, mark isDone() as const, too.

Change-Id: Ifac3d9ee2f4df524e780fd07423e26bb5e87dab3
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Reviewed-by: Isak Fyksen <isak.fyksen@qt.io>
2023-11-15 23:40:24 +01:00
Morten Sørvig
6017695bfa Windows: Improve hidpi style drawing and metrics
Follow-up change from enabling DPI awareness, which
caused some style elements (for instance check boxes)
to be rendered incorrectly on non-primary displays,
when there is a difference in DPI between displays.

Use two approaches to get system metrics and themes:

* Use forDpi() API variants and query at 96 DPI for style
  metrics, that are in device independent pixels. These are
  metrics which are used for layout calculations.

* Get theme metrics at the target display DPI, and scale
  to device independent pixels when needed. This is used
  for OpenThemeData(), since this theme is used for drawing
  as well and needs to be in device pixels.

One approach is not used any more:

 * Get metrics for the main display, and scale by the ratio
   between the main and target display.

Change the theme cache to cache themes per window handle (HWND).
This is required since OpenThemeData() returns theme data for
a specific DPI, which means we can no longer use a shared
cache.

Clear the cache on theme change, DPI change, and when
the window is destroyed. This  handles cache invalidation
when the window is moved to a different screen, and also
when the DPI for a screen is changed.

Move the cache implementation to QWindowsStyleSupport
in QtGui, where it can be accessed by both the style and
windows platform plugins.

Task-number: QTBUG-110681
Change-Id: I5a4ff3a3753762bad8a51d08e51e8013bc7816a1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-15 21:52:24 +01:00
Assam Boudjelthia
d6861926a1 Android: set displayManager listener after QtLayout is initialized
the QtDisplayManager listener uses m_layout but it can be called
before m_layout is actually initialized, so set the listener after
the layout has been initialized.

Task-number: QTBUG-118077
Fixes: QTBUG-119007
Fixes: QTBUG-119134
Change-Id: Icebc350f09210c12dbd011f86ce88a90b6f27d12
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-15 22:52:23 +02:00
Axel Spoerl
2c96f51771 QDockAreaLayout: implement widget based add() and remove()
The item_list of a QDockAreaLayoutInfo has abstraction methods for
reading the item list. Adding to and removing from the item list is
done directly, by using the QList api.

Implement an abstraction, that takes a QWidget *.
The argument may either be a QDockWidgetGroupWindow or a QDockWidget.

Task-number: QTBUG-118578
Task-number: QTBUG-118579
Pick-to: 6.6 6.5
Change-Id: Ib2ccd7557a21a43b68f184fe4575018f2a97004b
Reviewed-by: David Faure <david.faure@kdab.com>
2023-11-15 21:52:23 +01:00
Axel Spoerl
1ab91b7bdb QDockWidget: call raise() when a dock widget starts to hover
When dock widget (1) starts to hover over another floating dock
widget (2), the latter animates a rubber band, to indicate to the user
that it is ready to accept a drop.

The creation of a QRubberBand moves (2) one position up in the Z order.
The consequence is a visual glitch: While
- the mouse cursor dragging (1) is still outside (2) and
- the visual rectangle of (1) starts overlapping (2)
(1) hides behind (2).
As soon as the mouse cursor enters (2), (1) suddenly comes on top and
(2) hides behind (1).

=> raise() 1 as soon as it starts hovering. That brings it on top of
the Z order, which is expected behavior.

Pick-to: 6.6 6.5
Change-Id: I1140fc6ff109c7a713e7e2617072698467375585
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2023-11-15 21:52:23 +01:00