Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[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:
What i want is the rgb color: 170,170,255.
How can i set the color to this rgb?
koahnig last edited by
i had read this thread..
@ item->setBackgroundColor(QColor::setRgb ( 170, 170, 255 ));@
error: cannot call member function ‘void QColor::setRgb(int, int, int, int)’ without object
andre last edited by
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.
Haven't seen this function Andre. All fine now.