Nesta página

Shadow

Essa categoria de aviso é denominada “ [shadow] ” pelo qmllint.

O sinal ou método já existe no tipo base

O que aconteceu?

Um membro no componente atual tem o mesmo nome que um sinal ou método de uma classe base.

Observe que propriedades que ocultam outras propriedades são tratadas pela categoria “Substituição de propriedade ”.

Por que isso é ruim?

O sinal ou método ofuscado não pode mais ser usado. Isso torna o código mais difícil de ler e pode causar confusão.

Exemplo

import QtQuick

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

Para corrigir esse aviso, renomeie o sinal ` f ` ou a propriedade ` int ` que o está ofuscando.

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.