Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Not displaying image in the window
shalinir last edited by
the source code
@QPalette p = palette();
QDesktopWidget* desktopWidget = QApplication::desktop(); QRect rect = desktopWidget->availableGeometry(); QSize size(rect.width() , rect.height()); QPixmap pixmap(pixmap1.scaled(size)); p.setBrush(QPalette::Background, pixmap); setPalette(p);@ when the project is built in the output console it displays--QPixmap::scaled: Pixmap is a null pixmap
stukdev last edited by
BG without extension?
andre last edited by
So, is the image actually in the resource? Did you deploy the needed image format plugin?
tzander last edited by
yeah, like stuk said; you may have mis-typed the filename :)
Also would like to suggest you use QImage for opening the image which is much faster than using a pixmap for nothing but scaling.
postal267 last edited by
I think you should replace
you need to put the image extension in the code.