MCPcopy Create free account
hub / github.com/Simsys/qhexedit2 / setFont

Method setFont

src/qhexedit.cpp:431–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429}
430
431void 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
449QString QHexEdit::toReadableString()
450{

Callers 4

readSettingsMethod · 0.80
loadMethod · 0.80
saveMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected