MCPcopy Create free account
hub / github.com/baldurk/renderdoc / paintEvent

Method paintEvent

qrenderdoc/Windows/TimelineBar.cpp:459–865  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457}
458
459void 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);

Callers

nothing calls this directly

Calls 15

uniformMarginsFunction · 0.85
QMarginsClass · 0.85
getLuminanceFunction · 0.85
devicePixelRatioFunction · 0.85
aliasAlignFunction · 0.85
fillRectMethod · 0.80
setWrapModeMethod · 0.80
setLeftMethod · 0.80
drawTextMethod · 0.80
bottomLeftMethod · 0.80
bottomRightMethod · 0.80
topRightMethod · 0.80

Tested by

no test coverage detected