akonadi
Akonadi::EntityTreeView Class Reference
A view to show an item/collection tree provided by an EntityTreeModel. More...
#include <entitytreeview.h>
Inherits QTreeView.
Signals | |
void | clicked (const Akonadi::Item &item) |
void | clicked (const Akonadi::Collection &collection) |
void | currentChanged (const Akonadi::Item &item) |
void | currentChanged (const Akonadi::Collection &collection) |
void | doubleClicked (const Akonadi::Item &item) |
void | doubleClicked (const Akonadi::Collection &collection) |
Public Member Functions | |
EntityTreeView (KXMLGUIClient *xmlGuiClient, QWidget *parent=0) | |
EntityTreeView (QWidget *parent=0) | |
virtual | ~EntityTreeView () |
virtual void | setModel (QAbstractItemModel *model) |
void | setXmlGuiClient (KXMLGUIClient *xmlGuiClient) |
Protected Member Functions | |
virtual void | contextMenuEvent (QContextMenuEvent *event) |
virtual void | dragMoveEvent (QDragMoveEvent *event) |
virtual void | dropEvent (QDropEvent *event) |
virtual void | startDrag (Qt::DropActions supportedActions) |
virtual void | timerEvent (QTimerEvent *event) |
Detailed Description
A view to show an item/collection tree provided by an EntityTreeModel.
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() { EntityTreeView *view = new EntityTreeView( this, this ); setCentralWidget( view ); EntityTreeModel *model = new EntityTreeModel( ... ); view->setModel( model ); } }
- Since:
- 4.4
Definition at line 70 of file entitytreeview.h.
Constructor & Destructor Documentation
EntityTreeView::EntityTreeView | ( | QWidget * | parent = 0 |
) | [explicit] |
Creates a new entity tree view.
- Parameters:
-
parent The parent widget.
Definition at line 162 of file entitytreeview.cpp.
EntityTreeView::EntityTreeView | ( | KXMLGUIClient * | xmlGuiClient, | |
QWidget * | parent = 0 | |||
) | [explicit] |
Creates a new entity tree view.
- Parameters:
-
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.
Definition at line 170 of file entitytreeview.cpp.
EntityTreeView::~EntityTreeView | ( | ) | [virtual] |
Destroys the entity tree view.
Definition at line 178 of file entitytreeview.cpp.
Member Function Documentation
void Akonadi::EntityTreeView::clicked | ( | const Akonadi::Item & | item | ) | [signal] |
This signal is emitted whenever the user has clicked an item in the view.
- Parameters:
-
item The clicked item.
void Akonadi::EntityTreeView::clicked | ( | const Akonadi::Collection & | collection | ) | [signal] |
This signal is emitted whenever the user has clicked a collection in the view.
- Parameters:
-
collection The clicked collection.
void Akonadi::EntityTreeView::currentChanged | ( | const Akonadi::Item & | item | ) | [signal] |
This signal is emitted whenever the current item in the view has changed.
- Parameters:
-
item The new current item.
void Akonadi::EntityTreeView::currentChanged | ( | const Akonadi::Collection & | collection | ) | [signal] |
This signal is emitted whenever the current collection in the view has changed.
- Parameters:
-
collection The new current collection.
void Akonadi::EntityTreeView::doubleClicked | ( | const Akonadi::Item & | item | ) | [signal] |
This signal is emitted whenever the user has double clicked an item in the view.
- Parameters:
-
item The double clicked item.
void Akonadi::EntityTreeView::doubleClicked | ( | const Akonadi::Collection & | collection | ) | [signal] |
This signal is emitted whenever the user has double clicked a collection in the view.
- Parameters:
-
collection The double clicked collection.
void EntityTreeView::setModel | ( | QAbstractItemModel * | model | ) | [virtual] |
Definition at line 184 of file entitytreeview.cpp.
void EntityTreeView::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.
- Parameters:
-
xmlGuiClient The KXMLGUIClient the view is used in.
Definition at line 257 of file entitytreeview.cpp.
The documentation for this class was generated from the following files: