Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

Adding consecutive stylesheets to widget

$
0
0
Hello all! I’m using a single stylesheet to apply styles to all my widgets. My qss code is, QLabel#heading {     font-size: 28px;     font-weight: bold;     font-family: "Arial Narrow"; }   QLabel#colorgreen {     color: green; }   QLabel#colorblack {     color:black; } And in my source file, I want to call both ‘heading’ and ‘colorgreen’ or ‘ colorblack’ depending on my color requirements. I have,     ui->channel_name->setObjectName("heading");     ui->channel_name->setStyleSheet("");     ui->channel_name->setObjectName("blackcolor");     ui->channel_name->setStyleSheet(""); However, only the color changes to black. The styles under ‘heading’ is not applied. Does anyone know why? Please help me out. Thanks.

Viewing all articles
Browse latest Browse all 18427

Trending Articles