KDE 4.7 PyKDE API Reference

- KDE's Python API

# EntityListView Class Reference

`from PyKDE4.akonadi import *`

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

## Detailed Description

A view to show an item/collection list 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()
        {
          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>

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)
| contextMenuEvent (self, QContextMenuEvent event)
| dragMoveEvent (self, QDragMoveEvent event)
| dropEvent (self, QDropEvent event)
| setModel (self, QAbstractItemModel model)
| setXmlGuiClient (self, KXMLGUIClient xmlGuiClient)
| startDrag (self, Qt::DropActions supportedActions)

## Signal Documentation

clicked | ( | 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 | ( | 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)`

currentChanged | ( | 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 | ( | 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 | ( | 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 | ( | 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)`

## Method Documentation

__init__ | ( | self, |
|  | QWidget | parent=0
| ) |  |  |

Creates a new favorite collections view.

Parameters:

  | parent | The parent widget.

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

Creates a new favorite collections 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.

contextMenuEvent | ( | self, |
|  | QContextMenuEvent | event
| ) |  |  |

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