Commit Graph

7505 Commits (b0056f052d842150305d59a3ced280e1885a8619)

Author SHA1 Message Date
Christian Ehrlicher 1d799e9108 QAbstractItemView: close all child editors when parent is removed
QAIV::rowsAboutToBeRemoved() closed all child editors when the child was
a direct ancestor of the removed index but forgot to check if the index
is an indirect ancestor. Some of those editors were removed later in
updateEditorGeometries() but not all as the testcase in the bug report
showed.

Pick-to: 6.7 6.6 6.5
Fixes: QTBUG-103476
Change-Id: I90b3d3bff3857aa79f96eecf23d980928693b7bc
Reviewed-by: David Faure <david.faure@kdab.com>
2024-02-08 18:31:26 +01:00
Christian Ehrlicher c6af5b9c12 Q(Plain)TextEdit: don't crash when using a style sheet
When using a style sheet, Q(Plain)TextEdit::isReadOnly() might get
called during the initialization before d->control is properly
initialized which lead to a crash.
This amends 43ce457cbd.

Fixes: QTBUG-121697
Fixes: QTBUG-121790
Task-number: QTBUG-1857
Pick-to: 6.7 6.6.2 6.6 6.5 6.2
Change-Id: I15c357c9eef7f6559bcc2ad89033a3d8e7fcbfef
Reviewed-by: David Faure <david.faure@kdab.com>
2024-02-07 02:17:37 +01:00
Tasuku Suzuki bd6d7d4d74 Remove extra semi-colons
Change-Id: I92fddb36cd136fd1bd627955f15d0559b9942d7e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-02-06 20:17:18 +09:00
Volker Hilsheimer 4b64df5650 Reapply: Remove const/ref debug operator for QDockWidget
QObjects are usually passed by pointer, so we leave the override
taking a pointer.

This amends bbeff2a335, and reverts
the previous revert in b148a362c3.
Now that we have removed the incorrectly added operators from the
6.6 branches entirely, we can remove the unnecessary const/ref
operator from 6.7.

Task-number: QTBUG-119952
Pick-to: 6.7
Change-Id: Id196367ddf3ffb443db44194002f850dcfec5d79
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-03 00:48:19 +01:00
Giuseppe D'Angelo e35dcba5bb QLineEdit: disable cursor blinking on hide
QLineEdit activates the blinking cursor timer when it's shown,
but never deactivates it, resulting in constant wakeups even for
hidden line edits.

Note that this is a workaround. Qt is supposed to send a focus out
event to line edits that get hidden. In some corner cases, it
doesn't, and only a hide event is sent.

Change-Id: Ic0645512051466ca9b1e84c54cef34c22287338b
Task-number: QTBUG-52021
Pick-to: 6.7 6.6 6.5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-02-02 23:12:00 +01:00
Ghenady Kuznetsov 3aa9388056 Fusion style: add right side indent to groupbox title
Add right side indent to the title if groupbox alignment is set to
Qt::AlignRight | Qt::AlignVCenter.

Fixes: QTBUG-121049
Pick-to: 6.7 6.6
Change-Id: I9aac295c824ad774410efd679f59075e4251b611
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-02-03 00:12:00 +02:00
Tasuku Suzuki 2b8a604c40 Fix build with -no-feature-animation
This amends 8eaf01ef81

Pick-to: 6.7
Change-Id: I8e30f232b732b0acb0b6c7070ecfa216fabd64da
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-02-02 22:12:00 +00:00
Lucie Gérard 1dbc57ad0c Change doc snippet license
According to QUIP-18 [1], all doc snippet files should be
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: I6e5bc9d05a5d510cc07a15abafe2257034562510
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-02-02 16:52:11 +00:00
Tor Arne Vestbø 97c02b80ae Harden WidgetAttributes debug stream operator
The call site may pass in a null-widget, so guard for that.

Pick-to: 6.7
Change-Id: I631cb2fc105bad69faf3daaeac4b893457d27cc1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-02-02 15:04:14 +01:00
Tasuku Suzuki 8f26ff0dee Fix build with -no-feature-menu
Change-Id: I29a230d70a96c3037f4e07dbe23fce13aa869089
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-02-02 16:26:30 +09:00
Ahmad Samir 2a8b27bf6c QFileSystemModel: don't crash with setIconProvider(nullptr)
The method takes a pointer, so the code shouldn't crash when passed a
nullptr.

QFileInfoGatherer::getInfo() still needs to generate a descriptive
string for the file, so we refactor QAbstractFileIconProvider::type()
to put the implementation into a reusable static function
QAbstractFileIconProviderPrivate::getFileType(const QFileInfo &info).
This unfortunately involves constructing a QMimeDatabase on the fly,
but the docs say that is fine.

Drive-by change: use nullptr instead of `0` for pointers.

Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-99178
Change-Id: Ia32ea0a26701d593e74fbecced7be8d9e0aa0f52
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2024-02-01 22:06:12 +00:00
Lucie Gérard 865d0133fc Change license of .qdoc files
According to QUIP-18 [1], all .qdoc files should be
LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

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

Pick-to: 6.7
Change-Id: I4559af21fc9069efa9bf0cbd29c5e86cfdac9082
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-02-01 19:25:42 +00:00
Tor Arne Vestbø 5ba0982b28 Don't set ExplicitShowHide on children when showing parent widget
As a result of using QWidget::setVisible to show the child widgets we
would end up also setting ExplicitShowHide. This is not in line with
the intent of ExplicitShowHide, which is to flag a widget as explicitly
shown/hidden by the developer, which in turn prevents Qt Widgets from
toggling WState_Hidden when the widget is reparented.

By using QWidgetPrivate::setVisible instead, we can show the child
without setting ExplicitShowHide.

As side effect of this is that we no longer reset WA_WState_Hidden
from QWidgetWindowPrivate::setVisible(). This is an issue when the
setVisible call comes as a result of destroying the QWidgetWindow,
as that is an implicit hide, and should not result in the widget
having WA_WState_Hidden. QWidget handles this case in hideChildren
by not calling QWidgetPrivate::setVisible -- instead doing its own
reset of WA_WState_Visible. We don't want to untangle this just yet,
so as a workaround we detect that the widget is already !isVisible(),
thanks to hideChildren having hidden it, and then skip the call
to QWidgetPrivate::setVisible that results from QWindow::destroy().

Task-number: QTBUG-121398
Pick-to: 6.7
Change-Id: Ib5b4d9c84f0569124c5f3ca2169cabff18934e2d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-01 15:28:56 +01:00
Tor Arne Vestbø b393b26c70 Add logging, clarifications, and tests for QWidget show/hide behavior
Task-number: QTBUG-121398
Pick-to: 6.7
Change-Id: I94b4c90c3bd515279417c88497d7b9bd5a362eae
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-01 15:28:56 +01:00
Tor Arne Vestbø 4634fbf34e Add QWidgetPrivate::isExplicitlyHidden() helper function
To aid readability.

Task-number: QTBUG-121398
Pick-to: 6.7
Change-Id: I3cb231584c2b7aee72e9f01c669fed1e01fbe475
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-01-31 15:19:49 +01:00
Ghenady Kuznetsov 4725bbb3ee Fusion style: add indent to groupbox title
Add indent to the title if groupbox alignment is set to Qt::AlignLeft |
Qt::AlignVCenter.

Fixes: QTBUG-121049
Pick-to: 6.7 6.6
Change-Id: I25e2fe4e73b920baf4c678b6b0e758d1da7cf632
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-01-31 10:50:37 +00:00
Kai Köhne 8ed75d3a75 Widgets: Add missing deprecation version markers
Change-Id: I277e481c7e802f97d1394d7421e9527083df8482
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-01-28 15:50:10 +01:00
Axel Spoerl 4cd2baae9a QMessageBox: Move enum static assertions to cpp file
Move static assertions for StandardButton and ButtonRole enums from
header to cpp file.

Use qToUnderlying instead of casting and assert types where possible.

Amends 773f9ab018.

Found in API-Review.

Change-Id: Ia52886e6e33a3b94b327d17d1453e18febe6dd50
Found-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Task-number: QTBUG-119952
Pick-to: 6.7 6.6 6.5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-01-25 17:37:48 +00:00
Tor Arne Vestbø 3f2a9523a4 qWaitForWindowFocused: Pass timeout as QDeadlineTimer
We should avoid int-based timeouts nowadays, and prefer std::chrono,
or for timeouts where Forever is a valid state, QDeadlineTimer.

Discovered during API header review.

Pick-to: 6.7
Change-Id: Ia56a67084c7a2f989951755fed5ffc161ed8f79e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-01-25 18:37:47 +01:00
Volker Hilsheimer bed7788402 QFileDialog::getOpenFileContent: default new parent parameter
Amends 7c5cf8cae0, which
removed the old function that didn't have any parent parameter
from the API, and added a new one with the parent parameter in
its stead.
However, to make sure that the new function is source compatible
with existing code, the parent parameter must be defaulted to
nullptr (which it already is in the new version of
saveFileContent).

Found during header review.

Pick-to: 6.7
Change-Id: I3e734905be9788ae1b206c7a65328e604667f5e4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-01-24 19:41:08 +01:00
Volker Hilsheimer 703f922b18 Inline one qDrawPlainRoundedRect overload
Don't export both, the one is just calling the other, so make it inline.
Give parameters descriptive names that match the documentation.

Found in header review.

Pick-to: 6.7
Change-Id: I48b221a4fcc476483fee2842ec0a5cadd628b803
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-01-24 19:41:07 +01:00
Ghenady Kuznetsov b820aa7a04 Fusion style: wrongly used PixelMetric enum
Wrongly used QStyle::PM_ExclusiveIndicatorHeight, which is height of a
radio button indicator instead of QStyle::PM_IndicatorHeight, which is
height of a checkbox indicator in pixelMetric() calls for checkbox
subcontrol of groupbox.

Pick-to: 6.7 6.6
Change-Id: Ifbf7783fd4494d1e00ee28c27fa5f62b319b8787
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-01-23 22:00:02 +00:00
Tor Arne Vestbø 12203e94f5 QWidget: Clean up state that depends on QWindow from ~QWidgetWindow()
We were assuming that QWidget was in full control of QWidgetWindow
destruction, via deleteTLSysExtra(), and that we could limit any
cleanups to that function.

But in some situations QWidgetWindow is destructed from other code paths,
in which case we were left with dangling pointers to the QWidgetWindow
in both QTLWExtra, as well as the backingstore.

This can happen if there's a child widget hierarchy where there is not
a 1:1 mapping between QWidgets and QWindows, for example if the window
attribute WA_DontCreateNativeAncestors has been set. In this situation
our normal recursion into children in QWidget::destroy() stops at the
first widget without a window handle. When we then delete the top level
QWindow, the QWindow destructor will delete any child QWindows, which
includes our leaf QWidgetWindow.

We should probably fix up QWidget::destroy to continue looking for
children, even if we don't destroy the current child. But independently
of that we should make sure the QWidgetWindow cleans up when it's being
deleted, regardless of how it ended up there.

There's further room to clean up the deleteTLSysExtra() function and
friends, but that's been left for a later time.

Fixes: QTBUG-120509
Pick-to: 6.7 6.6 6.6.2 6.5
Change-Id: Ib691df164d7c9c83cb464c0a6bf3bc2116e8ca43
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-01-23 12:56:54 +00:00
Laszlo Agocs 80e7bcd368 Do more QRhiWidget cleanups based on API review
Pick-to: 6.7
Change-Id: I339fb2ac2546b9d7b4b88cba89191e7a4311017f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-01-22 20:40:19 +01:00
Thorbjørn Lindeijer d99b0cfed2 Increase precision for QGraphicsView::AnchorUnderMouse
* Use a more precise view center for views with odd width/height
* Use the QPointF version of mapToScene to avoid rounding
* Round instead of truncate when setting scroll bar values

These changes increase the precision of AnchorUnderMouse, which is
important when for example wheel scrolling is used to change the scale
of the view. Without these changes, the view shifts slightly with each
change in the transform.

[ChangeLog][QtWidgets][QGraphicsView] Increase precision for QGraphicsView::AnchorUnderMouse and QGraphicsView::centerOn

Pick-to: 6.6 6.7
Task-number: QTBUG-96879
Change-Id: I8199196c671e4aa96732f382e8057468f676b8d7
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2024-01-22 14:18:09 +01:00
Ed Cooke 343551ffae QPushButton with a menu remains in sunken state after menu closed
Regression fix, introduced in:
7199498fb9

QPushButton with a menu will have a sunken state, QStyle::State_Sunken,
when the menu has been closed. Expected behavior is that the sunken
style is to be removed when the menu is closed.

A boolean called "menuOpen" is never set to false after being set to
true in the popupPressed() method. When this boolean is true, a sunken
state is painted.

Fixes: QTBUG-120976
Pick-to: 6.6 6.7
Change-Id: I3e721da5dfbb6db200aa2de7366ac5dc73c873e0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-01-22 08:19:20 +01:00
Marc Mutz 3512fb1ec5 QCheckBox: deprecate stateChanged()
[ChangeLog][QtWidgets][Deprecation Notices][QCheckBox]
stateChanged(int) has been deprecated in favor of
checkStateChanged(Qt:CheckState).

Found in API-review. Amends 5a96d13bb5.

Pick-to: 6.7
Change-Id: I6ff4aa38c2f43622ba4b127420aff83790785455
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-01-19 17:51:14 +01:00
Marc Mutz 88c3cd6e08 QMetaTypeModuleHelper: mark instances constexpr
Static and thread-local objects should be constexpr or constinit if possible.

Task-number: QTBUG-100485
Pick-to: 6.7 6.6 6.5
Change-Id: I29088798a50d6278252c9088e7c191c4214b2e5b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-01-19 10:15:25 +01:00
Axel Spoerl b148a362c3 Revert "API Review / QDockWidget: Remove const/ref debug operator"
This reverts commit ca2f46c04c.

Reason for revert: <BIC in 6.6 found by Marc Mutz>

Pick-to: 6.7 6.6
Change-Id: Ia5b8849e55ebccb514bc753ce1d31855d91e2406
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2024-01-18 20:17:17 +00:00
Marc Mutz 11d153ae1c QMetaTypeModuleHelper: suppress cppcoreguidelines-virtual-class-destructor
Says clang-tidy:

   destructor of '(unnamed struct at qmetatype.cpp:966:14)' is public and non-virtual
   in file:src/corelib/kernel/qmetatype.cpp line:966 col:14

       static const struct : QMetaTypeModuleHelper

Yes, these classes are polymorphic (because the base class is). Yes,
the destructor is non-virtual (because the base class' one isn't, but
it's also protected, so fine).

But these classes are not used as base classes, so suppress the
warning.

Pick-to: 6.7 6.6 6.5 6.2
Change-Id: I75be86bca36a4a0e93d72acb1a0d2fe0dca1c505
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-01-18 12:48:03 +01:00
Laszlo Agocs acebb97b58 Update QRhiWidget API based on review comments
Spell out some API names in enum.

Some functions are now protected.

Remove property for autoRenderTarget.

textureFormat -> colorBufferFormat.

Used "fixed" instead of "explicit" and follow
the above naming, so that explicitSize becomes
fixedColorBufferSize.

Pick-to: 6.7
Change-Id: I2fd6ad46033313a3febbb8846146021d5dd11010
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-01-18 12:48:03 +01:00
Ghenady Kuznetsov 9b4c35abff Fusion style: add clip region for groupbox title
Fusion style is missing clip region for the title in
QFusionStyle::drawComplexControl().
Without that region, the top line of the frame will be visible behind
the vertically centered title.

Fixes: QTBUG-121041
Pick-to: 6.7 6.6
Change-Id: I3daf5854195e28a5ee3cb50343e2dd56e66ed940
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-01-17 11:30:18 +00:00
Timur Pocheptsov 72b03e268d QFusionStyle: draw slider in a scrollbar using lighter color
The gradient we are using now, makes slider almost invisible in 'Dark' theme
(non-transient scroll bar). Instead of using gradient for non-selected
and non-pressed state, use the same color as in pressed state.

Fixes: QTBUG-120971
Change-Id: I1a7e4aefa4483e8095e59d82be3d0c1c3526b28f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-01-16 23:17:32 +01:00
Tor Arne Vestbø a99d313076 Remove note about QDockWidget::DockWidgetClosable not working on macOS
It does nowadays.

Pick-to: 6.7 6.6 6.5
Change-Id: Ie14a84460abfebd42c93e5ae41969d9e3b4c4f5d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-01-16 20:06:36 +01:00
Christian Ehrlicher d0d5794a3d Doc: Remove wrong comment in QStyle::pixelMetric() doc
Pick-to: 6.7 6.6 6.5 6.2
Change-Id: Iebb5794a166899c986e1c408a254184b22bc276e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-01-16 09:18:26 +01:00
Christian Ehrlicher 43ce457cbd Widgets: pass widget to QStyle::pixelMetric()
Make sure to pass the widget to QStyle::pixelMetric() as some styles
might use this (e.g. the new windows styles) to determine the correct
pixel metric.

Pick-to: 6.7 6.6 6.5 6.2
Task-number: QTBUG-1857
Change-Id: I5c32f5af8b284749732b610e56b4e3d8c8ed1946
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2024-01-16 00:01:43 +01:00
Christian Ehrlicher 8594fe1b8d Styles/fusion: Adjust QSlider painting with modified paint rect
When the painting rect is adjusted within an overloaded
QSlider::initStyleOption() there are some glitches when using the fusion
style:
 - the tickmarks are not painted inside the specified rect / it is
   ignored
 - the glue groove bar is clipped incorrectly

Pick-to: 6.7 6.6
Fixes: QTBUG-111314
Change-Id: If140c5348031d869b527c6c4850b4a8d34b395c1
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-01-12 14:35:30 +01:00
Volker Hilsheimer ab6e3c59a3 QColorDialog: Add trailing comma to new enum value
As commented in header review, this will make future header reviews
less noisy.

Pick-to: 6.7
Change-Id: Ia75e51facec100172de7dbb0854830d9981f0552
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-01-12 12:59:27 +01:00
Christian Ehrlicher 574692e5ac QFusionStyle: fix painting handle with tickmarks enabled
The handle was drawn outside of the widget's rect when tickmarks were
enabled (TicksAbove/TicksLeft).

Pick-to: 6.7 6.6 6.5
Fixes: QTBUG-83604
Change-Id: Iff3a1a330317576a759e3fd6795d0b4849e2044b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-01-12 11:59:27 +00:00
Christian Ehrlicher 742be5254c QComboBox: ignore hidden items when calculating popup size
The popup size depends on the max visible items property. But the loop
did not ignore the hidden items which results in fewer items in the
popup than allowed.

Fixes: QTBUG-120574
Pick-to: 6.7 6.6 6.5
Change-Id: Ic3c503a5272d6839aee158740e096405ca8887d6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-01-12 12:59:26 +01:00
Volker Hilsheimer 51a1dfe72d Doc: complete the snippet for a dialog with extension
Add the setting of the layout's size constraint to 'fixed' back to the
snippet, so that the dialog automatically resizes when the extension
gets hidden. The user won't be able to resize the dialog, but allowing
the user to resize the dialog and to show and hide the extension anyway
leads to unpredictable results for the user.

Amends 11da92ba94.

Pick-to: 6.7 6.6
Change-Id: Ie74ca36eaa1a8e9567e0d5826f91f8633e5cbc05
Reviewed-by: David Faure <david.faure@kdab.com>
2024-01-11 23:40:27 +01:00
Christian Ehrlicher 7efd3c2718 QLabel: Use pmf-style connects
Port all string-based signal/slots connections to pmf-style connects.

Pick-to: 6.7
Change-Id: I888fe3d0022fddbe7ba391dc6841c3ea6b9d1d4b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-01-10 22:20:03 +00:00
Christian Ehrlicher 7dd4a7b213 QColorDialog: Use pmf-style connects
Port all string-based signal/slots connections to pmf-style connects.

Pick-to: 6.7
Change-Id: If1075a5a8a4d018e060e7d18ee59c8fc4c0a5207
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-01-10 22:20:03 +00:00
Axel Spoerl 24d84a86cf API Review / QDockWidget: Fix TODO comment
Use ### Qt 7 syntaxt instead of TODO.

This amends 3aaeef59fb.

Change-Id: I0354debbe43796aa6bd2cf04d567fd932fde3c66
Found-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Task-number: QTBUG-119952
Pick-to: 6.7
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-01-10 19:52:37 +01:00
Milian Wolff 76845e1d31 Fix potential leak of QPropertyAnimation in QLineEditIconButton
When startOpacityAnimation is triggered and the animation doesn't
finish, it might get leaked during shutdown as shown by valgrind:

```
==133963== 600 (16 direct, 584 indirect) bytes in 1 blocks are definitely lost in loss record 2,326 of 2,356
==133963==    at 0x4841FA3: operator new(unsigned long) (vg_replace_malloc.c:483)
==133963==    by 0x12698E2D: QLineEditIconButton::startOpacityAnimation(double) (qlineedit_p.cpp:437)
==133963==    by 0x1269900D: displayWidgets(std::vector<QLineEditPrivate::SideWidgetEntry, std::allocator<QLineEditPrivate::SideWidgetEntry> > const&, bool) (qlineedit_p.cpp:459)
==133963==    by 0x126A1084: QLineEdit::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_qlineedit.cpp:276)
==133963==    by 0x152D781E: void doActivate<false>(QObject*, int, void**) (qobject.cpp:3935)
==133963==    by 0x1269AB01: QLineEdit::textChanged(QString const&) (moc_qlineedit.cpp:447)
==133963==    by 0x126A0EF8: QLineEdit::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (moc_qlineedit.cpp:255)
==133963==    by 0x152D781E: void doActivate<false>(QObject*, int, void**) (qobject.cpp:3935)
==133963==    by 0x126A1A94: QWidgetLineControl::textChanged(QString const&) (moc_qwidgetlinecontrol_p.cpp:273)
==133963==    by 0x126A4C35: QWidgetLineControl::finishChange(int, bool, bool) (qwidgetlinecontrol.cpp:736)
==133963==    by 0x126A4F05: QWidgetLineControl::internalSetText(QString const&, int, bool) (qwidgetlinecontrol.cpp:772)
==133963==    by 0x12698AF4: setText (qwidgetlinecontrol_p.h:251)
==133963==    by 0x12698AF4: QLineEditPrivate::setText(QString const&) (qlineedit_p.cpp:277)
```

Note that the line numbers above are potentially slightly off as that
backtrace was recorded on Qt 5.15.9.

Pick-to: 6.7 6.6 6.5 6.2 5.15
Change-Id: Ie79744d98d2783e4644e18ec51892c0bc43c1557
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-01-10 16:14:27 +00:00
Axel Spoerl ca2f46c04c API Review / QDockWidget: Remove const/ref debug operator
Remove the debug operator taking a const QDockWidget & argument.

Leaving the override taking a pointer.

This amends bbeff2a335.

Change-Id: I0fbca6ea7dbffe6269c70e5e9eb29af9f84c3600
Found-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Task-number: QTBUG-119952
Pick-to: 6.7 6.6
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2024-01-10 08:30:12 +01:00
Christian Ehrlicher b71aa162c0 QSidebar: Use pmf-style connects
Port all string-based signal/slots connections to pmf-style connects.

Pick-to: 6.7
Change-Id: I4ebabf1b117f86f39d3875965efa8ee5042bce84
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-01-10 03:11:52 +00:00
Christian Ehrlicher 4fdcb1212d QInputDialog: Use pmf-style connects
Port all string-based signal/slots connections to pmf-style connects.
Exception: Private::ensureEnabledConnection(QAbstractSpinBox*)

Pick-to: 6.7
Change-Id: Id88fe88a1f9071085a159e1fa6429a6ec02e61bb
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-01-10 03:11:52 +00:00
Christian Ehrlicher fb58a3aabe QFontDialog: Use pmf-style connects
Port all string-based signal/slots connections to pmf-style connects.

Pick-to: 6.7
Change-Id: Ic7ecfd1efb8eb76239598e48f25251357040f814
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-01-10 03:11:52 +00:00
Christian Ehrlicher e03e2e9886 QFileDialog: Use pmf-style connects
Port all string-based signal/slots connections to pmf-style connects.

Pick-to: 6.7
Change-Id: I6121e727c2730f9e5947f9f3b7550903bb17aee0
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-01-10 03:11:52 +00:00