FolderDialog QML Type
기본 폴더 대화상자입니다. 자세히...
Import Statement: | import Qt.labs.platform |
Inherits: |
속성
- acceptLabel : string
- currentFolder : url
- folder : url
- options : flags
- rejectLabel : string
상세 설명
FolderDialog 유형은 네이티브 플랫폼 폴더 대화 상자를 위한 QML API를 제공합니다.
폴더 대화 상자를 표시하려면 FolderDialog의 인스턴스를 만들고 원하는 속성을 설정한 다음 open()를 호출합니다. currentFolder 속성은 대화 상자에서 현재 선택된 폴더를 확인하는 데 사용할 수 있습니다. folder 속성은 대화 상자를 수락하여 최종 선택이 이루어진 후에만 업데이트됩니다.
MenuItem { text: "Open..." onTriggered: folderDialog.open() } FolderDialog { id: folderDialog currentFolder: viewer.folder folder: StandardPaths.standardLocations(StandardPaths.PicturesLocation)[0] } MyViewer { id: viewer folder: folderDialog.folder }
사용 가능성
현재 다음 플랫폼에서 기본 플랫폼 폴더 대화 상자를 사용할 수 있습니다:
- Android
- iOS
- Linux(GTK+ 플랫폼 테마로 실행하는 경우)
- macOS
- Windows
Qt Labs Platform 모듈은 기본 구현을 사용할 수 없는 플랫폼에서 Qt Widgets 을 대체로 사용합니다. 따라서 Qt Labs Platform 모듈의 유형을 사용하는 애플리케이션은 QtWidgets에 링크하고 QGuiApplication 대신 QApplication 을 사용해야 합니다.
QtWidgets 라이브러리에 링크하려면 qmake 프로젝트 파일에 다음을 추가합니다:
QT += widgets
main()
에 QApplication 의 인스턴스를 생성합니다:
#include <QApplication> #include <QQmlApplicationEngine> int main(int argc, char *argv[]) { QApplication app(argc, argv); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); return app.exec(); }
참고: Qt.labs 모듈의 유형은 향후 버전에서 호환성을 보장하지 않습니다.
FileDialog 및 StandardPaths 을참조하세요 .
속성 문서
acceptLabel : string |
이 속성은 대화 상자를 수락하는 버튼에 표시되는 레이블 텍스트를 저장합니다.
빈 문자열로 설정하면 기본 플랫폼의 기본 레이블이 사용됩니다. 기본 레이블은 일반적으로 Open 입니다.
기본값은 빈 문자열입니다.
rejectLabel 를참조하세요 .
currentFolder : url |
folder : url |
이 속성은 최종적으로 허용된 폴더를 보유합니다.
currentFolder 속성과 달리 folder
속성은 사용자가 대화 상자에서 폴더를 선택하는 동안에는 업데이트되지 않고 최종 선택이 완료된 후에만 업데이트됩니다. 즉, 사용자가 OK 을 클릭하여 폴더를 수락한 경우에만 업데이트됩니다. 또는 accepted() 신호를 처리하여 최종 선택을 가져올 수도 있습니다.
currentFolder 및 accepted()도 참조하세요 .
options : flags |
이 속성에는 대화 상자의 모양과 느낌에 영향을 주는 다양한 옵션이 있습니다.
기본적으로 모든 옵션은 비활성화되어 있습니다.
대화 상자를 표시하기 전에 옵션을 설정해야 합니다. 대화 상자가 표시된 상태에서 옵션을 설정해도 옵션 및 플랫폼에 따라 대화 상자에 즉각적인 영향을 미치지는 않습니다.
사용 가능한 옵션
상수 | 설명 |
---|---|
FolderDialog.ShowDirsOnly | 폴더 대화 상자에 디렉터리만 표시합니다. 기본적으로 폴더와 디렉터리가 모두 표시됩니다. |
FolderDialog.DontResolveSymlinks | 폴더 대화 상자에서 심볼릭 링크를 확인하지 않습니다. 기본적으로 심볼 링크가 확인됩니다. |
FolderDialog.ReadOnly | 대화 상자에서 디렉터리 생성을 허용하지 않음을 나타냅니다. |
rejectLabel : string |
이 속성은 대화 상자를 거부하는 버튼에 표시되는 레이블 텍스트를 보유합니다.
빈 문자열로 설정하면 기본 플랫폼의 기본 레이블이 사용됩니다. 기본 레이블은 일반적으로 Cancel 입니다.
기본값은 빈 문자열입니다.
acceptLabel 를참조하세요 .
© 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.