QMediaImageViewer Class ReferenceThe QMediaImageViewer class provides a means of viewing image media. More... #include <QMediaImageViewer> This class is under development and is subject to change. Inherits QMediaObject. Public Types
Properties
Public Functions
Public Slots
Signals
Additional Inherited Members
Detailed DescriptionThe QMediaImageViewer class provides a means of viewing image media. The primary use of QMediaImageViewer is to display image media. If asked to display a non-image media type QMediaImageViewer will instead display the media's cover art or poster if a URI is available for either. In order to actually display an image the QMediaImageViewer class must be coupled with a display output such as QVideoWidget. A display output is attached to the image viewer by passing a pointer the QMediaImageViewer instance in the constructor of the display output, and can be removed by deleting the display output. viewer = new QMediaImageViewer(this); display = new QVideoWidget(viewer); display->show(); QMediaImageViewer can be paired with a QMediaPlaylist to create a slide show of images. Constructing a QMediaPlaylist with a pointer to an instance of QMediaImageViewer will attach it to the image viewer; changing the playlist's selection will then change the media displayed by the image viewer. With a playlist attached QMediaImageViewer's play(), pause(), and stop() slots can be control the progression of the playlist. The timeout property determines how long an image is displayed for before progressing to the next in the playlist, and the elapsedTime property holds how the duration the current image has been displayed for. playlist = new QMediaPlaylist(viewer, this); playlist->setPlaybackMode(QMediaPlaylist::Loop); playlist->appendItem(image1); playlist->appendItem(image2); playlist->appendItem(image3); viewer->setTimeout(5000); viewer->play(); Member Type Documentation
|
Constant | Value | Description |
---|---|---|
QMediaImageViewer::NoMedia | 0 | There is no current media. |
QMediaImageViewer::LoadingMedia | 1 | The image viewer is loading the current media. |
QMediaImageViewer::LoadedMedia | 2 | The image viewer has loaded the current media. |
QMediaImageViewer::InvalidMedia | 3 | The current media cannot be loaded. |
Enumerates the possible control states an image viewer may be in. The control state of an image viewer determines whether the image viewer is automatically progressing through images in an attached playlist.
Constant | Value | Description |
---|---|---|
QMediaImageViewer::StoppedState | 0 | The image viewer is stopped, and will not automatically move to the next image. The elapsedTime is fixed at 0. |
QMediaImageViewer::PlayingState | 1 | The slide show is playing, and will move to the next image when the elapsedTime reaches the timeout. The elapsedTime is being incremented. |
QMediaImageViewer::PausedState | 2 | The image viewer is paused, and will not automatically move the to next image. The elapsedTime is fixed at the time the image viewer was paused. |
This property holds the amount of time in milliseconds that has elapsed since the current image was loaded.
The elapsed time only increases while the image viewer is in the PlayingState. If stopped the elapsed time will be reset to 0.
Access functions:
int | elapsedTime () const |
Notifier signal:
void | elapsedTimeChanged ( int time ) |
This property holds the media an image viewer is presenting.
If the media is on a non image type the image viewer will instead display the media's cover art or poster if a URI is available for either.
Access functions:
QMediaContent | media () const |
void | setMedia ( const QMediaContent & media ) |
Notifier signal:
void | mediaChanged ( const QMediaContent & media ) |
This property holds the status of the current media.
Access functions:
MediaStatus | mediaStatus () const |
Notifier signal:
void | mediaStatusChanged ( QMediaImageViewer::MediaStatus status ) |
This property holds the playlist control state of a slide show.
Access functions:
State | state () const |
Notifier signal:
void | stateChanged ( QMediaImageViewer::State state ) |
This property holds the amount of time in milliseconds an image is displayed for before moving to the next image.
The timeout only applies if the image viewer has a playlist attached and is in the PlayingState.
Access functions:
int | timeout () const |
void | setTimeout ( int timeout ) |
Constructs a new image viewer with the given parent.
Destroys an image viewer.
Signals that the amount of time in milliseconds since the current image was loaded has changed.
This signal is emitted at a regular interval when the image viewer is in the PlayingState and an image is loaded. The notification interval is controlled by the QMediaObject::notifyInterval property.
See also timeout and QMediaObject::notifyInterval.
Signals that the media an image viewer is presenting has changed.
Signals the the status of the current media has changed.
Pauses a slide show.
The current media and elapsed time are retained. If resumed, the current image will be displayed for the remainder of the time out period before the next image is loaded.
Starts a slide show.
If the playlist has no current media this will start at the beginning of the playlist, otherwise it will resume from the current media.
If no playlist is attached to an image viewer this will do nothing.
Signals that the playlist control state of an image viewer has changed.
Stops a slide show.
The current media is retained, but the elapsed time is discarded. If resumed, the current image will be displayed for the full time out period before the next image is loaded.
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt qtmobility-1.0-tp | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com