I added a QToolButton onto a QToolBar. But the first button always has the dashed line ractangle around it. Even if I click other button, the first button still has that rectangle. I don't know how to remove it. Here I set each QToolButton as following code:
action->setIcon(icon);
action->setCheckable(true);
actionGroup->addAction(action);
action = new QAction(this);
action->setIcon(icon);
action->setCheckable(true);
actionGroup->addAction(action);
To copy to clipboard, switch view to plain text mode
And then I create the QToolButton:
{
button->setDefaultAction(action);
button->setAutoRaise(true);
return button;
}
// ...
layout->addWidget(button , 0, 0, 1, 1);
// other butttons
QToolButton * createToolButton(QAction *action)
{
QToolButton *button = new QToolButton;
button->setDefaultAction(action);
button->setAutoRaise(true);
return button;
}
// ...
QToolButton *button = createToolButton(action);
layout->addWidget(button , 0, 0, 1, 1);
// other butttons
To copy to clipboard, switch view to plain text mode
Please help me. Thank you all!
Bookmarks