i'm trying to move a QWidget which is inside of a QScrollArea but neither setGeometry() nor move() do work. here's a small example. what am i doing wrong here? qw always stays on the top left and doesn't move

Qt Code:
  1. #include <QApplication>
  2. #include <QMainWindow>
  3. #include <QScrollArea>
  4.  
  5. int main( int argc, char **argv )
  6. {
  7. QApplication a( argc, argv );
  8.  
  9. QMainWindow *mw = new QMainWindow();
  10.  
  11. QScrollArea *sa = new QScrollArea( mw );
  12. sa->setPalette( QPalette( QColor(41,141,40) ) );
  13.  
  14. QWidget *qw = new QWidget( sa );
  15. qw->setPalette( QPalette( QColor(41,161,90) ) );
  16. qw->resize(100,100);
  17. qw->move(80,80);
  18.  
  19. //qw->setGeometry(80,80,100,100);
  20.  
  21. sa->setWidget(qw);
  22.  
  23. mw->setCentralWidget( sa );
  24. mw->show();
  25.  
  26. return a.exec();
  27. }
To copy to clipboard, switch view to plain text mode