Passing QFile objecrt as parameter
How do I pass a QFile object as a paramter. I'm rehoisting some code that use to pass in the file pointer to the method. I've redone it to use QString and QFile. But when I try to compile I get an error saying that the QFile object is private...
the declaration is...
CNewProcess::ReadCommand(QFile cmdFile, in_buff_t buff[], *int items);
I call it as follows...
QFile commandFile("/tmp/commands.txt");
.
.
ReadCommands(commandFile, inputBuff, count);
..
..
Re: Passing QFile objecrt as parameter
Pretty hard to say. If you switched from a pointer var, have you modified all references in the the code not to use pointers?
Regards
Re: Passing QFile objecrt as parameter
QFile is a QObject. QObjects cannot be copied for a reason. Passing by value means copying. So you must either pass by reference or pass a pointer.