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?
Re: Isolating update of a single item
What do you mean by "update"?
Re: Isolating update of a single item
Quote:
Originally Posted by
sp
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.
Quote:
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.
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?
Re: Isolating update of a single item
Through one of methods from the API that has "cache" in its name.
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???
Re: Isolating update of a single item
Quote:
Originally Posted by
sp
tried but didnt work out. Application still slows down.
Apparently the problem is elsewhere.
Quote:
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.
Quote:
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.