Results 1 to 7 of 7

Thread: Isolating update of a single item

  1. #1
    Join Date
    Feb 2011
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Isolating update of a single item

    Hi,
    I have a QGraphicsScene in which there are many layers ( QGraphicsRectItem of same size). I have to update some layers at 10ms while others i have to update occasionally. All layers are visible. Is it possible to update single layer without updating other visible layer? (Application slows down drastically

    One more thing. Is it possible to divide all layers into 3 different QGLFrameBufferObjects (I dont know much about QGLFrameBufferObject but somebody in my office has suggested that) to achieve above objective?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Isolating update of a single item

    What do you mean by "update"?

  3. #3
    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: Isolating update of a single item

    Quote Originally Posted by sp View Post
    I have a QGraphicsScene in which there are many layers ( QGraphicsRectItem of same size). I have to update some layers at 10ms while others i have to update occasionally. All layers are visible. Is it possible to update single layer without updating other visible layer? (Application slows down drastically
    You can enable caching for your items.

    One more thing. Is it possible to divide all layers into 3 different QGLFrameBufferObjects (I dont know much about QGLFrameBufferObject but somebody in my office has suggested that) to achieve above objective?
    It is possible but it won't help with anything.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Feb 2011
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Isolating update of a single item

    Update means calling update() function of graphicsItem every 10 ms.

    Can u plz tell how to enable caching?

  5. #5
    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: Isolating update of a single item

    Through one of methods from the API that has "cache" in its name.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Feb 2011
    Posts
    10
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Isolating update of a single item

    tried but didnt work out. Application still slows down.

    Can u plz tell how to use QFrameBufferObject inside paint() of QgraphicsItem.

    In my application, there is a widget having a QGraphicsScene and a QGraphicsView.
    In QGraphicsScene, there are many QGraphicsRectItem. Each QGraphicsRectItem has a QGraphicsItem.
    I have set my QGraphicsView viewport as new QGLWidget.

    As told earlier, items have different update rate. Any other way of isolating update???

  7. #7
    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: Isolating update of a single item

    Quote Originally Posted by sp View Post
    tried but didnt work out. Application still slows down.
    Apparently the problem is elsewhere.

    Can u plz tell how to use QFrameBufferObject inside paint() of QgraphicsItem.
    Exactly the same way you'd use it outside paint() -- you bind the FBO to the current GL context, render whatever you have to render and then unbind and use the result however you want.

    As told earlier, items have different update rate. Any other way of isolating update???
    For a GL viewport the whole viewport is always redrawn thus caching is the only thing that prevents all items to be repainted. If caching didn't help, then the only solution I can see is to not update the scene that often.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 0
    Last Post: 11th June 2013, 10:50
  2. Replies: 11
    Last Post: 13th February 2013, 23:26
  3. Styling a Single Item on a QMenuBar
    By Goug in forum Qt Programming
    Replies: 3
    Last Post: 10th November 2011, 07:04
  4. Single Item update in QGraphicsView
    By oberlus in forum Qt Programming
    Replies: 0
    Last Post: 27th August 2010, 09:17
  5. Changing font color for a single item in a QTreeView
    By Doug Broadwell in forum Qt Programming
    Replies: 1
    Last Post: 3rd November 2007, 19:14

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.