QToolButton + style sheet problem
Does anyone know if this is correct?
Code:
tb->setText ("Trial");
tb->setFixedWidth (150);
tb->setFixedHeight (40);
tb->setArrowType (Qt::DownArrow);
tb->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
// This section here ???
tb->setStyleSheet ("down-arrow: subcontrol-position: right center");
I want to move the arrow to the right
Re: QToolButton + style sheet problem
I dont know.. but if it works, it might be right :D
Re: QToolButton + style sheet problem
Quote:
Originally Posted by
aamer4yu
I dont know.. but if it works, it might be right :D
uhm it doesn't work. Sorry if the wording on my post was wrong. But I want to know how to use that function call to move the "arrow" in a QToolButton to the right side of the button.
Re: QToolButton + style sheet problem
Quote:
Originally Posted by
John82
[CODE]tb->setStyleSheet ("down-arrow: subcontrol-position: right center");[/CODE
You should take a closer look at the syntax of css. I don't have checked if your commands work but one right syntax is:
Code:
QToolButton::down-arrow{subcontrol-position: right center;}
Re: QToolButton + style sheet problem
Quote:
Originally Posted by
Lykurg
You should take a closer look at the syntax of css. I don't have checked if your commands work but one right syntax is:
Code:
QToolButton::down-arrow{subcontrol-position: right center;}
I tried this. I wrote the above line in a .qss file and read it. But it didnt work, that is why I am am looking for a direct implementation.
Re: QToolButton + style sheet problem
Quote:
Originally Posted by
John82
I tried this. I wrote the above line in a .qss file and read it. But it didnt work, that is why I am am looking for a direct implementation.
Did you mean by "direct implementation" setting the qss on the toolbutton? If so, that makes no difference and also there you have to respect the css syntax:
Code:
tb->setStyleSheet ("::down-arrow {subcontrol-position: right center}");
Re: QToolButton + style sheet problem
Si necesitas estilizar y/o quieres controlar la flecha hacia abajo de los botones QToolButton de un QToolBar, es posible que tengas problemas cuando los creas a partir de QAction. La manera de acceder a ello es utilizando QToolButton::menu-arrow {...} o QToolButton::menu-button {...}
Si tu tienes una barra de navegación la puedes nombrar barra->setObjectName("miBarra");
Y puedes controlar su flecha abajo con #miBarra QToolButton::menu-arrow {...} o #miBarra QToolButton::menu-button {...}