Home > Mobile >  Qt define a menu bar menu styles and style of action
Qt define a menu bar menu styles and style of action

Time:03-21

/* QMainWindow form design mode, the menu bar to add the four menu button (menuM1 menuM2, menuM3, menuM4), in the style of QMenuBar now list will be four menu change big, also wrote a hovering and choose the color of the change, can realize, now I don't know how to set the four menu (state) without hovering click set different colors respectively,

QMenuBar {background: grey; }/* all menus in the menu bar is gray

QMenuBar# menuM1:! Selected {background: red; 1}/* run, menu color not red

QMenu# menuM1 {background: red; 1}/* menu a red color also not

Using QMenuBar: : item {background: red; }/* menu 1-4 are red, but I want to set up different color


O great god answer same drop-down menu button after several action
how to set up a different color

CodePudding user response:

Look at QSS, id selector requires the use of the objectname
  •  Tags:  
  • Qt
  • Related