Welcome! Log In Create A New Profile


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 11:56AM
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.
avatar Re: Text Files
February 17, 2012 07:49PM
Are you trying to generate a text file with a class in your project? I forget how that works exactly, but seem to recall you can specify any valid path for it.

If you're making a text file manually, you'd just do that in Notepad, not the Qt Creator IDE.

Sorry if that's not much help. Perhaps give a bit more context?
Re: Text Files
February 17, 2012 09:25PM
I have a text file of items(barcode, price) in notepad and i want to read it from notepad to a QStringList and then use the vaules.
avatar Re: Text Files
February 18, 2012 05:10PM
Sounds a bit like you can put it anywhere as long as you tell your code where to find it? One of the methods would be something like Savitch described in COS112; another would be to take advantage of some Qt functionality.

The problem of what's on the file is separate from the problem of where the file goes, is separate from the problem of how to make some use of what's in the file. Try to decompose the main problem into the finest granularity of subproblems, then just solve the simplest of the subproblems, stand back, look, solve the next one, and so on ...

Sorry I'm being so general. Sounds like a more direct answer is a bit too close to offering an answer to the assignment, though. (You have my sympathy for what it's worth).
Re: Text Files
February 19, 2012 01:35PM
Great, thanks.
Sorry, only registered users may post in this forum.

Click here to login