Qt style sheets: how to apply style to a menu? How to remove blue tint around QTextEdit?

I am trying to make menubar a black gradient and this works fine except for the menu headers.

Here is the stylesheet that I use:

 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);
  • How can I apply style to headers too?
  • There is a blue tint around QTextEditwhich I cannot get rid of. Is there any way to set it to black?

Thank:)

stylesheet not applied to menu items

+5
source share
4 answers

I believe the following website is a good resource to answer your question about the QT problem menubaryou have:

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

, , . , , - .

.

+4

:

QMenuBar::item {
    background-color: transparent;
}
+2

You can try to use QMenuBar::item{}.

+1
source
  • for title bar:

QMenuBar::item{ background-color: qlineargradient(x1:0,x2:0,y1:0,y2:1,stop:0 #cccccc, stop:0.4 gray) }

  1. For a blue tint around QTextEdit:

QTextEdit{ border: 0 }

0
source

All Articles