Hi friends!
Is there any easy way to create a tool bar with checkeable actions where only one action may be selected at once?
I'm trying to use toggled signals, but my code looks ugly and difficult.
Any suggestion/idea?
Thanks in advance.
Printable View
Hi friends!
Is there any easy way to create a tool bar with checkeable actions where only one action may be selected at once?
I'm trying to use toggled signals, but my code looks ugly and difficult.
Any suggestion/idea?
Thanks in advance.
Simply use setAutoExclusive().
Perhaps you are wrong about Qt Designer. I've been looking for setAutoExclusive on QAtions and QToolBar but there is nothing at property editor.
I guess I have to create by code a QActionGropu and add actions, and after that, add it to a tool bar (no idea how to)
Another question is: Why this code does not delete/destroy alignmentGroup variable?
http://doc.trolltech.com/4.1/mainwin...indow-cpp.html
What do you think Lykurg? By the way, thanks a lot, you are very helpful.
Ah, ok, I was wrong. It is only displayed as an action not as the tool button, which it is in fact. So you have it to do in your code. But simply create a QToolButton, add the action, set autoExclusive and add the button to the toolbar. should work without a action group (when you don't have other "normal" actions inside the toolbar), it does at least work inside a QFrame.
Because the parent deletes it by itself, if it gets destroyed.Quote:
Another question is: Why this code does not delete/destroy alignmentGroup variable?
http://doc.trolltech.com/4.1/mainwin...indow-cpp.html
Thaks, useful.