Skip to content

GraphicsVideoItem

Qt Base Class: QGraphicsVideoItem

Signature: QGraphicsVideoItem(self, parent: Optional[PySide6.QtWidgets.QGraphicsItem] = None) -> None

Base classes

Name Children Inherits
GraphicsObjectMixin
prettyqt.widgets.graphicsobject
QGraphicsVideoItem
PySide6.QtMultimediaWidgets
QGraphicsVideoItem(self, parent: Optional[PySide6.QtWidgets.QGraphicsItem] \= None) -> None

⋔ Inheritance diagram

graph TD
  1473573992928["multimediawidgets.GraphicsVideoItem"]
  1473293697024["widgets.GraphicsObjectMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473293706784["widgets.GraphicsItemMixin"]
  1473573987072["QtMultimediaWidgets.QGraphicsVideoItem"]
  1473365816752["QtWidgets.QGraphicsObject"]
  1473290795024["QtWidgets.QGraphicsItem"]
  1473291690208["Shiboken.Object"]
  1473288842240["QtCore.QObject"]
  1473293697024 --> 1473573992928
  1473299815024 --> 1473293697024
  140713234304496 --> 1473299815024
  1473293706784 --> 1473293697024
  140713234304496 --> 1473293706784
  1473573987072 --> 1473573992928
  1473365816752 --> 1473573987072
  1473290795024 --> 1473365816752
  1473291690208 --> 1473290795024
  140713234304496 --> 1473291690208
  1473288842240 --> 1473365816752
  1473291690208 --> 1473288842240

🛈 DocStrings

Bases: GraphicsObjectMixin, QGraphicsVideoItem

Source code in prettyqt\multimediawidgets\graphicsvideoitem.py
class GraphicsVideoItem(
    widgets.GraphicsObjectMixin, QtMultimediaWidgets.QGraphicsVideoItem
):
    def get_offset(self) -> core.PointF:
        return core.PointF(self.offset())

    def get_native_size(self) -> core.SizeF:
        return core.SizeF(self.nativeSize())

    def get_size(self) -> core.SizeF:
        return core.SizeF(self.size())

    def set_aspect_ratio_mode(
        self, mode: constants.AspectRatioModeStr | constants.AspectRatioMode
    ):
        """Set the aspect ratio mode.

        Args:
            mode: aspect ratio mode
        """
        self.setAspectRatioMode(constants.ASPECT_RATIO_MODE.get_enum_value(mode))

    def get_aspect_ratio_mode(self) -> constants.AspectRatioModeStr:
        """Return current aspect ratio mode.

        Returns:
            aspect ratio mode
        """
        return constants.ASPECT_RATIO_MODE.inverse[self.aspectRatioMode()]

get_aspect_ratio_mode() -> constants.AspectRatioModeStr

Return current aspect ratio mode.

Source code in prettyqt\multimediawidgets\graphicsvideoitem.py
def get_aspect_ratio_mode(self) -> constants.AspectRatioModeStr:
    """Return current aspect ratio mode.

    Returns:
        aspect ratio mode
    """
    return constants.ASPECT_RATIO_MODE.inverse[self.aspectRatioMode()]

set_aspect_ratio_mode(mode: constants.AspectRatioModeStr | constants.AspectRatioMode)

Set the aspect ratio mode.

Parameters:

Name Type Description Default
mode AspectRatioModeStr | AspectRatioMode

aspect ratio mode

required
Source code in prettyqt\multimediawidgets\graphicsvideoitem.py
def set_aspect_ratio_mode(
    self, mode: constants.AspectRatioModeStr | constants.AspectRatioMode
):
    """Set the aspect ratio mode.

    Args:
        mode: aspect ratio mode
    """
    self.setAspectRatioMode(constants.ASPECT_RATIO_MODE.get_enum_value(mode))

⌗ Property table

Qt Property Type Doc
objectName QString
parent QGraphicsObject
opacity double
enabled bool
visible bool
pos QPointF
x double
y double
z double
rotation double
scale double
transformOriginPoint QPointF
effect QGraphicsEffect
children QDeclarativeListProperty
width double
height double
aspectRatioMode Qt::AspectRatioMode
offset QPointF
size QSizeF
nativeSize QSizeF
videoSink QVideoSink