mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-03-15 06:09:58 +01:00
Element text item with are now converted to dynamic element text item.
From now, the class ElementTextItem is not anymore use in qet. Every texts in a diagram are DynamicElementTextItem. the Xref item was adapted to dynamic text. Previously, the comment and location, displayed as a "static text" below the "old text" tagged "label" are now automaticaly converted to DynamicElementTextItem, so visually, these texts stay unchanged git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5216 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -23,6 +23,8 @@
|
||||
#include <QPicture>
|
||||
|
||||
class Element;
|
||||
class DynamicElementTextItem;
|
||||
class ElementTextItemGroup;
|
||||
|
||||
/**
|
||||
* @brief The CrossRefItem class
|
||||
@@ -42,8 +44,14 @@ class CrossRefItem : public QGraphicsObject
|
||||
//Methods
|
||||
public:
|
||||
explicit CrossRefItem(Element *elmt);
|
||||
explicit CrossRefItem(Element *elmt, DynamicElementTextItem *text);
|
||||
explicit CrossRefItem(Element *elmt, ElementTextItemGroup *group);
|
||||
~CrossRefItem() override;
|
||||
|
||||
private:
|
||||
void init();
|
||||
void setUpConnection();
|
||||
|
||||
public:
|
||||
enum { Type = UserType + 1009 };
|
||||
int type() const override { return Type; }
|
||||
|
||||
@@ -68,6 +76,7 @@ class CrossRefItem : public QGraphicsObject
|
||||
void autoPos ();
|
||||
|
||||
protected:
|
||||
bool sceneEvent(QEvent *event) override;
|
||||
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
|
||||
void mouseDoubleClickEvent (QGraphicsSceneMouseEvent * event ) override;
|
||||
void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
|
||||
@@ -75,6 +84,7 @@ class CrossRefItem : public QGraphicsObject
|
||||
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
|
||||
|
||||
private:
|
||||
void linkedChanged();
|
||||
void buildHeaderContact ();
|
||||
void setUpCrossBoundingRect (QPainter &painter);
|
||||
void drawAsCross (QPainter &painter);
|
||||
@@ -82,7 +92,6 @@ class CrossRefItem : public QGraphicsObject
|
||||
QRectF drawContact (QPainter &painter, int flags, Element *elmt);
|
||||
void fillCrossRef (QPainter &painter);
|
||||
void AddExtraInfo (QPainter &painter, QString);
|
||||
void setTextParent ();
|
||||
QList<Element *> NOElements() const;
|
||||
QList<Element *> NCElements() const;
|
||||
|
||||
@@ -96,7 +105,10 @@ class CrossRefItem : public QGraphicsObject
|
||||
int m_drawed_contacts;
|
||||
QMap <Element *, QRectF> m_hovered_contacts_map;
|
||||
Element *m_hovered_contact = nullptr;
|
||||
|
||||
DynamicElementTextItem *m_text = nullptr;
|
||||
ElementTextItemGroup *m_group = nullptr;
|
||||
QList <QMetaObject::Connection> m_slave_connection;
|
||||
QList <QMetaObject::Connection> m_update_connection;
|
||||
};
|
||||
|
||||
#endif // CROSSREFITEM_H
|
||||
|
||||
Reference in New Issue
Block a user