Conductor is an herited class of QGraphicsObject, instead of QObject and QGraphicsPathItem

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5371 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2018-05-18 19:36:27 +00:00
parent cc9184c0b6
commit bca58fa555
2 changed files with 43 additions and 19 deletions

View File

@@ -39,7 +39,7 @@ typedef QHash<Qt::Corner, ConductorProfile> ConductorProfilesGroup;
This class represents a conductor, i.e. a wire between two element
terminals.
*/
class Conductor : public QObject, public QGraphicsPathItem
class Conductor : public QGraphicsObject
{
Q_OBJECT
@@ -90,6 +90,8 @@ class Conductor : public QObject, public QGraphicsPathItem
ConductorSegment *middleSegment();
QPointF posForText(Qt::Orientations &flag);
void refreshText();
void setPath(const QPainterPath &path);
QPainterPath path() const;
public:
static bool valideXml (QDomElement &);
@@ -181,6 +183,7 @@ class Conductor : public QObject, public QGraphicsPathItem
static QPen conductor_pen;
static QBrush conductor_brush;
static bool pen_and_brush_initialized;
QPainterPath m_path;
private:
void segmentsToPath();