views:

136

answers:

2

How to set QWidget width? I know setGeometry(QRect& rect) function to do that, but in that case I should use geometry() function to get former parameters of my QWidget, then I should increment the width and use setGeometry(..). Is there any ditect way to say

QWidget aa;
aa.setWidth(165); //something like this?
+3  A: 

resize() might be better to use.

JimDaniel
right, thanks!!!
Narek
+2  A: 

QWidget reference.

Try examining all available "yyysize" methods (because there are different sizing policies for Qt widgets and you might need something special).

Basically, yes, it's resize(...).

Kotti
Why are you linking to docs for 4.2? It's not critical here but 4.6 is the latest full release.
Troubadour
@Troubadour Yes, google sometimes is evil :) Thanks.
Kotti