[SOLVED] Size of layout elements

  • 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

  • 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.

  • Ah yeah, that's the point, I have to show it before. Thx!

  • Could you then put [SOLVED] in the title of the post? :)

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.