CustomMessageDlg.h 638 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef CUSTOMMESSAGEDLG_H
  2. #define CUSTOMMESSAGEDLG_H
  3. #include <QDialog>
  4. #include <QMouseEvent>
  5. namespace Ui {
  6. class CustomMessageDlg;
  7. }
  8. class CustomMessageDlg : public QDialog
  9. {
  10. Q_OBJECT
  11. public:
  12. explicit CustomMessageDlg(QWidget *parent = nullptr);
  13. ~CustomMessageDlg();
  14. protected:
  15. void mousePressEvent(QMouseEvent* event) override;
  16. void mouseMoveEvent(QMouseEvent* event) override;
  17. public slots:
  18. void on_tCloseBut_clicked();
  19. void on_closeBut_clicked();
  20. private:
  21. Ui::CustomMessageDlg *ui;
  22. QPoint m_dragPosition={};
  23. bool m_isTitleBarClicked = false;
  24. };
  25. #endif // CUSTOMMESSAGEDLG_H