qtmaterialdrawer.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef QTMATERIALDRAWER_H
  2. #define QTMATERIALDRAWER_H
  3. #include "lib/qtmaterialoverlaywidget.h"
  4. class QtMaterialDrawerPrivate;
  5. class QtMaterialDrawerStateMachine;
  6. class QtMaterialDrawer : public QtMaterialOverlayWidget
  7. {
  8. Q_OBJECT
  9. public:
  10. explicit QtMaterialDrawer(QWidget *parent = 0);
  11. ~QtMaterialDrawer();
  12. void setDrawerWidth(int width);
  13. int drawerWidth() const;
  14. void setDrawerLayout(QLayout *layout);
  15. QLayout *drawerLayout() const;
  16. void setClickOutsideToClose(bool state);
  17. bool clickOutsideToClose() const;
  18. void setAutoRaise(bool state);
  19. bool autoRaise() const;
  20. void setOverlayMode(bool value);
  21. bool overlayMode() const;
  22. public slots:
  23. void openDrawer();
  24. void closeDrawer();
  25. protected:
  26. bool event(QEvent *event) Q_DECL_OVERRIDE;
  27. bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
  28. void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
  29. const QScopedPointer<QtMaterialDrawerPrivate> d_ptr;
  30. private:
  31. Q_DISABLE_COPY(QtMaterialDrawer)
  32. Q_DECLARE_PRIVATE(QtMaterialDrawer)
  33. };
  34. #endif // QTMATERIALDRAWER_H