28 lines
803 B
C++
28 lines
803 B
C++
#ifndef ELECTRICBASEMODELSVGITEM_H
|
|
#define ELECTRICBASEMODELSVGITEM_H
|
|
|
|
#include "graphicsItem/graphicsBaseItem.h"
|
|
#include <QGraphicsSvgItem>
|
|
|
|
class ElectricBaseModelSvgItem :public GraphicsBaseModelItem
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
ElectricBaseModelSvgItem(const QRect &rect, bool genNewPort = true,QGraphicsItem *parent = 0); //genNewPort生成新接线点
|
|
virtual ~ElectricBaseModelSvgItem();
|
|
void updateCoordinate();
|
|
void move(const QPointF&);
|
|
|
|
protected:
|
|
virtual QPainterPath shape();
|
|
virtual void editShape(int, const QPointF&);
|
|
virtual void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*);
|
|
virtual void loadSvg(const QString&);
|
|
protected:
|
|
QRectF m_lastBoudingRect; //记录上一时刻的boundingRect
|
|
QSvgRenderer* m_pRender;
|
|
|
|
};
|
|
|
|
#endif
|