qt-material-widgets/components/drawer.h

63 lines
1.2 KiB
C
Raw Normal View History

2022-02-17 15:17:19 +00:00
#ifndef DRAWER_H
#define DRAWER_H
2017-09-30 00:20:12 +00:00
#include <QtWidgets/QApplication>
#include <QtWidgets/QLayout>
#include <QtWidgets/QVBoxLayout>
#include <QPainter>
#include <QEvent>
#include <QDebug>
#include <QMouseEvent>
#include <QLinearGradient>
2022-02-17 15:17:19 +00:00
#include "drawer_p.h"
#include "drawer_internal.h"
#include "lib/overlaywidget.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
}
2022-02-17 15:17:19 +00:00
#endif // DRAWER_H