Akonadi::CollectionDialog Class

A collection selection dialog. More...

Header: #include <Akonadi/CollectionDialog>
CMake: find_package(KPim6 REQUIRED COMPONENTS AkonadiWidgets)
target_link_libraries(mytarget PRIVATE KPim6::AkonadiWidgets)

Public Functions

CollectionDialog(QWidget *parent = nullptr)
CollectionDialog(QAbstractItemModel *model, QWidget *parent = nullptr)
CollectionDialog(Akonadi::CollectionDialog::CollectionDialogOptions options, QAbstractItemModel *model = nullptr, QWidget *parent = nullptr)
virtual ~CollectionDialog() override
Akonadi::Collection::Rights accessRightsFilter() const
void changeCollectionDialogOptions(Akonadi::CollectionDialog::CollectionDialogOptions options)
QStringList mimeTypeFilter() const
Akonadi::Collection selectedCollection() const
Akonadi::Collection::List selectedCollections() const
QAbstractItemView::SelectionMode selectionMode() const
void setAccessRightsFilter(Akonadi::Collection::Rights rights)
void setContentMimeTypes(const QStringList &mimetypes)
void setDefaultCollection(const Akonadi::Collection &collection)
void setDescription(const QString &text)
void setMimeTypeFilter(const QStringList &mimeTypes)
void setSelectionMode(QAbstractItemView::SelectionMode mode)
void setUseFolderByDefault(bool b)
bool useFolderByDefault() const

Detailed Description

Provides a dialog that lists collections that are available on the Akonadi storage and allows the selection of one or multiple collections.

The list of shown collections can be filtered by mime type and access rights. Note that mime types are not enabled by default, so setMimeTypeFilter() must be called to enable the desired mime types.

Example:


Member Function Documentation

[explicit] CollectionDialog::CollectionDialog(QWidget *parent = nullptr)

Creates a new collection dialog.

parent The parent widget.

[explicit] CollectionDialog::CollectionDialog(QAbstractItemModel *model, QWidget *parent = nullptr)

Creates a new collection dialog with a custom model.

The filtering by content mime type and access rights is done on top of the custom model.

model The custom model to use. parent The parent widget.

[explicit] CollectionDialog::CollectionDialog(Akonadi::CollectionDialog::CollectionDialogOptions options, QAbstractItemModel *model = nullptr, QWidget *parent = nullptr)

Creates a new collection dialog with a custom model.

The filtering by content mime type and access rights is done on top of the custom model.

options The collection dialog options. model The custom model to use. parent The parent widget.

[override virtual noexcept] CollectionDialog::~CollectionDialog()

Destroys the collection dialog.

Akonadi::Collection::Rights CollectionDialog::accessRightsFilter() const

Sets the access rights that the listed collections shall match with.

See also setAccessRightsFilter().

void CollectionDialog::changeCollectionDialogOptions(Akonadi::CollectionDialog::CollectionDialogOptions options)

Change collection dialog options. options the collection dialog options to change

QStringList CollectionDialog::mimeTypeFilter() const

Returns the mime types any of which the selected collection(s) shall support.

See also setMimeTypeFilter().

Akonadi::Collection CollectionDialog::selectedCollection() const

Returns the selected collection if the selection mode is QAbstractItemView::SingleSelection. If another selection mode was set, or nothing is selected, an invalid collection is returned.

Akonadi::Collection::List CollectionDialog::selectedCollections() const

Returns the list of selected collections.

QAbstractItemView::SelectionMode CollectionDialog::selectionMode() const

Returns the selection mode.

See also setSelectionMode() and QAbstractItemView::selectionMode().

void CollectionDialog::setAccessRightsFilter(Akonadi::Collection::Rights rights)

Sets the access rights that the listed collections shall match with. rights access rights filter values

See also accessRightsFilter().

void CollectionDialog::setContentMimeTypes(const QStringList &mimetypes)

Allow to specify collection content mimetype when we create new one.

void CollectionDialog::setDefaultCollection(const Akonadi::Collection &collection)

Sets the collection that shall be selected by default. collection the dialog's preselected collection

void CollectionDialog::setDescription(const QString &text)

Sets the text that will be shown in the dialog. text the dialog's description text

void CollectionDialog::setMimeTypeFilter(const QStringList &mimeTypes)

Sets the mime types any of which the selected collection(s) shall support. Note that mime types are not enabled by default. mimeTypes MIME type filter values

See also mimeTypeFilter().

void CollectionDialog::setSelectionMode(QAbstractItemView::SelectionMode mode)

Sets the selection mode. The initial default mode is QAbstractItemView::SingleSelection. mode the selection mode to use

See also selectionMode() and QAbstractItemView::setSelectionMode().

void CollectionDialog::setUseFolderByDefault(bool b)

See also useFolderByDefault().

bool CollectionDialog::useFolderByDefault() const

See also setUseFolderByDefault().