Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QMediaProgressLabel Class Reference
[QtMediaModule]

The QMediaProgressLabel class displays the current progress of a playing media content as a text label. More...

    #include <QMediaProgressLabel>

Inherits QWidget.

Public Types

Public Functions

Public Slots

Additional Inherited Members


Detailed Description

The QMediaProgressLabel class displays the current progress of a playing media content as a text label.

The QMediaProgressLabel class can be used in conjunction with the QMediaContent class to display the playback progress of a media content object.

    QMediaProgressLabel *label = new QMediaProgressLabel( this );
    label->setProgressType( QMediaProgressLabel::ElapsedTotalTime );

    QMediaContent *content = new QMediaContent( url, this );
    label->setMediaContent( content );

Alternatively the progress can be set directly using the setElapsed() and setTotal() slots. For example, the QMediaSeekWidget class emits positionChanged() and lengthChanged() signals during a seek. Connect the QMediaSeekWidget signals to the QMediaProgressLabel slots to display the current seek position as the user performs a seek.

    QMediaProgressLabel *label = new QMediaProgressLabel( this );

    QMediaSeekWidget *seek = new QMediaSeekWidget( this );
    connect( seek, SIGNAL(positionChanged(quint32)),
        label, SLOT(setElapsed(quint32)) );
    connect( seek, SIGNAL(lengthChanged(quint32)),
        label, SLOT(setTotal(quint32)) );

    QMediaContent *content = new QMediaContent( url, this );
    seek->setMediaContent( content );

The progress display type can be set either by the constructor or by the setProgressType() method.

"QMediaProgressLabel"

QMediaProgressLabel is a player object.


Member Type Documentation

enum QMediaProgressLabel::Type

This enum type specifies progress display formats.

ConstantValueDescription
QMediaProgressLabel::ElapsedTime0Displays the elapsed time with the format 0:00.
QMediaProgressLabel::ElapsedTotalTime1Displays the elapsed and total time with the format 0:00 / 0:00.
QMediaProgressLabel::RemainingTime2Displays the remaining time with the format -0:00.


Member Function Documentation

QMediaProgressLabel::QMediaProgressLabel ( Type type = ElapsedTime, QWidget * parent = 0 )

Constructs a progress label with the format type. Elapsed and total time are initialized to 0:00.

The parent argument is passed to the QWidget constructor.

QMediaProgressLabel::~QMediaProgressLabel ()

Destroys the label.

QMediaContent * QMediaProgressLabel::content () const

Returns the media content object currently being watched.

Type QMediaProgressLabel::progressType () const

Returns the current progress type.

See also setProgressType().

void QMediaProgressLabel::setElapsed ( quint32 ms )   [slot]

Sets the elapsed time to ms in milliseconds.

Calling this method should not be necessary if a media content is set.

void QMediaProgressLabel::setMediaContent ( QMediaContent * content )   [slot]

Sets content as the media content object to watch.

void QMediaProgressLabel::setProgressType ( Type type )

The type sets kind of progress to display.

See also progressType().

void QMediaProgressLabel::setTotal ( quint32 ms )   [slot]

Sets the total time to ms in milliseconds.

Calling this method should not be necessary if a media content is set.


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3