| 1039 | } |
| 1040 | |
| 1041 | void QHexEdit::setSelection(qint64 pos) |
| 1042 | { |
| 1043 | pos = pos / 2; |
| 1044 | if (pos < 0) |
| 1045 | pos = 0; |
| 1046 | if (pos > _chunks->size()) |
| 1047 | pos = _chunks->size(); |
| 1048 | |
| 1049 | if (pos > _bSelectionBegin) |
| 1050 | { |
| 1051 | _bSelectionEnd = pos; |
| 1052 | } |
| 1053 | else |
| 1054 | { |
| 1055 | _bSelectionBegin = pos; |
| 1056 | } |
| 1057 | _colorManager->selection().setRange(_bSelectionBegin, _bSelectionEnd); |
| 1058 | } |
| 1059 | |
| 1060 | qint64 QHexEdit::getSelectionBegin() |
| 1061 | { |