Hello!

I'm trying to read a .txt file in my program, so, to do that i created a "Database/test.txt" file in "build-Loterias-Desktop-Debug" folder. When i run my program using QTCreator, he finds my .txt file, but when i run it directly without using QtCreator he finds nothing!

How can i solve the problem?

Here my code.
Qt Code:
  1. #define LF_PATH "Database/test.txt"
  2. obj.createTestData( LF_PATH );
To copy to clipboard, switch view to plain text mode 
Qt Code:
  1. void Test::createTestData(QString filePath) {
  2. if( !filePath.isEmpty( ) ) {
  3. QFile file( filePath );
  4.  
  5. if( file.open(QIODevice::ReadOnly | QIODevice::Text) ) {
  6. QTextStream stream( &file );
  7.  
  8. // Rest of the code...
  9.  
  10. file.close( );
  11. }
  12. }
  13. }
To copy to clipboard, switch view to plain text mode 

Thanks!