1

I used webview to show the webpage,

view->setUrl(QUrl("C:\\Qt\\2010.07\\qt\\serbest\\googleSearch.htm"));

in the HTML code I put some ajax code googleSearch. After I execute the program, the webview runs and there are results (pages links).

When I clicked any of the links they do not open. So what do I do to open the links I clicked?

How can I access the title of the links from the result of javascript in Qt?

1 Answer 1

1
"C:\Qt\2010.07\qt\serbest\googleSearch.htm"

That's not a URL, it's a Windows pathname. Also, it has troublesome unescaped backslashes: \201 is a string literal escape for the control character U+0081 in many languages (including JavaScript as per your tags, though the snippet does not appear to actually be JavaScript).

The URL form of that filename would look something like:

"file:///C|/Qt/2010.07/qt/serbest/googleSearch.htm"

You can convert a filename into a URL using fromLocalFile().

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.