QFileInfo fileInfo("example.txt"); if (fileInfo.exists()) { qDebug() << "File exists!"; } else { qDebug() << "File not found!"; }
QFileInfo fileInfo("example.txt"); qint64 size = fileInfo.size(); qDebug() << "File size:" << size << "bytes";
QFileInfo fileInfo("example_dir"); if (fileInfo.isDir()) { qDebug() << "This is a directory"; } else { qDebug() << "This is not a directory"; }The package library for QFileInfo is the Qt library.