I am using a QToolbar in a frame where I would like to display the icons in a flat mode. I did not found what I have to set for getting the flat representation.
If someone has an idea...
I am using a QToolbar in a frame where I would like to display the icons in a flat mode. I did not found what I have to set for getting the flat representation.
If someone has an idea...
Set the QToolButtons flat.
EDIT: Too fast, only QPushButton can be set flat. So you could set css "border:0;" to the QToolButton with the same effect.
Set QToolButton::autoRise to true. It causes the ToolButton to be flat and only raise when the mouse hovers over it.
What I am currently doing is:
- create the action
- add the action to the toolBar by using the addAction method
Is there a way to access the QToolButton that is created automatically when the action is added to the toolbar with QToolBar::addAction() ?
Or should I:
- create the action
- create the toolButton
- set the default action of the toolButton
- add the toolButton to the toolBar
u can use
QAction * QToolBar::addWidget ( QWidget * widget )
to set a pushbutton..(for setFlat())
QWidget * widgetForAction ( QAction * action ) constis there a way to access the QToolButton that is created automatically when the action is added to the toolbar with QToolBar::addAction() ?
The following code did not change the way it is presented.
Qt Code:
void if (m_useToolbar) { m_toolbar->addAction(action); toolButton->setAutoRaise(true); } }To copy to clipboard, switch view to plain text mode
So I guess what I am seeing could be just the border for the entire QToolBar widget ?
test it by adding few more widgets like comboboxSo I guess what I am seeing could be just the border for the entire QToolBar widget ?
Mmmm. Ok it is is the border of the entire QToolBar I was seeing.
Now I am looking how to remove this one.
Ok, I was able to remove the border with the following CSS rule:
Bookmarks