Doppelte Importe

Diese Warnkategorie wird von qmllint mit [duplicate-import] angegeben.

Doppelter Import

Was ist passiert?

Das Dokument enthält doppelte Importanweisungen.

Warum ist das schlecht?

Sie verschmutzen das Dokument unnötig und können den Start der Anwendung verlangsamen.

Beispiel

import QtQuick.Controls
import QtQuick
import QtQuick 2.1 as QQ21
import QtQuick.Controls

Item {

}

Um diese Warnung zu beheben, entfernen Sie alle doppelten Importe bis auf den letzten. Achten Sie darauf, dass Sie die Reihenfolge der Importe nicht ändern, da dies die Typauflösung beeinflussen kann:

import QtQuick
import QtQuick 2.1 as QQ21 // different from the previous import
import QtQuick.Controls

Item {

}

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