MCPcopy Create free account
hub / github.com/clementgallet/libTAS / drawSeparators

Method drawSeparators

src/external/qhexview/src/qhexview.cpp:521–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

519}
520
521void QHexView::drawSeparators(QPainter* p) const {
522 if(!m_options.hasFlag(QHexFlags::Separators))
523 return;
524
525 auto oldpen = p->pen();
526 p->setPen(m_options.separatorcolor.isValid()
527 ? m_options.separatorcolor
528 : this->palette().color(QPalette::Dark));
529
530 if(m_options.hasFlag(QHexFlags::HSeparator)) {
531 QLineF l(0, m_fontmetrics.lineSpacing(), this->endColumnX(),
532 m_fontmetrics.lineSpacing());
533 if(!m_hexdelegate || !m_hexdelegate->paintSeparator(p, l, this))
534 p->drawLine(l);
535 }
536
537 if(m_options.hasFlag(QHexFlags::VSeparator)) {
538 QLineF l1(this->hexColumnX(), 0, this->hexColumnX(), this->height());
539 QLineF l2(this->asciiColumnX(), 0, this->asciiColumnX(),
540 this->height());
541
542 if(!m_hexdelegate ||
543 (m_hexdelegate && !m_hexdelegate->paintSeparator(p, l1, this)))
544 p->drawLine(l1);
545
546 if(!m_hexdelegate ||
547 (m_hexdelegate && !m_hexdelegate->paintSeparator(p, l2, this)))
548 p->drawLine(l2);
549 }
550
551 p->setPen(oldpen);
552}
553
554void QHexView::drawHeader(QTextCursor& c) const {
555 if(m_options.hasFlag(QHexFlags::NoHeader))

Callers 1

paintMethod · 0.95

Calls 6

endColumnXMethod · 0.95
hexColumnXMethod · 0.95
asciiColumnXMethod · 0.95
hasFlagMethod · 0.80
paintSeparatorMethod · 0.80
isValidMethod · 0.45

Tested by

no test coverage detected