QGraphicsVideoItem

The QGraphicsVideoItem class provides a graphics item which display video produced by a QMediaObject . More

Inheritance diagram of PySide2.QtMultimediaWidgets.QGraphicsVideoItem

Synopsis

Functions

Signals

Detailed Description

Attaching a QGraphicsVideoItem to a QMediaObject allows it to display the video or image output of that media object. A QGraphicsVideoItem is attached to a media object by passing a pointer to the QMediaObject to the setMediaObject() function.

player = new QMediaPlayer(this);

QGraphicsVideoItem *item = new QGraphicsVideoItem;
player->setVideoOutput(item);
graphicsView->scene()->addItem(item);
graphicsView->show();

player->setMedia(QUrl("http://example.com/myclip4.ogv"));
player->play();

Note : Only a single display output can be attached to a media object at one time.

class QGraphicsVideoItem([parent=None])
param parent

QGraphicsItem

Constructs a graphics item that displays video.

The parent is passed to QGraphicsItem .

PySide2.QtMultimediaWidgets.QGraphicsVideoItem.aspectRatioMode()
Return type

AspectRatioMode

PySide2.QtMultimediaWidgets.QGraphicsVideoItem.nativeSize()
Return type

QSizeF

PySide2.QtMultimediaWidgets.QGraphicsVideoItem.nativeSizeChanged(size)
Parameters

sizeQSizeF

PySide2.QtMultimediaWidgets.QGraphicsVideoItem.offset()
Return type

QPointF

See also

setOffset()

PySide2.QtMultimediaWidgets.QGraphicsVideoItem.setAspectRatioMode(mode)
Parameters

modeAspectRatioMode

PySide2.QtMultimediaWidgets.QGraphicsVideoItem.setOffset(offset)
Parameters

offsetQPointF

See also

offset()

PySide2.QtMultimediaWidgets.QGraphicsVideoItem.setSize(size)
Parameters

sizeQSizeF

See also

size()

PySide2.QtMultimediaWidgets.QGraphicsVideoItem.size()
Return type

QSizeF

See also

setSize()