Disable indexing of items and reenable it after you create all items. Also be sure to create and add items to the scene before you set the scene on the view. If that doesn't help - use a profiler to find the bottleneck.
Disable indexing of items and reenable it after you create all items. Also be sure to create and add items to the scene before you set the scene on the view. If that doesn't help - use a profiler to find the bottleneck.
when building items I only add them to theire parents, and only at the end of process I add the main parent item to scene.
This way I think indexing cannot be part of the slow process![]()
(or I am missing an other indexing place?).
ok, with profiler I have no experience, do you know a good one with Qt (I am working with QTCreator for now).
Seeking on my own right now but always open to any advise.
On Linux I'm using either gprof or callgrind which is part of the Vallgrind package.
Ok the problem seems to come from setParentItem :
- I am working with a layer logic.
- My points layer contain all geographics points
I don't know what change between 4.5.0 and 4.5.1, but the way parentItem are settings know cause slow processing when there is over 10 000 items on one parent, and the more items there is the slower it is.
No idea to solve this yet...
May be set Items parent all in one after items build... But it should still be slow...
Maybe try incorporating more layers to your structure? Instead of having an item with 10000 children, have an item with 100 children that each have 100 children of their own?
Yes, that's possible.
But then I worry about memory needs(we try to minize it on this project) and time needed when calling a fonction like show or one layer (responsible to call every item on layer to to set their visibility ).
And the all layer logic should be recheck with this solution
I would like a way to solve the problem to see the program working pretty mutch the same that it use to with 4.5.0.
know looking at Qt library code to understand the difference...
Obviously if no other solution is possbile that the one I'll put in motion.
One empty graphics item uses up about 60 bytes of memory.
If someone else met this particular problem, the solution is to correctly set Items
setFlag(QGraphicsItem::ItemDoesntPropagateOpacityT oChildren);
Opacity since 4.5.1 is not process the same way.
Thank you wysota for your support! Way to build a community!![]()
Bookmarks