PySide6.QtQml.QQmlFile¶
- class QQmlFile¶
QQmlFile
类提供了静态实用方法来对URL进行分类。更多…概要¶
方法¶
def
__init__()
def
clear()
def
data()
def
dataByteArray()
def
error()
def
isError()
def
isLoading()
def
isNull()
def
isReady()
def
load()
def
size()
def
status()
def
url()
静态函数¶
def
isLocalFile()
def
isSynchronous()
注意
本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。
详细描述¶
QQmlFile
提供了一些静态实用方法,用于按照QQmlEngine
从内容加载时的方式对URL和文件名进行分类。- class Status¶
- __init__()¶
- __init__(engine, url)
- Parameters:
engine –
QQmlEngine
url – str
- __init__(engine, url)
- Parameters:
engine –
QQmlEngine
url –
QUrl
- clear()¶
- clear(object)
- Parameters:
对象 –
QObject
- connectDownloadProgress(arg__1, arg__2)
- Parameters:
arg__1 –
QObject
arg__2 – 整数
- Return type:
布尔
- connectFinished(arg__1, arg__2)
- Parameters:
arg__1 –
QObject
arg__2 – 整数
- Return type:
布尔
- data()¶
- Return type:
字符串
- dataByteArray()¶
- Return type:
- error()¶
- Return type:
字符串
- isError()¶
- Return type:
布尔
- isLoading()¶
- Return type:
布尔
- static isLocalFile(url)¶
- Parameters:
url – str
- Return type:
布尔
如果
url
是一个可以用 QFile 打开的本地文件,则返回true
。否则返回false
。本地文件的 URL 具有qrc:
或file:
方案。注意
在Android上,带有
assets:
或content:
方案的URL也被视为本地文件。- static isLocalFile(url)
- Parameters:
url –
QUrl
- Return type:
布尔
如果
url
是一个可以用 QFile 打开的本地文件,则返回true
。否则返回false
。本地文件的 URL 具有qrc:
或file:
方案。注意
在Android上,带有
assets:
或content:
方案的URL也被视为本地文件。- isNull()¶
- Return type:
布尔
- isReady()¶
- Return type:
布尔
- static isSynchronous(url)¶
- Parameters:
url – str
- Return type:
布尔
- static isSynchronous(url)
- Parameters:
url –
QUrl
- Return type:
布尔
- load(arg__1, arg__2)¶
- Parameters:
arg__1 –
QQmlEngine
arg__2 – 字符串
- load(arg__1, arg__2)
- Parameters:
arg__1 –
QQmlEngine
arg__2 –
QUrl
- size()¶
- Return type:
整数
- static urlToLocalFileOrQrc(url)¶
- Parameters:
url – str
- Return type:
字符串
如果
url
是本地文件,则返回适合传递给 QFile 的路径。否则返回空字符串。另请参阅
- static urlToLocalFileOrQrc(url)
- Parameters:
url –
QUrl
- Return type:
字符串
如果
url
是本地文件,则返回适合传递给 QFile 的路径。否则返回空字符串。另请参阅