[PySide] image format for best performance

Sebastian Elsner sebastian at risefx.com
Sun May 27 12:24:45 CEST 2012

I did not notice a speed difference in formats, but since you are bound
to use QPixmaps or QIcons (dont use Qimage/qpicture, its for
manipulation of image data), which you pass your icon path to, and thus
instanciate and read the actual data, I am always using a simple cache
algorithm which would remember the whole pixmap after loading the data.
You can do this in a separate dict with itemname:QPixmap once per
item/icon or if you are using come kind of itemmodel in the item used.
So at least in most cases you dont have to load your icon data twice.
For exmaple in a TreeView or TableView this greatly improves scrolling

  Am 26.05.2012 22:34, schrieb Frank Rueter | OHUfx:
> Hi all,
> is there a recommended image format to use to get best performance out 
> of QT?
> I've got some animated widgets (sliding docks etc.) that are populated 
> with several small icons (currently 8bit pngs).
> Since the animation is a bit jerky I will have to go hunting for ways 
> top optimise the code, and thought the image format for the icons would 
> be a good place to start.
> Any experience and/or recommendations for this?
> Cheers,
> frank
> _______________________________________________
> PySide mailing list
> PySide at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/pyside

More information about the PySide mailing list