# eric6.E5Gui.E5TreeWidget

Module implementing specialized tree views.

### Global Attributes

None

### Classes

E5TreeWidget | Class implementing an extended tree widget.

### Functions

None

## E5TreeWidget

Class implementing an extended tree widget.

### Signals

itemControlClicked(QTreeWidgetItem)
  emitted after a Ctrl-Click on an item
itemMiddleButtonClicked(QTreeWidgetItem)
  emitted after a click of the middle button on an item

### Derived from

QTreeWidget

### Class Attributes

ItemsCollapsed
ItemsExpanded

### Class Methods

None

### Methods

E5TreeWidget | Constructor
__iterateAllItems | Private method to iterate over the child items of the parent.
__scheduleRefresh | Private slot to schedule a refresh of the tree.
addTopLevelItem | Public method to add a top level item.
addTopLevelItems | Public method to add a list of top level items.
allItems | Public method to get a list of all items.
appendToParentItem | Public method to append an item to a parent item.
clear | Public slot to clear the tree.
deleteItem | Public method to delete an item.
deleteItems | Public method to delete a list of items.
filterString | Public slot to set a new filter.
insertTopLevelItem | Public method to insert a top level item.
insertTopLevelItems | Public method to insert a list of top level items.
mousePressEvent | Protected method handling mouse press events.
prependToParentItem | Public method to prepend an item to a parent item.
setDefaultItemShowMode | Public method to set the default item show mode.

### Static Methods

None

#### E5TreeWidget (Constructor)

E5TreeWidget(parent=None)

Constructor

parent
  reference to the parent widget (QWidget)

#### E5TreeWidget.__iterateAllItems

__iterateAllItems(parent)

Private method to iterate over the child items of the parent.

parent
  parent item to iterate (QTreeWidgetItem)

#### E5TreeWidget.__scheduleRefresh

__scheduleRefresh()

Private slot to schedule a refresh of the tree.

#### E5TreeWidget.addTopLevelItem

addTopLevelItem(item)

Public method to add a top level item.

item
  item to be added as a top level item (QTreeWidgetItem)

#### E5TreeWidget.addTopLevelItems

addTopLevelItems(items)

Public method to add a list of top level items.

items
  items to be added as top level items (list of QTreeWidgetItem)

#### E5TreeWidget.allItems

allItems()

Public method to get a list of all items.

Returns:
  list of all items (list of QTreeWidgetItem)

#### E5TreeWidget.appendToParentItem

appendToParentItem(parent, item)

Public method to append an item to a parent item.

parent
  text of the parent item (string) or the parent item (QTreeWidgetItem)
item
  item to be appended (QTreeWidgetItem)

Returns:
  flag indicating success (boolean)

Raises RuntimeError:
  raised to indicate an illegal type for the parent

#### E5TreeWidget.clear

clear()

Public slot to clear the tree.

#### E5TreeWidget.deleteItem

deleteItem(item)

Public method to delete an item.

item
  item to be deleted (QTreeWidgetItem)

#### E5TreeWidget.deleteItems

deleteItems(items)

Public method to delete a list of items.

items
  items to be deleted (list of QTreeWidgetItem)

#### E5TreeWidget.filterString

filterString(filter)

Public slot to set a new filter.

filter
  filter to be set (string)

#### E5TreeWidget.insertTopLevelItem

insertTopLevelItem(index, item)

Public method to insert a top level item.

index
  index for the insertion (integer)
item
  item to be inserted as a top level item (QTreeWidgetItem)

#### E5TreeWidget.insertTopLevelItems

insertTopLevelItems(index, items)

Public method to insert a list of top level items.

index
  index for the insertion (integer)
items
  items to be inserted as top level items (list of QTreeWidgetItem)

#### E5TreeWidget.mousePressEvent

mousePressEvent(evt)

Protected method handling mouse press events.

evt
  mouse press event (QMouseEvent)

#### E5TreeWidget.prependToParentItem

prependToParentItem(parent, item)

Public method to prepend an item to a parent item.

parent
  text of the parent item (string) or the parent item (QTreeWidgetItem)
item
  item to be prepended (QTreeWidgetItem)

Returns:
  flag indicating success (boolean)

Raises RuntimeError:
  raised to indicate an illegal type for the parent

#### E5TreeWidget.setDefaultItemShowMode

setDefaultItemShowMode(mode)

Public method to set the default item show mode.

mode
  default mode (ItemsCollapsed, ItemsExpanded)

Up