incapacitant
14th March 2006, 07:55
In the following code the SLOT(Ok()) is not triggered when the user presses the pushbutton Ok. I have either to put "accept" or "close". As it is here the window is not closed or only with cancel
I don't understand this behaviour, what have I done wrong ?
pbOk = new QPushButton( "Ok", this);
connect( pbOk, SIGNAL( clicked() ), this, SLOT( Ok() ) ); // <--- does not work
connect( pbCancel, SIGNAL( clicked() ), this, SLOT( close() ) );
}
//************************************************** ***********
void Destinataires::Ok()
{
accept(); // does not work either with emit accept, emit close
close();
}
Thanks for helping me out !
I don't understand this behaviour, what have I done wrong ?
pbOk = new QPushButton( "Ok", this);
connect( pbOk, SIGNAL( clicked() ), this, SLOT( Ok() ) ); // <--- does not work
connect( pbCancel, SIGNAL( clicked() ), this, SLOT( close() ) );
}
//************************************************** ***********
void Destinataires::Ok()
{
accept(); // does not work either with emit accept, emit close
close();
}
Thanks for helping me out !