Hello!
I am facing a problem.
I want to use the conten of a file bt I have to check first if the file is opened.
I am receiving th efollowing error message: "return-statement with no value, in function returning 'QStringList"
My question: How to stop the process if the file can not be opened, since "return-statement does not work here?
break-statement can be used only in a loop.
Here is my code.
{
{
QMessageBox::critical(this,
"Warning",
"Open a file please");
return;
}
// I do something here
}
QStringList myWindow::open(QString &fileName)
{
QFile file(fileName);
if(!file.open(QIODevice::ReadOnly))
{
QMessageBox::critical(this, "Warning", "Open a file please");
return;
}
// I do something here
}
To copy to clipboard, switch view to plain text mode
Many thanks in advance.
Bookmarks