framelessmainwindowwin.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef FRAMELESSMAINWINDOWWIN_H
  2. #define FRAMELESSMAINWINDOWWIN_H
  3. #include "framelessmainwindow.h"
  4. namespace vnotex
  5. {
  6. #ifdef Q_OS_WIN
  7. class FramelessMainWindowWin : public FramelessMainWindow
  8. {
  9. Q_OBJECT
  10. public:
  11. FramelessMainWindowWin(bool p_frameless, QWidget *p_parent = nullptr);
  12. protected:
  13. #if (QT_VERSION >= QT_VERSION_CHECK(6,0,0))
  14. bool nativeEvent(const QByteArray &p_eventType, void *p_message, qintptr *p_result);
  15. #else
  16. bool nativeEvent(const QByteArray &p_eventType, void *p_message, long *p_result);
  17. #endif
  18. void moveEvent(QMoveEvent *p_event) Q_DECL_OVERRIDE;
  19. void setWindowFlagsOnUpdate() Q_DECL_OVERRIDE;
  20. private:
  21. // To fix some unkonwn bugs of the interface.
  22. void forceRedraw();
  23. void updateMargins();
  24. int m_resizeAreaWidth = 6;
  25. QTimer *m_redrawTimer = nullptr;
  26. QSize m_sizeBeforeMove;
  27. QMargins m_maximizedMargins;
  28. int m_titleBarHeight = 0;
  29. };
  30. #else
  31. class FramelessMainWindowWinDummy
  32. {
  33. public:
  34. FramelessMainWindowWinDummy() = default;
  35. };
  36. #endif
  37. }
  38. #endif // FRAMELESSMAINWINDOWWIN_H