How to set a full background for the main widget
Unsolved
General and Desktop
-
I am trying to set a full background image for my mainwindow but it is not fitting fully .
Like the image which i have attached . Kindly say how to set a full scaled image as a background for my mainwindow
My code :
QPixmap bkgnd("" + QDir::currentPath() + "./Images/9.jpg"); bkgnd = bkgnd.scaled(this->size(), Qt::IgnoreAspectRatio); QPalette palette; palette.setBrush(QPalette::Background, bkgnd); this->setPalette(palette);
-
I am trying to set a full background image for my mainwindow but it is not fitting fully .
Like the image which i have attached . Kindly say how to set a full scaled image as a background for my mainwindow
My code :
QPixmap bkgnd("" + QDir::currentPath() + "./Images/9.jpg"); bkgnd = bkgnd.scaled(this->size(), Qt::IgnoreAspectRatio); QPalette palette; palette.setBrush(QPalette::Background, bkgnd); this->setPalette(palette);