WebBrowser/SearchWidget.py

branch
QtWebEngine
changeset 4715
79009bc4acd5
parent 4710
370a38e03efe
child 4881
c269212cceac
equal deleted inserted replaced
4713:8dca047daf4b 4715:79009bc4acd5
10 from __future__ import unicode_literals 10 from __future__ import unicode_literals
11 11
12 from PyQt5.QtCore import pyqtSlot, Qt 12 from PyQt5.QtCore import pyqtSlot, Qt
13 from PyQt5.QtGui import QPalette, QBrush, QColor 13 from PyQt5.QtGui import QPalette, QBrush, QColor
14 from PyQt5.QtWidgets import QWidget 14 from PyQt5.QtWidgets import QWidget
15 ##from PyQt5.QtWebKitWidgets import QWebPage
16 15
17 from .Ui_SearchWidget import Ui_SearchWidget 16 from .Ui_SearchWidget import Ui_SearchWidget
18 17
19 import UI.PixmapCache 18 import UI.PixmapCache
20 19
86 85
87 if not self.findtextCombo.currentText(): 86 if not self.findtextCombo.currentText():
88 return 87 return
89 88
90 # TODO: adjust this to the browser API 89 # TODO: adjust this to the browser API
91 # TODO: use the callback interface of QWebEnginePage 90 self.__mainWindow.currentBrowser().findNextPrev(
92 if not self.__mainWindow.currentBrowser().findNextPrev( 91 self.findtextCombo.currentText(),
93 self.findtextCombo.currentText(), 92 self.caseCheckBox.isChecked(),
94 self.caseCheckBox.isChecked(), 93 self.__findBackwards,
95 self.__findBackwards, 94 self.wrapCheckBox.isChecked(),
96 self.wrapCheckBox.isChecked(), 95 False,
97 False): 96 self.__findNextPrevCallback)
97
98 def __findNextPrevCallback(self, found):
99 """
100 Private method to process the result of the last search.
101
102 @param found flag indicating if the last search succeeded
103 @type bool
104 """
105 if not found:
98 self.infoLabel.setText(self.tr("Expression was not found.")) 106 self.infoLabel.setText(self.tr("Expression was not found."))
99 self.__setFindtextComboBackground(True) 107 self.__setFindtextComboBackground(True)
100 ## 108 ##
101 ## @pyqtSlot(bool) 109 ## @pyqtSlot(bool)
102 ## def on_highlightAllCheckBox_toggled(self, checked): 110 ## def on_highlightAllCheckBox_toggled(self, checked):

eric ide

mercurial