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...
void mainwindow::ouvrir_dialogue()
{
dialogue->setModal(true);
pal.setColor(dialogue->backgroundRole(),Qt::white);
dialogue->setPalette(pal);
.......................
.........................
...........................
dialogue->show();
QObject::connect(bouton1,
SIGNAL(clicked
()),
this,
SLOT(save
()));
QObject::connect(bouton2,
SIGNAL(clicked
()),
qApp,
SLOT(quit
()));
}
void mainwindow::ouvrir_dialogue()
{
QDialog *dialogue = new QDialog(this);
dialogue->setModal(true);
QPalette pal = dialogue->palette();
pal.setColor(dialogue->backgroundRole(),Qt::white);
dialogue->setPalette(pal);
.......................
.........................
QPushButton *bouton1 = new QPushButton("Enregistrer ");
QPushButton *bouton2 = new QPushButton("Terminer");
...........................
dialogue->show();
QObject::connect(bouton1, SIGNAL(clicked()), this, SLOT(save()));
QObject::connect(bouton2, SIGNAL(clicked()), qApp, SLOT(quit()));
}
To copy to clipboard, switch view to plain text mode
Bookmarks