In questa pagina

Importazioni non utilizzate

Questa categoria di avvisi viene indicata da qmllint come " [unused-imports] ".

Importazione non utilizzata

Cosa è successo?

È stata utilizzata un'istruzione di importazione per importare un modulo QML, ma non è stato utilizzato nessuno dei suoi tipi.

Perché è un problema?

L'istruzione di importazione indica una dipendenza da un modulo QML che in realtà non è necessario. Ciò influisce sulla leggibilità del codice e sulle prestazioni del motore QML e degli strumenti, costringendoli a elaborare un modulo QML superfluo.

Esempio

import QtQuick
import QtQuick.Controls

Item {}

Per risolvere questo avviso, rimuovi l'importazione inutilizzata:

import QtQuick

Item {}

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