[SOLVED] assign button ID
-
hello,
I need to assign some buttons an ID. I created my buttons in QtDesigner and it doesn't seem it is possible with QtDesigner to assign IDs (correct me if i am wrong).
So i am doing this into the code.
I am assigning an ID :
ui->outputGroup->setId(ui->out1, 1);
but when i grab this ID the application crashes :
ui->inputGroup->button(1)->setChecked(true);
It seems i am doing it wrong
qDebug() << "button pressed : " << ui->inputGroup->button(1) << endl;
This always returns
button pressed : QObject(0x0)
whatever the button is : button(1), button(2), button(3) etc...
-
Hi,
Unless it's a typo here, you are assigning IDs to the outputGroup and request the button from the inputGroup
-
Don't worry, it happens to all of us ;)
Happy coding !