Like the title says I have a QML WebView and I set it's url to a local HTML file from a folder outside the qrc:/ (resources). HTML file is calling a JS and a CSS file from the same folder. All work very well.
The problem is that I want to pass JS variables to QML or to QT main (C++). I know it is possible to exchange messages from QML to C++ and vice verse but I want to pass JS variables from QML WebView to QML or to QT.
Also I know that you can pass variables from JS to QML if you import in QML the JS file (import "myjs.JS" as D) and then you can access the variables. But the thing is that I copied the HTML, CSS, JS file from qrc:/ to another folder then I set the WebView url to that HTML file from folder. If I am to access with import I will get the default variables not the current ones. The reason why I copied the files to another folder is that I work on phone and I can't access or set the url to HTML file inside qrc:/ or asset:/
The structure of my files is:
1 QT main.cpp
1 QML file
1 HTML file
1 CSS file
1 JS file




Reply With Quote
Bookmarks