From 9f486efcbe5ca0f5bb8ba895c4931a5e30748ed6 Mon Sep 17 00:00:00 2001 From: Marcel Krems Date: Tue, 12 Aug 2014 13:10:08 +0200 Subject: Show the correct cursor for QLineEdit's side buttons. Task-number: QTBUG-40708 Change-Id: I5869f42bab3a27085b5572a4b83b16c39a67f733 Reviewed-by: Marc Mutz --- src/widgets/widgets/qlineedit_p.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/widgets/widgets/qlineedit_p.cpp') diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index 10689b2fc3..d19fe43eb2 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -309,7 +309,6 @@ QLineEditIconButton::QLineEditIconButton(QWidget *parent) : QToolButton(parent) , m_opacity(0) { - updateCursor(); setFocusPolicy(Qt::NoFocus); } @@ -333,6 +332,7 @@ void QLineEditIconButton::setOpacity(qreal value) { if (!qFuzzyCompare(m_opacity, value)) { m_opacity = value; + updateCursor(); update(); } } @@ -340,7 +340,6 @@ void QLineEditIconButton::setOpacity(qreal value) void QLineEditIconButton::startOpacityAnimation(qreal endValue) { QPropertyAnimation *animation = new QPropertyAnimation(this, QByteArrayLiteral("opacity")); - connect(animation, &QAbstractAnimation::finished, this, &QLineEditIconButton::updateCursor); animation->setDuration(160); animation->setEndValue(endValue); animation->start(QAbstractAnimation::DeleteWhenStopped); -- cgit v1.2.3 From bf9a4ef8b4210bd1f434828911361008ea2350ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Mon, 11 Aug 2014 19:28:23 +0100 Subject: Fix QT_NO_ANIMATION build Change-Id: Ia589e703206d6ca675a392e634e2a445dcf4cca3 Reviewed-by: Marc Mutz --- src/widgets/widgets/qlineedit_p.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/widgets/widgets/qlineedit_p.cpp') diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp index d19fe43eb2..a4394ae92b 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -337,6 +337,7 @@ void QLineEditIconButton::setOpacity(qreal value) } } +#ifndef QT_NO_ANIMATION void QLineEditIconButton::startOpacityAnimation(qreal endValue) { QPropertyAnimation *animation = new QPropertyAnimation(this, QByteArrayLiteral("opacity")); @@ -344,6 +345,7 @@ void QLineEditIconButton::startOpacityAnimation(qreal endValue) animation->setEndValue(endValue); animation->start(QAbstractAnimation::DeleteWhenStopped); } +#endif void QLineEditIconButton::updateCursor() { @@ -358,6 +360,7 @@ void QLineEditPrivate::_q_textChanged(const QString &text) const int newTextSize = text.size(); if (!newTextSize || !lastTextSize) { lastTextSize = newTextSize; +#ifndef QT_NO_ANIMATION const bool fadeIn = newTextSize > 0; foreach (const SideWidgetEntry &e, leadingSideWidgets) { if (e.flags & SideWidgetFadeInWithText) @@ -367,6 +370,7 @@ void QLineEditPrivate::_q_textChanged(const QString &text) if (e.flags & SideWidgetFadeInWithText) static_cast(e.widget)->animateShow(fadeIn); } +#endif } } } -- cgit v1.2.3