QFile is the class that does data I/O.
If you only need a reference to the file use either QString or QFileInfo.
If you need the file, e.g. when you function does more than just create the instance, then return a smart pointer
QSharedPointer<QFile> MyClass:getFile()
{
// ....
QSharedPointer<QFile>
file(new QFile(filename
);
file->open(...); // or other tasks with file
return file;
}
QSharedPointer<QFile> MyClass:getFile()
{
// ....
QSharedPointer<QFile> file(new QFile(filename);
file->open(...); // or other tasks with file
return file;
}
To copy to clipboard, switch view to plain text mode
Cheers,
_
Bookmarks