qt-material-widgets/components/qtmaterialdrawer.h

51 lines
1.0 KiB
C
Raw Normal View History

2017-09-30 00:20:12 +00:00
#ifndef QTMATERIALDRAWER_H
#define QTMATERIALDRAWER_H
#include "lib/qtmaterialoverlaywidget.h"
2022-02-17 02:22:22 +00:00
namespace md
{
2017-09-30 00:20:12 +00:00
2022-02-17 02:22:22 +00:00
class DrawerPrivate;
class DrawerStateMachine;
2017-09-30 00:20:12 +00:00
2022-02-17 02:22:22 +00:00
class Drawer : public OverlayWidget
2017-09-30 00:20:12 +00:00
{
Q_OBJECT
public:
2022-02-17 02:22:22 +00:00
explicit Drawer(QWidget *parent = 0);
~Drawer();
2017-09-30 00:20:12 +00:00
void setDrawerWidth(int width);
int drawerWidth() const;
void setDrawerLayout(QLayout *layout);
QLayout *drawerLayout() const;
void setClickOutsideToClose(bool state);
bool clickOutsideToClose() const;
2017-10-05 08:13:21 +00:00
void setAutoRaise(bool state);
bool autoRaise() const;
void setOverlayMode(bool value);
bool overlayMode() const;
public slots:
2017-09-30 00:20:12 +00:00
void openDrawer();
void closeDrawer();
protected:
2017-10-12 19:10:43 +00:00
bool event(QEvent *event) Q_DECL_OVERRIDE;
2017-09-30 00:20:12 +00:00
bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
2022-02-17 02:22:22 +00:00
const QScopedPointer<DrawerPrivate> d_ptr;
2017-09-30 00:20:12 +00:00
private:
2022-02-17 02:22:22 +00:00
Q_DISABLE_COPY(Drawer)
Q_DECLARE_PRIVATE(Drawer)
2017-09-30 00:20:12 +00:00
};
2022-02-17 02:22:22 +00:00
}
2017-09-30 00:20:12 +00:00
#endif // QTMATERIALDRAWER_H