Uranium
Application Framework
|
Model that holds instance containers. More...
Public Member Functions | |
__init__ (self, parent=None) | |
setSectionProperty (self, property_name) | |
sectionProperty (self) | |
None | setFilter (self, Dict[str, str] filter_dict) |
Set the filter of this model based on a string. | |
Dict[str, str] | filter (self) |
setFilterList (self, filter_list) | |
Set a list of filters to use when fetching containers. | |
filterList (self) | |
rename (self, instance_id, new_name) | |
getFileNameFilters (self, io_type) | |
Gets a list of the possible file filters that the plugins have registered they can read or write. | |
getDefaultPath (self) | |
exportProfile (self, instance_id, file_url, file_type) | |
importProfile (self, file_url) | |
![]() | |
__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. | |
Public Attributes | |
NameRole | |
IdRole | |
MetaDataRole | |
ReadOnlyRole | |
SectionRole | |
Static Public Attributes | |
int | NameRole = Qt.UserRole + 1 |
int | IdRole = Qt.UserRole + 2 |
int | MetaDataRole = Qt.UserRole + 3 |
int | ReadOnlyRole = Qt.UserRole + 4 |
int | SectionRole = Qt.UserRole + 5 |
sectionPropertyChanged = pyqtSignal() | |
filterChanged = pyqtSignal() | |
![]() | |
itemsChanged = pyqtSignal() | |
Protected Member Functions | |
_onContainerChanged (self, container) | |
Handler for container added / removed events from registry. | |
_update (self) | |
Private convenience function to reset & repopulate the model. | |
_recomputeItems (self) | |
Computes the items that need to be in this list model. | |
Tuple[Dict[str, InstanceContainer], Dict[str, Dict[str, Any]]] | _fetchInstanceContainers (self) |
Fetch the list of containers to display. | |
_getIOPlugins (self, io_type) | |
Gets a list of profile reader or writer plugins. | |
_sortKey (self, item) | |
_updateMetaData (self, container) | |
_onContainerLoadComplete (self, container_id) | |
If a container has loaded fully (rather than just metadata) we need to move it from the dict of metadata to the dict of full containers. | |
Protected Attributes | |
_instance_containers | |
_instance_containers_metadata | |
_section_property | |
_onContainerChanged | |
_onContainerLoadComplete | |
_container_change_timer | |
_update | |
_filter_dicts | |
_updateMetaData | |
![]() | |
_items | |
_role_names | |
Model that holds instance containers.
By setting the filter property the instances held by this model can be changed.
UM.Settings.Models.InstanceContainersModel.InstanceContainersModel.__init__ | ( | self, | |
parent = None |
|||
) |
Reimplemented from UM.Qt.ListModel.ListModel.
|
protected |
Fetch the list of containers to display.
This method is intended to be overridable by subclasses.
|
protected |
Gets a list of profile reader or writer plugins.
|
protected |
Computes the items that need to be in this list model.
This does not set the items in the list itself. It is intended to be overwritten by subclasses that add their own roles to the model.
UM.Settings.Models.InstanceContainersModel.InstanceContainersModel.getFileNameFilters | ( | self, | |
io_type | |||
) |
Gets a list of the possible file filters that the plugins have registered they can read or write.
The convenience meta-filters "All Supported Types" and "All Files" are added when listing readers, but not when listing writers.
io_type | str name of the needed IO type |
None UM.Settings.Models.InstanceContainersModel.InstanceContainersModel.setFilter | ( | self, | |
Dict[str, str] | filter_dict | ||
) |
Set the filter of this model based on a string.
filter_dict | Dict Dictionary to do the filtering by. |
UM.Settings.Models.InstanceContainersModel.InstanceContainersModel.setFilterList | ( | self, | |
filter_list | |||
) |
Set a list of filters to use when fetching containers.
filter_list | List[Dict] List of filter dicts to fetch multiple sets of containers. The final result is the union of these sets. |