Using Qt WebKit
-
Hello all,
I want to create a C++ app with a HTML page attached to it. I was succesfull in creating the project and add a HTML page and was able to run it. I can now see my HTML page with buttons and text in it.
Now i want to be able to recieve the HTML button click events in the C++ code. How can i do that?
Once i recieve the button click, i want to call a JavaScript function in HTML page. How to do that?
I am new to Qt and WebKit. So please help. I looked at the FormExtractor example in Qt web, but that doesn't talk about how to recive HTML button click events in C++ code.
Thanks in advance.
-
Hello. Take a look at this:
http://qt-project.org/forums/viewthread/35089/#151811Then you could do:
@<button onclick="my_object.buttonPressed()">The button</button>@
And for running javascript from C++ side, see:
http://qt-project.org/doc/qt-5.1/qtwebkit/qwebframe.html#evaluateJavaScript