[Qt-qml] Basic QML Webkit + Flickable not working
tico.ballagas at nokia.com
tico.ballagas at nokia.com
Tue Nov 9 05:50:03 CET 2010
Hmm. It looks like it also works if I just use constants for the preferredWidth / preferredHeight:
import Qt 4.7
import QtWebKit 1.0
Flickable{
width: 640; height:480
contentWidth: webView.width
contentHeight: webView.height
WebView {
id: webView
preferredWidth: 640
preferredHeight: 480
url: 'http://qt.nokia.com'
}
}
However, if I try to bind preferredWidth / preferredHeight to the parent properties, I get the checkerboard.
import Qt 4.7
import QtWebKit 1.0
Flickable{
width: 640; height:480
contentWidth: webView.width
contentHeight: webView.height
WebView {
id: webView
preferredWidth: parent.width
preferredHeight: parent.height
url: 'http://qt.nokia.com'
}
}
On Nov 6, 2010, at 7:41 AM, ext Andrew.Christian at nokia.com<mailto:Andrew.Christian at nokia.com> wrote:
I ran into the same problem. Oddly, I found that it can be solved with:
import Qt 4.7
import QtWebKit 2.0
Flickable{
width: 240; height:400
function updateContentSize(w,h) {
contentWidth = Math.max(width,w);
contentHeight = Math.max(height,h);
}
WebView {
id: webView
preferredWidth: parent.width
preferredHeight: parent.height
url: 'http://qt.nokia.com'
onWidthChanged: updateContentSize(width,height)
onHeightChanged: updateContentSize(width,height)
}
}
I don't understand why. Some kind of race condition in the signals, perhaps?
- Andrew
On Nov 5, 2010, at 5:17 PM, ext Tico Ballagas wrote:
I was trying to create a basic QML Webkit + Flickable proof of concept.
import Qt 4.7
import QtWebKit 2.0
Flickable{
width: 640; height: 480
contentWidth: webView.width
contentHeight: webView.height
WebView {
id: webView
preferredWidth: parent.width
url: 'http://qt.nokia.com'
}
}
However, this seems to show a checkerboard... until you scroll. Once you scroll, the content magically appears. I've tried this on both Linux and Mac and get the same result. What am I doing wrong?
Best
-Tico
<ATT00001..txt>
<ATT00001..txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20101109/bbdfaab9/attachment.html
More information about the Qt-qml
mailing list