You can also use transparencies, and you can scale the image to fit the widget. You can also move around, show & hide, treat as top level widget, etc. B-) On Friday 17 September 2004 08:32 am, Stefan Hundhammer wrote:
On Friday 17 September 2004 15:46, Brad Bourn wrote:
Create a QWidget The use the setPaletteBackgroundPixmap() to set it's background image (pixmap) to your file.
QWidget* wig = new QWidget(this); wig->setPaletteBackgroundPixmap(QPixmap::QPixmap(QImage::QImage("images/1 .p ng"))); wig->show();
That approach has drawbacks: If the widget's size is larger or smaller than the pixmap's size, the pixmap is replicated (tiled) or cut off. That might even be desired in some cases, but in general it is not.
The advantage is that this kind of pixmap is repainted automatically by the X server, so that is really fast - the pixmap appears first on the screen, even before widget boundaries are rendered.
CU -- Stefan Hundhammer
Penguin by conviction. YaST2 Development SuSE Linux AG Nuernberg, Germany