eric7/WebBrowser/AdBlock/AdBlockTreeWidget.py

branch
eric7
changeset 8356
68ec9c3d4de5
parent 8318
962bce857696
child 8358
144a6b854f70
equal deleted inserted replaced
8355:8a7677a63c8d 8356:68ec9c3d4de5
12 from PyQt6.QtWidgets import ( 12 from PyQt6.QtWidgets import (
13 QAbstractItemView, QTreeWidgetItem, QInputDialog, QLineEdit, QMenu, 13 QAbstractItemView, QTreeWidgetItem, QInputDialog, QLineEdit, QMenu,
14 QApplication 14 QApplication
15 ) 15 )
16 16
17 from E5Gui.E5TreeWidget import E5TreeWidget, E5TreeWidgetItemsState 17 from E5Gui.EricTreeWidget import EricTreeWidget, EricTreeWidgetItemsState
18 from E5Gui.E5OverrideCursor import E5OverrideCursor 18 from E5Gui.EricOverrideCursor import EricOverrideCursor
19 19
20 20
21 class AdBlockTreeWidget(E5TreeWidget): 21 class AdBlockTreeWidget(EricTreeWidget):
22 """ 22 """
23 Class implementing a tree widget for the AdBlock configuration dialog. 23 Class implementing a tree widget for the AdBlock configuration dialog.
24 """ 24 """
25 def __init__(self, subscription, parent=None): 25 def __init__(self, subscription, parent=None):
26 """ 26 """
37 self.__topItem = None 37 self.__topItem = None
38 self.__ruleToBeSelected = "" 38 self.__ruleToBeSelected = ""
39 self.__itemChangingBlock = False 39 self.__itemChangingBlock = False
40 40
41 self.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu) 41 self.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
42 self.setDefaultItemShowMode(E5TreeWidgetItemsState.EXPANDED) 42 self.setDefaultItemShowMode(EricTreeWidgetItemsState.EXPANDED)
43 self.setHeaderHidden(True) 43 self.setHeaderHidden(True)
44 self.setAlternatingRowColors(True) 44 self.setAlternatingRowColors(True)
45 45
46 self.customContextMenuRequested.connect(self.__contextMenuRequested) 46 self.customContextMenuRequested.connect(self.__contextMenuRequested)
47 self.itemChanged.connect(self.__itemChanged) 47 self.itemChanged.connect(self.__itemChanged)
79 79
80 def refresh(self): 80 def refresh(self):
81 """ 81 """
82 Public method to refresh the tree. 82 Public method to refresh the tree.
83 """ 83 """
84 with E5OverrideCursor(): 84 with EricOverrideCursor():
85 self.__itemChangingBlock = True 85 self.__itemChangingBlock = True
86 self.clear() 86 self.clear()
87 87
88 boldFont = QFont() 88 boldFont = QFont()
89 boldFont.setBold(True) 89 boldFont.setBold(True)

eric ide

mercurial