Question: Im trying to read from a file and put into to the text edit and it keeps saying QIODevice::read:device not open. The .txt file is in the same location as my .qrc and .cpp file. I was following a step by step guide from online. From my understanding, they changed something when they went from Q4 to Q5. Does anyone have any hint on how I can fix this. thanks

```
//My findstuff.h 
#ifndef FINDSTUFF_H 
#define FINDSTUFF_H 
#include <QWidget> 
namespace Ui {class FindStuff;} 

class FindStuff : public QWidget{ 
Q_OBJECT
public:
  explicit FindStuff(QWidget *parent = 0);
  ~FindStuff();

private slots:
  void on_goButton_clicked();

private:
  Ui::FindStuff *ui; 
  void getTextFile();
};

```

Answer: 
You're not passing the *absolute* path of the file to `QFile::open()`, and you're not checking the result of opening the file. In your case, it's a failure and `open()` returns false, but you're ignoring it, instead of fixing the problem (the wrong path) that caused it.

This has zilch to do with Qt 4 -> Qt 5 upgrade, and everything to do with you assuming the wrong thing about the current directory your application happens to find itself with. Generally speaking, the current directory (or working directory) is arbitrary, and platform- and circumstance-specific, and wholly out of your control. Unless the user gives you a filename that's implicitly referenced to the current working directory (e.g. as a relative path given a commandline argument), you must use absolute file paths or things simply won't work.
I had this problem and it turned out Qt Creator hadn't actually added the .qrc file to my project. I'm using Qt Creator 4.1.0 on a Mac and the projects view doesn't always get populated after creating a new project, first requiring a restart of Creator. My version of this problem may relate to that.