#ifndef MAINWINDOW_H #define MAINWINDOW_H #include #include class ProjectInfo; class PopUpAniStackedWidget; class QHBoxLayout; class NavigationInterface; class CustomTitleBar; class HomeView; class ExpertManageView; class EvaluateView; class LoginView; class UserView; class AboutView; class SettingView; class QStackedWidget; class StackedWidget : public QFrame { Q_OBJECT public: StackedWidget(QWidget *parent = nullptr); void addWidget(QWidget *widget); QWidget *widget(int index) const; void removeWidget(QWidget *widget); void setCurrentWidget(QWidget *widget, bool popOut = false); void setCurrentIndex(int index, bool popOut = false); PopUpAniStackedWidget *view() const; int index(const QString routeKey); signals: void currentWidgetChanged(QWidget *); private: QHBoxLayout *m_hBoxLayout; PopUpAniStackedWidget *m_view; }; class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QWidget *parent = nullptr); ~MainWindow(); private: void initLoginPage(); void initMainPage(); void initNavigation(); void setNaviInterfaceHidden(bool hidden); int titleBarIndent() const; void resizeEvent(QResizeEvent *event) override; int routeIndex(const QString routeKey) const; private slots: void slotLogin(); void slotLogout(); void slotCancelLogin(); void slotNaviItemClicked(); void slotOpenProject(ProjectInfo *proj); void slotCloseProject(); void slotDeleteProject(ProjectInfo *proj); private: CustomTitleBar *m_titleBar = 0; QStackedWidget *m_mainStackedWidget = 0; LoginView *m_loginView = 0; QWidget *m_mainWidget = 0; QHBoxLayout *m_hBoxLayout = 0; QHBoxLayout *m_widgetLayout = 0; StackedWidget *m_stackWidget = 0; NavigationInterface *m_naviInterface = 0; HomeView *m_homeView = 0; AboutView *m_aboutView = 0; SettingView *m_settingView = 0; UserView *m_userView = 0; }; #endif // MAINWINDOW_H