From 8bfdc82c5aa217a14f76ab5c3fa05b285a1fd23e Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 26 Feb 2016 14:33:37 +0100 Subject: [PATCH] FancyLineEdit: De-duplicate some code Change-Id: Ia9bf5db44d4546ae756d2d4ecca3c4057076f69a Reviewed-by: Niels Weber --- src/libs/utils/fancylineedit.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/libs/utils/fancylineedit.cpp b/src/libs/utils/fancylineedit.cpp index 75e12e7bc0b..20a26733527 100644 --- a/src/libs/utils/fancylineedit.cpp +++ b/src/libs/utils/fancylineedit.cpp @@ -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->start(QAbstractAnimation::DeleteWhenStopped); - } else { - QPropertyAnimation *animation = new QPropertyAnimation(this, "iconOpacity"); - animation->setDuration(FADE_TIME); - animation->setEndValue(0.0); - animation->start(QAbstractAnimation::DeleteWhenStopped); - } + QPropertyAnimation *animation = new QPropertyAnimation(this, "iconOpacity"); + animation->setDuration(FADE_TIME); + animation->setEndValue(visible ? 1.0 : 0.0); + animation->start(QAbstractAnimation::DeleteWhenStopped); } QSize IconButton::sizeHint() const