CustomGrip.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef CUSTOMGRIP_H
  2. #define CUSTOMGRIP_H
  3. #include <QFrame>
  4. #include <QHBoxLayout>
  5. class Widgets;
  6. class CustomGrip : public QWidget
  7. {
  8. Q_OBJECT
  9. public:
  10. explicit CustomGrip(QWidget *parent, Qt::Edge positon, bool disableColor = false);
  11. QPoint mousePos;
  12. private:
  13. Widgets *wi;
  14. // QWidget interface
  15. protected:
  16. void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
  17. void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
  18. bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE;
  19. };
  20. class Widgets : public QObject
  21. {
  22. public:
  23. Widgets(QObject *parent = nullptr);
  24. void top(QWidget *form);
  25. void bottom(QWidget *form);
  26. void left(QWidget *form);
  27. void right(QWidget *form);
  28. QFrame *m_containerTop;
  29. QHBoxLayout *m_topLayout;
  30. QFrame *m_topLeft;
  31. QFrame *m_top;
  32. QFrame *m_topRight;
  33. QFrame *m_containerBottom;
  34. QHBoxLayout *m_bottomLayout;
  35. QFrame *m_bottomLeft;
  36. QFrame *m_bottom;
  37. QFrame *m_bottomRight;
  38. QFrame *m_leftgrip;
  39. QFrame *m_rightgrip;
  40. };
  41. #endif // CUSTOMGRIP_H