Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

Background color of QMenu by StyleSheet doen't work this

$
0
0
Hi, I tried to work with Stylesheet and added in the constructor of my QMainWindow a line this->setStyleSheet(" * {background-color: blue;color: yellow;} QPushButton {background-color: red;} QMenu::item::selected {background-color: black;}"); Basically, it works for all items, but not for the Menubar, which I create by m_FileNew = new QAction("new database",this); ... m_FileMenu = new QMenu("File", this); menuBar()->addMenu(m_FileMenu);   m_FileMenu->addAction(m_FileNew); m_FileMenu->addAction(m_FileOpen); ... However, get GUI, all widgets are colored, even the entries in the menu “new database” etc., but not the “File” entry, where the background color is still gray (as default) I tried to google around, but didnt find a solutation yet. Does anyone have an idea, what i got wrong or if there is a workaround. kind regards, curator

Viewing all articles
Browse latest Browse all 18427

Trending Articles