src/eric7/WebBrowser/SearchWidget.py

branch
eric7
changeset 10436
f6881d10e995
parent 10190
dbe6394786ea
child 10439
21c28b0f9e41
equal deleted inserted replaced
10435:c712d09cc839 10436:f6881d10e995
23 23
24 def __init__(self, mainWindow, parent=None): 24 def __init__(self, mainWindow, parent=None):
25 """ 25 """
26 Constructor 26 Constructor
27 27
28 @param mainWindow reference to the main window (QMainWindow) 28 @param mainWindow reference to the main window
29 @param parent parent widget of this dialog (QWidget) 29 @type QMainWindow
30 @param parent parent widget of this dialog
31 @type QWidget
30 """ 32 """
31 super().__init__(parent) 33 super().__init__(parent)
32 self.setupUi(self) 34 self.setupUi(self)
33 35
34 self.__mainWindow = mainWindow 36 self.__mainWindow = mainWindow
56 @pyqtSlot(str) 58 @pyqtSlot(str)
57 def on_findtextCombo_editTextChanged(self, txt): 59 def on_findtextCombo_editTextChanged(self, txt):
58 """ 60 """
59 Private slot to enable/disable the find buttons. 61 Private slot to enable/disable the find buttons.
60 62
61 @param txt text of the combobox (string) 63 @param txt text of the combobox
64 @type str
62 """ 65 """
63 self.findPrevButton.setEnabled(txt != "") 66 self.findPrevButton.setEnabled(txt != "")
64 self.findNextButton.setEnabled(txt != "") 67 self.findNextButton.setEnabled(txt != "")
65 68
66 @pyqtSlot(str) 69 @pyqtSlot(str)
67 def __searchTextEdited(self, txt): 70 def __searchTextEdited(self, txt):
68 """ 71 """
69 Private slot to perform an incremental search. 72 Private slot to perform an incremental search.
70 73
71 @param txt current text of the search combos line edit (string) 74 @param txt current text of the search combos line edit
75 @type str
72 (unused) 76 (unused)
73 """ 77 """
74 self.__findNextPrev() 78 self.__findNextPrev()
75 79
76 def __findNextPrev(self): 80 def __findNextPrev(self):
206 210
207 def keyPressEvent(self, event): 211 def keyPressEvent(self, event):
208 """ 212 """
209 Protected slot to handle key press events. 213 Protected slot to handle key press events.
210 214
211 @param event reference to the key press event (QKeyEvent) 215 @param event reference to the key press event
216 @type QKeyEvent
212 """ 217 """
213 if event.key() == Qt.Key.Key_Escape: 218 if event.key() == Qt.Key.Key_Escape:
214 cb = self.__mainWindow.currentBrowser() 219 cb = self.__mainWindow.currentBrowser()
215 if cb: 220 if cb:
216 cb.setFocus(Qt.FocusReason.ActiveWindowFocusReason) 221 cb.setFocus(Qt.FocusReason.ActiveWindowFocusReason)
221 def __setFindtextComboBackground(self, error): 226 def __setFindtextComboBackground(self, error):
222 """ 227 """
223 Private slot to change the findtext combo background to indicate 228 Private slot to change the findtext combo background to indicate
224 errors. 229 errors.
225 230
226 @param error flag indicating an error condition (boolean) 231 @param error flag indicating an error condition
232 @type bool
227 """ 233 """
228 styleSheet = ( 234 styleSheet = (
229 "color: #000000; background-color: #ff6666" 235 "color: #000000; background-color: #ff6666"
230 if error 236 if error
231 else f"color: {self.__defaultTextColor};" 237 else f"color: {self.__defaultTextColor};"

eric ide

mercurial