akonadi
Akonadi::ItemView Class Reference
A view to show an item list provided by an ItemModel. More...
#include <itemview.h>
Inherits QTreeView.
Signals | |
void | activated (const Akonadi::Item &item) |
void | currentChanged (const Akonadi::Item &item) |
Public Member Functions | |
ItemView (KXmlGuiWindow *xmlGuiWindow, QWidget *parent=0) | |
ItemView (QWidget *parent=0) | |
virtual void | setModel (QAbstractItemModel *model) |
void | setXmlGuiWindow (KXmlGuiWindow *xmlGuiWindow) |
virtual | ~ItemView () |
Protected Member Functions | |
void | contextMenuEvent (QContextMenuEvent *event) |
Detailed Description
A view to show an item list provided by an ItemModel.
When a KXmlGuiWindow is set, the XMLGUI defined context menu akonadi_itemview_contextmenu
is used if available.
Example:
class MyWindow : public KXmlGuiWindow { public: MyWindow() : KXmlGuiWindow() { Akonadi::ItemView *view = new Akonadi::ItemView( this, this ); setCentralWidget( view ); Akonadi::ItemModel *model = new Akonadi::ItemModel( this ); view->setModel( model ); } }
Definition at line 60 of file itemview.h.
Constructor & Destructor Documentation
ItemView::ItemView | ( | QWidget * | parent = 0 |
) | [explicit] |
Creates a new item view.
- Parameters:
-
parent The parent widget.
Definition at line 101 of file itemview.cpp.
ItemView::ItemView | ( | KXmlGuiWindow * | xmlGuiWindow, | |
QWidget * | parent = 0 | |||
) | [explicit] |
Creates a new item view.
- Parameters:
-
xmlGuiWindow The KXmlGuiWindow this 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 108 of file itemview.cpp.
ItemView::~ItemView | ( | ) | [virtual] |
Member Function Documentation
void Akonadi::ItemView::activated | ( | const Akonadi::Item & | item | ) | [signal] |
This signal is emitted whenever the user has activated an item in the view.
- Parameters:
-
item The activated item.
void Akonadi::ItemView::currentChanged | ( | const Akonadi::Item & | item | ) | [signal] |
This signal is emitted whenever the current item in the view has changed.
- Parameters:
-
item The current item.
void ItemView::setXmlGuiWindow | ( | KXmlGuiWindow * | xmlGuiWindow | ) |
Sets the KXmlGuiWindow which this view is used in.
This is needed if you want to use the built-in context menu.
- Parameters:
-
xmlGuiWindow The KXmlGuiWindow this view is used in.
Definition at line 139 of file itemview.cpp.
The documentation for this class was generated from the following files: