코드 스타일 지정
파일의 MIME 유형에 따라 파일이 열리는 모드와 편집기가 결정됩니다. Qt Creator 는 C++ 코드 편집기에서는 Edit 모드에서 C++ 파일을, Qt Quick 편집기에서는 QML 파일을 엽니다.
들여쓰기 지정
- C++ 파일
- QML 파일
- Nim 파일
코드 스타일을 전역적으로 또는 각 프로젝트에 대해 개별적으로 지정합니다. 여러 세트의 코드 스타일 설정을 지정하고 그 사이를 쉽게 전환할 수 있습니다. 또한 코드 스타일 설정을 가져오거나 내보낼 수 있습니다.
현재 프로젝트의 글로벌 코드 스타일을 재정의하려면 다음과 같이 하세요:
- Projects > Project Settings > Code Style 로 이동합니다.

- Language 에서 C++, Qt Quick또는 Nim 을 선택합니다.
- C++의 경우
.clang-format파일을 프로젝트에 사용하려면 Use global settings 의 선택을 취소합니다. - 프로젝트의
.clang-format파일을 재정의하려면 Use custom settings 을 선택합니다. - Custom settings 에서 프로젝트에 사용할 설정을 선택합니다.
드물지만 ClangFormat이 코드 구조에 걸려 Qt Creator 크래시를 유발할 수 있습니다. 프로젝트에서 이 문제가 발생하면 Formatting mode 에서 Use Built-In Indenter 을 선택하여 프로젝트에 대한 ClangFormat을 해제하세요. 충돌을 재현할 수 있는 경우 Help > Report Bug 으로 이동하여 버그를 신고하고 충돌을 유발하는 코드를 버그 신고에 첨부하세요.
텍스트 또는 코드 들여쓰기, MIME 유형 편집, C++ 코드 스타일, Qt Quick 코드 스타일 지정 및 Nim도참조하세요 .
Copyright © The Qt Company Ltd. and other contributors. 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.