WebEngineView->findText()
I am using QWebEngineView to display the .html page.
I try to use findText to find where the search text is found on the loaded page.
Code:
bool textFound;
findText(QStringLiteral("Experience"), QWebEnginePage::FindFlags(), [this](bool found) { textFound = found;});
if(textFound)
{
// do my processing
}
When I execute this code, getting error as below
error: expected expression
findText(QStringLiteral("Experience"), QWebEnginePage::FindFlags(), [this](bool found) { qDebug()<<"inside";});
^
Kindly help me resolve this issue.
Re: WebEngineView->findText()
Dont you need to call the findText function via an object ??
Re: WebEngineView->findText()
I am calling this from inside the webengineview class
Re: WebEngineView->findText()
Code:
void WebEngineView::foundText(bool value)
{
textFound = value;
}
void searchText()
{
findText(QStringLiteral("exception"), QWebEnginePage::FindFlags(),
[=](bool found) { foundText(found); }
);
}
This is the code which works