1

Topic: Button highlighting at induction in a submenu

Good afternoon, actually there are buttons QToolButton, at induction on them they are highlit normally, is implemented: myButton-> setStyleSheet ("QToolButton:hover {background-color: red;}"); Made ToolButton from the menu (at pushing this button there is a menu with other dial-up of buttons) and here in it button menus for some reason are not highlit, what it is necessary to add? At creation of this menu, a representing dial-up of buttons, in the same way I set style.

2

Re: Button highlighting at induction in a submenu

3

Re: Button highlighting at induction in a submenu

Hello, TOPAZ23, you wrote: TOP> Good afternoon, actually there are buttons QToolButton, at induction on them they are highlit normally, is implemented: TOP> TOP> myButton-> setStyleSheet ("QToolButton:hover {background-color: red;}"); TOP> TOP> Made ToolButton from the menu (at pushing this button there is a menu with other dial-up of buttons) and here in it button menus for some reason are not highlit, what it is necessary to add? TOP> at creation of this menu, a representing dial-up of buttons, in the same way I set style. The menu with buttons through QWidgetAction?

4

Re: Button highlighting at induction in a submenu

Hello, SaZ, you wrote: SaZ> Hello, TOPAZ23, you wrote: TOP>> Good afternoon, actually there are buttons QToolButton, at induction on them they are highlit normally, is implemented: TOP>> TOP>> myButton-> setStyleSheet ("QToolButton:hover {background-color: red;}"); TOP>> TOP>> Made ToolButton from the menu (at pushing this button there is a menu with other dial-up of buttons) and here in it button menus for some reason are not highlit, what it is necessary to add? TOP>> at creation of this menu, a representing dial-up of buttons, in the same way I set style. SaZ> the menu with buttons through QWidgetAction? QToolButton* button = new QToolButton (parent); QHBoxLayout* rowLayot = new QHBoxLayout (); for (int i = 0; i <MenuNames.size (); i ++) {QToolButton *pbTab = new QToolButton (); pbTab-> setStyleSheet ("QToolButton:hover {background-color: red; border:none;} "); pbTab-> setCheckable (true); pbTab-> setText (text); pbTab-> setAutoRaise (true); pbTab-> setIcon (QIcon (icon)); pbTab-> setToolButtonStyle (Qt:: ToolButtonTextUnderIcon); rowLayot-> addWidget (pbTab);} QMenu* menu = new QMenu; menu-> setStyleSheet (" QMenu {background: #f0e96b;} "); button-> setMenu (menu); menu-> setLayout (rowLayot); approximately so

5

Re: Button highlighting at induction in a submenu

Hello, TOPAZ23, you wrote: TOP> Hello, SaZ, you wrote: SaZ>> Hello, TOPAZ23, you wrote: TOP>>> Good afternoon, actually there are buttons QToolButton, at induction on them they are highlit normally, is implemented: TOP>>> TOP>>> myButton-> setStyleSheet ("QToolButton:hover {background-color: red;} "); TOP>>> TOP>>> Made ToolButton from the menu (at pushing this button there is a menu with other dial-up of buttons) and here in it button menus for some reason are not highlit, what it is necessary to add? TOP>>> at creation of this menu, a representing dial-up of buttons, in the same way I set style. SaZ>> the menu with buttons through QWidgetAction? TOP> TOP> QToolButton* button = new QToolButton (parent); TOP> QHBoxLayout* rowLayot = new QHBoxLayout (); TOP> for (int i = 0; i <MenuNames.size (); i ++) TOP> {TOP> QToolButton *pbTab = new QToolButton (); TOP> pbTab-> setStyleSheet (" QToolButton:hover {background-color: red; border:none;} "); TOP> pbTab-> setCheckable (true); TOP> pbTab-> setText (text); TOP> pbTab-> setAutoRaise (true); TOP> pbTab-> setIcon (QIcon (icon)); TOP> pbTab-> setToolButtonStyle (Qt:: ToolButtonTextUnderIcon); TOP> rowLayot-> addWidget (pbTab); TOP>} TOP> QMenu* menu = new QMenu; menu->> setStyleSheet (" QMenu {background: #f0e96b;} "); TOP> button-> setMenu (menu); menu->> setLayout (rowLayot); TOP> TOP> approximately so As the test made all too most, only without hover: pbTab-> setStyleSheet (" QToolButton {background-color: red; border:none;} "); result - all buttons became red

6

Re: Button highlighting at induction in a submenu

What version Qt? It is not eliminated that a bug, in styles it is a lot of them

7

Re: Button highlighting at induction in a submenu

Hello, Qt-Coder, you wrote: QC> What version Qt? It is not eliminated that a bug, them in styles it is a lot of Ugu, just answered on SO, it appeared that at the dude old Qt.

8

Re: Button highlighting at induction in a submenu

Hello, SaZ, you wrote: QC>> What version Qt? It is not eliminated that a bug, them in styles it is a lot of SaZ> Ugu, just answered on SO, it appeared that at the dude old Qt. I confirm. Too suffered with this bug, in 5.6.0 it still is, in 5.6.2 it is already corrected.