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 From 974c2108352d1136835a615d3b56b827d6ef99dd Mon Sep 17 00:00:00 2001 From: Matti Paaso Date: Thu, 21 Aug 2014 16:51:22 +0300 Subject: Update license headers and add new license files - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund --- src/widgets/widgets/qlineedit_p.cpp | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 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 76830c57a1..2daccc345d 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -5,36 +5,28 @@ ** ** This file is part of the QtWidgets module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:LGPL21$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** General Public License version 2.1 or version 3 as published by the Free +** Software Foundation and appearing in the file LICENSE.LGPLv21 and +** LICENSE.LGPLv3 included in the packaging of this file. Please review the +** following information to ensure the GNU Lesser General Public License +** requirements will be met: https://www.gnu.org/licenses/lgpl.html and +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception +** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** ** $QT_END_LICENSE$ ** ****************************************************************************/ -- cgit v1.2.3 From 55fbf1db19fbe9dba60cd11d2fdccc85b4bab7ac Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 22 Sep 2014 20:42:53 +0200 Subject: Widgets: remove references to QStyleOptionFrameV They're gone since Qt 5.0 and only exist as typedefs for QStyleOptionFrame. Change-Id: Icff45cbd3a47db8618a7f7a80f7252651969237c Reviewed-by: Friedemann Kleint --- src/widgets/widgets/qlineedit_p.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 2daccc345d..0731c89094 100644 --- a/src/widgets/widgets/qlineedit_p.cpp +++ b/src/widgets/widgets/qlineedit_p.cpp @@ -135,7 +135,7 @@ void QLineEditPrivate::_q_selectionChanged() { Q_Q(QLineEdit); if (control->preeditAreaText().isEmpty()) { - QStyleOptionFrameV2 opt; + QStyleOptionFrame opt; q->initStyleOption(&opt); bool showCursor = control->hasSelectedText() ? q->style()->styleHint(QStyle::SH_BlinkCursorWhenTextSelected, &opt, q): @@ -194,7 +194,7 @@ void QLineEditPrivate::init(const QString& txt) QObject::connect(control, SIGNAL(updateNeeded(QRect)), q, SLOT(_q_updateNeeded(QRect))); - QStyleOptionFrameV2 opt; + QStyleOptionFrame opt; q->initStyleOption(&opt); control->setPasswordCharacter(q->style()->styleHint(QStyle::SH_LineEdit_PasswordCharacter, &opt, q)); control->setPasswordMaskDelay(q->style()->styleHint(QStyle::SH_LineEdit_PasswordMaskDelay, &opt, q)); @@ -217,7 +217,7 @@ void QLineEditPrivate::init(const QString& txt) QRect QLineEditPrivate::adjustedContentsRect() const { Q_Q(const QLineEdit); - QStyleOptionFrameV2 opt; + QStyleOptionFrame opt; q->initStyleOption(&opt); QRect r = q->style()->subElementRect(QStyle::SE_LineEditContents, &opt, q); r.setX(r.x() + effectiveLeftTextMargin()); @@ -387,7 +387,7 @@ QSize QLineEditPrivate::iconSize() const QIcon QLineEditPrivate::clearButtonIcon() const { Q_Q(const QLineEdit); - QStyleOptionFrameV2 styleOption; + QStyleOptionFrame styleOption; q->initStyleOption(&styleOption); return QIcon(q->style()->standardPixmap(QStyle::SP_LineEditClearButton, &styleOption, q)); } -- cgit v1.2.3