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:

Qt Code:
  1. LoginUI::LoginUI(QWidget *parent) : QDialog(parent)
  2. {
  3. ...
  4.  
  5. btnOK = new QPushButton("OK");
  6. layDialog->addWidget(btnOK);
  7.  
  8. setLayout(layDialog);
  9. setWindowTitle("Login");
  10. setFixedHeight(180);
  11. setFixedWidth(200);
  12.  
  13. QObject::connect(btnOK, SIGNAL(clicked()), this, SLOT(quit()));
  14. }
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?