The base class of native dialogs. More...
Import Statement: | import QtQuick.Dialogs |
Since: | Qt 6.2 |
Inherits: | |
Inherited By: |
ColorDialog, FileDialog, FolderDialog, FontDialog, and MessageDialog |
The Dialog type provides common QML API for native platform dialogs. For the non-native dialog, see Dialog.
To show a native dialog, construct an instance of one of the concrete Dialog implementations, set the desired properties, and call open(). Dialog emits accepted() or rejected() when the user is done with the dialog.
This default property holds the list of all objects declared as children of the dialog.
flags : Qt::WindowFlags |
This property holds the window flags of the dialog. The default value is Qt.Dialog
.
modality : Qt::WindowModality |
This property holds the modality of the dialog. The default value is Qt.WindowModal
.
Available values:
Constant | Description |
---|---|
Qt.NonModal |
The dialog is not modal and does not block input to other windows. |
Qt.WindowModal |
The dialog is modal to a single window hierarchy and blocks input to its parent window, all grandparent windows, and all siblings of its parent and grandparent windows. |
Qt.ApplicationModal |
The dialog is modal to the application and blocks input to all windows. |
parentWindow : Window |
result : StandardCode |
This property holds the result code.
Standard result codes:
Constant | Value |
---|---|
Dialog.Accepted |
|
Dialog.Rejected |
Note: MessageDialog sets the result to the value of the clicked standard button instead of using the standard result codes.
title : string |
This property holds the title of the dialog.
visible : bool |
void accepted() |
void rejected() |
void close() |
void done(StandardCode result) |