One idea that comes to my mind is to switch between exclusive and non-exclusive group on the fly. More or less something like this:
{
Q_OBJECT
public:
{
setExclusive(true);
connect(this,
SIGNAL(hovered
(QAction*)),
this,
SLOT(actionHovered
(QAction*)));
}
private slots:
void actionHovered
(QAction* action
) {
setExclusive(action != checkedAction() || !action->isChecked());
}
};
class ActionGroup : public QActionGroup
{
Q_OBJECT
public:
ActionGroup(QObject* parent = 0) : QActionGroup(parent)
{
setExclusive(true);
connect(this, SIGNAL(hovered(QAction*)), this, SLOT(actionHovered(QAction*)));
}
private slots:
void actionHovered(QAction* action)
{
setExclusive(action != checkedAction() || !action->isChecked());
}
};
To copy to clipboard, switch view to plain text mode
Bookmarks