The QVideoWidget class provides a widget which presents video produced by a media object. 更多...
头: | #include <QVideoWidget> |
qmake: | QT += multimediawidgets |
继承: | QWidget and QMediaBindableInterface |
继承者: | QCameraViewfinder |
|
|
QVideoWidget (QWidget * parent = Q_NULLPTR) | |
~QVideoWidget () | |
Qt::AspectRatioMode | aspectRatioMode () const |
int | brightness () const |
int | contrast () const |
int | hue () const |
bool | isFullScreen () const |
int | saturation () const |
virtual QMediaObject * | mediaObject () const override |
virtual QSize | sizeHint () const override |
void | setAspectRatioMode (Qt::AspectRatioMode mode ) |
void | setBrightness (int brightness ) |
void | setContrast (int contrast ) |
void | setFullScreen (bool fullScreen ) |
void | setHue (int hue ) |
void | setSaturation (int saturation ) |
void | brightnessChanged (int brightness ) |
void | contrastChanged (int contrast ) |
void | fullScreenChanged (bool fullScreen ) |
void | hueChanged (int hue ) |
void | saturationChanged (int saturation ) |
virtual bool | event (QEvent * event ) override |
virtual void | hideEvent (QHideEvent * event ) override |
virtual void | moveEvent (QMoveEvent * event ) override |
virtual void | paintEvent (QPaintEvent * event ) override |
virtual void | resizeEvent (QResizeEvent * event ) override |
virtual void | showEvent (QShowEvent * event ) override |
The QVideoWidget class provides a widget which presents video produced by a media object.
Attaching a QVideoWidget 到 QMediaObject allows it to display the video or image output of that media object. A QVideoWidget is attached to media object by passing a pointer to the QMediaObject in its constructor, and detached by destroying the QVideoWidget .
player = new QMediaPlayer; playlist = new QMediaPlaylist(player); playlist->addMedia(QUrl("http://example.com/myclip1.mp4")); playlist->addMedia(QUrl("http://example.com/myclip2.mp4")); videoWidget = new QVideoWidget; player->setVideoOutput(videoWidget); videoWidget->show(); playlist->setCurrentIndex(1); player->play();
注意 :每次只可以把单个显示输出附加到媒体对象。
另请参阅 QMediaObject , QMediaPlayer ,和 QGraphicsVideoItem .
视频如何比例缩放根据其宽高比。
访问函数:
Qt::AspectRatioMode | aspectRatioMode () const |
void | setAspectRatioMode (Qt::AspectRatioMode mode ) |
This property holds an adjustment to the brightness of displayed video.
有效亮度值的范围在 -100 到 100 之间,默认为 0。
访问函数:
int | brightness () const |
void | setBrightness (int brightness ) |
通知程序信号:
void | brightnessChanged (int brightness ) |
This property holds an adjustment to the contrast of displayed video.
有效对比度值的范围在 -100 到 100 之间,默认为 0。
访问函数:
int | contrast () const |
void | setContrast (int contrast ) |
通知程序信号:
void | contrastChanged (int contrast ) |
This property holds whether video display is confined to a window or is fullScreen.
访问函数:
bool | isFullScreen () const |
bool | isFullScreen () const |
void | setFullScreen (bool fullScreen ) |
通知程序信号:
void | fullScreenChanged (bool fullScreen ) |
This property holds an adjustment to the hue of displayed video.
有效色相值的范围在 -100 到 100 之间,默认为 0。
访问函数:
int | hue () const |
void | setHue (int hue ) |
通知程序信号:
void | hueChanged (int hue ) |
此特性保持提供 Widget 显示视频的媒体对象。
访问函数:
virtual QMediaObject * | mediaObject () const override |
This property holds an adjustment to the saturation of displayed video.
有效饱和度值的范围在 -100 至 100 之间,默认为 0。
访问函数:
int | saturation () const |
void | setSaturation (int saturation ) |
通知程序信号:
void | saturationChanged (int saturation ) |
构造新视频小部件。
The parent 会被传递给 QWidget .
销毁视频小部件。
[signal]
void
QVideoWidget::
brightnessChanged
(
int
brightness
)
信号视频 Widget 的 brightness 调节已改变。
注意: 通知程序信号对于特性 brightness .
另请参阅 brightness ().
[signal]
void
QVideoWidget::
contrastChanged
(
int
contrast
)
信号视频 Widget 的 contrast 调节已改变。
注意: 通知程序信号对于特性 contrast .
另请参阅 contrast ().
[override virtual protected]
bool
QVideoWidget::
event
(
QEvent
*
event
)
重实现自 QObject::event ().
当前事件 event 。返回值为基类 QWidget::event ( QEvent *event) 函数。
[signal]
void
QVideoWidget::
fullScreenChanged
(
bool
fullScreen
)
信号 fullScreen 视频 Widget 模式已改变。
注意: 通知程序信号对于特性 fullScreen .
另请参阅 isFullScreen ().
[override virtual protected]
void
QVideoWidget::
hideEvent
(
QHideEvent
*
event
)
重实现自 QWidget::hideEvent ().
处理隐藏 event .
[signal]
void
QVideoWidget::
hueChanged
(
int
hue
)
信号视频 Widget 的 hue 已改变。
注意: 通知程序信号对于特性 hue .
另请参阅 hue ().
[override virtual protected]
void
QVideoWidget::
moveEvent
(
QMoveEvent
*
event
)
重实现自 QWidget::moveEvent ().
处理移动 event .
[override virtual protected]
void
QVideoWidget::
paintEvent
(
QPaintEvent
*
event
)
重实现自 QWidget::paintEvent ().
处理描绘 event .
[override virtual protected]
void
QVideoWidget::
resizeEvent
(
QResizeEvent
*
event
)
重实现自 QWidget::resizeEvent ().
处理重置尺寸 event .
[signal]
void
QVideoWidget::
saturationChanged
(
int
saturation
)
信号视频 Widget 的 saturation 已改变。
注意: 通知程序信号对于特性 saturation .
另请参阅 saturation ().
[override virtual protected]
void
QVideoWidget::
showEvent
(
QShowEvent
*
event
)
重实现自 QWidget::showEvent ().
处理展示 event .
[override virtual]
QSize
QVideoWidget::
sizeHint
() const
重实现自 QWidget::sizeHint ().
返回用于当前后端的大小提示 (若有一个的话),否则大小提示来自 QWidget .