Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QMediaImageViewer Class Reference

The QMediaImageViewer class provides a means of viewing image media. More...

 #include <QMediaImageViewer>

Inherits: QMediaObject.

This class was introduced in Qt Mobility 1.0.

Public Types

enum MediaStatus { NoMedia, LoadingMedia, LoadedMedia, InvalidMedia }
enum State { StoppedState, PlayingState, PausedState }

Properties

Public Functions

QMediaImageViewer ( QObject * parent = 0 )
~QMediaImageViewer ()
int elapsedTime () const
QMediaContent media () const
MediaStatus mediaStatus () const
QMediaPlaylist * playlist () const
void setVideoOutput ( QVideoWidget * widget )
void setVideoOutput ( QGraphicsVideoItem * item )
void setVideoOutput ( QAbstractVideoSurface * surface )
State state () const
int timeout () const

Public Slots

void pause ()
void play ()
void setMedia ( const QMediaContent & media )
void setPlaylist ( QMediaPlaylist * playlist )
void setTimeout ( int timeout )
void stop ()
  • 1 public slot inherited from QObject

Signals

void elapsedTimeChanged ( int time )
void mediaChanged ( const QMediaContent & media )
void mediaStatusChanged ( QMediaImageViewer::MediaStatus status )
void stateChanged ( QMediaImageViewer::State state )

Additional Inherited Members

  • 1 public variable inherited from QObject
  • 4 static public members inherited from QObject
  • 2 protected functions inherited from QMediaObject
  • 7 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

The QMediaImageViewer class provides a means of viewing image media.

QMediaImageViewer is used together with a media display object such as QVideoWidget to present an image. A display object is attached to the image viewer by means of the bind function.

 viewer = new QMediaImageViewer(this);

 videoWidget = new QVideoWidget;
 viewer->bind(videoWidget);
 videoWidget->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(this);
 playlist->setPlaybackMode(QMediaPlaylist::Loop);
 playlist->addMedia(image1);
 playlist->addMedia(image2);
 playlist->addMedia(image3);

 viewer->setPlaylist(playlist);
 viewer->setTimeout(5000);
 viewer->play();

Member Type Documentation

enum QMediaImageViewer::MediaStatus

Enumerates the status of an image viewer's current media.

ConstantValueDescription
QMediaImageViewer::NoMedia0There is no current media.
QMediaImageViewer::LoadingMedia1The image viewer is loading the current media.
QMediaImageViewer::LoadedMedia2The image viewer has loaded the current media.
QMediaImageViewer::InvalidMedia3The current media cannot be loaded.

enum QMediaImageViewer::State

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.

ConstantValueDescription
QMediaImageViewer::StoppedState0The image viewer is stopped, and will not automatically move to the next image. The elapsedTime is fixed at 0.
QMediaImageViewer::PlayingState1The slide show is playing, and will move to the next image when the elapsedTime reaches the timeout. The elapsedTime is being incremented.
QMediaImageViewer::PausedState2The 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.

Property Documentation

elapsedTime : const int

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.

This property was introduced in Qt Mobility 1.0.

Access functions:

int elapsedTime () const

Notifier signal:

void elapsedTimeChanged ( int time )

media : QMediaContent

This property holds the media an image viewer is presenting.

This property was introduced in Qt Mobility 1.0.

Access functions:

QMediaContent media () const
void setMedia ( const QMediaContent & media )

Notifier signal:

void mediaChanged ( const QMediaContent & media )

mediaStatus : const MediaStatus

This property holds the status of the current media.

This property was introduced in Qt Mobility 1.0.

Access functions:

MediaStatus mediaStatus () const

Notifier signal:

void mediaStatusChanged ( QMediaImageViewer::MediaStatus status )

state : const State

This property holds the playlist control state of a slide show.

This property was introduced in Qt Mobility 1.0.

Access functions:

State state () const

Notifier signal:

void stateChanged ( QMediaImageViewer::State state )

timeout : int

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.

This property was introduced in Qt Mobility 1.0.

Access functions:

int timeout () const
void setTimeout ( int timeout )

Member Function Documentation

QMediaImageViewer::QMediaImageViewer ( QObject * parent = 0 )

Constructs a new image viewer with the given parent.

QMediaImageViewer::~QMediaImageViewer ()

Destroys an image viewer.

void QMediaImageViewer::elapsedTimeChanged ( int time ) [signal]

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.

This function was introduced in Qt Mobility 1.0.

See also timeout and QMediaObject::notifyInterval.

void QMediaImageViewer::mediaChanged ( const QMediaContent & media ) [signal]

Signals that the media an image viewer is presenting has changed.

This function was introduced in Qt Mobility 1.0.

void QMediaImageViewer::mediaStatusChanged ( QMediaImageViewer::MediaStatus status ) [signal]

Signals the the status of the current media has changed.

This function was introduced in Qt Mobility 1.0.

void QMediaImageViewer::pause () [slot]

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.

This function was introduced in Qt Mobility 1.0.

void QMediaImageViewer::play () [slot]

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.

This function was introduced in Qt Mobility 1.0.

QMediaPlaylist * QMediaImageViewer::playlist () const

Returns the current playlist, or 0 if none.

This function was introduced in Qt Mobility 1.0.

See also setPlaylist().

void QMediaImageViewer::setPlaylist ( QMediaPlaylist * playlist ) [slot]

Use playlist as the source of images to be displayed in the viewer.

This function was introduced in Qt Mobility 1.0.

See also playlist().

void QMediaImageViewer::setVideoOutput ( QVideoWidget * widget )

Sets a video widget as the current video output.

This will unbind any previous video output bound with setVideoOutput().

This function was introduced in Qt Mobility 1.1.

void QMediaImageViewer::setVideoOutput ( QGraphicsVideoItem * item )

Sets a video item as the current video output.

This will unbind any previous video output bound with setVideoOutput().

This function was introduced in Qt Mobility 1.1.

void QMediaImageViewer::setVideoOutput ( QAbstractVideoSurface * surface )

Sets a video surface as the video output of a image viewer.

If a video output has already been set on the image viewer the new surface will replace it.

This function was introduced in Qt Mobility 1.2.

void QMediaImageViewer::stateChanged ( QMediaImageViewer::State state ) [signal]

Signals that the playlist control state of an image viewer has changed.

This function was introduced in Qt Mobility 1.0.

void QMediaImageViewer::stop () [slot]

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.

This function was introduced in Qt Mobility 1.0.

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. «Le projet de loi des droits du développeur» : quelles conditions doivent remplir les entreprises pour que le développeur puisse réussir ? 69
  2. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 27
  3. Une nouvelle ère d'IHM 3D pour les automobiles, un concept proposé par Digia et implémenté avec Qt 3
  4. Qt Creator 2.5 est sorti en beta, l'EDI supporte maintenant plus de fonctionnalités de C++11 2
  5. Vingt sociétés montrent leurs décodeurs basés sur Qt au IPTV World Forum, en en exploitant diverses facettes (déclaratif, Web, widgets) 0
  6. PySide devient un add-on Qt et rejoint le Qt Project et le modèle d'open gouvernance 1
  7. Thread travailleur avec Qt en utilisant les signaux et les slots, un article de Christophe Dumez traduit par Thibaut Cuvelier 1
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 101
  2. Apercevoir la troisième dimension ou l'utilisation multithreadée d'OpenGL dans Qt, un article des Qt Quarterly traduit par Guillaume Belz 0
  3. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 51
  4. «Le projet de loi des droits du développeur» : quelles conditions doivent remplir les entreprises pour que le développeur puisse réussir ? 69
  5. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 27
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
Page suivante

Le Qt Quarterly au hasard

Logo

Utilisation du framework d'Undo/Redo avec les vues

Qt Quarterly est la revue trimestrielle proposée par Nokia et à destination des développeurs Qt. Ces articles d'une grande qualité technique sont rédigés par des experts Qt. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

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.2
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 !
 
 
 
 
Partenaires

Hébergement Web