A simple way around this is to add a child widget to the scrollview and do all the drawing in the paint event of the widget.

Qt Code:
  1. class MyWidget : public QWidget{
  2. public:
  3. MyWidget(QWidget *parent = 0) : QWidget(parent){}
  4. protected:
  5. void paintEvent(QPaintEvent *pe){
  6. //...
  7. }
  8. };
  9. //...
  10. wid = new MyWidget(viewport());
  11. wid.resize(600, 400);
  12. //...
To copy to clipboard, switch view to plain text mode