QVideoWidget Class▲
-
Header: QVideoWidget
-
qmake: QT += multimediawidgets
-
Inherits: QWidget and QMediaBindableInterface
-
Inherited By: QCameraViewfinder
-
Group: QVideoWidget is part of multimedia
Detailed Description▲
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-&
gt;addMedia(QUrl("http://example.com/myclip1.mp4"
));
playlist-&
gt;addMedia(QUrl("http://example.com/myclip2.mp4"
));
videoWidget =
new
QVideoWidget;
player-&
gt;setVideoOutput(videoWidget);
videoWidget-&
gt;show();
playlist-&
gt;setCurrentIndex(1
);
player-&
gt;play();
Note: Only a single display output can be attached to a media object at one time.
See Also▲
See also QMediaObject, QMediaPlayer, QGraphicsVideoItem
Property Documentation▲
aspectRatioMode : Qt::AspectRatioMode▲
how video is scaled with respect to its aspect ratio.
Access functions:
-
aspectRatioMode() const
-
void setAspectRatioMode( mode)
brightness : int▲
This property holds an adjustment to the brightness of displayed video.
Valid brightness values range between -100 and 100, the default is 0.
Access functions:
-
int brightness() const
-
void setBrightness(int brightness)
Notifier signal:
-
void brightnessChanged(int brightness)
contrast : int▲
This property holds an adjustment to the contrast of displayed video.
Valid contrast values range between -100 and 100, the default is 0.
Access functions:
-
int contrast() const
-
void setContrast(int contrast)
Notifier signal:
-
void contrastChanged(int contrast)
fullScreen : bool▲
This property holds whether video display is confined to a window or is fullScreen.
Access functions:
-
bool isFullScreen() const
-
bool isFullScreen() const
-
void setFullScreen(bool fullScreen)
Notifier signal:
-
void fullScreenChanged(bool fullScreen)
hue : int▲
This property holds an adjustment to the hue of displayed video.
Valid hue values range between -100 and 100, the default is 0.
Access functions:
-
int hue() const
-
void setHue(int hue)
Notifier signal:
-
void hueChanged(int hue)
mediaObject : QMediaObject* const▲
This property holds the media object which provides the video displayed by a widget.
Access functions:
-
virtual *mediaObject() const override
saturation : int▲
This property holds an adjustment to the saturation of displayed video.
Valid saturation values range between -100 and 100, the default is 0.
Access functions:
-
int saturation() const
-
void setSaturation(int saturation)
Notifier signal:
-
void saturationChanged(int saturation)
Member Function Documentation▲
[explicit] QVideoWidget::QVideoWidget(QWidget *parent = nullptr)▲
Constructs a new video widget.
The parent is passed to QWidget.
[virtual] QVideoWidget::~QVideoWidget()▲
Destroys a video widget.
void QVideoWidget::brightnessChanged(int brightness)▲
Signals that a video widgets's brightness adjustment has changed.
Notifier signal for property brightness.
See Also▲
See also brightness()
void QVideoWidget::contrastChanged(int contrast)▲
Signals that a video widgets's contrast adjustment has changed.
Notifier signal for property contrast.
See Also▲
See also contrast()
[override virtual protected] bool QVideoWidget::event(QEvent *event)▲
Reimplements: QWidget::event(QEvent *event).
Current event event. Returns the value of the baseclass QWidget::event(QEvent *event) function.
void QVideoWidget::fullScreenChanged(bool fullScreen)▲
Signals that the fullScreen mode of a video widget has changed.
Notifier signal for property fullScreen.
See Also▲
See also isFullScreen()
[override virtual protected] void QVideoWidget::hideEvent(QHideEvent *event)▲
Reimplements: QWidget::hideEvent(QHideEvent *event).
Handles the hide event.
void QVideoWidget::hueChanged(int hue)▲
Signals that a video widgets's hue has changed.
Notifier signal for property hue.
See Also▲
See also hue()
[override virtual protected] void QVideoWidget::moveEvent(QMoveEvent *event)▲
Reimplements: QWidget::moveEvent(QMoveEvent *event).
Handles the move event.
[override virtual protected] void QVideoWidget::paintEvent(QPaintEvent *event)▲
Reimplements: QWidget::paintEvent(QPaintEvent *event).
Handles the paint event.
[override virtual protected] void QVideoWidget::resizeEvent(QResizeEvent *event)▲
Reimplements: QWidget::resizeEvent(QResizeEvent *event).
Handles the resize event.
void QVideoWidget::saturationChanged(int saturation)▲
Signals that a video widgets's saturation has changed.
Notifier signal for property saturation.
See Also▲
See also saturation()
[override virtual protected] void QVideoWidget::showEvent(QShowEvent *event)▲
Reimplements: QWidget::showEvent(QShowEvent *event).
Handles the show event.
[override virtual] QSize QVideoWidget::sizeHint() const▲
Reimplements an access function for property: QWidget::sizeHint.
Returns the size hint for the current back end, if there is one, or else the size hint from QWidget.