[solved][Qt 5.4][QML] ios webview not working as expected
-
Hi
I got a problem with WebView component. I am trying to load a page but my url is never set. Whenever I check url its alweys empty string.
My simple code:
import QtQuick 2.0 import QtWebView 1.0 Item { width: 100 height: 62 z: 0 WebView{ width: parent.width height: parent.height url: "qrc:/hotel/html/index.html" } }
my pro file:
QT +=webview
-
WebView element is actually a wrapped native iOS web view. It won't work with a Qt resource file. You should try something like this:
Your *.pro file:ios { BUNDLE_DATA.files = $$$$files($$$$PWD/resources/index.html) // it should be double dollar signs here! QMAKE_BUNDLE_DATA += BUNDLE_DATA }
Your *.qml file:
WebView { width: parent.width height: parent.height url: "./index.html" }
Make sure resources/index.html is present in your source code directory.
-
You may be right but why isn't working with remote pages(tried www.google.pl), and why url string is always empty.