MCPcopy Create free account
hub / github.com/CE-Programming/CEmu / showCursor

Method showCursor

gui/qt/debugger/hexwidget.cpp:179–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179void HexWidget::showCursor() {
180 disconnect(verticalScrollBar(), &QScrollBar::valueChanged, this, &HexWidget::scroll);
181 int addr = m_cursorOffset / 2;
182 if (addr <= m_bytesPerLine) {
183 verticalScrollBar()->setValue(0);
184 } else if (addr <= m_lineStart) {
185 verticalScrollBar()->setValue(addr / m_bytesPerLine);
186 }
187 if (addr > (m_lineStart + m_visibleRows * m_bytesPerLine - 1)) {
188 verticalScrollBar()->setValue((addr / m_bytesPerLine) - m_visibleRows + 1);
189 }
190 if (m_cursor.x() < horizontalScrollBar()->value()) {
191 horizontalScrollBar()->setValue(0);
192 }
193 adjust();
194 connect(verticalScrollBar(), &QScrollBar::valueChanged, this, &HexWidget::scroll);
195}
196
197void HexWidget::adjust() {
198 m_size = m_data.size();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected