Akonadi::AgentTypeWidget Class

Provides a widget that lists all available agent types. More...

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

Public Functions

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

Signals

void activated()
void currentChanged(const Akonadi::AgentType &current, const Akonadi::AgentType &previous)

Detailed Description

The widget is listening on the dbus for changes, so the widget is updated automatically as soon as new agent types are added to or removed from the system.

 Akonadi::AgentTypeWidget *widget = new Akonadi::AgentTypeWidget( this );

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

If you want a dialog, you can use the Akonadi::AgentTypeDialog.

Author: Tobias Koenig <tokoe@kde.org>

Member Function Documentation

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

Creates a new agent type widget.

parent The parent widget.

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

Destroys the agent type widget.

[signal] void AgentTypeWidget::activated()

This signal is emitted whenever the user activates an agent.

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

Returns the agent filter proxy model, use this to filter by agent mimetype or capabilities.

Akonadi::AgentType AgentTypeWidget::currentAgentType() const

Returns the current agent type or an invalid agent type if no agent type is selected.

[signal] void AgentTypeWidget::currentChanged(const Akonadi::AgentType &current, const Akonadi::AgentType &previous)

This signal is emitted whenever the current agent type changes.

current The current agent type. previous The previous agent type.