Answer the question
In order to leave comments, you need to log in
Can't use branch operations in Qt?
// ... code!
void MyDialog::EnableOk()
{
ui->okbutton->setEnabled(ui->lineEdit->hasAcceptableInput());
switch(ui->okbutton->clicked())
{
default:
QMessageBox *msg = new QMessageBox;
msg->setText("TEST!!!");
msg->exec();
break;
}
}
// ... code!
void MyDialog::EnableOk()
{
ui->okbutton->setEnabled(ui->lineEdit->hasAcceptableInput());
bool b = ui->okbutton->clicked();
switch(b)
{
default:
QMessageBox *msg = new QMessageBox;
msg->setText("TEST!!!");
msg->exec();
break;
}
}
Answer the question
In order to leave comments, you need to log in
What do you want to achieve with such a strange design? What makes you think that clicked() should return bool? The compiler also says that it is void (and in general it is a signal, you can only emit it or connect a slot to it).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question