I'm trying to put rounded borders on some widgets (QFrame, QGroupBox, QListView for example) using border-radius in the stylesheet, but I find that the widget contents tend to draw over the borders.

tl;dr; is there a way to have the borders drawn later, over the top of the contents?


With the following stylesheet, the borders of a QListWidget are drawn over by the items in it. I could set the background-color of those items to transparent but that doesn't help with the selected item, for which I want to set a background color.



#Form { background-color: white; }


QListWidget { border-radius: 6px; border: 1px solid red; }

QListWidget::item:selected { background-color: lightblue; }



Now if I want to put rounded borders on a QGroupBox, the title text ends up in the wrong place (on Windows anyway). And if I fix that by adding padding and margin, the border is still obliterated because the title text draws its background over the top.




#Group1 { border-radius: 6px; border: 1px solid red; }

#Group2 { border-radius: 6px; border: 1px solid red; margin-top: 10px; }

#Group2::title { padding-top: -10px; padding-left: 10px; }


And if you make QGroupBox::title's background transparent, the border line goes right through it...


Suggestions most welcome.


Thanks

Hamish

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to