Gui hangs when close button is clicked
Hello,
I am a newbie in Qt.I would like to close a window but the Qt Gui hangs when I do so.
I am trying to close the Gui with this->close()
Code:
connect(ui->Close, SIGNAL(clicked()), this, SLOT(close()));
Code:
void MainWindow::close()
{
this->close();
}
Can anybody tell me how to close the Gui without hanging it.
Re: Gui hangs when close button is clicked
Code:
#include <QApplication>
connect(ui->Close, SIGNAL(clicked()), qApp, SLOT(quit()));
or
connect(ui->Close, SIGNAL(clicked()), qApp, SLOT(closeAllWindows()));