Stylesheet: background-color of QWidget

   3513   1   1
User Avatar
Member
10 posts
Joined: Sept. 2013
Offline
Hi,

I noticed that the background-color af a QWidget is not the grey color that I would expect (rgb(58, 58, 58))
I had a look in the stylesheet and the QWidget is prepended with a dot.

.QWidget { background-color: rgb(58, 58, 58); }
If this dot is removed the background gets the grey color. I am probably missing something but what is the purpose of the dot?

Best Regards,
Johan
User Avatar
Member
10 posts
Joined: Sept. 2013
Offline
I had a look in the qt docs (which I should have done in the first place)

The dot-selector matches instances of the class, but not of its subclasses

Qt Stylesheet syntax [doc.qt.io]
Edited by Petfactory - March 13, 2018 14:05:50
  • Quick Links