Uranium
Application Framework
|
Convenience base class for models of a list of items. More...
Public Member Functions | |
def | __init__ |
def | count (self) |
def | rowCount |
This function is necessary because it is abstract in QAbstractListModel. More... | |
def | addRoleName |
def | roleNames (self) |
def | data (self, index, role) |
Reimplemented from QAbstractListModel. | |
def | getItem |
Get an item from the list. | |
def | items (self) |
The list of items in this model. More... | |
def | setItems |
Replace all items at once. More... | |
def | appendItem |
Add an item to the list. More... | |
def | insertItem |
Insert an item into the list at an index. More... | |
def | removeItem |
Remove an item from the list. More... | |
def | clear (self) |
Clear the list. More... | |
def | setProperty |
def | sort |
Sort the list. More... | |
def | find |
Find a entry by key value pair. More... | |
Static Public Attributes | |
tuple | 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.
def UM.Qt.ListModel.ListModel.appendItem | ( | self, | |
item | |||
) |
Add an item to the list.
item | The item to add. |
def UM.Qt.ListModel.ListModel.clear | ( | self, | |
None | |||
) |
Clear the list.
def UM.Qt.ListModel.ListModel.find | ( | self, | |
key | |||
) |
Find a entry by key value pair.
key | |
value |
def UM.Qt.ListModel.ListModel.insertItem | ( | self, | |
index | |||
) |
Insert an item into the list at an index.
index | The index where to insert. |
item | The item to add. |
def UM.Qt.ListModel.ListModel.items | ( | self, | |
List, | |||
Dict, | |||
str, | |||
Any | |||
) |
The list of items in this model.
def UM.Qt.ListModel.ListModel.removeItem | ( | self, | |
index | |||
) |
Remove an item from the list.
index | The index of the item to remove. |
def UM.Qt.ListModel.ListModel.rowCount | ( | self, | |
parent = None , |
|||
int | |||
) |
This function is necessary because it is abstract in QAbstractListModel.
Under the hood, Qt will call this function when it needs to know how many items are in the model. This pyqtSlot will not be linked to the itemsChanged signal, so please use the normal count() function instead.
def UM.Qt.ListModel.ListModel.setItems | ( | self, | |
items | |||
) |
Replace all items at once.
items | The new list of items. |
def UM.Qt.ListModel.ListModel.sort | ( | self, | |
fun | |||
) |
Sort the list.
fun | The callable to use for determining the sort key. |