123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- #ifndef MAINWINDOW_H
- #define MAINWINDOW_H
- #include <QFrame>
- #include <QMainWindow>
- 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
|