1  MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
2  {
3     ui->setupUi(this);
4     windowCentralWidget = new QWidget();
5     mousePosition = new QLabel("Mouse Position");
6     QVBoxLayout *innerLayout = new QVBoxLayout();
7     innerLayout->addWidget(mousePosition);
8     windowCentralWidget->setLayout(innerLayout);
9     setCentralWidget(windowCentralWidget);
10    statusBar()->showMessage("Ready");
11    connect(this, SIGNAL(mouseMoved(QPoint)),
12             this, SLOT(updateMousePosition(QPoint)));
13  }