Results 1 to 6 of 6

Thread: Scrolling problem with background using View/Scene

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2007
    Location
    Pune, India
    Posts
    60
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Scrolling problem with background using View/Scene

    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
    Qt Code:
    1. 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
    Qt Code:
    1. GraphicsView::scrollContentsBy(int dx, int dy)
    2. {
    3. scene()->invalidate(sceneRect(), QGraphicsScene::BackgroundLayer);
    4. QGraphicsView::scrollContentsBy(dx, dy);
    5. }
    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.
    Last edited by wysota; 22nd October 2007 at 06:12. Reason: missing [code] tags

Similar Threads

  1. QTreeView problem scrolling to end.
    By seneca in forum Qt Programming
    Replies: 7
    Last Post: 22nd December 2015, 12:08
  2. QGraphicsView scrolling problem with 4.3.0
    By hb in forum Qt Programming
    Replies: 8
    Last Post: 30th August 2007, 22:18
  3. Replies: 2
    Last Post: 8th October 2006, 20:14

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.