Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QMediaProgressLabel class displays the current progress of a playing media content as a text label. More...
#include <QMediaProgressLabel>
Inherits QWidget.
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 is a player object.
This enum type specifies progress display formats.
Constant | Value | Description |
---|---|---|
QMediaProgressLabel::ElapsedTime | 0 | Displays the elapsed time with the format 0:00. |
QMediaProgressLabel::ElapsedTotalTime | 1 | Displays the elapsed and total time with the format 0:00 / 0:00. |
QMediaProgressLabel::RemainingTime | 2 | Displays the remaining time with the format -0:00. |
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.
Destroys the label.
Returns the media content object currently being watched.
Returns the current progress type.
See also setProgressType().
Sets the elapsed time to ms in milliseconds.
Calling this method should not be necessary if a media content is set.
Sets content as the media content object to watch.
The type sets kind of progress to display.
See also progressType().
Sets the total time to ms in milliseconds.
Calling this method should not be necessary if a media content is set.
Copyright © 2009 Nokia | Trademarks | Qt Extended 4.4.3 |