Diagram editor : add in the tree widget use to edit the property of dynamic text item, two news items for edit the X and Y pos of the text.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5088 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2017-10-29 10:43:34 +00:00
parent 5bb0a3f0a3
commit 50fc46e162
4 changed files with 87 additions and 5 deletions

View File

@@ -120,6 +120,22 @@ void DynamicElementTextItemEditor::setCurrentText(DynamicElementTextItem *text)
m_tree_view->setCurrentIndex(index);
}
QUndoCommand *DynamicElementTextItemEditor::associatedUndo() const
{
QUndoCommand *parent_undo = new QUndoCommand(tr("Modifier un texte d'élément"));
for (DynamicElementTextItem *deti : m_element->dynamicTextItems())
m_model->undoForEditedText(deti, parent_undo);
if(parent_undo->childCount() >= 1)
{
if(parent_undo->childCount() >= 2)
parent_undo->setText(tr("Modifier %1 textes d'élément").arg(QString::number(parent_undo->childCount())));
return parent_undo;
}
else
return nullptr;
}
void DynamicElementTextItemEditor::dataEdited(DynamicElementTextItem *deti)
{
Q_UNUSED(deti)