Akonadi::EntityListView Class
A view to show an item/collection list provided by an EntityTreeModel. More...
| Header: | #include <Akonadi/EntityListView> |
| CMake: | find_package(KPim6 REQUIRED COMPONENTS AkonadiWidgets)target_link_libraries(mytarget PRIVATE KPim6::AkonadiWidgets) |
Public Functions
| EntityListView(QWidget *parent = nullptr) | |
| EntityListView(KXMLGUIClient *xmlGuiClient, QWidget *parent = nullptr) | |
| virtual | ~EntityListView() override |
| bool | isDropActionMenuEnabled() const |
| void | setDropActionMenuEnabled(bool enabled) |
| void | setXmlGuiClient(KXMLGUIClient *xmlGuiClient) |
| KXMLGUIClient * | xmlGuiClient() const |
Reimplemented Public Functions
| virtual void | setModel(QAbstractItemModel *model) override |
Signals
| void | clicked(const Akonadi::Collection &collection) |
| void | clicked(const Akonadi::Item &item) |
| void | currentChanged(const Akonadi::Collection &collection) |
| void | currentChanged(const Akonadi::Item &item) |
| void | doubleClicked(const Akonadi::Collection &collection) |
| void | doubleClicked(const Akonadi::Item &item) |
Detailed Description
When a KXmlGuiWindow is passed to the constructor, the XMLGUI defined context menu \ akonadi_collectionview_contextmenu or \ akonadi_itemview_contextmenu is used if available.
Example:
using namespace Akonadi; class MyWindow : public KXmlGuiWindow { public: MyWindow() : KXmlGuiWindow() { EntityListView *view = new EntityListView( this, this ); setCentralWidget( view ); EntityTreeModel *model = new EntityTreeModel( ... ); KDescendantsProxyModel *flatModel = new KDescendantsProxyModel( this ); flatModel->setSourceModel( model ); view->setModel( flatModel ); } }
Author: Volker Krause <vkrause@kde.org> Author: Stephen Kelly <steveire@gmail.com>
Member Function Documentation
[explicit] EntityListView::EntityListView(QWidget *parent = nullptr)
Creates a new favorite collections view.
parent The parent widget.
[explicit] EntityListView::EntityListView(KXMLGUIClient *xmlGuiClient, QWidget *parent = nullptr)
Creates a new favorite collections view.
xmlGuiClient The KXMLGUIClient the view is used in. This is needed for the XMLGUI based context menu. Passing 0 is ok and will disable the builtin context menu. parent The parent widget.
[override virtual noexcept] EntityListView::~EntityListView()
Destroys the favorite collections view.
[signal] void EntityListView::clicked(const Akonadi::Collection &collection)
This signal is emitted whenever the user has clicked a collection in the view.
collection The clicked collection.
Note: This signal is overloaded. To connect to this signal:
// Connect using qOverload: connect(entityListView, qOverloadFor more examples and approaches, see connecting to overloaded signals.(&EntityListView::clicked), receiver, &ReceiverClass::slot); // Or using a lambda: connect(entityListView, qOverload (&EntityListView::clicked), this, [](const Akonadi::Collection &collection) { /* handle clicked */ });
[signal] void EntityListView::clicked(const Akonadi::Item &item)
This signal is emitted whenever the user has clicked an item in the view.
item The clicked item.
Note: This signal is overloaded. To connect to this signal:
// Connect using qOverload: connect(entityListView, qOverloadFor more examples and approaches, see connecting to overloaded signals.(&EntityListView::clicked), receiver, &ReceiverClass::slot); // Or using a lambda: connect(entityListView, qOverload (&EntityListView::clicked), this, [](const Akonadi::Item &item) { /* handle clicked */ });
[signal] void EntityListView::currentChanged(const Akonadi::Collection &collection)
This signal is emitted whenever the current collection in the view has changed.
collection The new current collection.
Note: This signal is overloaded. To connect to this signal:
// Connect using qOverload: connect(entityListView, qOverloadFor more examples and approaches, see connecting to overloaded signals.(&EntityListView::currentChanged), receiver, &ReceiverClass::slot); // Or using a lambda: connect(entityListView, qOverload (&EntityListView::currentChanged), this, [](const Akonadi::Collection &collection) { /* handle currentChanged */ });
[signal] void EntityListView::currentChanged(const Akonadi::Item &item)
This signal is emitted whenever the current item in the view has changed.
item The new current item.
Note: This signal is overloaded. To connect to this signal:
// Connect using qOverload: connect(entityListView, qOverloadFor more examples and approaches, see connecting to overloaded signals.(&EntityListView::currentChanged), receiver, &ReceiverClass::slot); // Or using a lambda: connect(entityListView, qOverload (&EntityListView::currentChanged), this, [](const Akonadi::Item &item) { /* handle currentChanged */ });
[signal] void EntityListView::doubleClicked(const Akonadi::Collection &collection)
This signal is emitted whenever the user has double clicked a collection in the view.
collection The double clicked collection.
Note: This signal is overloaded. To connect to this signal:
// Connect using qOverload: connect(entityListView, qOverloadFor more examples and approaches, see connecting to overloaded signals.(&EntityListView::doubleClicked), receiver, &ReceiverClass::slot); // Or using a lambda: connect(entityListView, qOverload (&EntityListView::doubleClicked), this, [](const Akonadi::Collection &collection) { /* handle doubleClicked */ });
[signal] void EntityListView::doubleClicked(const Akonadi::Item &item)
This signal is emitted whenever the user has double clicked an item in the view.
item The double clicked item.
Note: This signal is overloaded. To connect to this signal:
// Connect using qOverload: connect(entityListView, qOverloadFor more examples and approaches, see connecting to overloaded signals.(&EntityListView::doubleClicked), receiver, &ReceiverClass::slot); // Or using a lambda: connect(entityListView, qOverload (&EntityListView::doubleClicked), this, [](const Akonadi::Item &item) { /* handle doubleClicked */ });
bool EntityListView::isDropActionMenuEnabled() const
Returns whether the drop action menu is enabled and will be shown on drop operation.
void EntityListView::setDropActionMenuEnabled(bool enabled)
Sets whether the drop action \anu is enabled and will shown on drop operation. enabled enables drop action menu if set as \ true
See also isDropActionMenuEnabled().
[override virtual] void EntityListView::setModel(QAbstractItemModel *model)
model the model to set
void EntityListView::setXmlGuiClient(KXMLGUIClient *xmlGuiClient)
Sets the XML GUI client which the view is used in.
This is needed if you want to use the built-in context menu.
xmlGuiClient The KXMLGUIClient the view is used in.
See also xmlGuiClient().
KXMLGUIClient *EntityListView::xmlGuiClient() const
Return the XML GUI client which the view is used in.
See also setXmlGuiClient().