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

CollectionView Class Reference

from PyKDE4.akonadi import *

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

Detailed Description

A view to show a collection tree provided by a CollectionModel.

When a KXmlGuiWindow is passed to the constructor, the XMLGUI defined context menu akonadi_collectionview_contextmenu is used if available.

Example:


 class MyWindow : public KXmlGuiWindow
 {
   public:
    MyWindow()
      : KXmlGuiWindow()
    {
      Akonadi.CollectionView *view = new Akonadi.CollectionView( this, this );
      setCentralWidget( view );

      Akonadi.CollectionModel *model = new Akonadi.CollectionModel( this );
      view->setModel( model );
    }
 }

Author:
Volker Krause <vkrause@kde.org>


Signals

 clicked (Akonadi.Collection collection)
 currentChanged (Akonadi.Collection collection)

Methods

 __init__ (self, QWidget parent=0)
 __init__ (self, KXmlGuiWindow xmlGuiWindow, QWidget parent=0)
 clicked (self, Akonadi.Collection collection)
 contextMenuEvent (self, QContextMenuEvent event)
 currentChanged (self, Akonadi.Collection collection)
 dragLeaveEvent (self, QDragLeaveEvent event)
 dragMoveEvent (self, QDragMoveEvent event)
 dropEvent (self, QDropEvent event)
 setModel (self, QAbstractItemModel model)
 setXmlGuiWindow (self, KXmlGuiWindow xmlGuiWindow)

Method Documentation

__init__ (  self,
QWidget  parent=0
)

Creates a new collection view.

Parameters:
parent  The parent widget.

__init__ (  self,
KXmlGuiWindow  xmlGuiWindow,
QWidget  parent=0
)

Creates a new collection view.

Parameters:
xmlGuiWindow  The KXmlGuiWindow 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 a collection in the view.

Parameters:
collection  The clicked collection.

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

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

Parameters:
collection  The new current collection.

Signal syntax:
QObject.connect(source, SIGNAL("currentChanged(const Collection&)"), target_slot)
dragLeaveEvent (  self,
QDragLeaveEvent  event
)
dragMoveEvent (  self,
QDragMoveEvent  event
)
dropEvent (  self,
QDropEvent  event
)
setModel (  self,
QAbstractItemModel  model
)
setXmlGuiWindow (  self,
KXmlGuiWindow  xmlGuiWindow
)

Sets the KXmlGuiWindow which the view is used in. This is needed if you want to use the built-in context menu.

Parameters:
xmlGuiWindow  The KXmlGuiWindow the view is used in.

  • Full Index

Modules

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