eric6/WebBrowser/History/HistoryDialog.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
43 @param parent reference to the parent widget (QWidget 43 @param parent reference to the parent widget (QWidget
44 @param manager reference to the history manager object (HistoryManager) 44 @param manager reference to the history manager object (HistoryManager)
45 """ 45 """
46 super(HistoryDialog, self).__init__(parent) 46 super(HistoryDialog, self).__init__(parent)
47 self.setupUi(self) 47 self.setupUi(self)
48 self.setWindowFlags(Qt.Window) 48 self.setWindowFlags(Qt.WindowType.Window)
49 49
50 self.__historyManager = manager 50 self.__historyManager = manager
51 if self.__historyManager is None: 51 if self.__historyManager is None:
52 import WebBrowser.WebBrowserWindow 52 import WebBrowser.WebBrowserWindow
53 self.__historyManager = ( 53 self.__historyManager = (
67 except AttributeError: 67 except AttributeError:
68 header = fm.width("m") * 40 68 header = fm.width("m") * 40
69 self.historyTree.header().resizeSection(0, header) 69 self.historyTree.header().resizeSection(0, header)
70 self.historyTree.header().resizeSection(1, header) 70 self.historyTree.header().resizeSection(1, header)
71 self.historyTree.header().setStretchLastSection(True) 71 self.historyTree.header().setStretchLastSection(True)
72 self.historyTree.setContextMenuPolicy(Qt.CustomContextMenu) 72 self.historyTree.setContextMenuPolicy(
73 Qt.ContextMenuPolicy.CustomContextMenu)
73 74
74 self.historyTree.activated.connect(self.__activated) 75 self.historyTree.activated.connect(self.__activated)
75 self.historyTree.customContextMenuRequested.connect( 76 self.historyTree.customContextMenuRequested.connect(
76 self.__customContextMenuRequested) 77 self.__customContextMenuRequested)
77 78
126 """ 127 """
127 Private slot to handle the activation of an entry. 128 Private slot to handle the activation of an entry.
128 129
129 @param idx reference to the entry index (QModelIndex) 130 @param idx reference to the entry index (QModelIndex)
130 """ 131 """
131 if QApplication.keyboardModifiers() & Qt.ControlModifier: 132 if (
133 QApplication.keyboardModifiers() &
134 Qt.KeyboardModifier.ControlModifier
135 ):
132 self.__openHistoryInNewTab() 136 self.__openHistoryInNewTab()
133 elif QApplication.keyboardModifiers() & Qt.ShiftModifier: 137 elif (
138 QApplication.keyboardModifiers() &
139 Qt.KeyboardModifier.ShiftModifier
140 ):
134 self.__openHistoryInNewWindow() 141 self.__openHistoryInNewWindow()
135 else: 142 else:
136 self.__openHistoryInCurrentTab() 143 self.__openHistoryInCurrentTab()
137 144
138 def __openHistoryInCurrentTab(self): 145 def __openHistoryInCurrentTab(self):

eric ide

mercurial