#include "dog_book.h" #include "ui_dog_book.h" #include "book.h" #include "dog_concret.h" Dog_book::Dog_book(QWidget *parent) : QWidget(parent), ui(new Ui::Dog_book) { ui->setupUi(this); ui->go_book_concrete->setStyleSheet("QPushButton{border-radius:5px;background:rgb(255,43,89);color:black;}"); } Dog_book::~Dog_book() { delete ui; } void Dog_book::dog_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 Dog_book::on_pushButton_clicked() { Book* to_book1 = new Book; to_book1->book_set_background(); to_book1->show(); delete this; } void Dog_book::on_go_book_concrete_clicked() { dog_concret *to_dog = new dog_concret; to_dog->set_background(); to_dog->show(); delete this; }