
Originally Posted by
kamlesh.sangani
AFAIK QPalette will help to change colors of background, not to set image as background. I want to set image as background.
Funny, I wonder what QPalette::setBrush() is for then 
#include <QtGui>
int main(int argc, char **argv){
p.
setBrush(QPalette::Base,
QPixmap("/usr/share/wallpapers/Air/contents/images/1024x768.jpg"));
w.setPalette(p);
w.show();
return app.exec();
}
#include <QtGui>
int main(int argc, char **argv){
QApplication app(argc, argv);
QListView w;
QPalette p = w.palette();
p.setBrush(QPalette::Base, QPixmap("/usr/share/wallpapers/Air/contents/images/1024x768.jpg"));
w.setPalette(p);
w.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks