forked from qt-creator/qt-creator
Fixed an issue with animated icons on fancylineedit
Using a static local here is obviously simply wrong. This should take care of the remaining issues with broken animation states. Reviewed-by: danimo
This commit is contained in:
@@ -126,10 +126,9 @@ FancyLineEdit::FancyLineEdit(QWidget *parent) :
|
|||||||
void FancyLineEdit::checkButton(const QString &text)
|
void FancyLineEdit::checkButton(const QString &text)
|
||||||
{
|
{
|
||||||
if (autoHideIcon()) {
|
if (autoHideIcon()) {
|
||||||
static QString oldtext;
|
if (m_oldText.isEmpty() || text.isEmpty())
|
||||||
if (oldtext.isEmpty() || text.isEmpty())
|
|
||||||
m_d->m_iconbutton->animateShow(!text.isEmpty());
|
m_d->m_iconbutton->animateShow(!text.isEmpty());
|
||||||
oldtext = text;
|
m_oldText = text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ private:
|
|||||||
bool isSideStored() const;
|
bool isSideStored() const;
|
||||||
|
|
||||||
FancyLineEditPrivate *m_d;
|
FancyLineEditPrivate *m_d;
|
||||||
|
QString m_oldText;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Utils
|
} // namespace Utils
|
||||||
|
|||||||
Reference in New Issue
Block a user