Hi,
I am using view/Scene architecture to show rectangels and lines with background picture.
I have drawn background in GraphicsScene::drawBackground(..) function.
To speed up rendering I have set cache background
view->setCacheMode(QGraphicsView::CacheBackground);
To copy to clipboard, switch view to plain text mode
But using this when I zoom and then scroll the content there is artifacts comes. After scrolling scene doesnt refresh property.Background image doesnt refresh.
I have tried using
GraphicsView::scrollContentsBy(int dx, int dy)
{
}
GraphicsView::scrollContentsBy(int dx, int dy)
{
scene()->invalidate(sceneRect(), QGraphicsScene::BackgroundLayer);
QGraphicsView::scrollContentsBy(dx, dy);
}
To copy to clipboard, switch view to plain text mode
But this also doesnt refersh the screen.
I want to refresh only portion which is visible because of scrolling.
Can anybody have solution for this.
Bookmarks