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:
@@ -257,14 +257,12 @@ void QmlJSEditorWidget::updateOutlineIndexNow()
|
||||
emit outlineModelIndexChanged(m_outlineModelIndex);
|
||||
|
||||
if (comboIndex.isValid()) {
|
||||
bool blocked = m_outlineCombo->blockSignals(true);
|
||||
QSignalBlocker blocker(m_outlineCombo);
|
||||
|
||||
// There is no direct way to select a non-root item
|
||||
m_outlineCombo->setRootModelIndex(comboIndex.parent());
|
||||
m_outlineCombo->setCurrentIndex(comboIndex.row());
|
||||
m_outlineCombo->setRootModelIndex(QModelIndex());
|
||||
|
||||
m_outlineCombo->blockSignals(blocked);
|
||||
}
|
||||
}
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user