I have an undesirable black line of one or two pixels on the top of my rect when i use drawRect(). So my rect doesn't fill my widget completely.
My code :
QPainter Painter(this);
QString TmpColor;
int R, G, B, A;
TmpColor = c_LabColor;
R = TmpColor.left(TmpColor.indexOf(',')).toInt();
TmpColor.remove(0, TmpColor.indexOf(',') + 1);
G = TmpColor.left(TmpColor.indexOf(',')).toInt();
TmpColor.remove(0, TmpColor.indexOf(',') + 1);
B = TmpColor.left(TmpColor.indexOf(',')).toInt();
TmpColor.remove(0, TmpColor.indexOf(',') + 1);
A = TmpColor.left(TmpColor.indexOf(',')).toInt();
Painter.setBrush(QBrush(QColor(R,G,B,A)));
Painter.drawRect(this->rect());
Thank you for your suggestions.