Results 1 to 12 of 12

Thread: Slow Movement of QGraphicsItem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,332
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    317
    Thanked 871 Times in 858 Posts

    Default Re: Slow Movement of QGraphicsItem

    Rectangle is not child of QGraphicsPixmapItem .This Rectangle and Image from camera(Which is i am drawing on QGraphicsPixmapItem) are childs of QGraphicsScene.
    It still doesn't matter. If you move the rectangle over the pixmap, it will force the pixmap to redraw as different areas are exposed. And if in the process of redrawing the pixmap you are also rescaling it from the camera image, that is a huge amount of work to do every few ms and it gets worse as the number of pixels (size of the pixmap) increases. Try what I suggested: use an overlay widget to draw the ROI so your ROI is not in the same scene (or even in the same graphics view) as the pixmap.

    I would probably not even bother with the G-V architecture for the pixmap part at all - if the pixmap occupies the entire window, then just use a QWidget-based view to display it, and use the G-V architecture in the overlay widget only. If the scene coordinates match the pixmap dimensions, then all the coordinates will be self-consistent.

  2. #2
    Join Date
    Sep 2009
    Posts
    26
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanked 1 Time in 1 Post

    Default Re: Slow Movement of QGraphicsItem

    Quote Originally Posted by d_stranz View Post
    It still doesn't matter. If you move the rectangle over the pixmap, it will force the pixmap to redraw as different areas are exposed. And if in the process of redrawing the pixmap you are also rescaling it from the camera image, that is a huge amount of work to do every few ms and it gets worse as the number of pixels (size of the pixmap) increases. Try what I suggested: use an overlay widget to draw the ROI so your ROI is not in the same scene (or even in the same graphics view) as the pixmap.

    I would probably not even bother with the G-V architecture for the pixmap part at all - if the pixmap occupies the entire window, then just use a QWidget-based view to display it, and use the G-V architecture in the overlay widget only. If the scene coordinates match the pixmap dimensions, then all the coordinates will be self-consistent.
    I tried ur solution but its not solving the issue...Iam attaching the zipped files
    Attached Images Attached Images
    Attached Files Attached Files

Similar Threads

  1. How can QML understand mouse movement?
    By Yonetici in forum Qt Quick
    Replies: 5
    Last Post: 19th July 2012, 09:29
  2. QWidget movement
    By fakefish in forum Qt Programming
    Replies: 8
    Last Post: 19th April 2011, 12:02
  3. Registering QGraphicsItem Movement (Drag)
    By Polnareff in forum Newbie
    Replies: 5
    Last Post: 27th May 2010, 13:41
  4. line movement
    By zgulser in forum Qt Programming
    Replies: 7
    Last Post: 17th August 2009, 18:01
  5. QGraphicsItem recoloring really slow
    By kai in forum Qt Programming
    Replies: 1
    Last Post: 18th December 2008, 07:35

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.