On Mon, May 22, 2017, 8:10 PM Michael Boon <[email protected]> wrote:
> Hey all, > > I've just discovered that QIcon is really slow to create in Maya 2017. I'm > creating what is essentially a file browser, and my old version had a > QStandardItemModel, a QListView with > setViewModel(QtWidgets.QListView.IconMode) > and about 50,000 icons. Creating the icons used to take ~1 second and now > takes ~5 minutes. > Are they actually 50k discreet source images, or is it 50k items in your model which make use of a smaller collection of icons? Do you make any use of reusing the same QIcon for the same source file or is a new instance created per item for the same file each time? If you know all your icons up front, you can create the set of them up front. Or you can use a cache to create them once as needed and retrieved from the cache on subsequent needs. If nothing has changed in your own code between Qt4 and Qt5, maybe there is a difference in how they implicitly cache images for you. > Has anyone else found this? Does anyone know a way around it? Or has > anyone else found that they can create QIcons fast? > > Thanks! > > Boon > > -- > 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 [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/python_inside_maya/185bdb63-7a77-4201-83e8-3f361b1cca4b%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/185bdb63-7a77-4201-83e8-3f361b1cca4b%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA27psr3di%3Dv2JksA6pdhapKUJNqnTERESs8vMiU4LG2_g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
