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

Method saveToReadableFile

example/mainwindow.cpp:152–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152void MainWindow::saveToReadableFile()
153{
154 QString fileName = QFileDialog::getSaveFileName(this, tr("Save To Readable File"));
155 if (!fileName.isEmpty())
156 {
157 QFile file(fileName);
158 if (!file.open(QFile::WriteOnly | QFile::Text)) {
159 QMessageBox::warning(this, tr("QHexEdit"),
160 tr("Cannot write file %1:\n%2.")
161 .arg(fileName)
162 .arg(file.errorString()));
163 return;
164 }
165
166 QApplication::setOverrideCursor(Qt::WaitCursor);
167 file.write(hexEdit->toReadableString().toLatin1());
168 QApplication::restoreOverrideCursor();
169
170 statusBar()->showMessage(tr("File saved"), 2000);
171 }
172}
173
174void MainWindow::setAddress(qint64 address)
175{

Callers

nothing calls this directly

Calls 3

toReadableStringMethod · 0.80
openMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected