Periodic_triangulation_3: Fix warning in demo

This commit is contained in:
Andreas Fabri 2025-11-21 10:50:25 +00:00
parent b3e2f204a4
commit b04bbd81df
1 changed files with 6 additions and 1 deletions

View File

@ -138,7 +138,12 @@ public Q_SLOTS:
private:
void showFileBox(QString title, QString fileName) {
QFile textFile(fileName);
textFile.open(QIODevice::ReadOnly);
bool b = textFile.open(QIODevice::ReadOnly);
if(!b){
QMessageBox::critical(this, tr("Error"),
tr("Could not open file %1.").arg(fileName));
return;
}
QMessageBox mb(QMessageBox::NoIcon,
title,
QTextStream(&textFile).readAll(),