このページでは

Shadow

この警告カテゴリは、qmllint では「[shadow] 」と表記されます。

シグナルまたはメソッドが基底型にすでに存在します

何が起きたのですか?

現在のコンポーネント内のメンバーが、基底クラスのシグナルまたはメソッドと同じ名前を持っています。

他のプロパティをシャドウするプロパティについては、「Property override」カテゴリで扱われることに注意してください。

なぜ問題なのでしょうか?

シャドーイングされたシグナルやメソッドは、もはや使用できなくなります。これにより、コードの可読性が低下し、混乱を招く恐れがあります。

例

import QtQuick

Item {
    component Base: Item { signal f(); }
    Base {
        property int f: 42
    }
}

この警告を解消するには、シグナル「f 」または、これをシャドウイングしているプロパティ「int 」の名前を変更してください。

import QtQuick

Item {
    component Base: Item { signal f(); }
    Base {
        property int notF: 42
    }
}

© 2026 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.