You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
installer-prompt/src/backgroundscreen.cpp

28 lines
754 B

#include "backgroundscreen.h"
#include <QMessageBox>
#include <QGuiApplication>
#include <QScreen>
BackgroundScreen::BackgroundScreen(QWidget *parent)
: QWidget(parent) {
// Set the background image and scale it
QPixmap bg(":/background");
if (bg.isNull()) {
// the user will see the warning message that the InstallerPrompt object pops up, no need to bombard them with one message per screen
return;
}
QScreen *screen = QGuiApplication::primaryScreen();
QRect screenGeometry = screen->geometry();
bg = bg.scaled(screenGeometry.size(), Qt::IgnoreAspectRatio);
QPalette palette;
palette.setBrush(QPalette::Window, bg);
this->setPalette(palette);
}
BackgroundScreen::~BackgroundScreen()
{
}