이 페이지에서

QVideoWidget Class

QVideoWidget 클래스는 미디어 객체가 생성한 동영상을 표시하는 위젯을 제공합니다. 더 보기...

헤더: #include <qvideowidget.h>
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();

참고: 한 번에 하나의 디스플레이 출력만 미디어 객체에 연결할 수 있습니다.

경고: 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)

알림 신호:

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 의 show 메서드를 처리합니다.

[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.