Auf dieser Seite

Doppelte Importe

Diese Warnkategorie wird von qmllint als „ [duplicate-import] “ bezeichnet.

Doppelte Importe

Was ist passiert?

Das Dokument enthält doppelte Import-Anweisungen.

Warum ist das schlecht?

Sie überladen das Dokument unnötig und können den Start der App 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 Import-Anweisungen bis auf die letzte. Achten Sie darauf, die Reihenfolge der Importe nicht zu ändern, da dies die Typauflösung beeinträchtigen kann:

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

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.