I got your code to work but I don't know what the syntax is to combine what you suggested into the same style sheet with the other style declarations. For example both of the style sheet declarations below work but I can't put them together into one. What is the syntax? Thanks a lot!
Because the style sheet parameter is a QString, you can use all QString features, like the "+" and "+=" operators:
mycolor
= QColor(100,
200,
200);
QString style
= "background: rgb(%1, %2, %3);";
style = style.arg(mycolor.red()).arg(mycolor.green()).arg(mycolor.blue());
style += "color:black; font-size:12px;";
style += "font-weight:bold;";
drawButton->setStyleSheet(style);
mycolor = QColor(100,200,200);
QString style = "background: rgb(%1, %2, %3);";
style = style.arg(mycolor.red()).arg(mycolor.green()).arg(mycolor.blue());
style += "color:black; font-size:12px;";
style += "font-weight:bold;";
drawButton->setStyleSheet(style);
To copy to clipboard, switch view to plain text mode
Bookmarks