Results 1 to 3 of 3

Thread: QGraphicsView Problem

  1. #1
    Join Date
    Jun 2008
    Posts
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default QGraphicsView Problem

    I'm writing a little app that takes aerial photos and constructs something like a google map out of them. I'm adding QPixmapItems to my graphics scene, and the scene is connected to a qgraphicsview. Everything works great until I scale or rotate the qgraphicsview, the performance just goes to absolute crap. The qtdemo "ported canvas" seems to be able to zoom and rotate pixmaps without any loss of performance at all. Of course, I'm using 6megapixel pictures, not little tiny pixmaps, but I wouldn't expect it to get so slow. Anyone have any ideas what I'm doing wrong?

    With rotating, if I rotate back to the initial orientation, the performance goes back up, with zooming (calling qgraphicsview->scale and using scaling factors 0.5 and 1.5) as soon as I scale it the first time, it gets realy slow, and scaling back to the original scale still results in slow performance.

    Any help with this would be greatly appreciated - this is a bit of a rush job - has to be working by next week

    Thanks
    Andrew

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QGraphicsView Problem

    Try enabling QGraphicsItem::DeviceCoordinateCache for your items. Cutting images into smaller pieces should help too. Using fast pixmap transform mode should increase the speed significantly. Finally use QGLWidget as the viewport if you have hardware accelerated graphics card available (you probably do) - this should give you a big boost in speed.
    Last edited by jpn; 14th June 2008 at 08:09. Reason: disabled smilies

  3. #3
    Join Date
    Jun 2008
    Posts
    4
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGraphicsView Problem

    I tried turning on the device coordinate caching. Same problem. Scrolling works fine before anything is transformed, and takes > 10 seconds when any transformation is being applied to the pixmaps. I think for the first version of the program for this week, I'll just skip the map and just have a list of pictures and display them one at a time, and disable zooming. I would still like to figure this out for later though.

    I could try a smaller image too...

    Andrew

Similar Threads

  1. QGraphicsView Problem !!
    By Gamalof in forum Qt Programming
    Replies: 3
    Last Post: 14th June 2008, 13:55
  2. Mystic Problem (QGraphicsView + QGLWidget)
    By NoRulez in forum Qt Programming
    Replies: 2
    Last Post: 28th April 2008, 10:39
  3. problem in rendering opengl on QGraphicsView
    By Sandip in forum Qt Programming
    Replies: 17
    Last Post: 15th April 2008, 08:27
  4. Problem determining size of QGraphicsView
    By Bocki in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2008, 14:54
  5. QGraphicsView scrolling problem with 4.3.0
    By hb in forum Qt Programming
    Replies: 8
    Last Post: 30th August 2007, 22:18

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.