qt-material-widgets/components/fab.h

49 lines
969 B
C
Raw Normal View History

2022-02-17 15:17:19 +00:00
#ifndef FAB_H
#define FAB_H
2017-09-29 09:50:04 +00:00
2022-02-17 15:17:19 +00:00
#include "raisedbutton.h"
2022-02-17 02:26:57 +00:00
namespace md
{
2017-09-29 09:50:04 +00:00
2022-02-17 02:26:57 +00:00
class FloatingActionButtonPrivate;
2017-09-29 09:50:04 +00:00
2022-02-17 02:26:57 +00:00
class FloatingActionButton : public RaisedButton
2017-09-29 09:50:04 +00:00
{
Q_OBJECT
public:
2022-02-17 02:26:57 +00:00
explicit FloatingActionButton(const QIcon &icon, QWidget *parent = 0);
~FloatingActionButton();
2017-09-29 09:50:04 +00:00
QSize sizeHint() const Q_DECL_OVERRIDE;
void setMini(bool state);
bool isMini() const;
void setCorner(Qt::Corner corner);
Qt::Corner corner() const;
void setOffset(int x, int y);
QSize offset() const;
void setXOffset(int x);
int xOffset() const;
void setYOffset(int y);
int yOffset() const;
protected:
bool event(QEvent *event) Q_DECL_OVERRIDE;
bool eventFilter(QObject *obj, QEvent *event) Q_DECL_OVERRIDE;
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
void updateClipPath() Q_DECL_OVERRIDE;
private:
2022-02-17 02:26:57 +00:00
Q_DISABLE_COPY(FloatingActionButton)
Q_DECLARE_PRIVATE(FloatingActionButton)
2017-09-29 09:50:04 +00:00
};
2022-02-17 02:26:57 +00:00
}
2022-02-17 15:17:19 +00:00
#endif // FAB_H