#include "AboutView.h" #include AboutView::AboutView(QWidget *parent) : QWidget(parent) { setStyleSheet("background-color: rgb(222, 222, 0);"); } void AboutView::paintEvent(QPaintEvent *event) { QWidget::paintEvent(event); QPainter painter(this); QPixmap pixmap(":/resource/background/1.jpg"); painter.drawPixmap(0, 0, pixmap.scaled(width(), height(), Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation)); }