Skip to content

QuickItemMixin

Base classes

Name Children Inherits
ObjectMixin
prettyqt.core.object
QmlParserStatusMixin
prettyqt.qml.qmlparserstatus

Subclasses

Class Module Description
QuickItem prettyqt.quick.quickitem
QuickPaintedItem prettyqt.quick.quickpainteditem

⋔ Inheritance diagram

graph TD
  1473374484768["quick.QuickItemMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473572323776["qml.QmlParserStatusMixin"]
  1473299815024 --> 1473374484768
  140713234304496 --> 1473299815024
  1473572323776 --> 1473374484768
  140713234304496 --> 1473572323776

🛈 DocStrings

Bases: ObjectMixin, QmlParserStatusMixin

Source code in prettyqt\quick\quickitem.py
class QuickItemMixin(core.ObjectMixin, qml.QmlParserStatusMixin):
    def __getitem__(self, index: tuple[int, int]) -> QtQuick.QQuickItem:
        return self.childAt(*index)

    def __contains__(self, item: core.QPointF):
        return self.contains(item)

    def get_children_rect(self) -> core.RectF:
        return core.RectF(self.childrenRect())

    def get_cursor(self) -> gui.Cursor:
        return gui.Cursor(self.cursor())

    def get_flags(self):
        pass

    def set_transform_origin(
        self, origin: TransformOriginStr | QtQuick.QQuickItem.TransformOrigin
    ):
        """Set the origin point around which scale and rotation transform.

        The default is "center".

        Args:
            origin: transform origin to use
        """
        self.setTransformOrigin(TRANSFORM_ORIGIN.get_enum_value(origin))

    def get_transform_origin(self) -> TransformOriginStr:
        """Return the render type of text-like elements in Qt Quick.

        Returns:
            transform origin
        """
        return TRANSFORM_ORIGIN.inverse[self.transformOrigin()]

    def set_size(self, size: core.QSize | datatypes.SizeFType):
        self.setSize(datatypes.to_sizef(size))

get_transform_origin() -> TransformOriginStr

Return the render type of text-like elements in Qt Quick.

Source code in prettyqt\quick\quickitem.py
def get_transform_origin(self) -> TransformOriginStr:
    """Return the render type of text-like elements in Qt Quick.

    Returns:
        transform origin
    """
    return TRANSFORM_ORIGIN.inverse[self.transformOrigin()]

set_transform_origin(origin: TransformOriginStr | QtQuick.QQuickItem.TransformOrigin)

Set the origin point around which scale and rotation transform.

The default is "center".

Parameters:

Name Type Description Default
origin TransformOriginStr | TransformOrigin

transform origin to use

required
Source code in prettyqt\quick\quickitem.py
def set_transform_origin(
    self, origin: TransformOriginStr | QtQuick.QQuickItem.TransformOrigin
):
    """Set the origin point around which scale and rotation transform.

    The default is "center".

    Args:
        origin: transform origin to use
    """
    self.setTransformOrigin(TRANSFORM_ORIGIN.get_enum_value(origin))