Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-92449

qmllint: "unused import" lint don't care about "required" types

    XMLWordPrintable

Details

    • 8ac9a3f80d7491674097227a8b228b9d894a2de3 (qt/qtdeclarative/dev)

    Description

      For code below, qmlint reports that

      Info: Test2.qml:2:1: Unused import at Test2.qml:2:1
      
      import QtQuick.Controls 2.15
      ^^^^^^
      

      But this is not true, usage of "ApplicationWindow" type requires "QtQuick.Controls" import.
      And if line "import QtQuick.Controls 2.15" is removed, then during start of program I got: "ApplicationWindow is not a type" and load of suitable qml file failed.

      import QtQuick 2.15
      import QtQuick.Controls 2.15
      
      Item {
         required property ApplicationWindow applicationWindow
      }
      

      Attachments

        For Gerrit Dashboard: QTBUG-92449
        # Subject Branch Project Status CR V

        Activity

          People

            ulherman Ulf Hermann
            evgeniy_dushistov evgeniy_dushistov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes