eu.x
10th March 2007, 19:37
Hi,
I create a widget based on a QDialog and I need to close it when a button inside this widget is pressed. I tried to connect signal/slot on the class constructor, but it doesn't works:
LoginUI::LoginUI(QWidget *parent) : QDialog(parent)
{
...
btnOK = new QPushButton("OK");
layDialog->addWidget(btnOK);
setLayout(layDialog);
setWindowTitle("Login");
setFixedHeight(180);
setFixedWidth(200);
QObject::connect(btnOK, SIGNAL(clicked()), this, SLOT(quit()));
}
In my main.cpp I call this widget using obj->exec();
Someone know how to close this dialog and continue the application?
I create a widget based on a QDialog and I need to close it when a button inside this widget is pressed. I tried to connect signal/slot on the class constructor, but it doesn't works:
LoginUI::LoginUI(QWidget *parent) : QDialog(parent)
{
...
btnOK = new QPushButton("OK");
layDialog->addWidget(btnOK);
setLayout(layDialog);
setWindowTitle("Login");
setFixedHeight(180);
setFixedWidth(200);
QObject::connect(btnOK, SIGNAL(clicked()), this, SLOT(quit()));
}
In my main.cpp I call this widget using obj->exec();
Someone know how to close this dialog and continue the application?