import config from qtpy.QtWidgets import QInputDialog, QLineEdit from qtpy.QtWebEngineWidgets import QWebEnginePage def findText(found): if not found: config.mainWindow.displayMessage("Not found!") if config.pluginContext: config.mainWindow.mainPage.findText(config.pluginContext, QWebEnginePage.FindFlags(), findText) else: text, ok = QInputDialog.getText(config.mainWindow, "QInputDialog.getText()", "Find in Bible Window:", QLineEdit.Normal, "") if ok and text != '': config.mainWindow.mainPage.findText(text, QWebEnginePage.FindFlags(), findText)
forward=True, case=False, word=False, regexp=False): """Find text.""" if not WEBENGINE: findflag = QWebEnginePage.FindWrapsAroundDocument else: findflag = 0 if not forward: findflag = findflag | QWebEnginePage.FindBackward if case: findflag = findflag | QWebEnginePage.FindCaseSensitively return self.findText(text, QWebEnginePage.FindFlags(findflag)) def get_selected_text(self): """Return text selected by current text cursor""" return self.selectedText() def set_source_text(self, source_text): """Set source text of the page. Callback for QWebEngineView.""" self.source_text = source_text def get_number_matches(self, pattern, source_text='', case=False, regexp=False, word=False):
import config from qtpy.QtWidgets import QInputDialog, QLineEdit from qtpy.QtWebEngineWidgets import QWebEnginePage def findText(found): if not found: config.mainWindow.displayMessage("Not found!") if config.pluginContext: config.mainWindow.studyPage.findText(config.pluginContext, QWebEnginePage.FindFlags(), findText) else: text, ok = QInputDialog.getText(config.mainWindow, "QInputDialog.getText()", "Find in Bible Window:", QLineEdit.Normal, "") if ok and text != '': config.mainWindow.studyPage.findText(text, QWebEnginePage.FindFlags(), findText)