new on forum, be gentle, thx for help.
qt version 4.6.2

This is code:

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent)
{

closeButton = new QPushButton("close");
connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
setCentralWidget(closeButton);

bool x = false;
// here is problem
if ( !x )
close();
}

Q: why doesn't MainWindow closes?