| 429 | } |
| 430 | |
| 431 | void QHexEdit::setFont(const QFont &font) |
| 432 | { |
| 433 | QFont theFont(font); |
| 434 | theFont.setStyleHint(QFont::Monospace); |
| 435 | QWidget::setFont(theFont); |
| 436 | QFontMetrics metrics = fontMetrics(); |
| 437 | #if QT_VERSION > QT_VERSION_CHECK(5, 11, 0) |
| 438 | _pxCharWidth = metrics.horizontalAdvance(QLatin1Char('2')); |
| 439 | #else |
| 440 | _pxCharWidth = metrics.width(QLatin1Char('2')); |
| 441 | #endif |
| 442 | _pxCharHeight = metrics.height(); |
| 443 | _pxAreaMargin = _pxCharWidth / 2; |
| 444 | _pxCursorWidth = _pxCharHeight / 7; |
| 445 | _pxSelectionSub = _pxCharHeight / 5; |
| 446 | viewport()->update(); |
| 447 | } |
| 448 | |
| 449 | QString QHexEdit::toReadableString() |
| 450 | { |
no outgoing calls
no test coverage detected