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

qmlsc fails to detect import usage

    XMLWordPrintable

Details

    • 8f60ffc42 (dev), aafe206c4 (6.5)

    Description

      Code (Toolbar.qml) from https://doc-snapshots.qt.io/qt6-6.5/qtquickcontrols-attachedstyleproperties-example.html

      // Copyright (C) 2022 The Qt Company Ltd.
      // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
      
      import QtQuick
      import QtQuick.Templates as T
      
      import MyStyle
      
      T.ToolBar {
          id: control
      
          implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
                                  contentWidth + leftPadding + rightPadding)
          implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
                                   contentHeight + topPadding + bottomPadding)
      
          background: Rectangle {
              implicitHeight: 40
              // Ensure that we use Control's attached MyStyle object by qualifying
              // the binding with its id. If we don't do this, an extra, unnecessary
              // attached MyStyle object will be created for the Rectangle.
              color: control.MyStyle.toolBarColor
          }
      }
      

       

      Wrong Warning

      Info: ToolBar.qml:7:1: Unused import [unused-imports]
      import MyStyle
      ^^^^^^
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ulherman Ulf Hermann
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes