[SOLVED] How can i set the background color of listwidget item using rgb values?
I want to set the background of my listwidget item.
I don’t want a simple blue so i don’t want this one:
- item->setBackgroundColor("blue");
What i want is the rgb color: 170,170,255.
How can i set the color to this rgb?
4 replies
You can use a QColor value.
E.g. through http://doc.qt.nokia.com/4.7/qcolor.html#setRgb [doc.qt.nokia.com]
Of course you can not. setRgb is not a static method, after all. Use fromRgb if you do not want to use a QColor object instance that you can manipulate.
This is really basic stuff, and very easy to find in the documentation file that you were already refered to. Please do a bit of digging yourself before asking.
You must log in to post a reply. Not a member yet? Register here!



