PDA

View Full Version : Gui hangs when close button is clicked



Tanny007
20th April 2012, 01:44
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()


connect(ui->Close, SIGNAL(clicked()), this, SLOT(close()));


void MainWindow::close()
{
this->close();
}

Can anybody tell me how to close the Gui without hanging it.

Jonny174
20th April 2012, 05:10
#include <QApplication>

connect(ui->Close, SIGNAL(clicked()), qApp, SLOT(quit()));

or

connect(ui->Close, SIGNAL(clicked()), qApp, SLOT(closeAllWindows()));