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

@@ -42,7 +42,8 @@ class DynamicElementTextModel : public QStandardItemModel
compositeText,
size,
tagg,
color
color,
pos
};
DynamicElementTextModel(QObject *parent = nullptr);
@@ -53,7 +54,7 @@ class DynamicElementTextModel : public QStandardItemModel
DynamicElementTextItem *textFromIndex(const QModelIndex &index) const;
DynamicElementTextItem *textFromItem(QStandardItem *item) const;
QModelIndex indexFromText(DynamicElementTextItem *text) const;
QUndoCommand *undoForEditedText(DynamicElementTextItem *deti) const;
QUndoCommand *undoForEditedText(DynamicElementTextItem *deti, QUndoCommand *parent_undo = nullptr) const;
signals:
void dataForTextChanged(DynamicElementTextItem *text);
@@ -67,6 +68,7 @@ class DynamicElementTextModel : public QStandardItemModel
private:
QHash <DynamicElementTextItem *, QStandardItem *> m_texts_list;
QHash <DynamicElementTextItem *, QList<QMetaObject::Connection>> m_hash_text_connect;
bool m_block_dataForTextChanged = false;
};
class DynamicTextItemDelegate : public QStyledItemDelegate