Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QQmlFile Class Reference

\inmodule QtQml More...

#include <qqmlfile.h>

Collaboration diagram for QQmlFile:

Static Public Member Functions

static bool isSynchronous (const QString &url)
static bool isSynchronous (const QUrl &url)
static bool isLocalFile (const QString &url)
 Returns true if url is a local file that can be opened with \l{QFile}.
static bool isLocalFile (const QUrl &url)
 Returns true if url is a local file that can be opened with \l{QFile}.
static QString urlToLocalFileOrQrc (const QString &)
 If url is a local file returns a path suitable for passing to \l{QFile}.
static QString urlToLocalFileOrQrc (const QUrl &)
 If url is a local file returns a path suitable for passing to \l{QFile}.

Detailed Description

\inmodule QtQml

Since
5.0

The QQmlFile class provides static utility methods to categorize URLs.

QQmlFile provides some static utility methods to categorize URLs and file names the way \l{QQmlEngine} does when loading content from them.

Definition at line 18 of file qqmlfile.h.

Member Function Documentation

◆ isLocalFile() [1/2]

bool QQmlFile::isLocalFile ( const QString & url)
static

Returns true if url is a local file that can be opened with \l{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.

Definition at line 665 of file qqmlfile.cpp.

◆ isLocalFile() [2/2]

bool QQmlFile::isLocalFile ( const QUrl & url)
static

Returns true if url is a local file that can be opened with \l{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.

Definition at line 584 of file qqmlfile.cpp.

◆ isSynchronous() [1/2]

bool QQmlFile::isSynchronous ( const QString & url)
static

Returns true if QQmlFile will open url synchronously. Otherwise returns false. Synchronous urls have a {qrc:} or {file:} scheme.

Note
On Android, urls with {assets:} or {content:} scheme are also considered synchronous.

Definition at line 529 of file qqmlfile.cpp.

◆ isSynchronous() [2/2]

bool QQmlFile::isSynchronous ( const QUrl & url)
static

Returns true if QQmlFile will open url synchronously. Otherwise returns false. Synchronous urls have a {qrc:} or {file:} scheme.

Note
On Android, urls with {assets:} or {content:} scheme are also considered synchronous.

Definition at line 499 of file qqmlfile.cpp.

◆ urlToLocalFileOrQrc() [1/2]

QString QQmlFile::urlToLocalFileOrQrc ( const QString & url)
static

If url is a local file returns a path suitable for passing to \l{QFile}.

Otherwise returns an empty string.

See also
isLocalFile

Definition at line 763 of file qqmlfile.cpp.

◆ urlToLocalFileOrQrc() [2/2]

QString QQmlFile::urlToLocalFileOrQrc ( const QUrl & url)
static

If url is a local file returns a path suitable for passing to \l{QFile}.

Otherwise returns an empty string.

See also
isLocalFile

Definition at line 709 of file qqmlfile.cpp.


The documentation for this class was generated from the following files: