May 2019
Intermediate to advanced
542 pages
13h 37m
English
So far, we've loaded and displayed content in our web view widget, but we haven't really done much with the actual content. One of the powerful features that we get with QtWebEngine is the ability to manipulate the contents of web pages by injecting our own JavaScript code into those pages. To see how this works, we're going to use the following instructions to develop a text search feature that will highlight all instances of a search term:
find_dock = qtw.QDockWidget('Search') self.addDockWidget(qtc.Qt.BottomDockWidgetArea, find_dock) self.find_text = qtw.QLineEdit() find_dock.setWidget(self.find_text) self.find_text.textChanged.connect(self.text_search) ...Read now
Unlock full access