QVideoWidget Class
QVideoWidget クラスは、メディアオブジェクトによって生成されたビデオを表示するウィジェットを提供します。詳細...
| ヘッダー: | #include <qvideowidget.h> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS MultimediaWidgets) target_link_libraries(mytarget PRIVATE Qt6::MultimediaWidgets) |
| qmake: | QT += multimediawidgets |
| 継承元: | QWidget |
プロパティ
- aspectRatioMode : Qt::AspectRatioMode
- fullScreen : bool
パブリック関数
| 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 つの表示出力しかアタッチできません。
警告: QVideoWidget は 、eglfs プラットフォームプラグインではサポートされていません。
関連項目: QCamera 、QMediaPlayer 、および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) |
Notifierシグナル:
| void | fullScreenChanged(bool fullScreen) |
メンバ関数のドキュメント
[explicit] QVideoWidget::QVideoWidget(QWidget *parent = nullptr)
新しいビデオウィジェットを作成します。
parent がQWidget に渡されます。
[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) を再実装します。
event の表示処理を行います。
[override virtual] QSize QVideoWidget::sizeHint() const
プロパティ「QWidget::sizeHint 」のアクセス関数を再実装します。
現在のバックエンドのサイズヒントが存在する場合はそれを返し、存在しない場合はQWidget からのサイズヒントを返します。
[invokable] QVideoSink *QVideoWidget::videoSink() const
QVideoSink のインスタンスを返します。
注:この関数は 、メタオブジェクトシステムを介して、またはQMLから呼び出すことができます。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.