Utility functions
| 364 | |
| 365 | // ********************************************************************** Utility functions |
| 366 | void 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 | |
| 379 | qint64 QHexEdit::indexOf(const QByteArray &ba, qint64 from) |
| 380 | { |
nothing calls this directly
no outgoing calls
no test coverage detected