Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
4.6.2
-
None
Description
I create a horizontal linear layout and add three widgets:
1) QGraphicsWidget with preferredsize 0,0 and sizepolicy QSizePolicy::Preferred,QSizePolicy::Preferred
2) QGraphicsWidget with min and max size of 80,80 and sizepolicy QSizePolicy::Preferred,QSizePolicy::Preferred
3) QGraphicsWidget with preferredsize 0,0 and sizepolicy QSizePolicy::Preferred,QSizePolicy::Preferred
I would expect that the middle widget is centered. However the items 1 and 3 get a size of 0, even if there if room for them to grow. Changing the preferredSize to 1,1 helps in this case, but now consider:
1) QGraphicsWidget with preferredsize 0,0 or 1,1 and sizepolicy QSizePolicy::Preferred,QSizePolicy::Preferred
2) QGraphicsWidget with min and max size of 80,80 and sizepolicy QSizePolicy::Expanding,QSizePolicy::Expanding
3) QGraphicsWidget with preferredsize 0,0 or 1,1 and sizepolicy QSizePolicy::Preferred,QSizePolicy::Preferred
Again I would expect that the middle widget is centered, but it is left aligned with the first and large widget getting a size of 1 only.
Printing out the layout->geometry() in both cases gives a geometry width of 300.
(Test case included, tested with Qt 4.6.3)