If you like print border from QGraphicsScene draw a QGraphicsLineItem
to not print drawBackground on view....
void GraphicsView
::drawBackground(QPainter *painter,
const QRectF &rect
) {
setCacheMode(CacheNone); /* cache or not Background QGraphicsView::CacheBackground*/
painter->save();
painter
->setPen
( QPen(Qt
::darkGray,
1) );
painter
->setBrush
(QBrush(chessgrid
));
painter->drawRect(scene->sceneRect());
painter->restore();
}
void GraphicsView::drawBackground(QPainter *painter, const QRectF &rect)
{
setCacheMode(CacheNone); /* cache or not Background QGraphicsView::CacheBackground*/
painter->save();
painter->setPen( QPen(Qt::darkGray,1) );
painter->setBrush(QBrush(chessgrid));
painter->drawRect(scene->sceneRect());
painter->restore();
}
To copy to clipboard, switch view to plain text mode
Bookmarks