Hi QT community.

I have a QDockWidget, which has a QFrame inside it (it's actually a QScrollArea) and I need to change their styles according to what the designer asked.

He asked that the title be a box, smaller than the width of the QDockWidget, with round corners, etc.

So I tried to do it with QT's qss system. Then I'm now stuck with this:

qtabwidget_and_qdockwidget.jpg

The left is a QTabWidget, in which I could do the frame line pass in the middle of the title. I did that with this qss:

Qt Code:
  1. QTabWidget::pane {
  2. top: -5px;
  3. ...
  4. }
To copy to clipboard, switch view to plain text mode 

So I tried doing the same with the QFrame inside the QDockWidget:

Qt Code:
  1. margin-top: -5px; /* top actually does nothing, so I tried to switch to margin-top */
  2. }
To copy to clipboard, switch view to plain text mode 

But I get the following results:

qtabwidget_and_qdockwidget_less5margin_top.jpg

The border of the QFrame is hidden by the QDockWidget title.

Any help is appreciated, be it in code or qss.

Thanks for any help.