Home · All Classes · Annotated · Functions

QImageDocumentSelector Class Reference

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

#include <QImageDocumentSelector>

Inherits QWidget.

Public Types

Public Functions

Public Slots

Signals

Additional Inherited Members


Detailed Description

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

The QImageDocumentSelector widget builds a list of documents by using Qtopia::findDocuments() to locate all images in the device document directories. Alternatively, the list can be built with images from the source directories given in the widget constructor.

The following functionality is provided:

In addition QImageDocumentSelector provides control of the presentation of image documents for selection. If a single image selection is required, consider using the QImageDocumentSelectorDialog convience class.

Documents may be presented in two modes:

Images are displayed one at a time and are selected via the stylus or select key and arrow keys are used to navigate through the list of image documents.

When an image is selected the following occurs:

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

For example, the following code allows the user to select 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(const QContent&)),
        this, SLOT(openImage(const QContent&)) );

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

See also QImageDocumentSelectorDialog and QDocumentSelector.


Member Type Documentation

enum QImageDocumentSelector::ViewMode

This enum describes presentation 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 QImageDocumentSelector with parent parent.

The list shows all documents with the image mime type.

QImageDocumentSelector::QImageDocumentSelector ( const QContentSet & documents, QWidget * parent = 0 )

Construct an QImageDocumentSelector with parent parent.

Images in the documents QContentSet are shown. Non-image documents are not filtered out if included in the set.

QImageDocumentSelector::QImageDocumentSelector ( const QContentSet::QContentFilter & filter, QWidget * parent = 0 )

Construct an QImageDocumentSelector with parent parent.

Images in the backing store matching filter are shown.

If filter is empty, the list shows all documents with the image mime type. If no mime type filter is specified the image mime filter will be added.

QImageDocumentSelector::~QImageDocumentSelector ()

Destroys the widget.

QCategoryFilter QImageDocumentSelector::categoryFilter () const

Returns the current category filter.

See also setCategoryFilter().

int QImageDocumentSelector::count () const

Returns the number of documents available for selection.

See also documents().

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

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

const QContentSet & QImageDocumentSelector::documents () const

Returns the list of documents available for selection.

See also count().

void QImageDocumentSelector::documentsChanged ()   [signal]

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

QContentSet::QContentFilter QImageDocumentSelector::filter () const

Returns the current documents filter.

See also setFilter().

QContent QImageDocumentSelector::selectedDocument () const

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

void QImageDocumentSelector::setCategoryFilter ( const QCategoryFilter & filter )

Sets the category filter to filter. Only documents that pass the filter will be available for selection.

The default category filter is QCategoryFilter::All.

See also categoryFilter().

void QImageDocumentSelector::setFilter ( const QContentSet::QContentFilter & filter )

Sets the filter which determines what documents from the backing store are displayed.

See also 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::setThumbnailSize ( const QSize & size )

Sets the maximum size of a thumbnail to size.

The default size is QSize( 65, 65 ).

See also thumbnailSize().

void QImageDocumentSelector::setViewMode ( ViewMode mode )

Sets the display mode to mode.

The default mode is QImageDocumentSelector::Thumbnail.

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

See also viewMode().

QSize QImageDocumentSelector::thumbnailSize () const

Returns the current maximum size of a thumbnail.

See also setThumbnailSize().

ViewMode QImageDocumentSelector::viewMode () const

Returns the current display mode.

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

See also setViewMode().


Copyright © 2006 Trolltech Trademarks
Qtopia 4.1.7