# class ItemView

###

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

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.

To do: Convenience ctor including the KXmlGuiWindow for non-designer users?

### methods

- ItemView (parent)

  returns ctor

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

  Create a new item view.

  parent - the parent widget.

- ItemView (xmlGuiWindow, parent)

  returns ctor

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

  Create a new item view.

  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.

- activated (item)

  returns Nothing
  SIGNAL ("activated (const Item&)")

  Argument | Type | Default
  --- | --- | ---
  item | Akonadi.Item |

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

- contextMenuEvent (event)

  returns Nothing

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

- currentChanged (item)

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

  Argument | Type | Default
  --- | --- | ---
  item | Akonadi.Item |

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

- setModel (model)

  returns Nothing

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

  Reimplemented from QAbstractItemView.

- setXmlGuiWindow (xmlGuiWindow)

  returns Nothing

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

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

  xmlGuiWindow - The KXmlGuiWindow this view is used in.