oops right!!
thanks !!

I still have a little problem ....on my QDialog widget (I used the QDialog class instead of just QWidget, as proposed by Zlatomir)
I have a button to close it with the connection of the quit slot, but when I use it, my mainwindow closes at the same time, and I only want the QDialog widget to close...

Qt Code:
  1. void mainwindow::ouvrir_dialogue()
  2. {
  3. QDialog *dialogue = new QDialog(this);
  4. dialogue->setModal(true);
  5. QPalette pal = dialogue->palette();
  6. pal.setColor(dialogue->backgroundRole(),Qt::white);
  7. dialogue->setPalette(pal);
  8.  
  9. .......................
  10. .........................
  11.  
  12. QPushButton *bouton1 = new QPushButton("Enregistrer ");
  13. QPushButton *bouton2 = new QPushButton("Terminer");
  14.  
  15. ...........................
  16.  
  17. dialogue->show();
  18.  
  19. QObject::connect(bouton1, SIGNAL(clicked()), this, SLOT(save()));
  20. QObject::connect(bouton2, SIGNAL(clicked()), qApp, SLOT(quit()));
  21.  
  22. }
To copy to clipboard, switch view to plain text mode