QT picture crowd display

49 views
Skip to first unread message

Rémi Deletrain

unread,
Jun 19, 2017, 8:58:24 AM6/19/17
to Python Programming for Autodesk Maya
Hello everybody,

I try a new exercise with QT, a PoseManager. We already have it, but it's getting old now and I have to update it for the next production.
So I made a list with icons like the StudioLibrary: http://www.studiolibrary.com.
Why not use StudioLybrarie directly? Simply because the class that allows to do the display will also serve us on other tools and so must be generic and with our libs.

So I can start displaying 13,000 icons in less than two seconds.
However, once the interface is initialized and a UI with a large display the refresh begins to be long.
To give an idea with 280 icons of 60 * 60 it's good the refresh is ok. On the other hand 280 icons between 100 * 100 and 200 * 200 is too long ...

Where I came from here. Do any of you know techniques to optimize the image display with QT?

Justin Israel

unread,
Jun 19, 2017, 3:59:22 PM6/19/17
to Python Programming for Autodesk Maya

What kind of configuration are you using? QListView+model? QListWidget? Custom?
If QListview, did you try enabling uniform sizes (http://doc.qt.io/qt-4.8/qlistview.html#uniformItemSizes-prop) and raise the batch size?

If you are still getting performance issues, you may need to experiment with a custom solution. QGraphicsScene is more performant when you need to display a lot of custom graphics at once that need to paint. You might need to look at porting the example Flow layout that comes with Qt from QWidget to QGraphics (something I had to do as well).

Is it Qt4 or Qt5? If the later then you may need to try this in QML.

Justin


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/f70cc48e-15cb-4f2b-9b48-c308ca4541b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rémi Deletrain

unread,
Jun 20, 2017, 3:55:26 AM6/20/17
to Python Programming for Autodesk Maya
Thanks for your reply Justin,

I use PySide of Maya 2014. So it seems to me that it is more or less the version QT4. I am wrong ?
I made a class with a parent class QListView and I manage the model inside.
It may change a bit to also play with the QT proxy for the filters.

I tried the function uniform sizes and actually I have a big gain of performance with that!
I will try in my time lost to do with a QGraphicsScene but I do not know if I would have time to do the same thing from scratch ... This is the advantage of the QListView.
But it can be a very good exercise. I will try today and following how I advance I will see if I continue or not on this objective.

Justin Israel

unread,
Jun 20, 2017, 6:38:29 AM6/20/17
to Python Programming for Autodesk Maya

Ya that is Qt4. Good to hear you got a speed increase from that setting!

Have you tried comparing the speed difference between the view/model and the widget approach? Depending on whether you have alot of custom logic in your model and view or not, maybe leaving more of the logic in C++ might end up faster for your use case? If your model is making a ton of calls to custom python data() methods it could be a performance hit over a default C++ implementation. And then there is always that QGraphics route which is more involved.


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

Rémi Deletrain

unread,
Jun 21, 2017, 4:29:16 AM6/21/17
to Python Programming for Autodesk Maya
So in fact, I tried the QListWidget vs. QListView / QStandardItemModel. I win a good performance. Easily two to three times faster ...
At logic level I try to use a maximum of C ++ logic. Eventually, if I have time one day, it will be done in C ++

I did not have time to try with the QGraphicView ... Maybe today ...
Reply all
Reply to author
Forward
0 new messages