123456789101112131415161718192021222324252627282930313233343536 |
- #include "Login.h"
- #include "OriginalWnd/OriginalWnd.h"
- #include "ui_Login.h"
- #include <QStackedWidget>
- #include <qDebug>
- Login::Login(QWidget *parent)
- : QMainWindow(parent)
- , ui(new Ui::Login)
- {
- ui->setupUi(this);
- initForm();
- }
- Login::~Login()
- {
- delete ui;
- }
- void Login::initForm()
- {
- QPixmap pixmap(":/images/logo.png");
- QPixmap scaledPixmap = pixmap.scaled(283, 40, Qt::KeepAspectRatio);
- ui->label->setPixmap(scaledPixmap);
- }
- void Login::on_pushButton_clicked()
- {
- if (QStackedWidget *parent = qobject_cast<QStackedWidget*>(this->parentWidget())) {
- OriginalWnd *originalWnd = new OriginalWnd(this);
- parent->addWidget(originalWnd);
- parent->setCurrentIndex(parent->indexOf(originalWnd));
- }
- }
|