# eric7.WebBrowser.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

EricTreeWidget

### 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 (AdBlockSubscription)
  reference to the subscription
parent (QWidget)
  reference to the parent widget

#### AdBlockTreeWidget.__adjustItemFeatures

__adjustItemFeatures(itm, rule)

Private method to adjust an item.

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

#### AdBlockTreeWidget.__contextMenuRequested

__contextMenuRequested(pos)

Private slot to show the context menu.

pos (QPoint)
  position for the menu

#### 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 (QTreeWidgetItem)
  changed item

#### AdBlockTreeWidget.__subscriptionChanged

__subscriptionChanged()

Private slot handling a subscription change.

#### AdBlockTreeWidget.addRule

addRule(filterRule="")

Public slot to add a new rule.

filterRule (str)
  filter to be added

#### AdBlockTreeWidget.keyPressEvent

keyPressEvent(evt)

Protected method handling key presses.

evt (QKeyEvent)
  key press event

#### 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 (AdBlockRule)
  AdBlock rule to be shown

#### AdBlockTreeWidget.subscription

subscription()

Public method to get a reference to the subscription.

Return:
  reference to the subscription

Return Type:
  AdBlockSubscription

Up