ActionGroup and Toolbar
Solved
General and Desktop
-
Hi,
I create some QActions like this:
QActionGroup ag(this); QAction* a = new QAction( ... ); a->setCheckable(true); ag->addAction(a); QAction* b = new QAction( ... ); b->setCheckable(true); ag->addAction(b); ...
later on I create toolbars, where I add those actions
QToolBar* tb = new QToolBar("check", this); tb->addAction(a); tb->addAction(b);
but when I switch a toolbarbutton, nothing happens to respect of group behaviour of the other button.
Am I missing something, or are QActionGroup not intended to work with toolbars?
-
@django-Reinhard Change to
QActionGroup *ag = new QActionGroup(this);
-
Thanks a lot! That did the trick.
Interesting! Wasn't aware of that difference.