Home · All Classes · All Functions ·

QVideoWidget Class Reference

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

    #include <QVideoWidget>

This class is under development and is subject to change.

Inherits QWidget.


Public Types

enum AspectRatioMode { IgnoreAspectRatio, KeepAspectRatio }

Properties


Public Functions

QVideoWidget ( QMediaObject * object, QWidget * parent = 0 )
~QVideoWidget ()
AspectRatioMode aspectRatioMode () const
int brightness () const
int contrast () const
int hue () const
bool isFullScreen () const
int saturation () const

Reimplemented Public Functions

virtual QSize sizeHint () const

Public Slots

void setAspectRatioMode ( QVideoWidget::AspectRatioMode mode )
void setBrightness ( int brightness )
void setContrast ( int contrast )
void setFullScreen ( bool fullScreen )
void setHue ( int hue )
void setSaturation ( int saturation )

Signals

void brightnessChanged ( int brightness )
void contrastChanged ( int contrast )
void fullScreenChanged ( bool fullScreen )
void hueChanged ( int hue )
void saturationChanged ( int saturation )

Reimplemented Protected Functions

virtual void hideEvent ( QHideEvent * event )
virtual void moveEvent ( QMoveEvent * event )
virtual void paintEvent ( QPaintEvent * event )
virtual void resizeEvent ( QResizeEvent * event )
virtual void showEvent ( QShowEvent * event )

Additional Inherited Members


Detailed Description

The 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;

    widget = new QVideoWidget(player);
    widget->show();

    player->setMedia(QUrl("http://example.com/movie.mp4"));
    player->play();

Note: Only a single display output can be attached to a media object at one time.

See also QMediaObject, QMediaPlayer, and QGraphicsVideoItem.


Member Type Documentation

enum QVideoWidget::AspectRatioMode

Specfies how video is scaled with respect to its aspect ratio.

ConstantValueDescription
QVideoWidget::IgnoreAspectRatio0The video is scaled to fill the widget ignoring its aspect ratio.
QVideoWidget::KeepAspectRatio1The video is scaled to the largest rectangle that will fit within the widget's dimensions while still retaining its original aspect ratio.


Property Documentation

aspectRatioMode : AspectRatioMode

This property holds how video is scaled with respect to its aspect ratio.

Access functions:

AspectRatioMode aspectRatioMode () const
void setAspectRatioMode ( QVideoWidget::AspectRatioMode 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
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 )

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

QVideoWidget::QVideoWidget ( QMediaObject * object, QWidget * parent = 0 )

Constructs a new widget which displays video produced by a media object.

The parent is passed to QWidget.

QVideoWidget::~QVideoWidget ()

Destroys a video widget.

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

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

See also brightness.

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

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

See also contrast.

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

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

See also fullScreen.

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

Reimplemented from QWidget::hideEvent().

Handles the hide event.

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

Signals that a video widgets's hue has changed.

See also hue.

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

Reimplemented from QWidget::moveEvent().

Handles the move event.

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

Reimplemented from QWidget::paintEvent().

Handles the paint event.

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

Reimplemented from QWidget::resizeEvent().

Handles the resize event.

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

Signals that a video widgets's saturation has changed.

See also saturation.

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

Reimplemented from QWidget::showEvent().

Handles the show event.

QSize QVideoWidget::sizeHint () const   [virtual]

Reimplemented from QWidget::sizeHint().

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


Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies) Trademarks
Qt Mobility Project 1.0.0 (Technical Preview)