8

I am trying to make the menubar a gradient black colour and that works fine, except for the menu headings.

Here's the stylesheet i'm using:

 QString styleSheet = "QMenuBar{background: qlineargradient(x1:0,x2:0,y1:0,y2:1,stop:0 #cccccc, stop:0.4 gray)} QStatusBar{background: qlineargradient(x1:0,x2:0,y1:0,y2:1,stop:0 #cccccc, stop:0.4 gray);color:white;} ";

this->setStyleSheet(styleSheet);
  1. How do I apply the style to the meny headings too?
  2. There is a blue tinge all around the QTextEdit which I can't get rid of. Is there a way to set it to black?

Thanks :)

stylesheet not applied to menu items

W.K.S
  • 9,787
  • 15
  • 75
  • 122
  • 2
    http://www.trinitydesktop.org/docs/qt4/stylesheet-examples.html#customizing-qmenubar – nmagerko Jan 02 '12 at 22:01
  • nmagerko - that link was really useful. Could you please write as the answer so that I can accept it. Second, it doesn't quite answer how to get rid of the blue tinge - do you have any idea about that? – W.K.S Jan 04 '12 at 17:23

4 Answers4

6

I believe that the following website is a good resource for answering your question about the QT menubar issue you are having:

http://www.trinitydesktop.org/docs/qt4/stylesheet-examples.html#customizing-qmenubar

It gives a few code samples which should fully explain what you need to know. As for the blue tinge, I do not have a good idea on how to fix it - I haven't really seen that happen.

Best of luck.

nmagerko
  • 6,586
  • 12
  • 46
  • 71
2

This solved the problem for me:

QMenuBar::item {
    background-color: transparent;
}
jminardi
  • 936
  • 1
  • 11
  • 23
1

You can try using QMenuBar::item{}.

wolf9000
  • 141
  • 1
  • 9
0
  1. for aply color to the headings:

    QMenuBar::item{
        background-color: qlineargradient(x1:0,x2:0,y1:0,y2:1,stop:0 #cccccc, stop:0.4 gray)
    }
    
  2. For the blue tinge all around the QTextEdit:

    QTextEdit{
        border: 0
    `
    
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Fabrizio
  • 40
  • 1
  • 7