A file URL wrapper with optional filesystem change watching. More...
| Import Statement: | import org.shotcut.qml |
Use File in filter panels to manage paths to auxiliary files (e.g. LUT files, preset data files). Set url and call watch() to receive fileChanged notifications when the file is modified externally.
File { id: lutFile url: filter.get("av.file") onFileChanged: filter.set("av.file", path) }
fileName : string |
The base file name without the directory path (e.g. "lut.cube").
filePath : string |
The full local filesystem path (e.g. "/home/user/lut.cube").
path : string |
The directory path portion of the URL (without the file name).
url : string |
The file URL as a string (e.g. "file:///home/user/lut.cube"). Setting this property stops watching any previously watched file.
fileChanged(string path) |
Emitted when the watched file is modified or deleted externally. path is the full file system path. Connect a file watcher by calling watch() first.
Note: The corresponding handler is onFileChanged.
urlChanged(url url) |
Emitted when url changes. url is the new URL value.
Note: The corresponding handler is onUrlChanged.
copyFromFile(string source) |
Copies the file at source to the path described by url.
bool exists() |
Returns true if the file at url exists on the filesystem.
string suffix() |
Returns the file extension without the leading dot (e.g. "cube").
watch() |
Begins watching the file at url for external changes. When the file is modified or deleted, fileChanged is emitted.