QML 글로벌 객체
QML JavaScript 호스트 환경은 다음과 같은 호스트 객체와 함수를 구현합니다. 이러한 객체와 함수는 기본 제공되므로 추가 임포트 없이 QML에 로드된 모든 JavaScript 코드에서 사용할 수 있습니다:
- Qt object: QML 환경에 특정한 헬퍼 메서드와 프로퍼티를 제공하는 QML 객체입니다.
- qsTr(), qsTranslate(), qsTrId(), QT_TR_NOOP()(), QT_TRANSLATE_NOOP(), QT_TRID_NOOP() 함수: QML 환경에서 문자열과 문자열 리터럴을 변환할 수 있는 QML 함수입니다.
- gc() 함수: 가비지 컬렉션을 수동으로 트리거하는 QML 함수.
- print() 함수: 출력을 콘솔에 인쇄하는 QML 함수입니다.
- 콘솔 객체: FireBug 콘솔 API의 하위 집합을 구현합니다.
- XMLHttpRequest, DOMException: W3C XMLHttpRequest 사양의 하위 집합을 구현합니다.
참고: globalObject() 함수를 사용하여 QQmlEngine 의 전역 객체를 변경할 수 없습니다. 자세한 내용은 자바스크립트 환경 제한을 참조하세요.
© 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.