# eric5.Helpviewer.AdBlock.AdBlockTreeWidget

Module implementing a tree widget for the AdBlock configuration dialog.

### Global Attributes

None

### Classes

AdBlockTreeWidget | Class implementing a tree widget for the AdBlock configuration dialog.

### Functions

None

## AdBlockTreeWidget

Class implementing a tree widget for the AdBlock configuration dialog.

### Derived from

E5TreeWidget

### Class Attributes

None

### Class Methods

None

### Methods

AdBlockTreeWidget | Constructor
__adjustItemFeatures | Private method to adjust an item.
__contextMenuRequested | Private slot to show the context menu.
__copyFilter | Private slot to copy the current filter to the clipboard.
__itemChanged | Private slot to handle the change of an item.
__subscriptionChanged | Private slot handling a subscription change.
addRule | Public slot to add a new rule.
keyPressEvent | Protected method handling key presses.
refresh | Public method to refresh the tree.
removeRule | Public slot to remove the current rule.
showRule | Public method to highlight the given rule.
subscription | Public method to get a reference to the subscription.

### Static Methods

None

#### AdBlockTreeWidget (Constructor)

AdBlockTreeWidget(subscription, parent=None)

Constructor

subscription
  reference to the subscription (AdBlockSubscription)
parent
  reference to the parent widget (QWidget)

#### AdBlockTreeWidget.__adjustItemFeatures

__adjustItemFeatures(itm, rule)

Private method to adjust an item.

itm
  item to be adjusted (QTreeWidgetItem)
rule
  rule for the adjustment (AdBlockRule)

#### AdBlockTreeWidget.__contextMenuRequested

__contextMenuRequested(pos)

Private slot to show the context menu.

pos
  position for the menu (QPoint)

#### AdBlockTreeWidget.__copyFilter

__copyFilter()

Private slot to copy the current filter to the clipboard.

#### AdBlockTreeWidget.__itemChanged

__itemChanged(itm)

Private slot to handle the change of an item.

itm
  changed item (QTreeWidgetItem)

#### AdBlockTreeWidget.__subscriptionChanged

__subscriptionChanged()

Private slot handling a subscription change.

#### AdBlockTreeWidget.addRule

addRule(filter="")

Public slot to add a new rule.

filter
  filter to be added (string)

#### AdBlockTreeWidget.keyPressEvent

keyPressEvent(evt)

Protected method handling key presses.

evt
  key press event (QKeyEvent)

#### AdBlockTreeWidget.refresh

refresh()

Public method to refresh the tree.

#### AdBlockTreeWidget.removeRule

removeRule()

Public slot to remove the current rule.

#### AdBlockTreeWidget.showRule

showRule(rule)

Public method to highlight the given rule.

rule
  AdBlock rule to be shown (AdBlockRule)

#### AdBlockTreeWidget.subscription

subscription()

Public method to get a reference to the subscription.

Returns:
  reference to the subscription (AdBlockSubscription)

Up