StandardPaths QML Type

표준 시스템 경로에 대한 액세스를 제공합니다. 더 보기...

Import Statement: import Qt.labs.platform
Inherits:

QtObject

Status: Deprecated since 6.4

이 유형은 Qt.labs.platform 6.4부터 더 이상 사용되지 않습니다. 새 코드에서 사용하지 않는 것이 좋습니다.

메서드

자세한 설명

대신 QtCore::StandardPaths를 사용하십시오.

StandardPaths 싱글톤 유형은 표준 시스템 경로를 쿼리하는 메서드를 제공합니다. 표준 경로는 주로 FileDialogFolderDialog 유형과 함께 사용할 때 유용합니다.

FileDialog {
    folder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
}

참고: Qt.labs 모듈의 타입은 향후 버전에서 호환성을 보장하지 않습니다.

QtCore::StandardPaths, FileDialog, FolderDialog, QStandardPaths참조하세요 .

메서드 문서

string displayName(StandardLocation type)

지정된 위치의 지역화된 표시 이름 type 또는 관련 위치를 찾을 수 없는 경우 빈 QString 을 반환합니다.

QStandardPaths::displayName()도 참조하세요 .


url findExecutable(string executableName, list<string> paths)

지정된 paths 또는 paths 가 비어 있는 경우 시스템 경로에서 executableName 라는 이름의 실행 파일을 찾습니다.

대부분의 운영 체제에서 시스템 경로는 PATH 환경 변수에 의해 결정됩니다. 실행 파일을 검색할 디렉터리는 경로 인수로 설정할 수 있습니다. 사용자 경로와 시스템 경로 모두에서 검색하려면 경로가 설정된 상태에서 한 번, 경로가 비어 있는 상태에서 한 번씩 findExecutable을 두 번 호출합니다. 심볼릭 링크는 호출되는 이름에 따라 동작이 달라지는 실행 파일의 경우 동작을 보존하기 위해 확인되지 않습니다.

참고: Windows에서는 일반적인 실행 파일 확장자(PATHEXT 환경 변수에서)가 자동으로 추가됩니다. 예를 들어, findExecutable("foo") 호출은 foo.exe 또는 foo.bat (있는 경우)을 찾습니다.

실행 파일의 절대 파일 경로를 반환하거나 찾을 수 없는 경우 빈 문자열을 반환합니다.

주어진 executableName 이 실행 파일을 가리키는 절대 경로인 경우 깨끗한 경로가 반환됩니다.

QStandardPaths::findExecutable()도 참조하세요 .


url locate(StandardLocation type, string fileName, LocateOptions options)

type 의 표준 위치에서 fileName 라는 파일 또는 디렉터리를 찾습니다.

options 플래그를 사용하면 파일 또는 디렉터리를 찾을지 여부를 지정할 수 있습니다. 기본적으로 이 플래그는 LocateFile 로 설정되어 있습니다.

처음 찾은 파일 또는 디렉터리의 절대 경로를 반환하고, 그렇지 않으면 빈 문자열을 반환합니다.

QStandardPaths::locate()도 참조하세요 .


list<url> locateAll(StandardLocation type, string fileName, LocateOptions options)

type 의 표준 위치에서 fileName 이라는 이름의 모든 파일 또는 디렉터리를 찾습니다.

options 플래그를 사용하면 파일 또는 디렉터리를 찾을지 여부를 지정할 수 있습니다. 기본적으로 이 플래그는 LocateFile 로 설정되어 있습니다.

찾은 모든 파일 목록을 반환합니다.

QStandardPaths::locateAll()도 참조하세요 .


void setTestModeEnabled(bool testMode)

testModetrue 인 경우 QStandardPaths 에서 쓰기 가능한 위치를 테스트 디렉터리를 가리키도록 변경하는 특수 "테스트 모드"가 활성화됩니다. 이렇게 하면 자동 테스트가 현재 사용자의 구성을 읽거나 쓰지 못하게 됩니다.

테스트 프로그램이 파일을 쓸 수 있는 위치에 영향을 줍니다: GenericDataLocation, AppDataLocation, ConfigLocation, GenericConfigLocation, AppConfigLocation, StateLocation, GenericStateLocation, GenericCacheLocation, CacheLocation. 다른 위치는 영향을 받지 않습니다.

Unix의 경우 XDG_DATA_HOME~/.qttest/share, XDG_CONFIG_HOME~/.qttest/config, XDG_STATE_HOME~/.qttest/state, XDG_CACHE_HOME~/.qttest/cache 로 설정됩니다.

macOS에서는 데이터는 ~/.qttest/Application Support, 캐시는 ~/.qttest/Cache, 구성은 ~/.qttest/Preferences 으로 이동합니다.

Windows에서는 모든 것이 %APPDATA% 아래의 "qttest" 디렉토리로 이동합니다.

QStandardPaths::setTestModeEnabled()도 참조하세요 .


list<url> standardLocations(StandardLocation type)

type 의 파일이 속한 모든 디렉터리를 반환합니다.

디렉터리 목록은 확인 가능한 경우 writableLocation()부터 시작하여 우선순위가 높은 것부터 낮은 것까지 정렬됩니다. 유형에 대한 위치가 정의되지 않은 경우 이 목록은 비어 있습니다.

QStandardPaths::standardLocations()도 참조하세요 .


url writableLocation(StandardLocation type)

type 파일이 기록되어야 하는 디렉터리를 반환하거나 위치를 확인할 수 없는 경우 빈 문자열을 반환합니다.

참고: 반환된 저장소 위치는 존재하지 않을 수도 있습니다. 즉, 시스템이나 사용자가 만들어야 할 수도 있습니다.

QStandardPaths::writableLocation()도 참조하세요 .


© 2025 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.