Cross ref item: when xref is show has table, user can add prefix to the text of power and delay contact.

Minor improvemnt: the table update is size according to his content


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3060 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2014-05-07 20:56:51 +00:00
parent b185bc323d
commit 56bf8b1c6b
6 changed files with 209 additions and 104 deletions

View File

@@ -50,15 +50,16 @@ class CrossRefItem : public QGraphicsObject
DelayOff = 16
};
QRectF boundingRect() const;
virtual QPainterPath shape() const;
QRectF boundingRect () const;
virtual QPainterPath shape () const;
QString elementPositionText (const Element *elmt, const bool &add_prefix = false) const;
signals:
public slots:
void setProperties (XRefProperties xrp);
void updateLabel();
void autoPos();
void setProperties (const XRefProperties &xrp);
void updateLabel ();
void autoPos ();
protected:
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
@@ -66,19 +67,20 @@ class CrossRefItem : public QGraphicsObject
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *e);
private:
void setUpCrossBoundingRect();
void drawHasCross (QPainter &painter);
void drawHasContacts (QPainter &painter);
void drawContact (QPainter &painter, int flags, QString str = QString());
void fillCrossRef (QPainter &painter);
void AddExtraInfo (QPainter &painter);
void checkMustShow ();
void buildHeaderContact ();
void setUpCrossBoundingRect ();
void drawHasCross (QPainter &painter);
void drawHasContacts (QPainter &painter);
void drawContact (QPainter &painter, int flags, QString str = QString());
void fillCrossRef (QPainter &painter);
void AddExtraInfo (QPainter &painter);
void checkMustShow ();
//Attributes
private:
Element *m_element; //element to display the cross reference
QRectF m_bounding_rect;
QPicture m_drawing;
QPicture m_drawing, m_hdr_no_ctc, m_hdr_nc_ctc;
QPainterPath m_shape_path;
XRefProperties m_properties;
int m_drawed_contacts;