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

Public Member Functions

None __init__ (self, parent=None)
None setContainerStack (self, Optional[ContainerStack] stack)
None setContainerStackId (self, str stack_id)
str containerStackId (self)
Optional[ContainerInterfacecontainerStack (self)
None setRemoveUnusedValue (self, bool remove_unused_value)
bool removeUnusedValue (self)
None setWatchedProperties (self, List[str] properties)
List[str] watchedProperties (self)
None setKey (self, str key)
 key (self)
 properties (self)
 forcePropertiesChanged (self)
 setStoreIndex (self, index)
 storeIndex (self)
 stackLevels (self)
 setPropertyValue (self, property_name, property_value)
Any getPropertyValue (self, str property_name, int stack_level)
str getPropertyValueAsString (self, str property_name)
None removeFromContainer (self, int index)
bool isValueUsed (self)

Static Public Attributes

 containerStackIdChanged = pyqtSignal()
 containerStackChanged = pyqtSignal()
 removeUnusedValueChanged = pyqtSignal()
 watchedPropertiesChanged = pyqtSignal()
 keyChanged = pyqtSignal()
 propertiesChanged = pyqtSignal()
 storeIndexChanged = pyqtSignal()
 stackLevelChanged = pyqtSignal()
 isValueUsedChanged = pyqtSignal()

Protected Member Functions

None _onPropertiesChanged (self, str key, List[str] property_names)
 _update (self, container=None)
None _updateDelayed (self, container=None)
 _containersChanged (self, container=None)
 _storeIndexChanged (self)
None _updateStackLevels (self)
 _getPropertyValue (self, property_name)

Protected Attributes

 _property_map = QQmlPropertyMap(self)
 _stack = None
str _key = ""
 _relations = set()
list _watched_properties = []
int _store_index = 0
int _value_used = None
list _stack_levels = []
bool _remove_unused_value = True
 _validator = None
 _update_timer = QTimer(self)
 _update
 _storeIndexChanged
 _onPropertiesChanged
 _containersChanged

Detailed Description

This class provides the value and change notifications for the properties of a single setting

Since setting values and other properties are provided by a stack, we need some way to
query the stack from QML to provide us with those values. This class takes care of that.

This class provides the property values through QObject dynamic properties so that they
are available from QML.

Member Function Documentation

◆ _updateStackLevels()

None UM.Settings.Models.SettingPropertyProvider.SettingPropertyProvider._updateStackLevels ( self)
protected
Updates the self._stack_levels field, which indicates at which levels in the stack the property is set.

◆ containerStackId()

str UM.Settings.Models.SettingPropertyProvider.SettingPropertyProvider.containerStackId ( self)
The ID of the container stack we should query for property values.

◆ getPropertyValue()

Any UM.Settings.Models.SettingPropertyProvider.SettingPropertyProvider.getPropertyValue ( self,
str property_name,
int stack_level )
Manually request the value of a property.
The most notable difference with the properties is that you have more control over at what point in the stack
you want the setting to be retrieved (instead of always taking the top one)

:param property_name: The name of the property to get the value from.
:param stack_level: the index of the container to get the value from.

◆ key()

UM.Settings.Models.SettingPropertyProvider.SettingPropertyProvider.key ( self)
The key of the setting that we should provide property values for.

◆ setContainerStackId()

None UM.Settings.Models.SettingPropertyProvider.SettingPropertyProvider.setContainerStackId ( self,
str stack_id )
Set the containerStackId property.

◆ setKey()

None UM.Settings.Models.SettingPropertyProvider.SettingPropertyProvider.setKey ( self,
str key )
Set the key property.

◆ setPropertyValue()

UM.Settings.Models.SettingPropertyProvider.SettingPropertyProvider.setPropertyValue ( self,
property_name,
property_value )
Set the value of a property.

:param stack_index: At which level in the stack should this property be set?
:param property_name: The name of the property to set.
:param property_value: The value of the property to set.

◆ setWatchedProperties()

None UM.Settings.Models.SettingPropertyProvider.SettingPropertyProvider.setWatchedProperties ( self,
List[str] properties )
Set the watchedProperties property.

◆ stackLevels()

UM.Settings.Models.SettingPropertyProvider.SettingPropertyProvider.stackLevels ( self)
At what levels in the stack does the value(s) for this setting occur?

◆ watchedProperties()

List[str] UM.Settings.Models.SettingPropertyProvider.SettingPropertyProvider.watchedProperties ( self)
A list of property names that should be watched for changes.

The documentation for this class was generated from the following file:
  • UM/Settings/Models/SettingPropertyProvider.py