On this page |
The widget is an editor for a list of strings that allows to user to add, delete, reorder or edit list elements.
This class inherits from Qt’s QtWidgets.QDialog
class.
Signals
itemMoved(old_row_num, new_row_num)
Emitted when the user drag-reorders an item.
itemEdited(row_num, new_text)
Emitted when the user edits the contents of an item.
listChanged()
Emitted when setStrings() is called.
accepted()
Emitted when the user clicks OK or presses Enter.
finished()
Emitted when the user makes the window go away (clicks OK, clicks Cancel, presses Enter, presses Escape, etc.)
rejected()
Emitted when the user clicks Cancel or presses Escape.
Methods
__init__()
Create and return a new ListEditor object.
topMessage()
→ str
The text shown above the list widget.
bottomMessage()
→ str
The text shown below the list widget.
strings()
→ list
The list of strings displayed in the dialog.
isEditingAllowed()
→ bool
Whether editing the string content is allowed.
isAddRemoveAllowed()
→ bool
Whether the user is allowed to add/remove strings to/from the list.
isReorderAllowed()
→ bool
Whether the user is allowed to drag items in the list to reorder them.
isEmptyStringAllowed()
→ bool
Whether an empty string in the list is allowed.
initialString()
→ str
The initial text of a newly created (using the +
button) item.
setTopMessage(text)
Sets the text shown above the list widget.
setBottomMessage(text)
Sets the text shown below the list widget.
setStrings(strings)
Sets the list of strings to display in the dialog.
setAllowEditing(allow)
Sets whether editing string content is allowed.
setAllowAddRemove(allow)
Sets whether the user is allowed to add/remove strings to/from the list.
setAllowReorder(allow)
Sets whether the user is allowed to drag items in the list to reorder them.
setAllowEmptyString(allow)
Sets whether an empty string in the list is allowed.
setInitialString(text)
Sets the initial text of a newly added item.