diff --git a/InGame.cpp b/InGame.cpp index 76cb5c7..347d6d7 100644 --- a/InGame.cpp +++ b/InGame.cpp @@ -3,7 +3,11 @@ InGame::InGame(QWidget *parent) : QWidget(parent) { this->mainLayout = new QVBoxLayout(this); this->mainLayout->setAlignment(Qt::AlignCenter); - this->setStyleSheet("background-image: url(:/img/ISEN-Nantes.png); background-repeat: no-repeat; background-position: center; background-color: white; background-size: auto 56%;"); + QPixmap bgPixmap(":/img/ISEN-Nantes.png"); + bgPixmap = bgPixmap.scaled(this->size(), Qt::KeepAspectRatioByExpanding); + QPalette palette; + palette.setBrush(QPalette::Window, QBrush(bgPixmap)); + this->setPalette(palette); this->pts = new QLabel("Points : 0", this); this->pts->setStyleSheet("font-size: 96px; color: black;"); this->x = new QLabel("X : 0", this); diff --git a/InGame.h b/InGame.h index cffa569..7a6f34d 100644 --- a/InGame.h +++ b/InGame.h @@ -3,6 +3,9 @@ #include #include #include +#include +#include +#include class InGame : public QWidget { Q_OBJECT