Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[SOLVED] assign button ID
Marty last edited by Marty
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 :
but when i grab this ID the application crashes :
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...
Unless it's a typo here, you are assigning IDs to the outputGroup and request the button from the inputGroup
Marty last edited by
ok. The problem stands between the keyboard and the chair...
Don't worry, it happens to all of us ;)
Happy coding !