resize - Qt: How to fit content to QScrollArea -


i reimplement qscrollarea , want add serveral widgets @ runtime. problem is, till scrollbars shown content of qscrollarea doesnt fit it. if add more widgets scrollbars shown content fits correctly.

i tried after adding widgets

this->widget()->resize(this->widget()->sizehint()); 

or

this->widget()->adjustsize(); 

but doesn't worked. have resize content? why content fits after scrollbars appear?

  1. add appropriate layout scroll area before setting widget.
  2. set size constraints(min , max property ) of widgets being added
  3. i not sure widget layout inside scroll area, can make use of spacers align widgets ( when there not many widgets fill scroll area scroll bar appear)

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -