Akonadi::AgentTypeDialog Class

A dialog to select an available agent type. More...

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

Public Functions

AgentTypeDialog(QWidget *parent = nullptr)
virtual ~AgentTypeDialog() override
Akonadi::AgentFilterProxyModel *agentFilterProxyModel() const
Akonadi::AgentType agentType() const

Public Slots

virtual void done(int result) override

Detailed Description

This dialogs allows the user to select an agent type from the list of all available agent types. The list can be filtered by the proxy model returned by agentFilterProxyModel().

 Akonadi::AgentTypeDialog dlg( this );

 // only list agent types that provide contacts
 dlg.agentFilterProxyModel()->addMimeTypeFilter( "text/directory" );

 if ( dlg.exec() ) {
   const AgentType agentType = dlg.agentType();
   ...
 }

Author: Tom Albers <tomalbers@kde.nl>

Member Function Documentation

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

Creates a new agent type dialog.

parent The parent widget of the dialog.

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

Destroys the agent type dialog.

Akonadi::AgentFilterProxyModel *AgentTypeDialog::agentFilterProxyModel() const

Returns the agent filter proxy model that can be used to filter the agent types that shall be shown in the dialog.

Akonadi::AgentType AgentTypeDialog::agentType() const

Returns the agent type that was selected by the user, or an empty agent type object if no agent type has been selected.

[override virtual slot] void AgentTypeDialog::done(int result)