Logo Search packages:      
Sourcecode: qt4-x11 version File versions

void MainWindow::drawBackground ( QPainter painter,
const QRectF rect 
) [protected, virtual]

Draws the background of the scene using painter, before any items and the foreground are drawn. Reimplement this function to provide a custom background for this view.

If all you want is to define a color, texture or gradient for the background, you can call setBackgroundBrush() instead.

All painting is done in scene coordinates. rect is the exposed rectangle.

The default implementation fills rect using the view's backgroundBrush. If no such brush is defined (the default), the scene's drawBackground() function is called instead.

See also:
drawForeground(), QGraphicsScene::drawBackground()

Reimplemented from QGraphicsView.

Definition at line 357 of file mainwindow.cpp.

References QPainter::drawPixmap().

    painter->drawPixmap(QPoint(0, 0), this->background);

Generated by  Doxygen 1.6.0   Back to index