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  · 

QImageDocumentSelector Class Reference
[QtBaseModule]

The QImageDocumentSelector widget allows the selection an image from a list of image documents available on the device. More...

    #include <QImageDocumentSelector>

Inherits QWidget.

Public Types

Public Functions

  • 206 public functions inherited from QWidget
  • 29 public functions inherited from QObject
  • 14 public functions inherited from QPaintDevice

Public Slots

  • 19 public slots inherited from QWidget
  • 1 public slot inherited from QObject

Signals

Additional Inherited Members

  • 57 properties inherited from QWidget
  • 1 property inherited from QObject
  • 1 public type inherited from QObject
  • 4 static public members inherited from QWidget
  • 4 static public members inherited from QObject
  • 38 protected functions inherited from QWidget
  • 7 protected functions inherited from QObject
  • 1 protected function inherited from QPaintDevice
  • 1 protected slot inherited from QWidget
  • 2 protected variables inherited from QObject
  • 1 protected type inherited from QPaintDevice

Detailed Description

The QImageDocumentSelector widget allows the selection an image from a list of image documents available on the device.

The QImageDocumentSelector widget builds a list of documents by locating all images in the device document directories. Alternatively, the list can be built with images which match a custom content filter.

Some of the commonly used functionality is:

Function/slotUsage
setFilter()filter the list of image documents using a QContentFilter.
filter()retrieve the current QContentFilter.
documents()Returns image documents listed.
documentSelected()notifies which document was chosen.

In addition documents may be viewed in two modes:

  • QImageDocumentSelector::Single - presents a thumbnail of the current image contained within the dimensions of the QImageDocumentSelector widget.
  • QImageDocumentSelector::Thumbnail - presents thumbnails of the images in an icon-type scroll view allowing multiple image thumbnails to be viewed concurrently.

    The size of thumbnails is manipulated using:

Images are highlighted one at a time and a articular image can be chosen vi the stylus or select key and arrow keys are used to navigate through the list of image documents.

When an image is chosen the following occurs:

  • The image document selector emits a documentSelected() signal
  • a QContent for the chosen document is passed with the signal.

Whenever the list of documents is changed as a result of a filter change or a file system change, QImageDocumentSelector will emit a documentsChanged() signal.

The following code allows the user to choose from all image documents available on the device using the thumbnail view mode with a custom thumbnail size:

    QImageDocumentSelector *selector = new QImageDocumentSelector( this );
    selector->setThumbnailSize( QSize( 100, 100 ) );

    connect( selector, SIGNAL(documentSelected(QContent)),
        this, SLOT(openImage(QContent)) );

QImageDocumentSelector is often the first widget seen in a document-oriented application. When used with QStackedWidget, an application allows choosing of a document using the selector before revealing the document viewer or editor.

See also QImageDocumentSelectorDialog, QDocumentSelector, and QDocumentSelectorDialog.


Member Type Documentation

enum QImageDocumentSelector::ViewMode

This enum describes the types of viewing modes.

ConstantValueDescription
QImageDocumentSelector::Single0Images are displayed one at a time.
QImageDocumentSelector::Thumbnail1Multiple images are displayed in an icon type scroll view.


Member Function Documentation

QImageDocumentSelector::QImageDocumentSelector ( QWidget * parent = 0 )

Construct an image document selector widget with the given parent.

QImageDocumentSelector::~QImageDocumentSelector ()

Destroys the widget.

QContent QImageDocumentSelector::currentDocument () const

Returns a QContent for the currently selected image, or an invalid QContent if there is no current selection.

See also documents().

QStringList QImageDocumentSelector::defaultCategories () const

Returns the categories checked by default in the document selector's category filter dialog.

See also setDefaultCategories().

void QImageDocumentSelector::documentSelected ( const QContent & image )   [signal]

This signal is emitted when the user chooses an image. A QContent for the image document is given in image.

const QContentSet & QImageDocumentSelector::documents () const

Returns the content set of image documents listed by the selector

See also currentDocument().

void QImageDocumentSelector::documentsChanged ()   [signal]

This signal is emitted when the list of documents changes as a result of a filter change or a file system change.

QContentFilter QImageDocumentSelector::filter () const

Returns the current documents filter.

The filter defines the subset of image documents on the device the user can select from.

See also setFilter() and QContentSet::filter().

QDrmRights::Permissions QImageDocumentSelector::mandatoryPermissions () const

Returns the permissions a document must have in order to be choosable by the document selector.

See also setMandatoryPermissions(), setSelectPermission(), and selectPermission().

QDrmRights::Permission QImageDocumentSelector::selectPermission () const

Returns the permissions a document should give in order to be choosable.

The permissions effectively describe the document's intended usage.

See also setSelectPermission(), mandatoryPermissions(), and setMandatoryPermissions().

void QImageDocumentSelector::setDefaultCategories ( const QStringList & categories )

Sets the categories checked by default in the document selector's category filter dialog.

If a supplied category does not match those available in the category filter dialog, the document selector will not filter with that category. Upon invocation this function will set the default checked categories within the category filter dialog, and filter according to the supplied categories. Note: Once the dialog has been shown once, this function no longer has any effect.

Filtering according to categories is applied after the filter defined by filter()

See also defaultCategories(), filter(), and setFilter().

void QImageDocumentSelector::setFilter ( const QContentFilter & filter )

Sets the filter which defines the subset of image documents on the device the user can select from.

See also filter() and QContentSet::filter().

void QImageDocumentSelector::setFocus ()   [slot]

Gives the keyboard input focus to this widget (or its focus proxy) if this widget or one of its parents is the active window.

void QImageDocumentSelector::setMandatoryPermissions ( QDrmRights::Permissions permissions )

Sets the permissions a document must have in order to be choosable from the document selector.

Unlike select permissions, if a document is missing a mandatory permission it will not be activated, and the document cannot be chosen.

Because the permissions are mandatory, passing QDrmRights::InvalidPermission as a parameter does not exhibit the same behavior as in setSelectPermission().

See also mandatoryPermissions(), setSelectPermission(), and selectPermission().

void QImageDocumentSelector::setSelectPermission ( QDrmRights::Permission permission )

Sets the permission a document should give in order to be choosable. The permissions effectively specify the intended usage for that document.

If a document does not have provide the given permission, the document selector will try to activate and thus acquire permissions for the document. If the document cannot be activated with that permission, it will not be choosable from the list and visual indication of this is given.

If the permission is QDrmRights::InvalidPermission the default permissions for the document is used.

See also selectPermission(), setMandatoryPermissions(), and mandatoryPermissions().

void QImageDocumentSelector::setSortCriteria ( const QContentSortCriteria & sort )

Sets the document sort criteria.

This will set the document selector sort mode to SortCriteria.

See also sortCriteria() and setSortMode().

void QImageDocumentSelector::setSortMode ( QDocumentSelector::SortMode sortMode )

Sets the document sortMode

The default mode is QDocumentSelector::Alphabetical.

See also sortMode().

void QImageDocumentSelector::setThumbnailSize ( const QSize & size )

Sets the maximum size of a thumbnail.

The default size is QSize( 65, 65 ).

See also thumbnailSize().

void QImageDocumentSelector::setViewMode ( ViewMode mode )

Sets the viewing mode

The default mode is QImageDocumentSelector::Thumbnail.

See QImageDocumentSelector::ViewMode for a listing of supported view modes.

See also viewMode().

QContentSortCriteria QImageDocumentSelector::sortCriteria () const

Returns the current document sort criteria.

See also setSortCriteria().

QDocumentSelector::SortMode QImageDocumentSelector::sortMode () const

Returns the current document sort mode.

See also setSortMode().

QSize QImageDocumentSelector::thumbnailSize () const

Returns the current maximum size of a thumbnail.

See also setThumbnailSize().

ViewMode QImageDocumentSelector::viewMode () const

Returns the current view mode.

See QImageDocumentSelector::ViewMode for a listing of supported view modes.

See also setViewMode().

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 64
  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. Les développeurs ignorent-ils trop les failles découvertes dans leur code ? Prenez-vous en compte les remarques des autres ? 17
  4. BlackBerry 10 : premières images du prochain OS de RIM qui devrait intégrer des widgets et des tuiles inspirées de Windows Phone 0
  5. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  6. Adieu qmake, bienvenue qbs : Qt Building Suite, un outil déclaratif et extensible pour la compilation de projets Qt 17
  7. La rubrique Qt a besoin de vous ! 1
Page suivante

Le Qt Labs au hasard

Logo

Construire l'avenir : (ré-)introduction aux composants de Qt Quick

Les Qt Labs sont les laboratoires des développeurs de Qt, où ils peuvent partager des impressions sur le framework, son utilisation, ce que pourrait être son futur. 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 qtextended4.4
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