28 #include "../vmisc/def.h"
29 #include "../vmisc/vabstractapplication.h"
30 #include "../vgeometry/vpointf.h"
42 : QGraphicsRectItem(parent)
46 , m_showPointName(true)
49 setAcceptHoverEvents(
true);
50 setFlag(QGraphicsItem::ItemIsFocusable,
true);
54 void SceneRect::paint(QPainter *painter,
const QStyleOptionGraphicsItem *option, QWidget *widget)
61 QGraphicsRectItem::paint(painter, option, widget);
67 setFlag(QGraphicsItem::ItemSendsGeometryChanges,
false);
68 setPos(
static_cast<QPointF
>(point));
69 setFlag(QGraphicsItem::ItemSendsGeometryChanges,
true);
93 QGraphicsRectItem::hoverEnterEvent(event);
100 QGraphicsRectItem::hoverLeaveEvent(event);
109 brushColor.setAlpha(100);
112 if (!
qApp->Settings()->isWireframe())
114 setBrush(QBrush(brushColor, Qt::SolidPattern));
118 setBrush(QBrush(brushColor, Qt::NoBrush));
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) Q_DECL_OVERRIDE
void setOnlyPoint(bool value)
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) Q_DECL_OVERRIDE
void setPointColor(const QString &value)
bool m_onlyPoint
m_rectColor color of point.
void setRectPen(qreal scale)
virtual void refreshPointGeometry(const VPointF &point)
SceneRect(const QColor &lineColor, QGraphicsItem *parent=nullptr)
The VPointF class keep data of point.
const qreal widthMainLine
qreal sceneScale(QGraphicsScene *scene)
qreal scaleWidth(qreal width, qreal scale)
QColor correctColor(const QGraphicsItem *item, const QColor &color)
void scaleRectSize(QGraphicsRectItem *item, qreal scale)
const qreal widthHairLine