mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-18 18:38:51 +00:00
Fix crash in hexdump, issue #163
To prevent recursive calls to hexScrolled block the signals of the verticalScrollBars of the QTextEdit widgets.
This commit is contained in:
parent
44d1b0454f
commit
6ffb18e6e4
@ -750,9 +750,18 @@ void MemoryWidget::hexScrolled()
|
|||||||
|
|
||||||
QList<QString> ret = this->get_hexdump(lastline);
|
QList<QString> ret = this->get_hexdump(lastline);
|
||||||
|
|
||||||
this->hexOffsetText->append(ret[0]);
|
// To prevent recursive calls to hexScrolled (this function) blocks the
|
||||||
this->hexHexText->append(ret[1]);
|
// scroll bar signals
|
||||||
this->hexASCIIText->append(ret[2]);
|
auto appendTextWithoutSignals = [](QTextEdit *edit, const QString &text)
|
||||||
|
{
|
||||||
|
edit->verticalScrollBar()->blockSignals(true);
|
||||||
|
edit->append(text);
|
||||||
|
edit->verticalScrollBar()->blockSignals(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
appendTextWithoutSignals(hexOffsetText, ret[0]);
|
||||||
|
appendTextWithoutSignals(hexHexText, ret[1]);
|
||||||
|
appendTextWithoutSignals(hexASCIIText, ret[2]);
|
||||||
this->resizeHexdump();
|
this->resizeHexdump();
|
||||||
|
|
||||||
// Append more hex text here
|
// Append more hex text here
|
||||||
|
Loading…
Reference in New Issue
Block a user