How to response html5 events from qt5
Qt WebKit
2
Posts
2
Posters
958
Views
1
Watching
-
Hi,
Welcome to devnet,
You can with QWebview.
- Load the HTML page using "QWebview":http://qt-project.org/doc/qt-5/qwebview.html
- Make a C++ class derived from QObject which is available to the page using "addToJavaScriptWindowObject":http://qt-project.org/doc/qt-5/qwebframe.html#addToJavaScriptWindowObject. Add a Q_INVOKABLE function to this class.
- In HTML page you can create a JavaScript function which will be able to call the function in C++ class by using the exposed object's name.
- Call this JavaScript function on button click.