| 131 | } |
| 132 | |
| 133 | void HexWidget::setCursorOffset(int offset, bool selection) { |
| 134 | if (offset > m_size * 2) { |
| 135 | offset = m_size * 2; |
| 136 | } |
| 137 | if (offset < 0) { |
| 138 | offset = 0; |
| 139 | } |
| 140 | if (selection) { |
| 141 | resetSelection(); |
| 142 | } |
| 143 | |
| 144 | m_cursorOffset = offset; |
| 145 | adjust(); |
| 146 | showCursor(); |
| 147 | } |
| 148 | |
| 149 | int HexWidget::getPosition(QPoint posa, bool allow) { |
| 150 | int xOffset = posa.x() + horizontalScrollBar()->value(); |