Hi, I have problem with setting up background colors for my QMenuBar corectly. I have this code:
//mainWindow, actions and fileMenu is defined in header file
mainWindow.setStyleSheet("background-color: #fcfcfc;");
menuBar()->setStyleSheet("background-color: #4d4d4d; selection-background-color: #fcfcfc;");
/*----------MENU----------*/
//menu File
changePinAction
= new QAction("Change PIN...");
changePukAction
= new QAction("Change PUK...");
//and some more actions
fileMenu = menuBar()->addMenu(tr("Soubor"));
fileMenu->addAction(changePinAction);
fileMenu->addAction(changePukAction);
//and some more addActoins for other QActions
//mainWindow, actions and fileMenu is defined in header file
mainWindow.setStyleSheet("background-color: #fcfcfc;");
menuBar()->setStyleSheet("background-color: #4d4d4d; selection-background-color: #fcfcfc;");
/*----------MENU----------*/
//menu File
changePinAction = new QAction("Change PIN...");
changePukAction = new QAction("Change PUK...");
//and some more actions
fileMenu = menuBar()->addMenu(tr("Soubor"));
fileMenu->addAction(changePinAction);
fileMenu->addAction(changePukAction);
//and some more addActoins for other QActions
To copy to clipboard, switch view to plain text mode
This way I created whole menu, but problem is, that StyleSheet is applied inside the menu but not on "Soubor" and other menu headings as shown on attached screenshot and I dont know how to chage it. Any help with that?
screen.jpg
Bookmarks