[qet] qet/qet: [5118] Forget file from previous commit |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 5118
Author: blacksun
Date: 2017-11-27 20:43:02 +0100 (Mon, 27 Nov 2017)
Log Message:
-----------
Forget file from previous commit
Modified Paths:
--------------
trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp
trunk/sources/qetgraphicsitem/dynamicelementtextitem.h
Modified: trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp 2017-11-27 19:37:39 UTC (rev 5117)
+++ trunk/sources/qetgraphicsitem/dynamicelementtextitem.cpp 2017-11-27 19:43:02 UTC (rev 5118)
@@ -23,6 +23,7 @@
#include "QPropertyUndoCommand/qpropertyundocommand.h"
#include "terminal.h"
#include "conductor.h"
+#include "elementtextitemgroup.h"
#include <QDomDocument>
#include <QDomElement>
@@ -222,6 +223,8 @@
/**
* @brief DynamicElementTextItem::ParentElement
* @return a pointer to the parent element. Note the pointer can be null.
+ * Note that the text can return a parent element,
+ * even if the text belong to a group of this same element.
*/
Element *DynamicElementTextItem::parentElement() const {
return m_parent_element;
@@ -228,6 +231,19 @@
}
/**
+ * @brief DynamicElementTextItem::parentGroup
+ * @return The group where this text belong, if this item
+ * is note in a group, return nullptr.
+ */
+ElementTextItemGroup *DynamicElementTextItem::parentGroup() const
+{
+ if(group())
+ return dynamic_cast<ElementTextItemGroup *>(group());
+ else
+ return nullptr;
+}
+
+/**
* @brief DynamicElementTextItem::elementUseForInfo
* @return a pointer to the element we must use for the variable information.
* If this text is owned by a simple element, the simple element is returned, this is the same element returned by the function parentElement().
@@ -493,6 +509,11 @@
return m_frame;
}
+QUuid DynamicElementTextItem::uuid() const
+{
+ return m_uuid;
+}
+
/**
* @brief DynamicElementTextItem::mousePressEvent
* @param event
Modified: trunk/sources/qetgraphicsitem/dynamicelementtextitem.h
===================================================================
--- trunk/sources/qetgraphicsitem/dynamicelementtextitem.h 2017-11-27 19:37:39 UTC (rev 5117)
+++ trunk/sources/qetgraphicsitem/dynamicelementtextitem.h 2017-11-27 19:43:02 UTC (rev 5118)
@@ -24,6 +24,7 @@
class Element;
class Conductor;
+class ElementTextItemGroup;
/**
* @brief The DynamicElementTextItem class
@@ -77,6 +78,7 @@
void fromXml(const QDomElement &dom_elmt) override;
Element *parentElement() const;
+ ElementTextItemGroup *parentGroup() const;
Element *elementUseForInfo() const;
void refreshLabelConnection();
@@ -93,6 +95,7 @@
QString compositeText() const;
void setFrame(const bool frame);
bool frame() const;
+ QUuid uuid() const;
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;