QFileInfo provides information about files. Information includes name, path, access rights, size, and dates. QFileInfo can also get resource info. A path can be relative or absolute. The absolute path...
QFileInfo provides information about files. Information includes name, path, access rights, size, and dates. QFileInfo can also get resource info. A path can be relative or absolute. The absolute path begins with “/”. Dates are returned by created(), lastModified() and lastRead(). Permissions are obtained with isReadable(), isWritable(), and isExecutable().
Sometimes you need the path, name, and extension separately. Use QFileInfo for this. The file name parts are extracted with baseName() and extension(). Dates and permissions are obtained like mentioned before.
Trailing separators can be appended to file names if desired. The files downloaded can have their extensions renamed. Get the path without the extension using QFileInfo. Then append the desired new extension.
QFileDialog filters allow setting allowed extensions. But the path may not include an extension when entered without one. Check if the path contains the extension. If not, append it. This forces the desired extension.
Use QFileDialog filters to limit selectable file types. For example, only image files can be opened by allowing just image extensions. Similarly, restrict to specific extensions as needed.
QuickTime movie files use the .QT extension. To open, go to file menu in Finder. Choose “Open With”. Then pick QuickTime Player from the apps. Other QT tools allow editing and converting.