Keep up to date the model when a dynamic text item change, for exemple after an undo command

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5030 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2017-08-24 17:35:40 +00:00
parent 99eac96475
commit 6419f84d9c
4 changed files with 59 additions and 18 deletions

View File

@@ -55,7 +55,7 @@ void DynamicElementTextItemEditor::setElement(Element *element)
DynamicElementTextModel *old_model = m_model;
m_model = new DynamicElementTextModel(m_tree_view);
connect(m_model, &DynamicElementTextModel::itemChanged, this, &DynamicElementTextItemEditor::dataEdited);
connect(m_model, &DynamicElementTextModel::dataForTextChanged, this, &DynamicElementTextItemEditor::dataEdited);
for (DynamicElementTextItem *deti : m_element->dynamicTextItems())
m_model->addText(deti);
@@ -120,9 +120,9 @@ void DynamicElementTextItemEditor::setCurrentText(DynamicElementTextItem *text)
m_tree_view->setCurrentIndex(index);
}
void DynamicElementTextItemEditor::dataEdited(QStandardItem *qsi)
void DynamicElementTextItemEditor::dataEdited(DynamicElementTextItem *deti)
{
Q_UNUSED(qsi)
Q_UNUSED(deti)
if (m_live_edit)
apply();
}