I'm not sure about QFile's behavior,
bool Class::Function (const QString & name)
{
QFile fp (name);
if (fp.open (QIODevice::ReadOnly))
{
// read file
return false;
}
return true;
}
Hmm, it's not like a FILE* pointer in C (which you must close and free), would this be a problem if I don't call QFile::close() (Does it do automatically on destruction) ?
QFile
object is closed automatically (Qt documentation) upon its destructor; hence there is no need to call close()
explicitly.