Home · All Classes · Annotated · Functions

QDocumentSelector Class Reference

The QDocumentSelector widget allows the user to select documents from a list of documents available on the device. More...

#include <QDocumentSelector>

Inherits QWidget.

Public Types

Public Functions

Signals

Additional Inherited Members


Detailed Description

The QDocumentSelector widget allows the user to select documents from a list of documents available on the device.

The QDocumentSelector widget builds the list of documents by using Qtopia::findDocuments() to find all documents that match the mime type filter given in the widget constructor.

The following functionality is provided:

When setNewEnabled() is enabled QDocumentSelector adds a new document icon to the selection widget. When the icon is selected the newDocument() signal is emitted.

When a document is selected, QDocumentSelector emits a documentSelected() signal and a QContent for the selected document is passed with the signal and the selected document is retrieved using selectedDocument().

When the list of documents is modified as a result of a change of:

QDocumentSelector emits a documentsChanged() signal.

The following code is an example of how to:

    QDocumentSelector *selector = new QDocumentSelector( "*", this );
    selector->setSortMode( QDocumentSelector::Chronological );
    selector->setNewEnabled( true );

    connect( selector, SIGNAL(newSelected()), this, SLOT(newDocument()) );
    connect( selector, SIGNAL(documentSelected(const QContent&)),
        this, SLOT(openDocument(const QContent&)) );

QDocumentSelector is often the first widget seen in a document-oriented application . Used in combination with QStackedWidget, a typical application allows selecton of a document using the selector before revealing the document viewer or editor.

See also QImageDocumentSelector.


Member Type Documentation

enum QDocumentSelector::SortMode

This enum specifies the sort order of the documents.

ConstantValue
QDocumentSelector::Alphabetical0
QDocumentSelector::ReverseAlphabetical1
QDocumentSelector::Chronological2
QDocumentSelector::ReverseChronological3


Member Function Documentation

QDocumentSelector::QDocumentSelector ( const QString & mimeTypes, QWidget * parent = 0 )

Constructs a QDocumentSelector with mime type filter mimeTypes and parent parent.

The mime type filter string may contain multiple wild-card patterns separated by semicolons. For example:

QDocumentSelector::QDocumentSelector ( const QString & mimeTypes, const QCategoryFilter & catFilter, QWidget * parent = 0 )

Constructs a QDocumentSelector with mime type filter mimeTypes, Category filter catFilter and parent parent.

The mime type filter is as above by semicolons. For example:

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

Constructs a QDocumentSelector with parent parent displaying all records in the QContentSet documents.

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

Constructs a QDocumentSelector with parent parent displaying all records from the backing store which pass all the filters listed in filter.

QDocumentSelector::~QDocumentSelector ()

Destroys the widget.

QCategoryFilter QDocumentSelector::categoryFilter () const

Returns the current category filter.

See also setCategoryFilter().

int QDocumentSelector::count () const

Returns the number of documents available for selection.

See also documents().

void QDocumentSelector::documentSelected ( const QContent & document )   [signal]

This signal is emitted when a document is selected. A QContent for the selected document is given in document.

const QContentSet & QDocumentSelector::documents () const

Returns the list of documents available for selection.

See also setDocuments() and count().

void QDocumentSelector::documentsChanged ()   [signal]

This signal is emitted when the list of documents is changed as a result of a change to the:

QContentSet::QContentFilter QDocumentSelector::filter () const

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

See also setFilter().

void QDocumentSelector::newSelected ()   [signal]

This signal is emitted when the new document icon is selected.

See also setNewEnabled().

QContent QDocumentSelector::selectedDocument () const

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

void QDocumentSelector::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 QDocumentSelector::setDocuments ( const QContentSet & documents )

Sets the list of documents available for selection.

See also documents().

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

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

See also filter().

void QDocumentSelector::setNewEnabled ( bool newEnabled )

When newEnabled is true, a new document icon is added to the selection widget.

New is disabled by default.

See also newSelected().

void QDocumentSelector::setSortMode ( SortMode mode )

Sets the document sort mode to mode.

The default mode is QDocumentSelector::Alphabetical.

See also sortMode().

SortMode QDocumentSelector::sortMode () const

Returns the current document sort mode.

See also setSortMode().


Copyright © 2006 Trolltech Trademarks
Qtopia 4.1.7