Hi, I have a slot for qpushbutton:
connect(button1, SIGNAL(clicked()), this, SLOT(handleButtonClicked()));
/* more code */
protected slots:
void handleButtonClicked()
{
qDebug() << "Clicked handler";
/* test if you want to continue the event */
return; // cancel the propagation?
}
qDebug() << "Glad that you join us";
}
connect(button1, SIGNAL(clicked()), this, SLOT(handleButtonClicked()));
/* more code */
protected slots:
void handleButtonClicked()
{
qDebug() << "Clicked handler";
/* test if you want to continue the event */
int ret = QMessageBox::question(...);
if (ret != QMessageBox::Yes) {
return; // cancel the propagation?
}
qDebug() << "Glad that you join us";
}
To copy to clipboard, switch view to plain text mode
my problem is that when I hit "No", the window closes
any ideas?
Bookmarks