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

Method saveSelectionToReadableFile

example/mainwindow.cpp:130–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130void MainWindow::saveSelectionToReadableFile()
131{
132 QString fileName = QFileDialog::getSaveFileName(this, tr("Save To Readable File"));
133 if (!fileName.isEmpty())
134 {
135 QFile file(fileName);
136 if (!file.open(QFile::WriteOnly | QFile::Text)) {
137 QMessageBox::warning(this, tr("QHexEdit"),
138 tr("Cannot write file %1:\n%2.")
139 .arg(fileName)
140 .arg(file.errorString()));
141 return;
142 }
143
144 QApplication::setOverrideCursor(Qt::WaitCursor);
145 file.write(hexEdit->selectionToReadableString().toLatin1());
146 QApplication::restoreOverrideCursor();
147
148 statusBar()->showMessage(tr("File saved"), 2000);
149 }
150}
151
152void MainWindow::saveToReadableFile()
153{

Callers

nothing calls this directly

Calls 3

openMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected