Commit Graph

7565 Commits (ad2da2080c8b99665cd32237ab365fee5461cf66)

Author SHA1 Message Date
Wladimir Leuschner df24438e6a QWindows11Style: HighDPI aware qDrawPlainRoundedRect
Pick-to: 6.7
Change-Id: Ic9562a20bce59c265c539a1378f5f8fd8e9e9a17
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2024-03-15 03:59:26 +00:00
Kai Uwe Broulik 4812497786 Move qt_blurImage to Qt GUI
Allows to use it without Qt Widgets or Qt Graphics Views.

Since anyone having imported this through Qt Widget will also be
linking Qt Gui this should be compatible.

qt_halfScaled is also unexported for lack of known users.

Change-Id: I39406dfd4839ed46f8cbfd4651577ab6ece9932c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-14 19:11:52 +01:00
Tor Arne Vestbø c956eb8edd Reparent QWindow children when reparenting QWidget
When a QWidget was reparented, we would take care to reparent its
backing QWidgetWindow as well, into the nearest QWindow of the
new QWidget parent.

However we would only do this for the reparented widget itself,
and not any of its child widgets. In the case where the widget
has native children with their own QWindows, the widget itself
may not (yet) be native, e.g. if it hasn't been shown yet, or
if the user has set Qt::WA_DontCreateNativeAncestors.

In these scenarios, we would be left with dangling QWindows,
still hanging off their original QWindow parents, which
would eventually lead to crashes.

We now reparent both the QWindow of the reparented widget (as
long as it's not about to be destroyed), and any QQWindow
children we can reach. For each child hierarchy we can stop
once we reach a QWindow, as the QWindow children of that
window will follow along once we reparent the QWindow.

QWindowContainer widgets don't usually have their own
windowHandle(), but still manage a QWindow inside their
parent widget hierarchy. These will not be reparented
during QWidgetPrivate::setParent_sys(), but instead
do their own reparenting later in QWidget::setParent
via QWindowContainer::parentWasChanged(). The only
exception to this is when the top level is about to
be destroyed, in which case we let the window container
know during QWidgetPrivate::setParent_sys().

Finally, although there should not be any leftover
QWindows in the reparented widget once we have done
the QWidgetWindow and QWindowContainer reparenting,
we still do a pass over any remaining QWindows and
reparent those too, since the original code included
this as a possibility.

We could make further improvements in this areas, such
as moving the QWindowContainer::parentWasChanged() call,
but the goal was to keep this change as minimal as possible
so we can back-port it.

Fixes: QTBUG-122747
Pick-to: 6.7.0 6.7 6.6 6.5
Change-Id: I4d1217fce4c3c48cf5f7bfbe9d561ab408ceebb2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-14 13:50:36 +00:00
Tor Arne Vestbø b30121041c QMessageBox: Respect explicit accept/reject after closing dialog
If the dialog is closed by pressing a button, the button will be
reflected via clickedButton(), and the result() will reflect either
the QMessageBox::StandardButton value, or an opaque value for custom
buttons.

Depending on the role if the buttons, the accepted or rejected
signals are emitted.

If the user called accept() or rejecct() on a dialog that had
already been closed by a button, we would as a result of
1f70c073d4 emit a signal based
on the original button that was clicked, instead of respecting
the newly triggered function.

It's a questionable use-case, as the clickedButton() is still
the original button e.g., but we should still avoid regressing
this, so we now emit the signals based on the newly stored
result code instead of using the clicked button as the source
of truth.

To allow this we had to change the opaque result() value for
custom buttons to stay out of the QDialog::DialogCode enum,
but this should be fine as the documentation explicitly says
that this is an opaque value.

Fixes: QTBUG-118226
Pick-to: 6.7 6.6 6.5
Change-Id: Ia2966cecc6694efce66493c401854402658332b4
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-14 14:50:36 +01:00
Wang Zichong 2dbcb25bfa QMessageBox: ensure setTextFormat() also apply to informative text
QMessageBox::setTextFormat can set the text format for its text label,
but the informative label will still use its default text format. This
change allow the setTextFormat also apply to the informative label, thus
user can use their preferred format like Markdown in the informative label.

Task-number: QTBUG-122712
Change-Id: I6f7487b29712ca07cee27171453312ff1707eea3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-14 21:40:53 +08:00
Paul Wicking 08e6d4b43d QDoc: Drop default arguments from some \fn documentation strings
In the \fn commands for a limited number of methods in the
documentation for Testlib and Widgets, `= 0` is passed as default
argument instead of `= Qt::KeyboardModifiers()`. Until QDoc with Clang
17, inclusive, QDoc generated the correct signature. However, with
Clang 18, QDoc outputs `= 0` in the documentation. While strictly
speaking still correct, this change impacts the documentation
negatively in terms of readability.

Dropping the default argument from the \fn command ensures that QDoc
generates the right signature with both Clang 17 and Clang 18.

Task-number: QTBUG-123130
Pick-to: 6.7
Change-Id: I94ccec2f2c9a02241095fb5b18feb74aa55f97e1
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2024-03-13 15:43:10 +01:00
Christian Ehrlicher e68c3f025e Don't show mnemonics in dockwidget titles
Dockwidget title accelerators doesn't work in dock widgets, so don't
show them.
This amends cc67b25579.

Fixes: QTBUG-86407
Pick-to: 6.7 6.6
Change-Id: I83fb2da1304d1e2b5eedfc127e5db3d322756d06
Reviewed-by: Sune Vuorela <sune@vuorela.dk>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-09 13:52:22 +01:00
Christian Ehrlicher 1ac58f4ba3 QStyleSheetStyle: don't draw check indicator twice
When the styled check indicator is smaller than the one from the base
style, then the clip region was to small and the check indicator from
the base style was also drawn. Therefore add both check rects to the
clipRegion.

Pick-to: 6.7 6.6 6.5
Task-number: QTBUG-102820
Fixes: QTBUG-122821
Fixes: QTBUG-122825
Change-Id: I1b5b8d70d66475bbfa4a40652dc3fdd4cc670c32
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-09 13:52:20 +01:00
Tor Arne Vestbø fde358dd90 Delete QComboBoxPrivateContainer while the combo box is still alive
Destroying the QComboxBox will, once it reaches the QWidget destructor,
close all popups, including the QComboBoxPrivateContainer, which emits
signals on behalf of the QComboBox, that is now gone.

Regression after d8e1100548.

The old-syle signal-slot syntax had the advantage of not delivering
signals to slots in derived classes after that derived class's
destructor had finished running (because we called via the virtual
qt_metacall). The new syntax made no checks, so a conversion from the
old to the new syntax may introduce crashes or other data corruptions
at runtime if the destructor had completed.

See 0e72a846d3.

We also need a QPointer for the QComboBoxPrivateContainer, as the
container may be deleted from outside QComboBox, as seen in the
tst_QGraphicsProxyWidget::bypassGraphicsProxyWidget() test, where
the QGraphicsProxyWidget proxies the QComboBoxPrivateContainer.

Pick-to: 6.7 6.6 6.5
Change-Id: I7590cc2821c73a6762f281504aa62f0c2b472252
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-09 13:52:19 +01:00
Eirik Aavitsland a5a6b657a7 Avoid QRubberBand leaving artefacts in QListView
On hidpi screens, the painted edges of the rubberband can extend
beyond the selection rect because of scaling. Extend the area to be
updated by 2x frame width, when the rubberband changes.

Fixes: QTBUG-113432
Pick-to: 6.7 6.6 6.5
Change-Id: Ie7aec1fefdc3fbf71c63952b693f462697adf849
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2024-03-08 20:50:51 +01:00
Axel Spoerl 6901ad665d QDockWidget: add notification signal to floating property
The toplevelChanged signal notifies about changes of the floating
property.

Add it in property declaration.

Change-Id: I06be59a24e2732030be26d87ce38f6ce58bdebbc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-03-08 05:23:31 +00:00
Axel Spoerl 78a3301372 QDialogButtonBox: Don't set focus in a dialog with StrongFocus children
A QDialogButtonBox with the first accept button becoming default, didn't
explicitly set focus on such a button in a QDialog.
d44413d526 implemented this missing
functionality. It set focus to the automatic default button, unless the
QDialog had a focusWidget() set.

That has caused a regression, in cases where
- the QDialog has a QWidget child with a Qt::StrongFocus policy, and
- the QDialog is not yet visible, so focusWidget() returns nullptr.

Amend d44413d526ec12ed83acd7343c2005782178c7ad:

Implement a helper in QWidgetPrivate, that returns true, if a child
with a given focus policy is found.

Do not set focus to a QDialogButtonBox's automatic default button, when
- not located inside a QDialog, or
- a focusWidget() exists, or
- the dialog has QWidget child with Qt::StrongFocus, that is not a
child of the QDialogButtonBox.

Add an autotest function.

Pick-to: 6.7 6.6 6.5
Fixes: QTBUG-121514
Fixes: QTBUG-120049
Change-Id: I3c65ae36b56657f9af4a3a4b42f9b66e8bc5c534
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-03-07 23:00:33 +00:00
Friedemann Kleint 8cd7a3d472 Fix menu size in multiscreen setups
During QMenuPrivate::popup() and QMenuBarPrivate::popupAction(),
QMenuPrivate::popupGeometry() is called from updateActionRects() with
screen = 0 several times (from sizeHint() and various event handlers
triggered), which causes it to return the primary screen geometry
always.

To fix this for the non-QGraphicsView case, use the screen of
the menu when it is visible or the screen stored in a newly introduced
popupScreen member variable, which is set from a few places
in QMenuPrivate::popup().

Fixes: QTBUG-118434
Pick-to: 6.7 6.6 6.5
Change-Id: I6b18593d313719d628b0856004197ac59f46c270
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-07 15:09:58 +00:00
David Redondo 986de654b8 Map drag event positions to global during dock/toolbar drag
Drag event positions are window relatives, QMainWindowLayout::hover
expects global coordinates however.

Fixes: QTBUG-122949
Pick-to: 6.7 6.6
Change-Id: I28469ba1b5ef88661e744d4cf87f6acab3eb2c72
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-05 17:58:15 +01:00
David Redondo d7fe948fdb Handle drag leave when performing platform drag of docks or toolbars
The existing widget machinery works through mouse positions. In order to
correctly update state  when a drag moves outside of a window it needs
to see a move outside of the window. When the platform drag leaves the
window a move to the outside of the window is now faked to not keep the
layout in the hovered state of the last move event.

Fixes: QTBUG-122944
Pick-to: 6.7 6.6
Change-Id: I348f5281a200b78e6be4f11b3c25339d052783a5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-05 16:58:14 +00:00
Ahmad Samir c610cfe328 Mention QChronoTimer in API docs
Change-Id: Iaf9fb31994f1580b2051dbd0b1b8eef2a218aa39
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-03 19:56:55 +02:00
Tor Arne Vestbø 7ff1285e7a Disconnect QWindowContainer::focusWindowChanged on destruction
Regression after 9e78256579.

Apparently the string based connection syntax is more lenient,
as with PMF-style connects, we (correctly) get:

 ASSERT failure in QWindowContainer: "Called object is not of the
 correct type (class destructor may have already run)"

when the QWidget destructor closes the QWindow and we get a
synchronous callback from the platform that we've lost the
focus window.

Pick-to: 6.7
Change-Id: I8f25b3b050e11913ec0f0941eaf831c88b4249f9
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-03-03 17:07:55 +01:00
Axel Spoerl 89fc58127d QDockWidget: Use resizer without native window decoration
975c0bdf73 has disabled usage of a resizer
on Windows. This has caused a regression, when a dock widget was
rendered frameless.

Use a resizer in that case.

Fixes: QTBUG-120694
Task-number: QTBUG-102196
Pick-to: 6.7 6.6 6.5 6.2
Change-Id: I9fbcb1a8b1d8869995093bc1da7524ec81e9f02d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-03-02 04:00:14 +01:00
Tor Arne Vestbø f451b01791 Add QWidgetPrivate::rhi() helper method
For accessing the RHI managed by the widget compositing machinery.

Pick-to: 6.7 6.6 6.5
Change-Id: Ia3c1227cc2d9cfebe95611cad3dbcd7aa6f6f8c7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-01 20:41:30 +01:00
Tor Arne Vestbø b571634172 Add QWidgetPrivate::closestParentWidgetWithWindowHandle helper method
In contrast to nativeParentWidget(), we return the closest widget with a
QWindow, even if this window has not been created yet.

Pick-to: 6.7 6.6 6.5
Change-Id: Icac46297a6052a7a5698d752d4aa871bd5c2bdd8
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-01 20:41:29 +01:00
Tor Arne Vestbø f517e85e90 Remove QWindowPrivate::compositing
It was added for Android in a4f50269f8,
for the case of QSurface::RasterGLSurface, but since 6.4 we no longer
use QSurface::RasterGLSurface for composition. And the Android usage
was removed in 2020ce5fd2.

Pick-to: 6.7 6.6 6.5
Change-Id: I8dafe959c54e09b3a974253e15d184365141d559
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-01 20:41:29 +01:00
Volker Hilsheimer 83f73df3e0 QTextEdit::event: refactor into switch statement
Replace if/else snake, made more complex by handling of QT_NO_*
configurations. Move the unconditional cases to the top, which also
fixes the handling of ShortcutOverride and ToolTip events when Qt was
built with QT_NO_CONTEXTMENU.

Pick-to: 6.7
Change-Id: I1e2cc2c39e3cef9fe29a71e48595756cff0d2949
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-01 19:00:33 +01:00
Mike Chen 402cb510e1 Fix QTextEdit/QPlanTextEdit palette not updated
QPlainTextEdit/QTextEdit, etc. never received ActivationChange
when used as child widget. Set palette to control on
WindowActivate/WindowDeactivate

Pick-to: 6.7 6.6 6.5
Change-Id: Iae75d9dcfba0c6171c556626551b37d4549006c7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-01 19:00:32 +01:00
Tim Blechmann c26994ff15 Fix -Wimplicit-fallthrough for clang
Clang's `-Wimplicit-fallthrough` warnings are a little stricter than
gcc's interpretation:

switch (i) {
case 0:
    foo();
case 4:
    break;
}

While gcc accepts the implicit fallthrough, if the following statement
is a trivial `break`, clang will warn about it.

Pick-to: 6.7
Change-Id: I38e0817f1bc034fbb552aeac21de1516edcbcbb0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-01 03:04:06 +00:00
Axel Spoerl 2d1db53f9c QApplicationPrivate::dispatchEnterLeave: remove dead code
Remove #ifdef 0 section added in 2011.

Task-number: QTBUG-121478
Pick-to: 6.7
Change-Id: I2154cd5616e2695af89cf4fc5ec9d1b3ae5572d5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-02-29 22:14:40 +01:00
Axel Spoerl cd2a3e970a Refactor and fix QMainWindow::tabifiedDockWidgets()
The method traversed QDockAreaLayoutInfo::item_list, to identify
dock widgets tabbed with the QDockWidget argument in a tab bar
It relied on bool QDockAreLayoutInfo::tabbed, which is set to true, when
a QMainWindowTabBar is to be added to a QDockAreaLayoutInfo. This flag
isn't cleared, when the second last dock widget is removed from the
tab bar. It can't be replaced by QMainWindowLayout::isDockWidgetTabbed,
because the flag also represents intermediate states, where e.g. a dock
widget is hovered over, prepares to become a floating tab and then rolls
back, because hovering doesn't result in a drop. In that case, tabbed
must become true, which the dock widget isn't actually tabbed.

Furthermore, the way to traverse item_list didn't find dock widgets
in a floating tab. In that case, tabifiedDockWidgets() wrongly returned
an empty list.

To fix both issues, refactor QMainWindow::tabifiedDockWidgets() to read
the list of dock widgets directly from the QMainWindowTabBar.

Add tests in tst_QDockWidget::floatingTabs() and
updateTabBarOnVisibilityChanged()

Fixes: QTBUG-122001
Pick-to: 6.7 6.6 6.5
Change-Id: Ia9eb3711be642101261f34ee447521cc6accc20c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-29 21:14:40 +00:00
Yansheng Zhu 70096b2bbd Implement Qt::ImEnabled by isEnabled() and isReadOnly()
Previously, querying Qt::ImEnabled only returned the value of
isEnabling(), which is incorrect for edit widgets with read-only
properties set, as Qt::ImEnabled indicates whether text can be *input*
through the input method, which results in the IM being able to insert
text into read-only edit widgets.

The fixed version uses both isEnabling() and isReadOnly() values to
determine whether input methods need to be enabled. For some platforms
(like iOS and Android) that rely on IM to select text, a check for
ImReadOnly has been added to their QPA plugins to enable handles on
read-only input boxes.

At the same time, the imEnabledNotImplemented function in the test file
tst_qwidget was modified, since ImEnabling should give a _false_ value
when a lineedit is read-only.

Task-number: QTBUG-105009
Task-number: QTBUG-110838
Task-number: QTBUG-119182
Pick-to: 6.7 6.6 6.5
Change-Id: Ia2abcdb3200826d567f90447d4f8b71d0ef1fbf0
Reviewed-by: Yansheng Zhu <670429759@qq.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-03-01 02:22:06 +08:00
Kai Köhne b74f814ae2 Doc: Further replace 'Qt Designer' with 'Qt Widgets Designer'
Use \QD macro wherever possible.

Amends 8aceccc7eb

Task-number: QTBUG-122253
Change-Id: I276dabd40fb81486f6380fd90cf9968990932a24
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-02-29 15:35:58 +01:00
Tor Arne Vestbø f6d09a68f6 QMessageBox: Forward helper checkbox state via lambda
There may not be a checkbox when the helper is initialized, and
we want to support the case of a checkbox being added at a later
stage.

Regression from e5c40ec5c1.

Pick-to: 6.7
Change-Id: I397c3b3a101b249aab17804bd90085cfd4ab7dbb
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-29 15:35:57 +01:00
Viktor Arvidsson d9397479e6 QAbstractItemView: Release tab focus when hidden
When hiding a widget that has focus we try to focus the next widget in
the focus chain by running focusNextPrevChild. The abstract item view
overrides this to step the items but does not account for this hide case
which makes focusing not only not work, but also by hiding the widget
the selection in the item view gets changed.

Pick-to: 6.7 6.6 6.5
Change-Id: I29d40a1fb86ced60ec742b2753a87383846a89b3
Reviewed-by: Viktor Arvidsson <viktor.arvidss@gmail.com>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-29 12:36:16 +01:00
David Faure d9b63c90bf QDialogButtonBox: fix crash when adding a QToolButton
Introduced by commit d4f38a3632

Pick-to: 6.7 6.6 6.5
Change-Id: I99385249a454c75eeae13c1d17670b356427cb70
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-28 23:27:25 +01:00
Lucie Gérard 1556a3a5eb Correct doc snippet license
All file under doc/snippet should be
license as Documentation snippets
and according to QUIP-18 [1]
this is LicenseRef-Qt-Commercial OR BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I76eedfb6b15c4091f726a5652e3530001d7cdaf7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-28 19:15:51 +01:00
Tomi Korpipää f429f12a7f Prevent re-replacing state in setGeometry
Do not allow replacing a state again if it is already being replaced.

Cleaned up from the patch provided in QTBUG-121126.

Fixes: QTBUG-121126
Pick-to: 6.6 6.7
Change-Id: Icca932b0e5cccd2f39ac18f29d8f7707887d147f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-02-27 18:43:14 +02:00
Tor Arne Vestbø d31cc6dc7b QWidgetRepaintManager: Use textureChildSeen to determine deferred update
We want to get rid of the QWindowPrivate::compositing member, as it is
no longer needed for the Android backingstore, which it was first added
for in a4f50269f8.

We can use textureChildSeen instead to check if we're compositing.

Pick-to: 6.7
Change-Id: If85b21f92c8253bf89543a7e81e03730023f8095
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-27 16:18:06 +01:00
Axel Spoerl 9af3a6c146 qmessagebox.h: Remove redundant semicolon after Q_ENUM
A redundant semicolon after Q_ENUM(StandardButton) caused a compiler
warning.

Remove it.

Fixes: QTBUG-122637
Pick-to: 6.7 6.6 6.5
Change-Id: I959c0c6d56bc312ad40f18c9455f4e6118b1c7c2
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-02-27 08:29:53 +01:00
Jonas Karlsson c1921abf65 Revert "QHeaderView: relayout on resetDefaultSectionSize"
This reverts commit a8df174369.

Reason for revert: Caused QTBUG-122109

Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-122109
Fixes: QTBUG-120699
Change-Id: Iea185c00f35e17d8eb8e8da70dc2d808ea274b04
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-26 22:34:55 +00:00
Paul Wicking 2fb8c2d5c3 Doc: Use QDOC_PROPERTY for QRhiWidget::autoRenderTarget
`autoRenderTarget` is a private bool that very much looks like it's
used as a Q_PROPERTY. Use QDOC_PROPERTY for it to generate warning-
free documentation.

Pick-to: 6.7
Change-Id: Ia6255287f139ff23172c4fac96950e1a37eeef83
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2024-02-26 18:59:02 +01:00
Giuseppe D'Angelo 3ec9331c34 Text widgets: document find() behavior with QRegularExpression
The various find() overloads that take a QRE *ignore* the case
sensitivity option set on the QRE object itself. They instead apply the
case sensitivity passed in the flags (see QTextDocument::find).

I think it was an historic mishap, but it's too late to change now.
Amend the documentation.

Change-Id: I526650d89a98777c7bb839b27d2f2e536a43ca4f
Pick-to: 6.7 6.6 6.5 6.2 5.15
Fixes: QTBUG-88721
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2024-02-26 01:31:07 +01:00
Christian Ehrlicher dfe5118f92 Fusion icons: fix artifacts in media icons
The fusion svg icons had some unneeded transparent objects which lead to
artifacts during png export/pngcrush optimization. Fix it by removing
the unused objects and re-export the pngs again.

Pick-to: 6.7
Fixes: QTBUG-122272
Change-Id: I13c670a90e88dd31cb7a066c3565cf30c42e83b5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-19 21:09:30 +01:00
Christian Ehrlicher 8b7f9f696e QErrorMessage: Honor devicePixelRatio for SP_MessageBoxInformation
Use QStyle::standardIcon() and retrieve the best icon based on the
current dpr instead standardPixmap() which does not know anything about
the dpr.

Change-Id: Icbc6fd0e7b14808aaa4f081ed5079c319207828a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-19 21:09:30 +01:00
Christian Ehrlicher e379203aed QWindowsStyle: remove unused code in QWindowsStyle::standardPixmap()
The code in QWindowsStyle::standardPixmap() is reimplemented in
QCommonStylePrivate::iconFromWindowsTheme() in a better way (as it
honors the dpr) so no need to leave it here.

Change-Id: Icc418d2bd0cff06a8a8e5bc6c14a99bfb34cfc68
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-19 21:09:30 +01:00
Christian Ehrlicher b9e5e5ea69 Windows style: remove unused function and member
Remove the two unused functions devicePixelRatio() and
appDevicePixelRatio() from QWindowsStylePrivate. Also remove an uneeded
forward declaration and the member menuBarTimer.

Change-Id: I18347744054fe9c904b0ee48e45788dc4d2a8233
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-02-19 21:09:30 +01:00
Kai Köhne d3117e9701 Doc: Mention AA_DontUseNativeDialogs in QFileDialog
Pick-to: 6.5 6.6 6.7
Task-number: QTBUG-119551
Change-Id: I54f7e8f4b855b15d22b2180095cbf454b31412c3
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2024-02-19 13:20:08 +01:00
Friedemann Kleint 8aceccc7eb Documentation: Rename 'Qt Designer' to 'Qt Widgets Designer'
Task-number: QTBUG-122253
Change-Id: I04ab521decaf908b1c1491987f6de1e816a42a33
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2024-02-19 09:21:16 +01:00
Christian Ehrlicher 7a4b307210 Style icons: fix artifacts in media icons
The media svg icons had some unneeded transparent objects which lead to
artifacts during png export/pngcrush optimization. Fix it by removing
the unused objects and re-export the pngs again.

Pick-to: 6.7
Fixes: QTBUG-122272
Change-Id: I7e63ef53e5a78ce3a06c0053dea98e13c6ba264b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-16 22:57:37 +01:00
Christian Ehrlicher 8eb599566e QDockWidget: fix dock buttons size
The previous fix calculated an icon size of 12 instead 10 for the icon
size when SH_DockWidget_ButtonsHaveFrame is set. This lead to a too
large icon. It was also rendered blurry because there was no native png
with 12x12 pixels so it has to be scaled.

This amends 04f4b27774

Pick-to: 6.7
Fixes: QTBUG-122214
Task-number: QTBUG-118643
Change-Id: Iaf332a21681e5b84222299d79d4b28d0c26b0cda
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-16 14:13:09 +01:00
Lucie Gérard 039d51835f Correct license in widget/kernel
According to QUIP-18 [1], all module files should be
LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
or
LicenseRef-Qt-Commercial OR GPL-3.0-only
LGPD and non-LGPL licenses should not be mixed in a
given directory.
The files in this patch now match the other files
in the same directory and QUIP-18 rule.

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: Ied60c775fbae38d6edeabc669f782b39d02c28f4
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-02-15 21:34:59 +01:00
Paul Wicking f157422c58 Doc: Resolve qdoc link warnings
- Drop link to non-existing documentation.
- Reorder links such that the target becomes the text and vice versa.
- Use correct link target names.
- Add missing qttestlib doc project dependency to qtwidgets.

Pick-to: 6.7
Change-Id: Iaa0ea7b22326c82271b14b17c4b78c3a25a834f1
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2024-02-14 21:47:28 +01:00
Tor Arne Vestbø 986f8b361c QRhiWidget: Register cleanup callback also on first RHI init
The first time ensureRhi() is called we don't have an RHI yet, and will
adopt the top level's repaint manager's RHI. We need to register a
cleanup callback for this RHI, so that if it goes away, we will
reset our RHI pointer to null, just like when we switch from one top
level to another (and get a new potential RHI).

Without the reset, we would be working with a stale QRhi pointer,
which we in most cases updated via a call to ensureRhi(), that
picked up the new QRhi, but for good measure we should reset it
if we can.

Pick-to: 6.7
Change-Id: Iac6d8787b636675bbcb4358e8f0baad26187b0e2
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-02-14 18:51:29 +01:00
Tor Arne Vestbø 6fbbbef260 QRhiWidget: Tear down resources before window has changed
We were handling QEvent::WindowChangeInternal, but based on what the
code is doing, what the comments say, and what QQuickWidget does,
the right event should be WindowAboutToChangeInternal.

This fixes a crash when reparenting a QRhiWidget into another widget,
where we could call removeCleanupCallback() on an RHI that was already
gone.

The fact that we have a stale RHI pointer at WindowChangeInternal time
is still problematic, and caused by our call to addCleanupCallback not
happening as it should for the first call to ensureRhi(), but this will
be fixed in a follow up.

Pick-to: 6.7
Change-Id: I054120e97a24a1f74af44b2d251470792f03f7f3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-02-14 18:51:29 +01:00