QVideoWidget Class

QVideoWidgetクラスは、メディアオブジェクトによって生成されたビデオを提示するウィジェットを提供します。詳細...

ヘッダ #include <QVideoWidget>
CMake: find_package(Qt6 REQUIRED COMPONENTS MultimediaWidgets)
target_link_libraries(mytarget PRIVATE Qt6::MultimediaWidgets)
qmake: QT += multimediawidgets
継承: QWidget

プロパティ

パブリック関数

QVideoWidget(QWidget *parent = nullptr)
virtual ~QVideoWidget() override
Qt::AspectRatioMode aspectRatioMode() const
bool isFullScreen() const
QVideoSink *videoSink() const

再実装パブリック関数

virtual QSize sizeHint() const override

パブリック・スロット

void setAspectRatioMode(Qt::AspectRatioMode mode)
void setFullScreen(bool fullScreen)

シグナル

void aspectRatioModeChanged(Qt::AspectRatioMode mode)
void fullScreenChanged(bool fullScreen)

再実装された保護された関数

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

詳細説明

QVideoWidget をQMediaPlayer またはQCamera に取り付けると、そのオブジェクトのビデオまたは画像出力を表示できます。

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

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

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

注意: メディア・オブジェクトに一度にアタッチできるのは、1つの表示出力のみです。

QCameraQMediaPlayer 、およびQGraphicsVideoItemも参照してください

プロパティ・ドキュメント

aspectRatioMode : Qt::AspectRatioMode

ビデオのアスペクト比をどのようにスケーリングするか。

アクセス機能

Qt::AspectRatioMode aspectRatioMode() const
void setAspectRatioMode(Qt::AspectRatioMode mode)

通知信号:

void aspectRatioModeChanged(Qt::AspectRatioMode mode)

fullScreen : bool

このプロパティは、ビデオ表示がウィンドウに限定されているか、フルスクリーンであるかを保持する。

アクセス関数

bool isFullScreen() const
void setFullScreen(bool fullScreen)

通知シグナル

void fullScreenChanged(bool fullScreen)

メンバ関数ドキュメント

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

新しい動画ウィジェットを構築する。

parentQWidget に渡される。

[override virtual noexcept] QVideoWidget::~QVideoWidget()

ビデオウィジェットを破壊する。

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

再実装:QWidget::event(QEvent *event)。

現在のイベントevent 。基本クラスQWidget::event(QEvent *event)関数の値を返します。

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

再実装:QWidget::hideEvent(QHideEvent *event)。

非表示event を処理します。

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

再実装:QWidget::moveEvent(QMoveEvent *event)。

移動event を処理します。

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

再実装:QWidget::resizeEvent(QResizeEvent *event)。

event のリサイズを処理します。

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

再実装:QWidget::showEvent(QShowEvent *event)。

showevent を処理します。

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

プロパティのアクセス関数を再インプリメントする:QWidget::sizeHint

現在のバックエンドのサイズヒントがあればそれを返し、なければQWidget からサイズヒントを返します。

[invokable] QVideoSink *QVideoWidget::videoSink() const

QVideoSink のインスタンスを返します。

注意: この関数はメタオブジェクトシステムやQMLから呼び出すことができます。Q_INVOKABLE を参照してください。

© 2025 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.