In this case the scroll area goes into the first slot of the hbox layout
Qt Code:
  1. QWidget *widget2 = new Widget2(this);
  2.  
  3. QHBoxLayout *layout = new QHBoxLayout(this);
  4. layout->addWidget(mScrollArea);
  5. layout->addWidget(widget2, 1);
To copy to clipboard, switch view to plain text mode 

Cheers,
_