⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)
how to scale the background image for the Mainwindow
I want to scale the image . (i.e) I want to place the image as the size of the Mainwindow when its in minimized size and resize the image when the Mainwindow widget is maximized .
What have you tried so far?
How did you set the background image on mainwindow in the first place?
There is an event for when resize happen which you can use.
QPixmap bkgnd("" + QDir::currentPath() + "./InputFiles/Images/Logo.png");
bkgnd = bkgnd.scaled(this->window()->size(), Qt::IgnoreAspectRatio);
My Current Code
What type of widget is your MainWindow ?
I used QT WIdget application type
In other words, the question was: what is the base class of MainWindow ?
class MainWindow : public QMainWindow is this the one. Or if i am saying it wrong kindly mention how to see it.