Welcome! Log In Create A New Profile

Advanced

Text Files

Posted by nirenu 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Text Files
February 17, 2012 12:43PM
Where does one place a text file(eg. Items.txt) in a QT project. Ives tried "new" , "Text file" but no luck. Please help. Thanks.
Re: Text Files
April 23, 2012 03:20PM
Right click on the project file, click add new, general tab, text file. Name it in the box. It then appears in a folder called "Other files".



You could also try linking the QFile to the file location: C:\Items.txt.

"QFile items("C:\Items.txt" "close bracket" ; //keeps making a smiley with this last bracket

//then you can go:

items.open(QIODevice::Readonly); //as if you had the file in the project itself but, the above of adding the text file to the project should work.

I would suggest using Dev C++ for this module, Qt is part of the visual programming module later. Qt also has it's own library and many of the other functions you usually use will have to change assuming you are using Walter Savitch's book. That is unless it is recommended that you use Qt for this module.
Sorry, only registered users may post in this forum.

Click here to login