hi, all
i use code set background - image , but nothing in screen
QString styleSheet("QWidget { background-image: url(:/pics/bg.jpg); } ");
QApplication a(argc, argv);
a.setStyleSheet(styleSheet);
what's wrong??
hi, all
i use code set background - image , but nothing in screen
QString styleSheet("QWidget { background-image: url(:/pics/bg.jpg); } ");
QApplication a(argc, argv);
a.setStyleSheet(styleSheet);
what's wrong??
I guess that setting is overridden from some other setting since it's too general. Have you tried to apply it directly to the widget?
yes i try, apply it directly to the widget
QString styleSheet(" { background-image: url(:/pics/bg.jpg) } ");
setStyleSheet(styleSheet);
but is nothing.
Have you checked the path and resource?
i use code
QPalette palette;
QImage bg;
bg.load( ":/pics/bg.jpg" );
palette.setBrush(backgroundRole(), QBrush(bg));
setPalette(palette);
the backgroup is show ok, so i think the resource is right
but , I really did not know how to check
Use such like RFile::isExist function in Qt