MMM i think you are connecting the objects the wrong way...You have a mainWindow with a menuBar and you want a dialog to pop-up...right?
So the right thing to connect is this (in the constructor of mainWindow):
connect(ui->actionModifica_valore_iniziale,SIGNAL(triggered()),this, SLOT(//this slot shows the dialog));
connect(ui->actionModifica_valore_iniziale,SIGNAL(triggered()),this, SLOT(//this slot shows the dialog));
To copy to clipboard, switch view to plain text mode
then mainWindow has a SLOT called
//this slot shows the dialog
that will do something like this:
void //this slot shows the dialog{
myDialog *dialog = new myDialog ();
//do something for example:
dialog->setData (ui->labelText->text ()); //you assign data from a label of the mainWindow to the dialog...
dialog->exec();
}
void //this slot shows the dialog{
myDialog *dialog = new myDialog ();
//do something for example:
dialog->setData (ui->labelText->text ()); //you assign data from a label of the mainWindow to the dialog...
dialog->exec();
}
To copy to clipboard, switch view to plain text mode
it is important that you understand the concept because this is used like a lot...
hope it helps!
PS:- with exec () you assure that the focus is going to return to mainWindow when the dialog closes
Bookmarks