MCPcopy Create free account
hub / github.com/Simsys/qhexedit2 / replaceOccurrence

Method replaceOccurrence

example/searchdialog.cpp:92–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92qint64 SearchDialog::replaceOccurrence(qint64 idx, const QByteArray &replaceBa)
93{
94 int result = QMessageBox::Yes;
95 if (replaceBa.length() >= 0)
96 {
97 if (ui->cbPrompt->isChecked())
98 {
99 result = QMessageBox::question(this, tr("QHexEdit"),
100 tr("Replace occurrence?"),
101 QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
102
103 if (result == QMessageBox::Yes)
104 {
105 _hexEdit->replace(idx, replaceBa.length(), replaceBa);
106 _hexEdit->update();
107 }
108 }
109 else
110 {
111 _hexEdit->replace(idx, _findBa.length(), replaceBa);
112 }
113 }
114 return result;
115}

Callers

nothing calls this directly

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected