QVideoWidget 类

QVideoWidget class provides a widget which presents video produced by a media object. 更多...

Header: #include <QVideoWidget>
qmake: QT += multimediawidgets
继承: QWidget and QMediaBindableInterface
继承者:

QCameraViewfinder

特性

公共函数

QVideoWidget (QWidget * parent = nullptr)
virtual ~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 )

静态公共成员

const QMetaObject staticMetaObject

重实现保护函数

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

Protected Variables

QVideoWidgetPrivate * d_ptr

额外继承成员

详细描述

QVideoWidget class provides a widget which presents video produced by a media object.

Attaching a QVideoWidget to a 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 .

特性文档编制

aspectRatioMode : Qt::AspectRatioMode

视频如何比例缩放根据其宽高比。

访问函数:

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

brightness : int

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 )

contrast : int

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 )

fullScreen : bool

This property holds whether video display is confined to a window or is fullScreen.

访问函数:

bool isFullScreen () const
void setFullScreen (bool fullScreen )

通知信号:

void fullScreenChanged (bool fullScreen )

hue : int

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 )

mediaObject : QMediaObject * const

This property holds the media object which provides the video displayed by a widget.

访问函数:

virtual QMediaObject * mediaObject () const override

saturation : int

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 )

成员函数文档编制

QVideoWidget:: QVideoWidget ( QWidget * parent = nullptr)

构造新视频小部件。

parent 会被传递给 QWidget .

[virtual] QVideoWidget:: ~QVideoWidget ()

销毁视频小部件。

[signal] void QVideoWidget:: brightnessChanged ( int brightness )

Signals that a video widgets's brightness adjustment has changed.

注意: 通知信号为特性 brightness .

另请参阅 brightness ().

[signal] void QVideoWidget:: contrastChanged ( int contrast )

Signals that a video widgets's contrast adjustment has changed.

注意: 通知信号为特性 contrast .

另请参阅 contrast ().

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

Reimplemented from QWidget::event ().

当前事件 event . Returns the value of the baseclass QWidget::event ( QEvent *event) function.

[signal] void QVideoWidget:: fullScreenChanged ( bool fullScreen )

Signals that the fullScreen mode of a video widget has changed.

注意: 通知信号为特性 fullScreen .

另请参阅 isFullScreen ().

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

Reimplemented from QWidget::hideEvent ().

处理隐藏 event .

[signal] void QVideoWidget:: hueChanged ( int hue )

Signals that a video widgets's hue 已改变。

注意: 通知信号为特性 hue .

另请参阅 hue ().

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

Reimplemented from QWidget::moveEvent ().

处理移动 event .

[override virtual protected] void QVideoWidget:: paintEvent ( QPaintEvent * event )

Reimplemented from QWidget::paintEvent ().

处理描绘 event .

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

Reimplemented from QWidget::resizeEvent ().

处理重置尺寸 event .

[signal] void QVideoWidget:: saturationChanged ( int saturation )

Signals that a video widgets's saturation 已改变。

注意: 通知信号为特性 saturation .

另请参阅 saturation ().

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

Reimplemented from QWidget::showEvent ().

处理展示 event .

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

Reimplemented from QWidget::sizeHint ().

Returns the size hint for the current back end, if there is one, or else the size hint from QWidget .