Page 2 of 2 FirstFirst 12
Results 21 to 22 of 22

Thread: QGraphicsPixmapItem performance

  1. #21
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QGraphicsPixmapItem performance

    Quote Originally Posted by cerber View Post
    Wysota was talking about X server, which has no meaning for Windows.
    Exactly. Pixmaps are implemented as images on Windows. It should make a difference on X11 though. It should be quite easy to test using a remote X server and a big pixmap.

  2. #22
    Join Date
    Aug 2007
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QGraphicsPixmapItem performance

    Hi.

    I've tested the approach with splitting pixmaps. It made a slight difference, but didn't seem the result that I expected.

    Finally, I've come to a thought that I have to zoom the image myself. This way:

    1. I reimplemented the paintEvent of the view.
    2. I look at the region that comes with event.
    3. For each rect of that region, I make a buffer of the size of the rect
    4. Copy a part of an image to that buffer usign image->bits()
    5. Pass that buffer to a function that scales an image (this function was implemented by my colleague).
    6. Then, create a QImage of returned buffer.
    7. And finally, draw that image on the target rect.

    Unbelivably, this works MUCH faster then Qt's pixmap transformation.

    The problem left is that very often Qt sends a paintEvent with the update-region equal to the whole view (which seems unneeded), and this slows this method a bit.

    But still - it's about 5-10 times faster!

    Thanks to everyone for your advices.

Similar Threads

  1. GraphicsView performance problems
    By Gopala Krishna in forum Qt Programming
    Replies: 79
    Last Post: 8th August 2007, 18:32
  2. Rotate QGraphicsPixmapItem
    By durbrak in forum Qt Programming
    Replies: 7
    Last Post: 15th April 2007, 15:51
  3. Replies: 1
    Last Post: 4th October 2006, 17:05
  4. [QT 4] QTextEdit performance
    By fellobo in forum Qt Programming
    Replies: 8
    Last Post: 6th March 2006, 20:27
  5. Increasing performance from Qtextedit, listview, etc?
    By taylor34 in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2006, 11:20

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.