Hello!

I want to insert a QTabBar in a QMainWindow and put on it a series of QActions, all this by code. Most of this QActions will be checkable, so that if one of them is checked, immediately any other that may be checked shall be unchecked. The traditional method I have being used to do this is that, once a button is pressed, it will activate a method receiving by parameters the Id of the button pressed, while that method will then uncheck all buttons with the exception of the one that was triggered (identified by the Id).

I know only two ways of implementing this: either I create some class which posses this Id thing and than, when its triggered, it emits a signal sending its id (and connects that signal with the slot that will implement the uncheck logic), or else I have to create a slot for each button created; since each will have its own slot, I know which was triggered. There is also a third option, which is to use something of the natural Qt class (instead of creating another with the Id stuff) to identify which button was triggered; sometimes I use the objectName to do that.

The problem:
* I can't perform the traditional method because I can't set subclasses of QAction in a QTabBar (already tried, no sucess); the addActions(QList...) don't accept.
* I want to avoid the second method because I don't want to create one slot for each new QAction I instantiate. Imagine a QTabBar with 30 QActions: 30 slots only to call the same method!
* Using a QString to identify takes to much resources when identifying the QAction; I want to avoid that as well. And of course, I don't know any other method to identify QActions naturally.


I'ld be glad for you guys telling me how may I do this, giving the problems I wrote about.


Thanks,

Momergil


Note: I hope you guys don't mind answering this another topic as well: http://www.qtcentre.org/threads/5774...a-QTableWidget