How to apply qss to a custom class
-
We have created a usrCntrListWidget class that inherits from Qlistwidget.
I declared in qss to apply qss. The declaration is:usrCntrListWidget { border: 4px solid #B8BCBF; }I declared this, but the style is not applied.
But
QListWidget { border: 4px solid #B8BCBF; }If declared as , the style is applied.
-
We have created a usrCntrListWidget class that inherits from Qlistwidget.
I declared in qss to apply qss. The declaration is:usrCntrListWidget { border: 4px solid #B8BCBF; }I declared this, but the style is not applied.
But
QListWidget { border: 4px solid #B8BCBF; }If declared as , the style is applied.
-
I ran the program after applying it to qss, but the style does not change.
But in qt designer style edit the style is applied. -
We have created a usrCntrListWidget class that inherits from Qlistwidget.
I declared in qss to apply qss. The declaration is:usrCntrListWidget { border: 4px solid #B8BCBF; }I declared this, but the style is not applied.
But
QListWidget { border: 4px solid #B8BCBF; }If declared as , the style is applied.
-
@IknowQT said in How to apply qss to a custom class:
usrCntrListWidget
{
border: 4px solid #B8BCBF;
}QListWidget#usrCntrListWidget { border: 4px solid #B8BCBF; } -
We have created a usrCntrListWidget class that inherits from Qlistwidget.
I declared in qss to apply qss. The declaration is:usrCntrListWidget { border: 4px solid #B8BCBF; }I declared this, but the style is not applied.
But
QListWidget { border: 4px solid #B8BCBF; }If declared as , the style is applied.