| 369 | } |
| 370 | |
| 371 | void MainWindow::loadFile(const QString &fileName) |
| 372 | { |
| 373 | file.setFileName(fileName); |
| 374 | if (!hexEdit->setData(file)) { |
| 375 | QMessageBox::warning(this, tr("QHexEdit"), |
| 376 | tr("Cannot read file %1:\n%2.") |
| 377 | .arg(fileName) |
| 378 | .arg(file.errorString())); |
| 379 | return; |
| 380 | } |
| 381 | setCurrentFile(fileName); |
| 382 | statusBar()->showMessage(tr("File loaded"), 2000); |
| 383 | } |
| 384 | |
| 385 | void MainWindow::readSettings() |
| 386 | { |