editor_dialog
editor_dialog
Classes
ConfigEditorDialog(config, parent=None, delete_on_close=False)
Bases: QDialog
Floating, non-modal dialog editing the layers of a LayeredConfig.
Intended to be spawned by a host application, which owns it through parent.
Attributes:
| Name | Type | Description |
|---|---|---|
saved |
Signal
|
Emitted with the layer name after a layer is saved. |
Initialize the dialog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
LayeredConfig
|
The config whose layers are edited. |
required |
parent
|
QWidget | None
|
Parent widget. |
None
|
delete_on_close
|
bool
|
Delete the dialog once it is closed. |
False
|
Source code in src/json_config_qt/editor_dialog.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
Attributes
document = self.editor.document
instance-attribute
editor = ConfigEditorWidget(config, self)
instance-attribute
saved = QtCore.Signal(str)
class-attribute
instance-attribute
Methods:
reject()
Close the dialog unless the user cancels the unsaved-changes prompt.
Source code in src/json_config_qt/editor_dialog.py
112 113 114 115 | |
show_for(config, parent=None)
classmethod
Show the editor for config, reusing the open one if there is one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
LayeredConfig
|
The config whose layers are edited. |
required |
parent
|
QWidget | None
|
Parent widget for a new dialog. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
ConfigEditorDialog |
ConfigEditorDialog
|
The shown dialog, deleted when closed. |
Source code in src/json_config_qt/editor_dialog.py
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |