Results 1 to 3 of 3

Thread: Using QGraphicsScene instead of OpenGL

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Using QGraphicsScene instead of OpenGL

    Don't recreate the item each time you change the image. Simply set the new image on the already existing item. And create the item on stack and not on heap. Apart from that your approach seems fine (although using OpenGL for that is ok too).

  2. The following user says thank you to wysota for this useful post:

    ntp (4th March 2008)

  3. #2
    Join Date
    Jul 2007
    Location
    California, USA
    Posts
    62
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    17
    Thanked 7 Times in 4 Posts

    Default Re: Using QGraphicsScene instead of OpenGL

    Here is a followup. Turns out the real problem was that I wasn't allocating enough memory for the incoming image. It needed to be displayBuffer = (unsigned char*) (malloc ((w*h) * 4)); not (... * 3).

    I am using Format_RGB32 but I was focusing on the RGB part and needed to allocate 32 bits and the last 8 bits are used for padding.

Similar Threads

  1. OpenGL and Qt Question
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 18th April 2009, 18:04
  2. Replies: 3
    Last Post: 12th February 2008, 21:17
  3. QGraphicsScene / QGraphicsView speed after resize
    By themolecule in forum Qt Programming
    Replies: 1
    Last Post: 21st July 2007, 23:46
  4. Qtopia Core & OpenGL ES?
    By zelko in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 28th May 2007, 07:21
  5. OpenGL ES, Qt/11 - Qtopia Core?
    By zelko in forum Qt Programming
    Replies: 0
    Last Post: 3rd May 2007, 10:56

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.