best way to add widget to QGraphicsView
hi,
Im having a opengl viewport QGraphicsView which dynamically load a image and a check box pair in its scene .
I made a QGraphicsPixmapItem and adding it to a QGraphicsLinearlayout
in QGraphicsPixmapItem im able to optimize the cache to load 1000 pixmap at a time.
now i need a QGraphicsProxyWidget to be optimize so i can render 1000 QCheckBox fast as i can along with the pixmap item..
I need suggestion from some experts
i m following the thread
http://www.qtcentre.org/threads/3798...QGraphicsScene
Re: best way to add widget to QGraphicsView
What kind of suggestions?
Re: best way to add widget to QGraphicsView
first thanks for the reply
similar like how u gave
Quote:
I can suggest a couple of things to try:
1. enable caching for items (as suggested by my preposter but with ItemCoordinateCache)
2. set ItemHasNoContents flag on all items that paint nothing
3. set "interactive" property of the view to false if you don't need your scene to be clickable
4. make shapes as simple as you can, if you scale use the level of detail information to avoid painting things that can't be noticed by the user
5. make use of drawBackground() and drawForeground() instead of having items that cover the whole scene
6. avoid clipping
7. try using the raster engine instead of OpenGL.
is there any specific things for QGraphicsProxyWidget ..?
Re: best way to add widget to QGraphicsView
There is one -- don't use QGraphicsProxyWidget.
Re: best way to add widget to QGraphicsView
Quote:
Originally Posted by
wysota
but how i can add a QCheckBox to the scene ..?
Re: best way to add widget to QGraphicsView
Either draw the checkbox yourself using QStyle or replace the checkbox with something else.