이 페이지에서

QQmlFile Class

QQmlFile 클래스는 URL을 분류하는 데 사용할 수 있는 정적 유틸리티 메서드를 제공합니다. 더 보기...

헤더: #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은 QQmlEngine 가 URL 및 파일 이름에서 콘텐츠를 불러올 때와 같은 방식으로 URL과 파일 이름을 분류하는 데 사용되는 몇 가지 정적 유틸리티 메서드를 제공합니다.

멤버 함수 문서

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

url 가 QFile 로 열 수 있는 로컬 파일인 경우 true 를 반환합니다. 그렇지 않은 경우 false 를 반환합니다. 로컬 파일 URL은 qrc: 또는 file: 스킴을 사용합니다.

참고: Android에서는 assets: 또는 content: 스키마를 사용하는 URL도 로컬 파일로 간주됩니다.

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

url 가 QFile 로 열 수 있는 로컬 파일인 경우 true 을 반환합니다. 그렇지 않은 경우 false 을 반환합니다. 로컬 파일 URL은 qrc: 또는 file: 스키마를 사용합니다.

참고: Android에서는 assets: 또는 content: 스키마를 가진 URL도 로컬 파일로 간주됩니다.

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

url 가 로컬 파일인 경우, QFile 에 전달하기에 적합한 경로를 반환합니다. 그렇지 않은 경우 빈 문자열을 반환합니다.

isLocalFile도 참조하십시오 .

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

url 가 로컬 파일인 경우, QFile 에 전달하기에 적합한 경로를 반환합니다. 그렇지 않은 경우 빈 문자열을 반환합니다.

isLocalFile도 참조하십시오 .

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.