# class CollectionView

###

Module | akonadi
Namespace | Akonadi
Class | CollectionView
Inherits | QTreeView

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>

### methods

- CollectionView (parent)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  parent | QWidget | 0

  Creates a new collection view.

  The - parent widget.

- CollectionView (xmlGuiWindow, parent)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  xmlGuiWindow | KXmlGuiWindow |
  parent | QWidget | 0

  Creates a new collection view.

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

  returns Nothing
  SIGNAL ("clicked (const Collection&)")

  Argument | Type | Default
  --- | --- | ---
  collection | Akonadi.Collection |

  This signal is emitted whenever the user has clicked a collection in the view.

  collection - The clicked collection.

- contextMenuEvent (event)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  event | QContextMenuEvent |

- currentChanged (collection)

  returns Nothing
  SIGNAL ("currentChanged (const Collection&)")

  Argument | Type | Default
  --- | --- | ---
  collection | Akonadi.Collection |

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

  collection - The new current collection.

- dragLeaveEvent (event)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  event | QDragLeaveEvent |

- dragMoveEvent (event)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  event | QDragMoveEvent |

- dropEvent (event)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  event | QDropEvent |

- setModel (model)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  model | QAbstractItemModel |

- setXmlGuiWindow (xmlGuiWindow)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  xmlGuiWindow | KXmlGuiWindow |

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

  xmlGuiWindow - The KXmlGuiWindow the view is used in.