Diagram editor :

1° When user drag and drop an element with text item (tagg input in the xml), the text item are converted to a dynamic text item.
2° When open an existing project, every texts item of elements in the project are converted to dynamic text field.

Note that the changes described upper don't work for the texts which have a tagg (for the moment)


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5083 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2017-10-19 09:10:23 +00:00
parent 055dbf84e6
commit 02fb84caec
6 changed files with 228 additions and 112 deletions

View File

@@ -37,6 +37,8 @@ class DynamicElementTextItem;
*/
class Element : public QetGraphicsItem
{
friend class DiagramEventAddElement;
Q_OBJECT
// constructors, destructor
@@ -215,6 +217,11 @@ class Element : public QetGraphicsItem
void hoverEnterEvent ( QGraphicsSceneHoverEvent * ) override;
void hoverLeaveEvent ( QGraphicsSceneHoverEvent * ) override;
protected:
// @m_converted_text_from_description, when a element is created from his description, the old element text item (tagged as 'input' in the xml)
// are converted to dynamic text field, the QPointF is the original position of the text item, because the origin transformation point of text item
// and dynamic text item are not the same, so we must to keep a track of this value, to be use in the function element::fromXml
QHash <DynamicElementTextItem *, QPointF> m_converted_text_from_xml_description;
private:
bool m_mouse_over;
QString m_prefix;