From 1b671990ee8435616725afdffba438fdfcd18069 Mon Sep 17 00:00:00 2001 From: plc-user <74435298+plc-user@users.noreply.github.com> Date: Fri, 30 May 2025 09:42:22 +0200 Subject: [PATCH] prevent crash, when adding text to element in diagram-editor --- sources/ui/dynamicelementtextitemeditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/ui/dynamicelementtextitemeditor.cpp b/sources/ui/dynamicelementtextitemeditor.cpp index 4b3a10a7a..709da077b 100644 --- a/sources/ui/dynamicelementtextitemeditor.cpp +++ b/sources/ui/dynamicelementtextitemeditor.cpp @@ -144,9 +144,9 @@ void DynamicElementTextItemEditor::setCurrentText(DynamicElementTextItem *text) QModelIndex index = m_model->indexFromText(text); if(!index.isValid()) return; - + ui->m_tree_view->expand(index); - ui->m_tree_view->expand(index.QModelIndex::model()->index(0,0)); +// ui->m_tree_view->expand(index.QModelIndex::model()->index(0,0)); // commented by plc-user: leads to crash, when other textitem was selected before ui->m_tree_view->setCurrentIndex(index); ui->m_remove_selection->setEnabled(true); }