forked from qt-creator/qt-creator
Replace manual signal blocking/unblocking with QSignalBlocker
Change-Id: Ibb59fab4e37d045e506c5a8172b6f5cbb955b028 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -478,14 +478,13 @@ void FancyLineEdit::validate()
|
||||
if (validHasChanged)
|
||||
emit validChanged(newState == Valid);
|
||||
}
|
||||
bool block = blockSignals(true);
|
||||
const QString fixedString = fixInputString(t);
|
||||
if (t != fixedString) {
|
||||
const int cursorPos = cursorPosition();
|
||||
QSignalBlocker blocker(this);
|
||||
setText(fixedString);
|
||||
setCursorPosition(qMin(cursorPos, fixedString.length()));
|
||||
}
|
||||
blockSignals(block);
|
||||
|
||||
// Check buttons.
|
||||
if (d->m_oldText.isEmpty() || t.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user