DiagramDesigner/diagramCavas/include/graphicsItem/electricBayItem.h

30 lines
753 B
C
Raw Normal View History

2026-03-23 11:06:17 +08:00
#ifndef ELECBAYITEM_H
#define ELECBAYITEM_H
2026-03-26 16:22:35 +08:00
#include "graphicsItem/graphicsBaseItem.h"
2026-03-23 11:06:17 +08:00
#include "baseProperty.h"
class ElectricBayItem :public GraphicsNonStandardItem
{
Q_OBJECT
public:
ElectricBayItem(const QRectF &rect, QGraphicsItem *parent = 0); //genNewPort生成新接线点
2026-04-24 17:14:45 +08:00
ElectricBayItem(const ElectricBayItem&);
2026-03-23 11:06:17 +08:00
virtual ~ElectricBayItem();
2026-04-24 17:14:45 +08:00
virtual ElectricBayItem* clone() const override;
2026-03-23 11:06:17 +08:00
void setText(const QString& s);
protected:
2026-04-24 17:14:45 +08:00
virtual QPainterPath shape() override;
virtual void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*) override;
2026-03-23 11:06:17 +08:00
private:
void updateTextShape();
protected:
QRectF _recLabel;
QString m_text;
QFont m_font;
QRectF m_showRect;
};
#endif