QWebEngineFindTextResult Class▲
-
Header: QWebEngineFindTextResult
-
Since: Qt 5.14
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS WebEngineCore)
target_link_libraries(mytarget PRIVATE Qt6::WebEngineCore)
-
qmake: QT += webenginecore
-
Inherited By:
-
Instantiated By: qml-qtwebengine-findtextresult.xml
Detailed Description▲
The string search can be initiated by the QWebEnginePage::findText() or WebEngineView.findText() method. The results of the search are highlighted in the view. The details of this result are passed as a QWebEngineFindTextResult object that can be used to show a status message, such as "2 of 2 matches". For example:
QObject::
connect(view.page(), &
amp;QWebEnginePage::
findTextFinished, [](const
QWebEngineFindTextResult &
amp;result) {
qInfo() &
lt;&
lt; result.activeMatch() &
lt;&
lt; "of"
&
lt;&
lt; result.numberOfMatches() &
lt;&
lt; "matches"
;
}
);
Results are passed to the user in the QWebEnginePage::findTextFinished() and WebEngineView.findTextFinished() signals.