Qt 5.2 QML WebView height: contentHeight
-
I want to have a weview inside a flickable
The problem is that we I set height: contentHeight, it triggers a binding loop and result in a height that is much larger.
Do you know how to do this? Thank you
This is the test code
import QtQuick 2.0
import QtWebKit 3.0Item{
width: 400
height: 300
Flickable {
anchors.fill: parent
contentWidth: parent.width
contentHeight: webView.height + label.height
Text {
id: label
text: "Hehe"
}
WebView {
id: webView
anchors.top: label.bottom
url: "http://www.google.com"
width: parent.width
height: contentHeight
}
}
} -
@import QtQuick 2.0
import QtWebKit 3.0Item{
width: 400
height: 300
Flickable {
anchors.fill: parent
contentWidth: parent.width
contentHeight: webView.height + label.height
Text {
id: label
text: "Hehe"
}
WebView {
id: webView
anchors.top: label.bottom
url: "http://www.google.com"
width: parent.width
height: contentHeight
}
}
}@