Unsolved Access QWebKit (QML based 5.2+ alpha) from C++
-
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
-
You need to include private headers of QtWebKit like
private/qquickwebview_p.h
and get access toQQuickWebView
object from your scene -
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
-
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++