diff options
author | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-10-12 14:57:20 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@theqtcompany.com> | 2015-10-13 13:05:27 +0000 |
commit | 629c24abdcbefd3a282e8e69b0e6b65706cc9c2f (patch) | |
tree | 8463d0d6c1dafa81892bafa3a0ccd46dca109ad7 /src/libs/utils/fancylineedit.cpp | |
parent | c455e7878109984fb9b89bc142cf18ec85a4c337 (diff) |
FancyLineEdit: Refactor class
Rename the code that evaluates the text and make it a public
slot.
Change-Id: I843bf505fa6e33661fc840a1fd2ec13ceb210037
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/libs/utils/fancylineedit.cpp')
-rw-r--r-- | src/libs/utils/fancylineedit.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/libs/utils/fancylineedit.cpp b/src/libs/utils/fancylineedit.cpp index a4a6e2d1835..7706ca12e68 100644 --- a/src/libs/utils/fancylineedit.cpp +++ b/src/libs/utils/fancylineedit.cpp @@ -169,7 +169,7 @@ FancyLineEdit::FancyLineEdit(QWidget *parent) : connect(d->m_iconbutton[Left], &QAbstractButton::clicked, this, &FancyLineEdit::iconClicked); connect(d->m_iconbutton[Right], &QAbstractButton::clicked, this, &FancyLineEdit::iconClicked); - connect(this, &QLineEdit::textChanged, this, &FancyLineEdit::onTextChanged); + connect(this, &QLineEdit::textChanged, this, &FancyLineEdit::validate); } FancyLineEdit::~FancyLineEdit() @@ -451,8 +451,10 @@ QString FancyLineEdit::errorMessage() const return d->m_errorMessage; } -void FancyLineEdit::onTextChanged(const QString &t) +void FancyLineEdit::validate() { + const QString t = text(); + if (d->m_isFiltering){ if (t != d->m_lastFilterText) { d->m_lastFilterText = t; @@ -498,17 +500,11 @@ void FancyLineEdit::onTextChanged(const QString &t) handleChanged(t); } -void FancyLineEdit::triggerChanged() -{ - onTextChanged(text()); -} - QString FancyLineEdit::fixInputString(const QString &string) { return string; } - // // IconButton - helper class to represent a clickable icon // |