| 519 | } |
| 520 | |
| 521 | void 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 | |
| 554 | void QHexView::drawHeader(QTextCursor& c) const { |
| 555 | if(m_options.hasFlag(QHexFlags::NoHeader)) |
no test coverage detected