def loaded(self, ok):
     self.assertTrue(ok)
     if not ok:
         QCoreApplication.quit()
     self._view.page().runJavaScript("document.title", 1,
                                     partial(self.javascript_callback))
     self._view.findText("fox", QWebEnginePage.FindFlags(),
                         partial(self.found_callback))
Пример #2
0
 def _emit_find(self, backward):
     needle = self._line_edit.text().strip()
     if needle:
         flags = QWebEnginePage.FindFlags()
         if self._case_sensitive_checkbox.isChecked():
             flags |= QWebEnginePage.FindCaseSensitively
         if backward:
             flags |= QWebEnginePage.FindBackward
         self.find.emit(needle, flags)