I have created a QTable with lots of gui elements like comboBoxes and checkBoxes in various cells. I am able to access these elements by creating pointers to them. What I want to know is, is there any way to know what type of widget(comboBox or checkBox) a cell is having?
Check out the answers to this question. The accepted answer gets the class name (as a const char*) from the widget's meta-object like so:
widget->metaObject()->className();
There's another answer that suggests using C++'s type management, but that sounds a lot less wieldly (more unwieldy?).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With