# eric7.EricWidgets.EricTreeWidget

Module implementing specialized tree views.

### Global Attributes

None

### Classes

EricTreeWidget | Class implementing an extended tree widget.
EricTreeWidgetItemsState | Class defining the items expansion state.

### Functions

None

## EricTreeWidget

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

None

### Class Methods

None

### Methods

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

#### EricTreeWidget (Constructor)

EricTreeWidget(parent=None)

Constructor

parent
  reference to the parent widget (QWidget)

#### EricTreeWidget.__iterateAllItems

__iterateAllItems(parent)

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

parent
  parent item to iterate (QTreeWidgetItem)

#### EricTreeWidget.__scheduleRefresh

__scheduleRefresh()

Private slot to schedule a refresh of the tree.

#### EricTreeWidget.addTopLevelItem

addTopLevelItem(item)

Public method to add a top level item.

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

#### EricTreeWidget.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)

#### EricTreeWidget.allItems

allItems()

Public method to get a list of all items.

Return:
  list of all items (list of QTreeWidgetItem)

#### EricTreeWidget.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)

Return:
  flag indicating success (boolean)

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

#### EricTreeWidget.clear

clear()

Public slot to clear the tree.

#### EricTreeWidget.deleteItem

deleteItem(item)

Public method to delete an item.

item
  item to be deleted (QTreeWidgetItem)

#### EricTreeWidget.deleteItems

deleteItems(items)

Public method to delete a list of items.

items
  items to be deleted (list of QTreeWidgetItem)

#### EricTreeWidget.filterString

filterString(filterStr)

Public slot to set a new filter.

filterStr
  filter to be set (string)

#### EricTreeWidget.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)

#### EricTreeWidget.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)

#### EricTreeWidget.mousePressEvent

mousePressEvent(evt)

Protected method handling mouse press events.

evt
  mouse press event (QMouseEvent)

#### EricTreeWidget.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)

Return:
  flag indicating success (boolean)

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

#### EricTreeWidget.setDefaultItemShowMode

setDefaultItemShowMode(mode)

Public method to set the default item show mode.

mode (EricTreeWidgetItemsState)
  default mode

Up

## EricTreeWidgetItemsState

Class defining the items expansion state.

### Derived from

enum.Enum

### Class Attributes

COLLAPSED
EXPANDED

### Class Methods

None

### Methods

None

### Static Methods

None

Up