* Paints the labels to the xcursor. * @param p The painter to draw with. * @param rect The rectangle of the xcursor area. */
| 243 | * @param rect The rectangle of the xcursor area. |
| 244 | */ |
| 245 | void XCursor::paint_label(QPainter &p, const QRect &rect) |
| 246 | { |
| 247 | if (_dsoSig) { |
| 248 | QRect map_rect = get_map_rect(rect); |
| 249 | p.setPen(Qt::NoPen); |
| 250 | p.setBrush(_dsoSig->get_colour()); |
| 251 | p.drawRect(map_rect); |
| 252 | p.setPen(Qt::white); |
| 253 | p.drawText(map_rect, Qt::AlignCenter | Qt::AlignHCenter, QString::number(_dsoSig->get_index())); |
| 254 | } |
| 255 | |
| 256 | QRect close = get_close_rect(rect); |
| 257 | p.setPen(Qt::NoPen); |
| 258 | |
| 259 | if (close.contains(QPoint(_view.hover_point().x(), _view.hover_point().y()))) |
| 260 | p.setBrush(View::Red); |
| 261 | else if (_dsoSig != NULL) |
| 262 | p.setBrush(_dsoSig->get_colour()); |
| 263 | else |
| 264 | p.setBrush(View::Blue); |
| 265 | |
| 266 | p.drawRect(close); |
| 267 | p.setPen(Qt::black); |
| 268 | p.drawLine(close.left() + 2, close.top() + 2, close.right() - 2, close.bottom() - 2); |
| 269 | p.drawLine(close.left() + 2, close.bottom() - 2, close.right() - 2, close.top() + 2); |
| 270 | } |
| 271 | |
| 272 | QColor XCursor::get_color() |
| 273 | { |
nothing calls this directly
no test coverage detected