[Qt-interest] suggestion for simple widget design.

Sean Harmer sean.harmer at maps-technology.com
Thu Apr 1 17:50:30 CEST 2010


On Thursday 01 April 2010 16:35:53 Josh wrote:
> I want to make a simple widget that displays a single image (bintmap,
> png, jpg etc) at a time. The image can be changed dynamically.
> 
> My original intent was to simply use a QLabel and setPixmap on it, using
> some images in a QPixmapCache.
> 
> A coworker is insisting that a QStackedWidget is the way to go? That
> seems like overkill for something that simply displays an image.
> 
> 
> Can anyone comment on which of these is the best approach? Is there some
> better way to do this?
> 
> Thanks,
> 
> Josh

QLabel is fine for static display. If you want some fancy transitions between 
images, then I suggest you take a look at QGraphicsView and QPixmapItem.

Cheers,

Sean



More information about the Qt-interest-old mailing list