Create a new dialog with the given window title.
When not given the title defaults to "Script".
Called when the dialog is closed via accept or the done method is called with Dialog.Accepted as its argument.
If false, the widget cannot be interacted with. Qt documentation: QWidget::enabled
Called when the dialog is closed or the done method is called. The number value it provides is either Dialog.Accepted or Dialog.Rejected.
You can use this property to prevent the widget from being resized to a height below this amount.
You can use this property to prevent the widget from being resized to a width below this amount.
Controls the automatic widget placement behavior of the dialog. Defaults to SameWidgetRows.
Called when the dialog is closed via the X button, reject, or the done method is called with Dialog.Rejected as its argument.
Set this property to override the style sheet for this widget.
See https://doc.qt.io/qt-6/stylesheet.html and https://doc.qt.io/qt-6/stylesheet-examples.html for more information.
The toolTip displayed when the user mouses over this widget
Controls whether this widget is visible. When toggling this property, the dialog layout will automatically adjust itself based on the visible widgets. Qt documentation: QWidget::visible;
The title of your dialog.
The dialog was accepted. Value is 1.
In this mode, the dialog will not add a new row unless you call addNewRow, addHeading or addSeparator.
The dialog was rejected. Value is 0.
The default row layout mode.
In this mode, if you add multiple of the same type of widget in a row, (for instance by calling addButton twice in a row), the Dialog will automatically group them into the same row.
As soon as a differently typed widget is added, a new row will be added to the dialog. The exception to this rule is the widget created by addLabel, which will be mixed with any other widget types when using this mode.
In this mode, only one widget will be allowed in the right column. A new row will be added after each time you place a widget in the right column.
Close this dialog, setting its result code to Dialog.Accepted.
Add a Qt.QPushButton widget with the given text to the dialog. Allows the user to press a button that you can respond to the clicked signal of.
Add a Qt.QCheckBox widget with the given text to the dialog. Allows a user to toggle a boolean value.
If the defaultValue parameter is true the checkbox is checked by default.
Add a ColorButton widget that allows the user to pick a color.
If the labelText is non-empty, a label widget will be added to the left of the widget.
Add a Qt.QComboBox widget (also known as a dropdown) allowing the user to select one of the given values.
If the labelText is non-empty, a label widget will be added to the left of the widget.
Add a FileEdit widget with a button which opens a file picker dialog and displays the path in the dialog.
If the labelText is non-empty, a label widget will be added to the left of the widget.
Add a heading to the dialog with the given labelText. A heading will always be the first widget in a row.
If the optional maxWidth parameter is true, the heading will be expanded to the full width of the dialog. Otherwise, it will be confined to the left-hand column of the dialog.
Adds an image widget that can display an image in a dialog.
Add a label to the dialog with the given test. A label will always be the first widget in a row.
Call this to force the next widget to go on a new row, even if it is the same type widget as the last one you added.
Add a Qt.QSlider widget to the dialog to allow a user to type a numerical value or use up and down controls on the widget to manipulate the value.
This can be used to enter integer or decimal values.
Adds a separator line with optional label to the dialog. Used to visually split up sections of the dialog.
Add a Qt.QSlider widget to the dialog to allow a user to slide a handle within a number range.
This can only be used to enter integer-type values.
Add a Qt.QTextEdit widget to the dialog to allow the user to edit multiple lines of text. Also allows display of rendered HTML by setting the Qt.QTextEdit.html property. The initial text on the widget can be given by defaultValue parameter.
If the labelText is non-empty, a label widget will be added to the left of the widget.
Add a Qt.QLineEdit widget to the dialog to allow the user to enter a single line of text. The initial text on the widget can be given by defaultValue parameter.
If the labelText is non-empty, a label widget will be added to the left of the widget.
Erase all of the widgets that you have added to the dialog. Call this if you want to re-draw your dialog with a new configuration of widgets.
Close this dialog, setting its result code to Dialog.Accepted or Dialog.Rejected.
Open the dialog, blocking your script until the Dialog has been accepted or rejected.
Close this dialog, setting its result code to Dialog.Rejected.
Show the dialog. Call this after you have added all of your desired widgets. This will not block your script until the dialog opens.
To respond to the dialog closing, it is recommended to connect to the finished signal.
Generated using TypeDoc
The
Dialog
object is used to display a dialog to the user which can be filled with a variety of widgets.The left-hand column of the dialog can only contain headings. If you call addHeading without specifying maxWidth = true, your heading will be placed in the left-hand column of the dialog.
All other widgets will be placed in the right-hand side column. When you add multiple instances of the same type of widget sequentially, they will be grouped into the same row unless you call addNewRow in between adding the widgets or change the newRowMode property.
This type is an extension of the QDialog type from Qt.
1.9