1

I have type some code to fill the whole QTreeWidget with single color:

myTree->setStyleSheet("border: 1px solid green; background: green;");

But as a result, the header color is not a solid color. Instead, the header has a gradient with two contrast lines.

How can I disable this effect and fill the header with a solid color? enter image description here

Arseniy
  • 266
  • 2
  • 14

2 Answers2

0

You can change the shape and the shadow of your header with:

myTree->header()->setFrameShape(QFrame::NoFrame);
myTree->header()->setFrameShadow(QFrame::Plain);

It should remove the gradient.

Dimitry Ernot
  • 6,256
  • 2
  • 25
  • 37
0
QHeaderView::section {border: 0px solid green; background: green;}

It's working.

https://forum.qt.io/topic/101700/how-to-disable-auto-gradient-effect-in-qheaderview/2

Arseniy
  • 266
  • 2
  • 14