Solved How to stretch the background image?
-
Hi.
How to stretch the background image?
The image does not stretch.QPalette Pal(palette()); //QImage background(":/Images/Images/splash-background.png"); QImage background(":/Images/Images/ico-qr.png"); Pal.setBrush(QPalette::Background, background); this->setAutoFillBackground(true); this->setPalette(Pal);
or
this->setStyleSheet("background-image: url(:/Images/Images/ico-qr.png); ");
-
Hi,
See this thread for inspiration.
-
QPixmap bkgnd(":/Images/Images/splash-background.png"); bkgnd = bkgnd.scaled(size(), Qt::IgnoreAspectRatio); QPalette p = palette(); //copy current, not create new p.setBrush(QPalette::Background, bkgnd); setPalette(p);