[Qt-qml] Column has unexpected width

Bo Thorsen bo at fioniasoftware.dk
Sat Sep 24 09:18:14 CEST 2011


Den 23-09-2011 20:14, John Temples skrev:
> In the code below, there are two Columns, with the second Column
> anchored to the right of the first one.  The first Column ends up with
> a width of -1, and the second Column has an x of -1.  Can someone
> explain why this happens?  I would have thought the Item would assume
> the size of its child Rectangle and wouldn't need to have a size
> explicitly provided.

Things are not laid out automatically in QML, so what you are doing here 
is that you get random values for the two columns. At the very least, 
you need to set the anchors at the sides of the columns to the rectangle.

Bo Thorsen,
Fionia Software.

-- 

Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk


More information about the Qt-qml mailing list