#include "graphicsItem/electricSvgItemRect.h" #include "graphicsItem/itemPort.h" #include "global.h" #include #include #include #include #include ElectricSvgItemRect::ElectricSvgItemRect(const QRect &rect, bool genNewPort, QGraphicsItem *parent) : ElectricSvgItem(rect,parent) { //loadSvg(":/images/element/svg_rect.svg"); setHandleIfShow(H_textCaption,false); setHandleIfShow(H_textCurrent,false); setHandleIfShow(h_textVoltage,false); setHandleVisible(false); setFunctionHandleIfShow(false); setFunctionHandleEnaable(false); m_dRatioX = 0.5; /*if(genNewPort) { addPort(P_const,QPointF(boundingRect().right() - boundingRect().width() * m_dRatioX, boundingRect().top()),QUuid::createUuid().toString(),T_lineIn,P_top); addPort(P_const,QPointF(boundingRect().right() - boundingRect().width() * m_dRatioX, boundingRect().bottom()),QUuid::createUuid().toString(),T_lineOut,P_down); }*/ } ElectricSvgItemRect::~ElectricSvgItemRect() { } void ElectricSvgItemRect::updateHandles() { ElectricSvgItem::updateHandles(); } void ElectricSvgItemRect::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) { ElectricSvgItem::paint(painter,option,widget); }