rename valueChanged signal to changed
This commit is contained in:
parent
e0dd848eb6
commit
cdd16e1230
|
@ -1,4 +1,5 @@
|
|||
#include "flatbutton.h"
|
||||
#include <QPainter>
|
||||
#include "lib/style.h"
|
||||
|
||||
FlatButton::FlatButton(QWidget *parent)
|
||||
|
@ -19,6 +20,15 @@ FlatButton::~FlatButton()
|
|||
{
|
||||
}
|
||||
|
||||
void FlatButton::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
Q_UNUSED(event)
|
||||
|
||||
QPainter painter(this);
|
||||
|
||||
painter.drawRect(rect().adjusted(0, 0, -1, -1));
|
||||
}
|
||||
|
||||
//#include <QDebug>
|
||||
//#include <QStylePainter>
|
||||
//#include <QMouseEvent>
|
||||
|
|
|
@ -11,6 +11,9 @@ public:
|
|||
explicit FlatButton(QWidget *parent = 0);
|
||||
explicit FlatButton(const QString &text, QWidget *parent = 0);
|
||||
~FlatButton();
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // FLATBUTTON_H
|
||||
|
|
|
@ -26,7 +26,7 @@ void Ripple::setRadius(qreal radius)
|
|||
return;
|
||||
|
||||
_radius = radius;
|
||||
emit valueChanged();
|
||||
emit changed();
|
||||
}
|
||||
|
||||
void Ripple::setOpacity(qreal opacity)
|
||||
|
@ -35,7 +35,7 @@ void Ripple::setOpacity(qreal opacity)
|
|||
return;
|
||||
|
||||
_opacity = opacity;
|
||||
emit valueChanged();
|
||||
emit changed();
|
||||
}
|
||||
|
||||
QPropertyAnimation *Ripple::animate(const QByteArray &property)
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
inline void startAnimation() { _group.start(); }
|
||||
|
||||
signals:
|
||||
void valueChanged();
|
||||
void changed();
|
||||
void finished();
|
||||
|
||||
private:
|
||||
|
|
|
@ -19,7 +19,7 @@ void RippleOverlay::addRipple(const QPoint &position, qreal radius)
|
|||
Ripple *ripple = new Ripple(position);
|
||||
ripple->setRadiusEndValue(radius);
|
||||
ripples.push_back(ripple);
|
||||
connect(ripple, SIGNAL(valueChanged()), this, SLOT(update()));
|
||||
connect(ripple, SIGNAL(changed()), this, SLOT(update()));
|
||||
connect(ripple, SIGNAL(finished()), this, SLOT(deleteRipple()));
|
||||
ripple->startAnimation();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue