[SOLVED] Size of layout elements
-
wrote on 13 Jul 2012, 07:44 last edited by
Hi there
I'm looking for the bling thing that tells me what size an element in a layout posseses. Let's assume I have a QHBoxLayout with two widgets in it. The first one has a strech of 1 the second doens't has a strech. So that would mean that the second widget is at it's minimal size. Now I want to know what size widget one has, cause this could change accordingly to the window size.
I tried already QWidget->size(), QWidget->geometry(), QWidget->width() and QWidget->height() but I always get the same resolution, 640x480 which doesn't have any relation to anything of my layout or window settings.
Thx for help
-
wrote on 13 Jul 2012, 11:19 last edited by
Hello,
QWidget->size() is correct.
However did you get this property before the widget is displayed?
In this case, you'll get a value which have no relation with the one once showed. -
wrote on 13 Jul 2012, 12:33 last edited by
Ah yeah, that's the point, I have to show it before. Thx!
-
wrote on 13 Jul 2012, 13:31 last edited by
Could you then put [SOLVED] in the title of the post? :)
1/4