From 7a0ee1009b84fd4e6ef8852cc5112a144f3fa50e Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 6 Mar 2019 08:53:56 +0100 Subject: [PATCH] Fix soft assert when opening widget designer form Creating a designer form adds it to design mode's editor tool bar, which is correct. But this should not try to switch the drop down to this new document, which has only just been created and is not registered anywhere. It is not even officially the current document yet. Switching the drop down is done when it becomes the current document anyhow. Change-Id: If7fa8273600d83eda2cd1fa4731924007f8ca1f5 Fixes: QTCREATORBUG-20270 Reviewed-by: Friedemann Kleint --- src/plugins/coreplugin/editortoolbar.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/plugins/coreplugin/editortoolbar.cpp b/src/plugins/coreplugin/editortoolbar.cpp index 55430f1a422..28ed8a9acc3 100644 --- a/src/plugins/coreplugin/editortoolbar.cpp +++ b/src/plugins/coreplugin/editortoolbar.cpp @@ -272,8 +272,6 @@ void EditorToolBar::addEditor(IEditor *editor) if (toolBar && !d->m_isStandalone) addCenterToolBar(toolBar); - - updateDocumentStatus(editor->document()); } void EditorToolBar::addCenterToolBar(QWidget *toolBar) @@ -408,10 +406,6 @@ void EditorToolBar::updateDocumentStatus(IDocument *document) return; } - const Utils::optional index = DocumentModel::rowOfDocument(document); - if (QTC_GUARD(index)) - d->m_editorList->setCurrentIndex(*index); - if (document->filePath().isEmpty()) { d->m_lockButton->setIcon(QIcon()); d->m_lockButton->setEnabled(false);