eric6/WebBrowser/QtHelp/HelpSearchWidget.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
71 71
72 def __searchingStarted(self): 72 def __searchingStarted(self):
73 """ 73 """
74 Private slot to handle the start of a search. 74 Private slot to handle the start of a search.
75 """ 75 """
76 QApplication.setOverrideCursor(Qt.WaitCursor) 76 QApplication.setOverrideCursor(Qt.CursorShape.WaitCursor)
77 77
78 def __searchingFinished(self, hits): 78 def __searchingFinished(self, hits):
79 """ 79 """
80 Private slot to handle the end of the search. 80 Private slot to handle the end of the search.
81 81
93 """ 93 """
94 if not url.isEmpty() and url.isValid(): 94 if not url.isEmpty() and url.isValid():
95 buttons = QApplication.mouseButtons() 95 buttons = QApplication.mouseButtons()
96 modifiers = QApplication.keyboardModifiers() 96 modifiers = QApplication.keyboardModifiers()
97 97
98 if buttons & Qt.MidButton: 98 if buttons & Qt.MouseButton.MidButton:
99 self.newTab.emit(url) 99 self.newTab.emit(url)
100 else: 100 else:
101 if ( 101 if (
102 modifiers & (Qt.ControlModifier | Qt.ShiftModifier) == 102 modifiers & (
103 (Qt.ControlModifier | Qt.ShiftModifier) 103 Qt.KeyboardModifier.ControlModifier |
104 Qt.KeyboardModifier.ShiftModifier
105 ) == (
106 Qt.KeyboardModifier.ControlModifier |
107 Qt.KeyboardModifier.ShiftModifier
108 )
104 ): 109 ):
105 self.newBackgroundTab.emit(url) 110 self.newBackgroundTab.emit(url)
106 elif modifiers & Qt.ControlModifier: 111 elif modifiers & Qt.KeyboardModifier.ControlModifier:
107 self.newTab.emit(url) 112 self.newTab.emit(url)
108 elif modifiers & Qt.ShiftModifier: 113 elif modifiers & Qt.KeyboardModifier.ShiftModifier:
109 self.newWindow.emit(url) 114 self.newWindow.emit(url)
110 else: 115 else:
111 self.openUrl.emit(url) 116 self.openUrl.emit(url)
112 117
113 def keyPressEvent(self, evt): 118 def keyPressEvent(self, evt):
114 """ 119 """
115 Protected method handling key press events. 120 Protected method handling key press events.
116 121
117 @param evt reference to the key press event (QKeyEvent) 122 @param evt reference to the key press event (QKeyEvent)
118 """ 123 """
119 if evt.key() == Qt.Key_Escape: 124 if evt.key() == Qt.Key.Key_Escape:
120 self.escapePressed.emit() 125 self.escapePressed.emit()
121 else: 126 else:
122 evt.ignore() 127 evt.ignore()
123 128
124 def contextMenuEvent(self, evt): 129 def contextMenuEvent(self, evt):

eric ide

mercurial