123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- #ifndef MAINWINDOW_H
- #define MAINWINDOW_H
- #include <QFrame>
- #include <QMainWindow>
- class PopUpAniStackedWidget;
- class QHBoxLayout;
- class NavigationInterface;
- class StandardTitleBar;
- class LoginView;
- class AboutView;
- class StackedWidget : public QFrame
- {
- Q_OBJECT
- public:
- StackedWidget(QWidget *parent = nullptr);
- void addWidget(QWidget *widget);
- void setCurrentWidget(QWidget *widget, bool popOut = false);
- void setCurrentIndex(int index, bool popOut = false);
- PopUpAniStackedWidget *view() const;
- 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 initialize();
- void initWindow();
- void initLayout();
- void initNavigation();
- void connectSignalsAndSlots();
- void setNaviInterfaceHidden(bool hidden);
- int titleBarIndent() const;
- void resizeEvent(QResizeEvent *event) override;
- void switchTo(QWidget *widget, bool triggerByUser = true);
- private slots:
- void loginViewClicked();
- void aboutViewClicked();
- private:
- StandardTitleBar *m_titleBar;
- QHBoxLayout *m_hBoxLayout;
- QHBoxLayout *m_widgetLayout;
- StackedWidget *m_stackWidget;
- NavigationInterface *m_naviInterface;
- LoginView *m_loginView;
- AboutView *m_aboutView;
- };
- #endif // MAINWINDOW_H
|