FancyLineEdit: De-duplicate some code

Change-Id: Ia9bf5db44d4546ae756d2d4ecca3c4057076f69a
Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
This commit is contained in:
Alessandro Portale
2016-02-26 14:33:37 +01:00
parent 2f735a126e
commit 8bfdc82c5a

View File

@@ -542,17 +542,10 @@ void IconButton::paintEvent(QPaintEvent *)
void IconButton::animateShow(bool visible)
{
if (visible) {
QPropertyAnimation *animation = new QPropertyAnimation(this, "iconOpacity");
animation->setDuration(FADE_TIME);
animation->setEndValue(1.0);
animation->setEndValue(visible ? 1.0 : 0.0);
animation->start(QAbstractAnimation::DeleteWhenStopped);
} else {
QPropertyAnimation *animation = new QPropertyAnimation(this, "iconOpacity");
animation->setDuration(FADE_TIME);
animation->setEndValue(0.0);
animation->start(QAbstractAnimation::DeleteWhenStopped);
}
}
QSize IconButton::sizeHint() const