I've searched the docs and the forums but can't figure out how to do this.

I open a new project in Qt Creator 4.0.2 and add one pushbutton to the form. When I click the pushbutton, I want the entire form to move to ( 100, 100 ).

main.cpp
Qt Code:
  1. #include "mainwindow.h"
  2. #include <QApplication>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. QApplication a(argc, argv);
  7. MainWindow w;
  8. w.show();
  9.  
  10. return a.exec();
  11. }
To copy to clipboard, switch view to plain text mode 

mainwindow.cpp
Qt Code:
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3.  
  4. MainWindow::MainWindow(QWidget *parent) :
  5. QMainWindow(parent),
  6. ui(new Ui::MainWindow)
  7. {
  8. ui->setupUi(this);
  9. }
  10.  
  11. MainWindow::~MainWindow()
  12. {
  13. delete ui;
  14. }
  15.  
  16. void MainWindow::on_pushButton_clicked()
  17. {
  18. w.move( 100, 100 );
  19. }
To copy to clipboard, switch view to plain text mode 

The last line, "w.move( 100, 100 ); doesn't work, of course, because w is defined in main.cpp, not mainwindow.cpp.

Substituting "ui" for "w" also doesn't work because there is no "move" function for ui.

"ui->centralWidget->move( 100, 100 );" works but it only moves the central widget, not the window.

What am I missing?