32 lines
933 B
C++
32 lines
933 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, QGraphicsItem *parent = 0); //genNewPort生成新接线点
|
|
ElectricBaseModelSvgItem(const ElectricBaseModelSvgItem&);
|
|
virtual ElectricBaseModelSvgItem* clone() const override;
|
|
virtual ~ElectricBaseModelSvgItem();
|
|
void updateCoordinate();
|
|
void move(const QPointF&);
|
|
void loadSvg(const QByteArray&);
|
|
|
|
protected:
|
|
virtual QPainterPath shape();
|
|
virtual void editShape(int, const QPointF&);
|
|
virtual void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*);
|
|
|
|
protected:
|
|
QRectF m_lastBoudingRect; //记录上一时刻的boundingRect
|
|
QSvgRenderer* m_pRender;
|
|
QByteArray m_icon;
|
|
|
|
};
|
|
|
|
#endif
|