qt-material-widgets/lib/rippleoverlay.h

39 lines
816 B
C
Raw Normal View History

2016-03-18 14:36:02 +00:00
#ifndef RIPPLEOVERLAY_H
#define RIPPLEOVERLAY_H
#include <QWidget>
class Ripple;
class RippleOverlay : public QWidget
{
Q_OBJECT
public:
explicit RippleOverlay(QWidget *parent = 0);
~RippleOverlay();
void addRipple(const QPoint &position, qreal radius = 300);
void addRipple(Ripple *ripple);
2016-03-18 14:36:02 +00:00
2016-06-12 00:56:37 +00:00
void setColor(const QColor &color);
2016-06-12 14:53:43 +00:00
inline void setClipping(bool enabled) { useClip = enabled; update(); }
inline bool hasClipping() const { return useClip; }
2016-06-12 15:17:27 +00:00
inline void setClipPath(const QPainterPath &path) { clipPath = path; update(); }
2016-06-12 14:53:43 +00:00
2016-03-18 14:36:02 +00:00
protected:
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
protected slots:
void deleteRipple();
private:
QList<Ripple *> ripples;
QPainterPath clipPath;
bool useClip;
2016-03-18 14:36:02 +00:00
};
#endif // RIPPLEOVERLAY_H