mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-04 11:30:52 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user