working on a project in Qt. I have a variable that will be 0-255. 255 needs to be black, 0 needs to be white, and anything in between should be some shade of gray. So I have a square QLabel. I'm trying to set a stylesheet, but I keep getting black no matter what I put in. Here is what my code looks like:
QString color = QString("QLabel {background-color: rgb(%1, %1, %1)}").arg(number); label->setStyleSheet(color); No matter what 'number' is it always shows as black. Note that I am using windows 8.