I have an override function for a QGraphicsView similar to what's below:
{
...
QBrush brush
(Qt
::SolidPattern);
brush.setColor(Qt::black);
painter->setBrush(brush);
painter->drawPolygon(...);
...
}
void form::drawBackground(QPainter *painter, const QRectF &rect)
{
...
QBrush brush(Qt::SolidPattern);
brush.setColor(Qt::black);
painter->setBrush(brush);
painter->drawPolygon(...);
...
}
To copy to clipboard, switch view to plain text mode
I'm trying to set the entire background color of the QGraphicsView to a color, but the only way I've been able to do that is by using one of the draw functions (in the example above I used drawPolygon). Is there any functions available to do this. I tried using "setBackground(brush)" but that doesn't seem to be accomplishing what I need.
Thanks in advance!
Bookmarks