PDA

View Full Version : Is it not possible to read and write into a text resource file?



ayanda83
28th January 2017, 16:31
Hi there guys, I've added 4 text files as resource files to my program, but the files wont open. I would like to read and write on three of these file and "append" on the forth. Here is my code below where I try to open the file.
QFile sourcedTenders_file(":/cpt_rcs/App_Resources/cpt/Current_Sourced_Tenders.txt"); //contains urls for sourced tenders.
if(!sourcedTenders_file.open(QFile::ReadWrite | QFile::Text))
{
QMessageBox msgBox_2;
msgBox_2.setText("Url File could not open for reading...");
msgBox_2.exec();
}
QTextStream in_stream(&sourcedTenders_file);

And I have attached a picture below of where the files are situated in the file tree.12312

Lesiok
28th January 2017, 16:44
Files in resources (compiled into the program) are READ ONLY.