Uranium
Application Framework
Loading...
Searching...
No Matches
UM.Settings.Models.SettingDefinitionsModel.SettingDefinitionsModel Class Reference

Model that provides a flattened list of the tree of SettingDefinition objects in a DefinitionContainer. More...

Inherits QAbstractListModel.

Public Member Functions

 __init__ (self, parent=None, *args, **kwargs)
 
 setShowAncestors (self, show_ancestors)
 
 showAncestors (self)
 
 setContainerId (self, container_id)
 Set the containerId property.
 
 containerId (self)
 The ID of the DefinitionContainer object this model exposes.
 
 setRootKey (self, key)
 Set the rootKey property.
 
 rootKey (self)
 The SettingDefinition to use as root for the list.
 
 setShowAll (self, show)
 Set the showAll property.
 
 showAll (self)
 Whether or not the model should show all definitions regardless of visibility.
 
 setVisibilityHandler (self, visibility_handler)
 Set the visibilityHandler property.
 
 visibilityHandler (self)
 An instance of SettingVisibilityHandler to use to determine which settings should be visible.
 
 setExclude (self, exclude)
 Set the exclude property.
 
 exclude (self)
 This property indicates which settings should never be visibile.
 
 setExpanded (self, expanded)
 Set the expanded property.
 
 expanded (self)
 This property indicates which settings should never be visibile.
 
 visibleCount (self)
 
 categoryCount (self)
 
 setFilter (self, filter_dict)
 Set the filter of this model based on a string.
 
 filter (self)
 
 expand (self, key)
 Show the children of a specified SettingDefinition.
 
 expandAll (self, key)
 Show the children of a specified SettingDefinition and all children of those settings as well.
 
 collapse (self, key)
 Hide the children of a specified SettingDefinition.
 
 show (self, key)
 Show a single SettingDefinition.
 
 hide (self, key)
 Hide a single SettingDefinition.
 
 setAllVisible (self, visible)
 
 setVisible (self, key, visible)
 Set a single SettingDefinition's visible state.
 
 getVisible (self, key)
 Get a single SettingDefinition's visible state.
 
 getIndex (self, key)
 
 getRequires (self, key, role=None)
 
 getRequiredBy (self, key, role=None)
 
 rowCount (self, parent=None)
 Reimplemented from QAbstractListModel Note that rowCount() is overridden from QAbstractItemModel.
 
 data (self, index, role)
 Reimplemented from QAbstractListModel.
 
 roleNames (self)
 Reimplemented from QAbstractListModel.
 
 forceUpdate (self)
 Force updating the model.
 

Static Public Attributes

int KeyRole = Qt.UserRole + 1
 
int DepthRole = Qt.UserRole + 2
 
int VisibleRole = Qt.UserRole + 3
 
int ExpandedRole = Qt.UserRole + 4
 
 showAncestorsChanged = pyqtSignal()
 Emitted whenever the showAncestors property changes.
 
 containerIdChanged = pyqtSignal()
 Emitted whenever the containerId property changes.
 
 rootKeyChanged = pyqtSignal()
 Emitted when the rootKey property changes.
 
 showAllChanged = pyqtSignal()
 Emitted when the showAll property changes.
 
 visibilityChanged = pyqtSignal()
 
 visibilityHandlerChanged = pyqtSignal()
 Emitted whenever the visibilityHandler property changes.
 
 excludeChanged = pyqtSignal()
 Emitted whenever the exclude property changes.
 
 expandedChanged = pyqtSignal()
 Emitted whenever the exclude property changes.
 
 visibleCountChanged = pyqtSignal()
 
 filterChanged = pyqtSignal()
 

Protected Member Functions

 _onVisibilityChanged (self)
 
 _update (self)
 
 _updateVisibleRows (self)
 
 _isDefinitionVisible (self, definition, **kwargs)
 
 _isAnyDescendantFiltered (self, definition)
 
 _isAnyDescendantVisible (self, definition)
 
 _findRowToInsert (self, index)
 

Protected Attributes

 _container_id
 
 _container
 
 _i18n_catalog
 
 _root_key
 
 _root
 
 _definition_list
 
 _row_index_list
 
 _expanded
 
 _visible
 
 _exclude
 
 _show_all
 
 _show_ancestors
 
 _visibility_handler
 
 _filter_dict
 
 _role_names
 
 _onVisibilityChanged
 

Detailed Description

Model that provides a flattened list of the tree of SettingDefinition objects in a DefinitionContainer.

This model exposes the tree of SettingDefinition objects in a DefinitionContainer as a list of settings. It uses two lists, one is the list of definitions which directly corresponds with the flattened contents of the DefinitionContainer. The other is a list matching rows in the model to indexes in the list of settings. This list can be quite a bit shorter than the list of definitions since all visibility criteria are applied.

Member Function Documentation

◆ rowCount()

UM.Settings.Models.SettingDefinitionsModel.SettingDefinitionsModel.rowCount (   self,
  parent = None 
)

Reimplemented from QAbstractListModel Note that rowCount() is overridden from QAbstractItemModel.

The signature of the method in that class is "int rowCount(const QModelIndex& parent)" which makes this slot declaration incorrect. TODO: fix the pointer when actually using this parameter.

◆ setFilter()

UM.Settings.Models.SettingDefinitionsModel.SettingDefinitionsModel.setFilter (   self,
  filter_dict 
)

Set the filter of this model based on a string.

Parameters
filter_dictDictionary to do the filtering by.

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