My code was as simple as those:
WebView {
id: testWebViewJs
anchors.fill: parent
url: "http://localhost"
onUrlChanged: {
console.log(testWebViewJs.url);
}
}
My environment is Qt 5.2 with mingw on WIndows 7.
I’m working on a qml based tool which is using QtQuick 2.2.
Here is the problem:
1.first of all,I can not drag a WebView to ui in the design mode ,it tells me :
“Using Qt Quick 1 code mode instead of Qt Quick 2 (M324)”
Even I add WebView manually in code mode,it still show me these error,I had to use “// @disable-check M324” to avoid this message.
2.The WebView shows correct html at the beginning,then I found that it will take over other widgets’s place when I scroll up/down the webpage,it seems like the WebView was squatting places outisde of the Rectangle wrapper,suddenly i realized maybe it’s just the size probelm.
Then I found preferredHeight and preferredWidth in the design mode,but it tells me “Cannot assign to non-existent property “preferredHeight”.
I checked Qt 5.2’s doc,it’s just a few Properties and doesn’t have preferredWidth/preferredHeight
I can’t move anymore,should I use Qt Quick 1 instead(I rather not to)?is that a wrong tool for display html content?Grateful for any advice.
↧