QString LoadTextFile(const QString &fileName) {
QFile file(fileName);
if (!file.open(QFile::ReadOnly | QFile::Text)) {
QMessageBox::warning(this,
tr("Application"),
tr("Cannot read file %1:\n%2.").arg(fileName).arg(file.errorString())
);
return "";
} else {
QTextStream Stream(&File);
return Stream.readAll();
}
}