PDA

View Full Version : QGraphicsView expert ? slown view with a lot of items



pl01
3rd December 2011, 20:05
Hi,

I'm looking for a QGraphicsView expert to help me to improve the performance of my QGraphicsView.

The problem is that when I have a lot of items, it take up to 10 seconds to refresh (move item, context menu ...)

I have play a lot with it, but found no solution so I'm ready to hire someone for a small job to help me !

Any idea is welcome.

Thanks

Lykurg
4th December 2011, 09:47
Without any knowledge of your actual code: Have you tried different settings for QGraphicsView::OptimizationFlag, QGraphicsView::ViewportUpdateMode or disabled the scene index (QGraphicsScene::ItemIndexMethod). Also altering renderHints can improve the speed.

Last option you could look at is to implement a level of detail (QStyleOptionGraphicsItem::levelOfDetailFromTransf orm) or altering your item flags, e.g. static content etc.

pl01
4th December 2011, 10:14
Thanks,

I have already play with a lot of options, there are several weeks I'm trying to improve the performance but without result :-(

you can download the code here http://www.spectralpixel.com/images/pgEditor.zip

Regards

pl01
5th December 2011, 09:13
I have found one solution for speed, the problem was related to QGraphicsItem::ItemCoordinateCache or QGraphicsItem::DeepItemCoordinateCache. When I use QGraphicsItem::NoCache it is really faster.

The problem is that I have no more antialiasing ! When I look at the documentation it seems that it completely redraw the item, so I don't understand why I have no anti aliasing !

Do you have an idea ?

Thanks

pl01
6th December 2011, 09:27
Nobody has an idea about the problem ?

Thanks