94 |
94 |
95 def keyPressEvent(self, event): |
95 def keyPressEvent(self, event): |
96 """ |
96 """ |
97 Protected slot to handle key press events. |
97 Protected slot to handle key press events. |
98 |
98 |
99 @param event reference to the key press event (QKeyEvent) |
99 @param event reference to the key press event |
|
100 @type QKeyEvent |
100 """ |
101 """ |
101 if event.key() == Qt.Key.Key_Escape: |
102 if event.key() == Qt.Key.Key_Escape: |
102 self.__mainWindow.setFocus(Qt.FocusReason.ActiveWindowFocusReason) |
103 self.__mainWindow.setFocus(Qt.FocusReason.ActiveWindowFocusReason) |
103 event.accept() |
104 event.accept() |
104 self.close() |
105 self.close() |
160 @pyqtSlot(str) |
161 @pyqtSlot(str) |
161 def on_findtextCombo_editTextChanged(self, txt): |
162 def on_findtextCombo_editTextChanged(self, txt): |
162 """ |
163 """ |
163 Private slot to enable/disable the find buttons. |
164 Private slot to enable/disable the find buttons. |
164 |
165 |
165 @param txt text of the combobox (string) |
166 @param txt text of the combobox |
|
167 @type str |
166 """ |
168 """ |
167 self.__setSearchButtons(txt != "") |
169 self.__setSearchButtons(txt != "") |
168 |
170 |
169 def __setSearchButtons(self, enabled): |
171 def __setSearchButtons(self, enabled): |
170 """ |
172 """ |
171 Private slot to set the state of the search buttons. |
173 Private slot to set the state of the search buttons. |
172 |
174 |
173 @param enabled flag indicating the state (boolean) |
175 @param enabled flag indicating the state |
|
176 @type bool |
174 """ |
177 """ |
175 self.__ui.findPrevButton.setEnabled(enabled) |
178 self.__ui.findPrevButton.setEnabled(enabled) |
176 self.__ui.findNextButton.setEnabled(enabled) |
179 self.__ui.findNextButton.setEnabled(enabled) |
177 |
180 |
178 def __findByReturnPressed(self): |
181 def __findByReturnPressed(self): |
187 |
190 |
188 def showFind(self, txt=""): |
191 def showFind(self, txt=""): |
189 """ |
192 """ |
190 Public method to display this widget. |
193 Public method to display this widget. |
191 |
194 |
192 @param txt text to be shown in the combo (string) |
195 @param txt text to be shown in the combo |
|
196 @type str |
193 """ |
197 """ |
194 self.__ui.findtextCombo.clear() |
198 self.__ui.findtextCombo.clear() |
195 self.__ui.findtextCombo.addItems(self.findHistory) |
199 self.__ui.findtextCombo.addItems(self.findHistory) |
196 self.__ui.findtextCombo.setEditText(txt) |
200 self.__ui.findtextCombo.setEditText(txt) |
197 self.__ui.findtextCombo.setFocus() |
201 self.__ui.findtextCombo.setFocus() |
202 |
206 |
203 def searchStringFound(self, found): |
207 def searchStringFound(self, found): |
204 """ |
208 """ |
205 Public slot to indicate that the search string was found. |
209 Public slot to indicate that the search string was found. |
206 |
210 |
207 @param found flag indicating success (boolean) |
211 @param found flag indicating success |
|
212 @type bool |
208 """ |
213 """ |
209 if found: |
214 if found: |
210 self.__ui.statusLabel.clear() |
215 self.__ui.statusLabel.clear() |
211 else: |
216 else: |
212 txt = self.__ui.findtextCombo.currentText() |
217 txt = self.__ui.findtextCombo.currentText() |