aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2018-03-20 15:41:39 +0100
committerEike Ziller <eike.ziller@qt.io>2018-03-29 08:03:15 +0000
commit26bfa469db1fbfb0f5f231c0ac9c780926e5d522 (patch)
treed332f1d385a86345f55e5425ccb301fab5612476
parent3ef455da1870b96ff2a70aceb601ba421a198e33 (diff)
Fix that clearing shortcut in settings did no longer work
This broke in 8d1a592d1637b52e539695afdef7f5564f6d723b We should ask the validator of a fancy line edit if an entry is valid, also if the line edit is empty and shows a placeholder text, even if we then do not mark the place holder with the error color, etc. In case of the shortcut settings, the validator has side effects that are important. Change-Id: I41c0d98ed3c6e9e68df4484a47c108b00ddbbfe7 Reviewed-by: David Schulz <david.schulz@qt.io>
-rw-r--r--src/libs/utils/fancylineedit.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libs/utils/fancylineedit.cpp b/src/libs/utils/fancylineedit.cpp
index 2a2e135005..07de1d799c 100644
--- a/src/libs/utils/fancylineedit.cpp
+++ b/src/libs/utils/fancylineedit.cpp
@@ -445,9 +445,9 @@ void FancyLineEdit::validate()
d->m_errorMessage.clear();
// Are we displaying the placeholder text?
const bool isDisplayingPlaceholderText = !placeholderText().isEmpty() && t.isEmpty();
- const State newState = isDisplayingPlaceholderText ?
- DisplayingPlaceholderText :
- (d->m_validationFunction(this, &d->m_errorMessage) ? Valid : Invalid);
+ const bool validates = d->m_validationFunction(this, &d->m_errorMessage);
+ const State newState = isDisplayingPlaceholderText ? DisplayingPlaceholderText
+ : (validates ? Valid : Invalid);
setToolTip(d->m_errorMessage);
// Changed..figure out if valid changed. DisplayingPlaceholderText is not valid,
// but should not show error color. Also trigger on the first change.