Results 1 to 4 of 4

Thread: Caching of QPushButton embedded in QGraphicsScene

  1. #1
    Join Date
    Jan 2010
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Caching of QPushButton embedded in QGraphicsScene

    Hi!

    I have a QGraphicsScene that draws a fullscreen (video) image in the background. I use OpenGL for that.
    On top of the video I am showing buttons and other widgets. I achieve that by embedding normal QWidgets as QGraphicsProxyWidgets. To speed up redrawing I enabled caching of those proxy widget items.
    My problem is, that widgets like buttons which have several states (hover, pressed ...) are only cached once so I don't see mouse over effects. Invalidating the cache on every Mouse event doesn't seem to be a good solution performance-wise.
    Does Qt offer any solution to that problem, or will I need to implement my own button class? I like the convenience of QGraphicsProxyWidgets together with StyleSheets, and wouldn't want to miss that.

    Regards,
    Matthias

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Caching of QPushButton embedded in QGraphicsScene

    Does disabling caching meets ur speed requirements ?
    If yes, then why go the longer way ;-)

  3. #3
    Join Date
    Jan 2010
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Caching of QPushButton embedded in QGraphicsScene

    Well, it depends on the complexity of the style sheet involved. Border-images for instance seem to have a noticable impact on performance. But overall the performance is still good without caching buttons (while caching all other static widgets). Nevertheless more optimization would be nice and caching button states should not be hard to implement, I suppose.

    Matthias

  4. #4
    Join Date
    Apr 2010
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Caching of QPushButton embedded in QGraphicsScene

    Quote Originally Posted by aamer4yu View Post
    Does disabling caching meets ur speed requirements ?
    If yes, then why go the longer way ;-)
    same problem as before but no disabling caching does not meet speed requirements

    I have not had any luck in capturing the events to invalidate the cache either

Similar Threads

  1. Replies: 1
    Last Post: 30th October 2009, 08:52
  2. password caching method
    By ramazangirgin in forum Qt Programming
    Replies: 2
    Last Post: 30th June 2009, 09:20
  3. Replies: 3
    Last Post: 26th September 2006, 12:16
  4. QPixmap caching?
    By gfunk in forum Qt Programming
    Replies: 3
    Last Post: 11th August 2006, 22:46
  5. Caching QAbstractProxyModel dilemma
    By Alessandro in forum Qt Programming
    Replies: 2
    Last Post: 11th April 2006, 19:51

Tags for this Thread

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.