개체의 속성으로 싱글톤에 액세스할 수 없습니다.
객체를 통해 싱글톤에 액세스
무슨 일이 있었나요?
네임스페이스에서 첨부된 속성에 액세스하는 구문을 사용하여 싱글톤에 액세스했습니다.
이것이 왜 나쁜가요?
싱글톤은 이러한 방식으로 액세스할 수 없습니다. 표현식이 정의되지 않은 것으로 평가됩니다.
예제
import QtQml import QtQuick as QQ QtObject { id: root // Cannot access singleton as a property of an object. Did you want to access an attached object? property var singletonAccess: root.QQ.Application.platform }
이 경고를 해결하려면 싱글톤을 사용하려는 경우 네임스페이스 앞에 id
또는 속성을 제거하세요. 또는 첨부된 속성에 액세스하려는 경우 오타가 있는지 확인하세요.
© 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.