Ok I've solved it now
that's the what I needed to do:
void MyGraphicsView
::drawBackground( QPainter* pPainter,
const QRectF
& rect
) {
if ( m_Scale == 1 ) {
}
else {
pPainter->resetTransform();
QRectF visibleRect
( horizontalScrollBar
()->value
(), verticalScrollBar
()->value
(), viewport
()->width
(), viewport
()->height
() );
pPainter
->drawPixmap
( QPoint(0,
0), m_ScaledPixmap, visibleRect
);
}
}
void MyGraphicsView::drawBackground( QPainter* pPainter, const QRectF& rect )
{
if ( m_Scale == 1 ) {
QGraphicsView::drawBackground( pPainter, rect );
}
else {
pPainter->resetTransform();
QRectF visibleRect( horizontalScrollBar()->value(), verticalScrollBar()->value(), viewport()->width(), viewport()->height() );
pPainter->drawPixmap( QPoint(0, 0), m_ScaledPixmap, visibleRect );
}
}
To copy to clipboard, switch view to plain text mode
m_ScaledPixmap is my pre-scaled pixmap. Naturally it takes some time, until the pre-scaled pixmap is computed, but therefore the scrolling works completely smooth...
Bookmarks