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:
@@ -137,14 +137,15 @@ public:
|
||||
int messageLevel, FakeVimHandler *eventFilter)
|
||||
{
|
||||
if (cursorPos != -1) {
|
||||
m_edit->blockSignals(true);
|
||||
m_label->clear();
|
||||
m_edit->setText(contents);
|
||||
if (anchorPos != -1 && anchorPos != cursorPos)
|
||||
m_edit->setSelection(anchorPos, cursorPos - anchorPos);
|
||||
else
|
||||
m_edit->setCursorPosition(cursorPos);
|
||||
m_edit->blockSignals(false);
|
||||
{
|
||||
QSignalBlocker blocker(m_edit);
|
||||
m_label->clear();
|
||||
m_edit->setText(contents);
|
||||
if (anchorPos != -1 && anchorPos != cursorPos)
|
||||
m_edit->setSelection(anchorPos, cursorPos - anchorPos);
|
||||
else
|
||||
m_edit->setCursorPosition(cursorPos);
|
||||
}
|
||||
setCurrentWidget(m_edit);
|
||||
m_edit->setFocus();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user