mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
prevent crash, when adding text to element in diagram-editor
This commit is contained in:
@@ -144,9 +144,9 @@ void DynamicElementTextItemEditor::setCurrentText(DynamicElementTextItem *text)
|
|||||||
QModelIndex index = m_model->indexFromText(text);
|
QModelIndex index = m_model->indexFromText(text);
|
||||||
if(!index.isValid())
|
if(!index.isValid())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ui->m_tree_view->expand(index);
|
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_tree_view->setCurrentIndex(index);
|
||||||
ui->m_remove_selection->setEnabled(true);
|
ui->m_remove_selection->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user