#include "rabbit.h" #include "ui_rabbit.h" #include "book.h" Rabbit::Rabbit(QWidget *parent) : QWidget(parent), ui(new Ui::Rabbit) { ui->setupUi(this); } Rabbit::~Rabbit() { delete ui; } void Rabbit::rabbit_set_background() { this->setWindowTitle("阅览界面"); // ui->label->setStyleSheet("background-color:red");//背景色 this->setMinimumSize(1280,720); this->setMaximumSize(1280,720); this->setAutoFillBackground(true); QPalette palette; QPixmap pixmap = QPixmap(":/image/背景_book.png").scaled(this->size()); palette.setBrush(QPalette::Window, QBrush(pixmap)); this->setPalette(palette); } void Rabbit::on_go_back_clicked() { Book* to_book1 = new Book; to_book1->book_set_background(); to_book1->show(); delete this; }