| 457 | } |
| 458 | |
| 459 | void TimelineBar::paintEvent(QPaintEvent *e) |
| 460 | { |
| 461 | QStylePainter p(viewport()); |
| 462 | |
| 463 | p.setFont(font()); |
| 464 | p.setRenderHint(QPainter::TextAntialiasing); |
| 465 | |
| 466 | // draw boundaries and background |
| 467 | { |
| 468 | QRectF r = viewport()->rect(); |
| 469 | |
| 470 | p.fillRect(r, palette().brush(QPalette::Window)); |
| 471 | |
| 472 | QRectF borderRect = r.marginsRemoved(uniformMargins(margin)); |
| 473 | r = borderRect.marginsRemoved(uniformMargins(borderWidth)); |
| 474 | |
| 475 | p.fillRect(r, palette().brush(QPalette::Base)); |
| 476 | |
| 477 | QStyleOptionFrame frameOpt; |
| 478 | frameOpt.initFrom(viewport()); |
| 479 | frameOpt.rect = borderRect.toRect(); |
| 480 | frameOpt.frameShape = QFrame::Box; |
| 481 | frameOpt.lineWidth = 1; |
| 482 | p.drawControl(QStyle::CE_ShapedFrame, frameOpt); |
| 483 | } |
| 484 | |
| 485 | QTextOption to; |
| 486 | |
| 487 | to.setWrapMode(QTextOption::NoWrap); |
| 488 | to.setAlignment(Qt::AlignLeft | Qt::AlignVCenter); |
| 489 | |
| 490 | { |
| 491 | QRectF titleRect = m_eidAxisRect; |
| 492 | titleRect.setLeft(titleRect.left() - m_titleWidth); |
| 493 | titleRect.setWidth(m_titleWidth); |
| 494 | |
| 495 | p.setPen(QPen(palette().brush(QPalette::Text), 1.0)); |
| 496 | |
| 497 | // add an extra margin for the text |
| 498 | p.drawText(titleRect.marginsRemoved(QMarginsF(margin, 0, 0, 0)), eidAxisTitle, to); |
| 499 | |
| 500 | titleRect.setLeft(titleRect.left() - margin); |
| 501 | titleRect.setTop(titleRect.top() - margin); |
| 502 | |
| 503 | drawLine(p, titleRect.bottomLeft(), titleRect.bottomRight()); |
| 504 | drawLine(p, titleRect.topRight(), titleRect.bottomRight()); |
| 505 | } |
| 506 | |
| 507 | QRectF eidAxisRect = m_eidAxisRect; |
| 508 | |
| 509 | drawLine(p, eidAxisRect.bottomLeft(), eidAxisRect.bottomRight() + QPointF(margin, 0)); |
| 510 | |
| 511 | drawLine(p, m_highlightingRect.topLeft(), m_highlightingRect.topRight()); |
| 512 | |
| 513 | if(m_Actions.isEmpty()) |
| 514 | return; |
| 515 | |
| 516 | eidAxisRect.setLeft(m_eidAxisRect.left() + m_pan); |
nothing calls this directly
no test coverage detected