Narek Narek - 1 year ago 112
C++ Question

How to set QWidget width?

How to set

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

QWidget aa;
aa.setWidth(165); //something like this?

Answer Source

resize() might be better to use.

Example usage:

widget->resize(165, widget->height());