Convenience base class for models of a list of items.
More...
|
| __init__ (self, parent=None) |
|
| rowCount (self, parent=None) |
| Reimplemented from QAbstractListModel.
|
|
| addRoleName (self, role, name) |
|
| roleNames (self) |
|
| data (self, index, role) |
| Reimplemented from QAbstractListModel.
|
|
| getItem (self, index) |
| Get an item from the list.
|
|
| items (self) |
| The list of items in this model.
|
|
| setItems (self, items) |
| Replace all items at once.
|
|
| appendItem (self, item) |
| Add an item to the list.
|
|
| insertItem (self, index, item) |
| Insert an item into the list at an index.
|
|
| removeItem (self, index) |
| Remove an item from the list.
|
|
| clear (self) |
| Clear the list.
|
|
| setProperty (self, index, property, value) |
|
| sort (self, fun) |
| Sort the list.
|
|
| find (self, key, value) |
| Find a entry by key value pair.
|
|
|
| itemsChanged = pyqtSignal() |
|
Convenience base class for models of a list of items.
This class represents a list of dictionary objects that can be exposed to QML. It is intended primarily as a read-only convenience class but supports removing elements so can also be used for limited writing.
◆ appendItem()
UM.Qt.ListModel.ListModel.appendItem |
( |
|
self, |
|
|
|
item |
|
) |
| |
Add an item to the list.
- Parameters
-
◆ find()
UM.Qt.ListModel.ListModel.find |
( |
|
self, |
|
|
|
key, |
|
|
|
value |
|
) |
| |
Find a entry by key value pair.
- Parameters
-
- Returns
- index of setting if found, None otherwise
◆ insertItem()
UM.Qt.ListModel.ListModel.insertItem |
( |
|
self, |
|
|
|
index, |
|
|
|
item |
|
) |
| |
Insert an item into the list at an index.
- Parameters
-
index | The index where to insert. |
item | The item to add. |
◆ removeItem()
UM.Qt.ListModel.ListModel.removeItem |
( |
|
self, |
|
|
|
index |
|
) |
| |
Remove an item from the list.
- Parameters
-
index | The index of the item to remove. |
◆ setItems()
UM.Qt.ListModel.ListModel.setItems |
( |
|
self, |
|
|
|
items |
|
) |
| |
Replace all items at once.
- Parameters
-
items | The new list of items. |
◆ sort()
UM.Qt.ListModel.ListModel.sort |
( |
|
self, |
|
|
|
fun |
|
) |
| |
Sort the list.
- Parameters
-
fun | The callable to use for determining the sort key. |
The documentation for this class was generated from the following file: