MCPcopy Create free account
hub / github.com/XRay3D/GERBER_X3 / paint

Method paint

shape_plugins/shape/shhandler.cpp:88–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86QRectF Handler::boundingRect() const { return rect(); }
87
88void Handler::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* /*widget*/)
89{
90 painter->setPen(Qt::NoPen);
91 QColor c;
92 switch (m_hType) {
93 case Adder:
94 c = QColor(Qt::yellow);
95 break;
96 case Center:
97 c = QColor(Qt::red);
98 break;
99 case Corner:
100 c = QColor(Qt::green);
101 break;
102 }
103 if (option->state & QStyle::State_MouseOver) {
104 drawPos(painter, pos());
105 } else
106 c.setAlpha(100);
107 painter->setBrush(c);
108 painter->setPen(QPen(Qt::black, 0.0));
109 if (!pressed)
110 painter->drawEllipse(rect());
111}
112
113void Handler::setPos(const QPointF& pos)
114{

Callers

nothing calls this directly

Calls 2

drawPosFunction · 0.85
setPenMethod · 0.45

Tested by

no test coverage detected