| 308 | } |
| 309 | |
| 310 | void ReferenceLinePrivate::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*option*/, QWidget*) { |
| 311 | if (!insidePlot) |
| 312 | return; |
| 313 | |
| 314 | painter->setOpacity(line->opacity()); |
| 315 | painter->setPen(line->pen()); |
| 316 | if (orientation == ReferenceLine::Orientation::Horizontal) |
| 317 | painter->drawLine(-length / 2, 0, length / 2, 0); |
| 318 | else |
| 319 | painter->drawLine(0, length / 2, 0, -length / 2); |
| 320 | |
| 321 | if (m_hovered && !isSelected() && !q->isPrinting()) { |
| 322 | painter->setPen(QPen(QApplication::palette().color(QPalette::Shadow), 2, Qt::SolidLine)); |
| 323 | painter->drawPath(m_shape); |
| 324 | } |
| 325 | |
| 326 | if (isSelected() && !q->isPrinting()) { |
| 327 | painter->setPen(QPen(QApplication::palette().color(QPalette::Highlight), 2, Qt::SolidLine)); |
| 328 | painter->drawPath(m_shape); |
| 329 | } |
| 330 | } |
| 331 | |
| 332 | // ############################################################################## |
| 333 | // ################## Serialization/Deserialization ########################### |
nothing calls this directly
no test coverage detected