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:
{
...
layDialog->addWidget(btnOK);
setLayout(layDialog);
setWindowTitle("Login");
setFixedHeight(180);
setFixedWidth(200);
QObject::connect(btnOK,
SIGNAL(clicked
()),
this,
SLOT(quit
()));
}
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()));
}
To copy to clipboard, switch view to plain text mode
In my main.cpp I call this widget using obj->exec();
Someone know how to close this dialog and continue the application?
Bookmarks