The QQmlFile class provides static utility methods to categorize URLs. More...
| Header: | #include <QQmlFile> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Qml)target_link_libraries(mytarget PRIVATE Qt6::Qml) |
| qmake: | QT += qml |
| bool | isLocalFile(const QString &url) |
| bool | isLocalFile(const QUrl &url) |
| QString | urlToLocalFileOrQrc(const QString &url) |
| QString | urlToLocalFileOrQrc(const QUrl &url) |
QQmlFile provides some static utility methods to categorize URLs and file names the way QQmlEngine does when loading content from them.
[static] bool QQmlFile::isLocalFile(const QString &url)Returns true if url is a local file that can be opened with QFile. Otherwise returns false. Local file urls have
either a qrc: or file: scheme.
Note: On Android, urls with assets: or content: scheme are also considered local files.
[static] bool QQmlFile::isLocalFile(const QUrl &url)Returns true if url is a local file that can be opened with QFile. Otherwise returns false. Local file urls have
either a qrc: or file: scheme.
Note: On Android, urls with assets: or content: scheme are also considered local files.
[static] QString QQmlFile::urlToLocalFileOrQrc(const QString &url)If url is a local file returns a path suitable for passing to QFile. Otherwise returns an empty string.
See also isLocalFile.
[static] QString QQmlFile::urlToLocalFileOrQrc(const QUrl &url)If url is a local file returns a path suitable for passing to QFile. Otherwise returns an empty string.
See also isLocalFile.
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: