QVideoWidget Class
A classe QVideoWidget fornece um widget que exibe vídeos produzidos por um objeto de mídia. Mais...
| Cabeçalho: | #include <qvideowidget.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS MultimediaWidgets) target_link_libraries(mytarget PRIVATE Qt6::MultimediaWidgets) |
| qmake: | QT += multimediawidgets |
| Herdado de: | QWidget |
Propriedades
- aspectRatioMode : Qt::AspectRatioMode
- fullScreen : bool
Funções públicas
| QVideoWidget(QWidget *parent = nullptr) | |
| virtual | ~QVideoWidget() override |
| Qt::AspectRatioMode | aspectRatioMode() const |
| bool | isFullScreen() const |
| QVideoSink * | videoSink() const |
Funções públicas reimplementadas
| virtual QSize | sizeHint() const override |
Slots públicos
| void | setAspectRatioMode(Qt::AspectRatioMode mode) |
| void | setFullScreen(bool fullScreen) |
Sinais
| void | aspectRatioModeChanged(Qt::AspectRatioMode mode) |
| void | fullScreenChanged(bool fullScreen) |
Funções protegidas reimplementadas
| virtual bool | event(QEvent *event) override |
| virtual void | hideEvent(QHideEvent *event) override |
| virtual void | moveEvent(QMoveEvent *event) override |
| virtual void | resizeEvent(QResizeEvent *event) override |
| virtual void | showEvent(QShowEvent *event) override |
Descrição detalhada
Ao associar um QVideoWidget a um QMediaPlayer ou QCamera, ele passa a exibir a saída de vídeo ou imagem desse objeto.
player = new QMediaPlayer;
player->setSource(QUrl("http://example.com/myclip1.mp4"));
videoWidget = new QVideoWidget;
player->setVideoOutput(videoWidget);
videoWidget->show();
player->play();Observação: Apenas uma saída de exibição pode ser associada a um objeto de mídia por vez.
Aviso: O QVideoWidget não é compatível com o plug-in da plataforma eglfs.
Veja também QCamera, QMediaPlayer e QGraphicsVideoItem.
Documentação das propriedades
aspectRatioMode : Qt::AspectRatioMode
como o vídeo é redimensionado em relação à sua proporção.
Funções de acesso:
| Qt::AspectRatioMode | aspectRatioMode() const |
| void | setAspectRatioMode(Qt::AspectRatioMode mode) |
Sinal do Notifier:
| void | aspectRatioModeChanged(Qt::AspectRatioMode mode) |
fullScreen : bool
Essa propriedade indica se a exibição do vídeo está restrita a uma janela ou se está em tela cheia.
Funções de acesso:
| bool | isFullScreen() const |
| void | setFullScreen(bool fullScreen) |
Sinal do Notifier:
| void | fullScreenChanged(bool fullScreen) |
Documentação das funções de membro
[explicit] QVideoWidget::QVideoWidget(QWidget *parent = nullptr)
Cria um novo widget de vídeo.
O objeto ` parent ` é passado para ` QWidget`.
[override virtual noexcept] QVideoWidget::~QVideoWidget()
Destrói um widget de vídeo.
[override virtual protected] bool QVideoWidget::event(QEvent *event)
Reimplementa: QWidget::event(QEvent *event).
event do evento atual. Retorna o valor da função QWidget::event(QEvent *event) da classe base.
[override virtual protected] void QVideoWidget::hideEvent(QHideEvent *event)
Reimplementa: QWidget::hideEvent(QHideEvent *event).
Lida com o evento de ocultação event.
[override virtual protected] void QVideoWidget::moveEvent(QMoveEvent *event)
Reimplementa: QWidget::moveEvent(QMoveEvent *event).
Lida com o movimento event.
[override virtual protected] void QVideoWidget::resizeEvent(QResizeEvent *event)
Reimplementa: QWidget::resizeEvent(QResizeEvent *event).
Lida com o redimensionamento event.
[override virtual protected] void QVideoWidget::showEvent(QShowEvent *event)
Reimplementa: QWidget::showEvent(QShowEvent *event).
Lida com o evento event.
[override virtual] QSize QVideoWidget::sizeHint() const
Reimplementa uma função de acesso para a propriedade: QWidget::sizeHint.
Retorna a sugestão de tamanho para o back-end atual, se houver, ou, caso contrário, a sugestão de tamanho de QWidget.
[invokable] QVideoSink *QVideoWidget::videoSink() const
Retorna a instância de ` QVideoSink `.
Observação: essa função pode ser chamada por meio do sistema de metaobjetos e a partir do QML. Consulte Q_INVOKABLE.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.