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.

Qt Code:
  1. QStringList myWindow::open(QString &fileName)
  2. {
  3. QFile file(fileName);
  4.  
  5. if(!file.open(QIODevice::ReadOnly))
  6. {
  7. QMessageBox::critical(this, "Warning", "Open a file please");
  8. return;
  9. }
  10.  
  11. // I do something here
  12. }
To copy to clipboard, switch view to plain text mode 

Many thanks in advance.