Skip to content

QmlPropertyMap

Qt Base Class: QQmlPropertyMap

Signature: QQmlPropertyMap(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None

Base classes

Name Children Inherits
QmlPropertyMapMixin
prettyqt.qml.qmlpropertymap
QQmlPropertyMap
PySide6.QtQml
QQmlPropertyMap(self, parent: Optional[PySide6.QtCore.QObject] \= None) -> None
MutableMapping
collections.abc
A MutableMapping is a generic container for associating

⋔ Inheritance diagram

graph TD
  1473572311088["qml.QmlPropertyMap"]
  1473572324752["qml.QmlPropertyMapMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473572260336["QtQml.QQmlPropertyMap"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473222543776["abc.MutableMapping"]
  1473222540848["abc.Mapping"]
  1473222211728["abc.Collection"]
  1473222226368["abc.Sized"]
  1473222223440["abc.Iterable"]
  1473222220512["abc.Container"]
  1473572324752 --> 1473572311088
  1473299815024 --> 1473572324752
  140713234304496 --> 1473299815024
  1473572260336 --> 1473572311088
  1473288842240 --> 1473572260336
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208
  1473222543776 --> 1473572311088
  1473222540848 --> 1473222543776
  1473222211728 --> 1473222540848
  1473222226368 --> 1473222211728
  140713234304496 --> 1473222226368
  1473222223440 --> 1473222211728
  140713234304496 --> 1473222223440
  1473222220512 --> 1473222211728
  140713234304496 --> 1473222220512

🛈 DocStrings

Bases: QmlPropertyMapMixin, QQmlPropertyMap, MutableMapping

Allows you to set key-value pairs that can be used in QML bindings.

Source code in prettyqt\qml\qmlpropertymap.py
class QmlPropertyMap(
    QmlPropertyMapMixin,
    QtQml.QQmlPropertyMap,
    MutableMapping,
    metaclass=datatypes.QABCMeta,
):
    """Allows you to set key-value pairs that can be used in QML bindings."""

    def __repr__(self):
        return get_repr(self, dict(self))

    def __setitem__(self, key: str, value: datatypes.Variant):
        self.insert(key, value)

    def __getitem__(self, key: str) -> datatypes.Variant:
        if not self.contains(key):
            raise KeyError(key)
        return self.value(key)

    def __delitem__(self, key: str):
        self.clear(key)

    def __contains__(self, key):
        return self.contains(key)

    def __bool__(self):
        return not self.isEmpty()

    def __iter__(self):
        return iter(self.keys())

⌗ Property table

Qt Property Type Doc
objectName QString