QWebEngineFindTextResult Class
The QWebEngineFindTextResult class encapsulates the result of a string search on a page. More...
Header: | #include <QWebEngineFindTextResult> |
Since: | Qt 5.14 |
Instantiated By: | FindTextResult |
This class was introduced in Qt 5.14.
Properties
- activeMatch : const int
- numberOfMatches : const int
Public Functions
int | activeMatch() const |
int | numberOfMatches() const |
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(), &QWebEnginePage::findTextFinished, [](const QWebEngineFindTextResult &result) { qInfo() << result.activeMatch() << "of" << result.numberOfMatches() << "matches"; });
Results are passed to the user in the QWebEnginePage::findTextFinished() and WebEngineView.findTextFinished() signals.
© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.