2019-09-28 01:18:08 +08:00
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QParallelAnimationGroup>
|
|
|
|
#include <QPropertyAnimation>
|
|
|
|
#include <QPushButton>
|
|
|
|
|
2019-09-29 01:40:19 +08:00
|
|
|
class BottomButtonGroup;
|
2019-09-28 01:18:08 +08:00
|
|
|
class MainWindow : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit MainWindow(QWidget *parent = nullptr);
|
|
|
|
~MainWindow() override;
|
|
|
|
|
|
|
|
protected slots:
|
2019-09-29 01:40:19 +08:00
|
|
|
void showEvent(QShowEvent *event) override;
|
2019-09-28 01:18:08 +08:00
|
|
|
void mousePressEvent(QMouseEvent *event) override;
|
|
|
|
void mouseMoveEvent(QMouseEvent *event) override;
|
|
|
|
void mouseReleaseEvent(QMouseEvent *event) override;
|
|
|
|
void mouseDoubleClickEvent(QMouseEvent *event) override;
|
|
|
|
void resizeEvent(QResizeEvent *event) override;
|
|
|
|
|
2019-09-29 01:40:19 +08:00
|
|
|
bool nativeEvent(const QByteArray& eventType, void* message, long* result) override;
|
|
|
|
|
2019-09-28 01:18:08 +08:00
|
|
|
void closeWindow();
|
2019-09-29 01:40:19 +08:00
|
|
|
void updateWidgetsPosition();
|
2019-09-28 01:18:08 +08:00
|
|
|
|
|
|
|
private:
|
|
|
|
QPoint m_oldMousePos;
|
|
|
|
QPropertyAnimation *m_fadeOutAnimation;
|
|
|
|
QPropertyAnimation *m_floatUpAnimation;
|
|
|
|
QParallelAnimationGroup *m_exitAnimationGroup;
|
|
|
|
QPushButton *m_closeButton;
|
2019-09-29 01:40:19 +08:00
|
|
|
BottomButtonGroup *m_bottomButtonGroup;
|
2019-09-28 01:18:08 +08:00
|
|
|
bool m_clickedOnWindow = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|