Uranium
Application Framework
UM.Qt.Bindings.OutputDevicesModel.OutputDevicesModel Class Reference

A list model providing a list of all registered OutputDevice instances. More...

Inheritance diagram for UM.Qt.Bindings.OutputDevicesModel.OutputDevicesModel:
UM.Qt.ListModel.ListModel

Public Member Functions

def __init__ (self, parent=None)
 
def getDevice (self, device_id)
 
def deviceCount (self)
 
- Public Member Functions inherited from UM.Qt.ListModel.ListModel
int count (self)
 
int rowCount (self, parent=None)
 
def addRoleName (self, int role, str name)
 
def roleNames (self)
 
def data (self, index, role)
 Reimplemented from QAbstractListModel.
 
Dict[str, Any] getItem (self, int index)
 
List[Dict[str, Any]] items (self)
 
None setItems (self, List[Dict[str, Any]] items)
 Replace all items at once. More...
 
def appendItem (self, Dict[str, Any] item)
 Add an item to the list. More...
 
None insertItem (self, int index, Dict[str, Any] item)
 Insert an item into the list at an index. More...
 
None removeItem (self, int index)
 Remove an item from the list. More...
 
None clear (self)
 Clear the list. More...
 
None setProperty (self, int index, str property, Any value)
 
None sort (self, Callable[[Any], float] fun)
 Sort the list. More...
 
int find (self, str key, Any value)
 

Static Public Attributes

int IdRole = Qt.UserRole + 1
 
int NameRole = Qt.UserRole + 2
 
int ShortDescriptionRole = Qt.UserRole + 3
 
int DescriptionRole = Qt.UserRole + 4
 
int IconNameRole = Qt.UserRole + 5
 
int PriorityRole = Qt.UserRole + 6
 
 str
 
 result
 
 outputDevicesChanged = pyqtSignal()
 
 int
 
 notify
 
- Static Public Attributes inherited from UM.Qt.ListModel.ListModel
 itemsChanged = pyqtSignal()
 
 int
 Get an item from the list.
 
 notify
 The list of items in this model. More...
 
 result
 This function is necessary because it is abstract in QAbstractListModel. More...
 
 str
 Find a entry by key value pair. More...
 
 QVariant
 

Detailed Description

A list model providing a list of all registered OutputDevice instances.

This list model wraps OutputDeviceManager's list of OutputDevice instances. Additionally it provides a function to set OutputDeviceManager's active device.

Exposes the following roles:

  • id - The device ID
  • name - The human-readable name of the device
  • short_description - The short description of the device
  • description - The full description of the device
  • icon_name - The name of the icon used to identify the device
  • priority - The device priority

The documentation for this class was generated from the following file: