Just add you widget to the QScrollArea, and that's all you are done. vertical / horizontal scroll bars appear as and when needed. The basic example from documentation is

Qt Code:
  1. QLabel *imageLabel = new QLabel; //replace this with your widget
  2. QImage image("happyguy.png");
  3. imageLabel->setPixmap(QPixmap::fromImage(image));
  4.  
  5. scrollArea = new QScrollArea;
  6. scrollArea->setBackgroundRole(QPalette::Dark);
  7. scrollArea->setWidget(imageLabel);//set your widget on to QScrollArea
To copy to clipboard, switch view to plain text mode