enum エントリの欠落
この警告カテゴリのスペルは[missing-enum-entry]
です。
enum のエントリではありません。
何が起こりましたか?
存在しない enum 値を使用しました。
なぜ悪いのですか?
enum値は実行時に未定義になります。
例
// Main.qml import QtQuick Item { enum Hello { World } Component.onCompleted: function() { console.log(Main.Hello.Wordl, Main.Hello.Moon) // both Wordl and Moon are incorrect } }
この警告を修正するには、潜在的なタイプミスを修正するか、欠落している列挙値を定義に追加してください:
// Main.qml import QtQuick Item { enum Hello { World, Moon } Component.onCompleted: function() { console.log(Main.Hello.World, Main.Hello.Moon) // both correct now } }
© 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.