Looks like we were revisiting this at the same time.  Yes, the following works 
correctly:

import Qt 4.7
import QtWebKit 1.0
Flickable{
    id: myflickable
    width: 640; height:480
    contentWidth: webView.width
    contentHeight: webView.height
    WebView {
        id: webView
        preferredWidth: myflickable.width
        preferredHeight: myflickable.height
        url: 'http://qt.nokia.com'
    }
}

I guess the idea is that Flickable has a contentItem that is of size 
(contentWidth, contentHeight), which results in a circular reference with 
preferredWidth / preferredHeight.  I wonder if there is a way to warn us of the 
circular reference.

-Tico


On Nov 8, 2010, at 8:38 PM, ext michael.bras...@nokia.com wrote:

> Hi,
> 
> On 06/11/2010, at 7:17 AM, 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?
> 
> Does it work correctly if you give the Flickable an id, and bind WebView's 
> preferredWidth to myFlickable.width rather than parent.width? Items added in 
> a Flickable become a child of the Flickable's contentItem rather than the 
> Flickable itself, which may be causing the problem (parent.width is binding 
> to the contentItem's width rather than the Flickable's width).
> 
> Regards,
> Michael
> 
> <ATT00001..txt>

_______________________________________________
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to