qfedu-qt-level/Project02/main.cpp

22 lines
434 B
C++
Raw Normal View History

2023-08-10 12:05:02 +08:00
#include "mainwindow.h"
2023-08-13 11:47:00 +08:00
#include "homewidget.h"
2023-08-10 12:05:02 +08:00
#include <QApplication>
2023-08-13 11:47:00 +08:00
#include <QDebug>
2023-08-10 12:05:02 +08:00
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
2023-08-13 11:47:00 +08:00
MainWindow w; // 登录页
w.show(); // 先显示登录页
HomeWidget hw; // 主页
QObject::connect(&w,&MainWindow::login_success,[&](){ // 登录成功则显示主页并关闭登录页
hw.show();
w.close();
});
2023-08-10 12:05:02 +08:00
return a.exec();
}