forked from qt-creator/qt-creator
QmlJSEditor: remove modeUpdated method
It does not say what it does, it is better for understanding to call the direct method instead. Change-Id: I2150d4c84254f684474e353995b466b59d4844c0 Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This commit is contained in:
committed by
Robert Loehning
parent
17fbbda57e
commit
2c1c51bbea
@@ -124,7 +124,7 @@ void QmlJSOutlineWidget::setEditor(QmlJSEditorWidget *editor)
|
|||||||
m_editor = editor;
|
m_editor = editor;
|
||||||
|
|
||||||
m_filterModel->setSourceModel(m_editor->qmlJsEditorDocument()->outlineModel());
|
m_filterModel->setSourceModel(m_editor->qmlJsEditorDocument()->outlineModel());
|
||||||
modelUpdated();
|
m_treeView->expandAll();
|
||||||
|
|
||||||
connect(m_treeView->selectionModel(), &QItemSelectionModel::selectionChanged,
|
connect(m_treeView->selectionModel(), &QItemSelectionModel::selectionChanged,
|
||||||
this, &QmlJSOutlineWidget::updateSelectionInText);
|
this, &QmlJSOutlineWidget::updateSelectionInText);
|
||||||
@@ -134,8 +134,9 @@ void QmlJSOutlineWidget::setEditor(QmlJSEditorWidget *editor)
|
|||||||
|
|
||||||
connect(m_editor, &QmlJSEditorWidget::outlineModelIndexChanged,
|
connect(m_editor, &QmlJSEditorWidget::outlineModelIndexChanged,
|
||||||
this, &QmlJSOutlineWidget::updateSelectionInTree);
|
this, &QmlJSOutlineWidget::updateSelectionInTree);
|
||||||
connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QmlOutlineModel::updated,
|
connect(m_editor->qmlJsEditorDocument()->outlineModel(), &QmlOutlineModel::updated, [this] () {
|
||||||
this, &QmlJSOutlineWidget::modelUpdated);
|
m_treeView->expandAll();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QAction*> QmlJSOutlineWidget::filterMenuActions() const
|
QList<QAction*> QmlJSOutlineWidget::filterMenuActions() const
|
||||||
@@ -161,11 +162,6 @@ QVariantMap QmlJSOutlineWidget::settings() const
|
|||||||
return {{QLatin1String("QmlJSOutline.ShowBindings"), m_showBindingsAction->isChecked()}};
|
return {{QLatin1String("QmlJSOutline.ShowBindings"), m_showBindingsAction->isChecked()}};
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlJSOutlineWidget::modelUpdated()
|
|
||||||
{
|
|
||||||
m_treeView->expandAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QmlJSOutlineWidget::updateSelectionInTree(const QModelIndex &index)
|
void QmlJSOutlineWidget::updateSelectionInTree(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
if (!syncCursor())
|
if (!syncCursor())
|
||||||
@@ -230,7 +226,7 @@ void QmlJSOutlineWidget::focusEditor()
|
|||||||
void QmlJSOutlineWidget::setShowBindings(bool showBindings)
|
void QmlJSOutlineWidget::setShowBindings(bool showBindings)
|
||||||
{
|
{
|
||||||
m_filterModel->setFilterBindings(!showBindings);
|
m_filterModel->setFilterBindings(!showBindings);
|
||||||
modelUpdated();
|
m_treeView->expandAll();
|
||||||
updateSelectionInTree(m_editor->outlineModelIndex());
|
updateSelectionInTree(m_editor->outlineModelIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ public:
|
|||||||
virtual QVariantMap settings() const override;
|
virtual QVariantMap settings() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void modelUpdated();
|
|
||||||
void updateSelectionInTree(const QModelIndex &index);
|
void updateSelectionInTree(const QModelIndex &index);
|
||||||
void updateSelectionInText(const QItemSelection &selection);
|
void updateSelectionInText(const QItemSelection &selection);
|
||||||
void updateTextCursor(const QModelIndex &index);
|
void updateTextCursor(const QModelIndex &index);
|
||||||
|
|||||||
Reference in New Issue
Block a user