diff --git a/src/book.cpp b/src/book.cpp new file mode 100644 index 0000000..197164e --- /dev/null +++ b/src/book.cpp @@ -0,0 +1,86 @@ +#include "book.h" +#include "ui_book.h" +#include "home.h" +#include "cat_book.h" +#include "dog_book.h" +#include "rabbit.h" +Book::Book(QWidget *parent) : + QWidget(parent), + ui(new Ui::Book) +{ + ui->setupUi(this); + + QPixmap myPix(":/image/按键边框_book.png"); + ui->label_cat->setPixmap(myPix); + ui->label_cat->setScaledContents(true); + ui->label_cat->show(); + + QPixmap myPix2(":/image/按键边框_book.png"); + ui->label_dog->setPixmap(myPix2); + ui->label_dog->setScaledContents(true); + ui->label_dog->show(); + + QPixmap myPix3(":/image/按键边框_book.png"); + ui->label_rabbit->setPixmap(myPix3); + ui->label_rabbit->setScaledContents(true); + ui->label_rabbit->show(); + + +} + +Book::~Book() +{ + delete ui; +} + + + +void Book::book_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 Book::on_book_to_home_clicked() +{ + Home* from_book_to_home = new Home; + from_book_to_home->set_background(); + from_book_to_home->show(); + delete this; +} + +void Book::on_cat_clicked() +{ + Cat_book *to_cat = new Cat_book; + to_cat->cat_book_set_background(); + to_cat->show(); + delete this; +} + + + +void Book::on_dog_clicked() +{ + Dog_book *to_dog = new Dog_book; + to_dog->dog_set_background(); + to_dog->show(); + delete this; +} + +void Book::on_rabbit_clicked() +{ + Rabbit *to_rabbit = new Rabbit; + to_rabbit->rabbit_set_background(); + to_rabbit->show(); + delete this; +}