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

Method ensureVisible

src/qhexedit.cpp:366–377  ·  view source on GitHub ↗

Utility functions

Source from the content-addressed store, hash-verified

364
365// ********************************************************************** Utility functions
366void QHexEdit::ensureVisible()
367{
368 if (_cursorPosition < (_bPosFirst * 2))
369 verticalScrollBar()->setValue((int)(_cursorPosition / 2 / _bytesPerLine));
370 if (_cursorPosition > ((_bPosFirst + (_rowsShown - 1)*_bytesPerLine) * 2))
371 verticalScrollBar()->setValue((int)(_cursorPosition / 2 / _bytesPerLine) - _rowsShown + 1);
372 if (_pxCursorX < horizontalScrollBar()->value())
373 horizontalScrollBar()->setValue(_pxCursorX);
374 if ((_pxCursorX + _pxCharWidth) > (horizontalScrollBar()->value() + viewport()->width()))
375 horizontalScrollBar()->setValue(_pxCursorX + _pxCharWidth - viewport()->width());
376 viewport()->update();
377}
378
379qint64 QHexEdit::indexOf(const QByteArray &ba, qint64 from)
380{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected