how to change the left white space which QPainter doesnot draw in QWidget?
Solved
General and Desktop
-
how to change the left white space which QPainter doesnot draw in QWidget?
i did some drawing in paintEvent, however, the left area which didnot draw remains White, now i want to change this White into the color of its parent's background color which is normally light-gray in windows. -
Hi
Show the code :)
or an image at least.
Its not easy to understand what you mean. -
Try something like this to fill the white space of your drawing.
void MyWidget::paintEvent(QPaintEvent*..) { .. .. QRect r = this->rect(); painter.setBrush(//Set the parent color); painter.drawRect(r).// draw the full background first painter.setBrush(//Set the current color); painter.drawRect(rect);//draw your rect }