I have an override function for a QGraphicsView similar to what's below:

Qt Code:
  1. void form::drawBackground(QPainter *painter, const QRectF &rect)
  2. {
  3. ...
  4. QBrush brush(Qt::SolidPattern);
  5. brush.setColor(Qt::black);
  6. painter->setBrush(brush);
  7. painter->drawPolygon(...);
  8. ...
  9. }
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!