incapacitant
26th February 2006, 14:35
I try to set the background of a widget to an image as indicated in Assistant in the
Porting to QT4 of setPaletteBackgroundPixmap :
QWidget *widget = new QWidget;
QPixmap pixmap(":/images/bArchi.png");
QPalette palette;
palette.setBrush(widget->backgroundRole(), QBrush(pixmap));
widget->setPalette(palette);
setCentralWidget(widget);
I played around with many combinations of the above code, but nothing will show my
image. The background remains unchanged...
:confused:
Porting to QT4 of setPaletteBackgroundPixmap :
QWidget *widget = new QWidget;
QPixmap pixmap(":/images/bArchi.png");
QPalette palette;
palette.setBrush(widget->backgroundRole(), QBrush(pixmap));
widget->setPalette(palette);
setCentralWidget(widget);
I played around with many combinations of the above code, but nothing will show my
image. The background remains unchanged...
:confused: