Hello!

I've made a new QMainWindow project by QtCreator.
Constructor looks like that:

MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow)
{

ui->setupUi(this);
}

Is it possible to add for example QPushButton to the window generated form *.ui file just by writing it in constructor?

I've tried to write:

QPushButton button("button",ui->centralWidget);
button.move(10,10);
button.show();


QPushButton button("button",this);
button.move(10,10);
button.show();

but the button don't want to show.

Please help
s410i