IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QVideoWidget Class

The QVideoWidget class provides a widget which presents video produced by a media object.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QVideoWidget Class

  • Header: QVideoWidget

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS MultimediaWidgets)

    target_link_libraries(mytarget PRIVATE Qt6::MultimediaWidgets)

  • qmake: QT += multimediawidgets

  • Inherits: QWidget

  • Group: QVideoWidget is part of multimedia, multimedia_video

Detailed Description

Attaching a QVideoWidget to a QMediaPlayer or QCamera allows it to display the video or image output of that object.

 
Sélectionnez
player = new QMediaPlayer;
player->setSource(QUrl("http://example.com/myclip1.mp4"));

videoWidget = new QVideoWidget;
player->setVideoOutput(videoWidget);

videoWidget->show();
player->play();

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

See Also

Property Documentation

 

aspectRatioMode : Qt::AspectRatioMode

how video is scaled with respect to its aspect ratio.

Access functions:

  • aspectRatioMode() const

  • void setAspectRatioMode( mode)

Notifier signal:

  • void aspectRatioModeChanged( mode)

fullScreen : bool

This property holds whether video display is confined to a window or is fullScreen.

Access functions:

  • bool isFullScreen() const

  • bool isFullScreen() const

  • void setFullScreen(bool fullScreen)

Notifier signal:

  • void fullScreenChanged(bool fullScreen)

Member Function Documentation

 

[explicit] QVideoWidget::QVideoWidget(QWidget *parent = nullptr)

Constructs a new video widget.

The parent is passed to QWidget.

[virtual] QVideoWidget::~QVideoWidget()

Destroys a video widget.

[override virtual protected] bool QVideoWidget::event(QEvent *event)

Reimplements: QWidget::event(QEvent *event).

Current event event. Returns the value of the base class QWidget::event(QEvent *event) function.

[override virtual protected] void QVideoWidget::hideEvent(QHideEvent *event)

Reimplements: QWidget::hideEvent(QHideEvent *event).

Handles the hide event.

[override virtual protected] void QVideoWidget::moveEvent(QMoveEvent *event)

Reimplements: QWidget::moveEvent(QMoveEvent *event).

Handles the move event.

[override virtual protected] void QVideoWidget::resizeEvent(QResizeEvent *event)

Reimplements: QWidget::resizeEvent(QResizeEvent *event).

Handles the resize event.

[override virtual protected] void QVideoWidget::showEvent(QShowEvent *event)

Reimplements: QWidget::showEvent(QShowEvent *event).

Handles the show event.

[override virtual] QSize QVideoWidget::sizeHint() const

Reimplements an access function for property: QWidget::sizeHint.

Returns the size hint for the current back end, if there is one, or else the size hint from QWidget.

QVideoSink *QVideoWidget::videoSink() const

Returns the QVideoSink instance.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+