check that value differs from current value in setters
This commit is contained in:
parent
5f56ae104f
commit
e6fd12d8bf
|
@ -20,6 +20,24 @@ Ripple::~Ripple()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Ripple::setRadius(qreal radius)
|
||||||
|
{
|
||||||
|
if (radius == _radius)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_radius = radius;
|
||||||
|
emit valueChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Ripple::setOpacity(qreal opacity)
|
||||||
|
{
|
||||||
|
if (opacity == _opacity)
|
||||||
|
return;
|
||||||
|
|
||||||
|
_opacity = opacity;
|
||||||
|
emit valueChanged();
|
||||||
|
}
|
||||||
|
|
||||||
QPropertyAnimation *Ripple::animate(const QByteArray &property)
|
QPropertyAnimation *Ripple::animate(const QByteArray &property)
|
||||||
{
|
{
|
||||||
QPropertyAnimation *animation = new QPropertyAnimation;
|
QPropertyAnimation *animation = new QPropertyAnimation;
|
||||||
|
|
|
@ -17,10 +17,10 @@ public:
|
||||||
explicit Ripple(const QPoint ¢er, QObject *parent = 0);
|
explicit Ripple(const QPoint ¢er, QObject *parent = 0);
|
||||||
~Ripple();
|
~Ripple();
|
||||||
|
|
||||||
inline void setRadius(qreal radius) { _radius = radius; emit valueChanged(); }
|
void setRadius(qreal radius);
|
||||||
inline qreal radius() const { return _radius; }
|
inline qreal radius() const { return _radius; }
|
||||||
|
|
||||||
inline void setOpacity(qreal opacity) { _opacity = opacity; emit valueChanged(); }
|
void setOpacity(qreal opacity);
|
||||||
inline qreal opacity() const { return _opacity; }
|
inline qreal opacity() const { return _opacity; }
|
||||||
|
|
||||||
inline const QPoint ¢er() const { return _center; }
|
inline const QPoint ¢er() const { return _center; }
|
||||||
|
|
Loading…
Reference in New Issue