Access QWebKit (QML based 5.2+ alpha) from C++
-
wrote on 7 Feb 2018, 15:01 last edited by
Hi there,
i'm building a sample app that uses QML for UI and WebKit View. I want to access and call functions on QML based QWebKit from C++. How can i achieve that?
Thanks
-
Hi there,
i'm building a sample app that uses QML for UI and WebKit View. I want to access and call functions on QML based QWebKit from C++. How can i achieve that?
Thanks
wrote on 7 Feb 2018, 15:59 last edited byYou need to include private headers of QtWebKit like
private/qquickwebview_p.h
and get access toQQuickWebView
object from your scene -
wrote on 10 Feb 2018, 17:30 last edited by
Thank you for your reply, looks like i dont get reply notifications
i saw the code but looks like its all happening in main file.
I created a simple Quick App, i exposed a C++ class WebKitController to QML and put both QML WebKit {} and my WebKitController{} in qml main file.
now i want to call a function on WebKitController.onCompleted{} that pass the WebKit QML object or its id to my cpp class. I dont know what my cpp class will expect here and what should i pass actually?Thanks again
-
wrote on 11 Feb 2018, 09:48 last edited by
What's wrong with accessing webview in the same way as in example above, i.e. property of a root object?
In my recent project I use a different approach, my QML scene is really minimalistic (WebView and splash screen only), so I construct it fully in C++
4/4