[Qt-qml] implicitWidth and implicitHeight in QML

Eduardo Fleury eduardo.fleury at openbossa.org
Thu Jul 29 15:11:02 CEST 2010


On Wed, Jul 28, 2010 at 9:13 PM, <warwick.allison at nokia.com> wrote:

> There is. They simply set the width and height in the element:
>
> MyFoo.qml:
>
> import Qt 4.7
> Item { width: 100; height: 100; ... }
>

Yep, but this only works for static default sizes. If instead I had to do

MyFoo.qml:

import Qt 4.7
Item { width: calcWidthBasedOnContent(); height: 100; ... }

I'd be in trouble since subsequent recalculations of
"calcWidthBasedOnContent()" would conflict with anchors that eventually
exist outside, like in:

main.qml

import Qt 4.7
Item {
    MyFoo { anchors.fill: parent }
}

What would make anchors and an active binding exist at the same time for
MyFoo.

-- 
Eduardo M. Fleury
OpenBossa - INdT
http://eduardofleury.com/
http://www.openbossa.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20100729/8b0772f0/attachment.html 


More information about the Qt-qml mailing list