Solved Reading File From Asset file which is in Build folder
-
Hello All,
As we Know After building An android project on Qt, Build file is generated in Workspace, In that Android-Build file , There is folder known as "Asset", we can move any file from any directory to this "asset folder", I am able to find that a file is present in "asset folder", But i am not able to read it through "Qfile", can anybody knows how to read it ?code i have written for reading file :-
void AssetFileDisplay::displaytext() { QFile dfile("assets:/Add.txt"); if (dfile.exists()) { qDebug()<<"Ready to Go"; } QTextStream in(&dfile); QString line = in.readLine(); emit complete(line); }
-
@Bhushan_Sure
a general question,are you aware of Qt's platform independed ressource system ? http://doc.qt.io/qt-5/resources.html
From this and your last topic, I think you may not be aware of it's existence. -
You haven't opened the file before trying to open the stream,
-