Qt 6.11 is out! See what's new in the release
blog
ActionGroup and Toolbar
-
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?
-
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?
-
Thanks a lot! That did the trick.
Interesting! Wasn't aware of that difference.