KDE 4.4 PyKDE API Reference
  • KDE's Python API
  • Overview
  • PyKDE Home
  • Sitemap
  • Contact Us
 

EntityTreeView Class Reference

from PyKDE4.akonadi import *

Inherits: QTreeView → QAbstractItemView → QAbstractScrollArea → QFrame → QWidget → QObject
Namespace: Akonadi.EntityTreeView

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 );
    }
 }

Author:
Volker Krause <vkrause@kde.org>
Author:
Stephen Kelly <steveire@gmail.com>
Since:
4.4


Signals

 clicked (, Akonadi.Collection collection)
 clicked (, Akonadi.Item item)
 currentChanged (, Akonadi.Collection collection)
 currentChanged (, Akonadi.Item item)
 doubleClicked (, Akonadi.Collection collection)
 doubleClicked (, Akonadi.Item item)

Methods

 __init__ (self, QWidget parent=0)
 __init__ (self, KXMLGUIClient xmlGuiClient, QWidget parent=0)
 clicked (self, Akonadi.Collection collection)
 clicked (self, Akonadi.Item item)
 contextMenuEvent (self, QContextMenuEvent event)
 currentChanged (self, Akonadi.Collection collection)
 currentChanged (self, Akonadi.Item item)
 doubleClicked (self, Akonadi.Collection collection)
 doubleClicked (self, Akonadi.Item item)
 dragMoveEvent (self, QDragMoveEvent event)
 dropEvent (self, QDropEvent event)
 setModel (self, QAbstractItemModel model)
 setXmlGuiClient (self, KXMLGUIClient xmlGuiClient)
 startDrag (self, Qt::DropActions supportedActions)
 timerEvent (self, QTimerEvent event)

Method Documentation

__init__ (  self,
QWidget  parent=0
)

Creates a new entity tree view.

Parameters:
parent  The parent widget.

__init__ (  self,
KXMLGUIClient  xmlGuiClient,
QWidget  parent=0
)

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.

clicked (  self,
Akonadi.Collection  collection
)

This signal is emitted whenever the user has clicked an item in the view.

Parameters:
item  The clicked item.

Signal syntax:
QObject.connect(source, SIGNAL("clicked(const Akonadi::Collection&)"), target_slot)
clicked (  self,
Akonadi.Item  item
)

This signal is emitted whenever the user has clicked an item in the view.

Parameters:
item  The clicked item.

Signal syntax:
QObject.connect(source, SIGNAL("clicked(const Akonadi::Item&)"), target_slot)
contextMenuEvent (  self,
QContextMenuEvent  event
)
currentChanged (  self,
Akonadi.Collection  collection
)

This signal is emitted whenever the current item in the view has changed.

Parameters:
item  The new current item.

Signal syntax:
QObject.connect(source, SIGNAL("currentChanged(const Akonadi::Collection&)"), target_slot)
currentChanged (  self,
Akonadi.Item  item
)

This signal is emitted whenever the current item in the view has changed.

Parameters:
item  The new current item.

Signal syntax:
QObject.connect(source, SIGNAL("currentChanged(const Akonadi::Item&)"), target_slot)
doubleClicked (  self,
Akonadi.Collection  collection
)

This signal is emitted whenever the user has double clicked an item in the view.

Parameters:
item  The double clicked item.

Signal syntax:
QObject.connect(source, SIGNAL("doubleClicked(const Akonadi::Collection&)"), target_slot)
doubleClicked (  self,
Akonadi.Item  item
)

This signal is emitted whenever the user has double clicked an item in the view.

Parameters:
item  The double clicked item.

Signal syntax:
QObject.connect(source, SIGNAL("doubleClicked(const Akonadi::Item&)"), target_slot)
dragMoveEvent (  self,
QDragMoveEvent  event
)
dropEvent (  self,
QDropEvent  event
)
setModel (  self,
QAbstractItemModel  model
)

@reimplemented

setXmlGuiClient (  self,
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.

startDrag (  self,
Qt::DropActions  supportedActions
)
timerEvent (  self,
QTimerEvent  event
)
  • Full Index

Modules

  • akonadi
  • dnssd
  • kdecore
  • kdeui
  • khtml
  • kio
  • knewstuff
  • kparts
  • kutils
  • nepomuk
  • phonon
  • plasma
  • polkitqt
  • solid
  • soprano
This documentation is maintained by Simon Edwards.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal