Tatiana Borisova ca3fa76a4e QDialogs: prevent crash in static get*() functions when parent gets deleted
- As explained in
https://blogs.kde.org/2009/03/26/how-crash-almost-every-qtkde-application-and-how-fix-it-0
creating dialogs on the stack is a bad idea, if the
application or the dialog's parent window can be closed
by means other than user interaction (such as a timer or
an IPC call). Since we cannot know whether Qt is used to
build such an application, we must assume it is, create
the dialog on the heap, and monitor its lifetime with a
QPointer.

Long time ago instead of using manual resource management,
QAutoPointer was added to fix the crash problem for QInputDialog.

The same fix now is being applied for the rest of QDialog classes:
QColorDialog, QFileDialog, QFontDialog.

Documentation warnings about deleting the parent are not actual anymore. Deleted.

Pick-to: 6.5
Task-number: QTBUG-54693
Change-Id: Ib7cc0575ea25f392a295538e21de9015dc49ebe4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 81d55f772892445686862e49d0a6092668f8c725)
2024-09-16 16:13:47 +00:00
2024-02-29 15:35:57 +01:00
2024-07-12 01:42:29 +00:00
2024-02-02 15:23:02 +00:00
Description
Qt Base (Core, Gui, Widgets, Network, ...)
822 MiB
Languages
C++ 84.3%
HTML 4.9%
C 3.9%
CMake 3.6%
Objective-C++ 2%
Other 0.8%