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

qmllint: False positive for required property

    XMLWordPrintable

Details

    • All
    • daf57e29d (dev), 43e2c4871 (6.9), a31d1762c (6.8), db2b388a0 (tqtc/lts-6.5)

    Description

      Additionally to the code in the description I also attached the project: RequiredLintTest.zip

      This looks like a false positive for me because Usage.qml already set the required property. But additionally there is a property alias to be able to optionally change the value from outside. This leads to a wrong requirement in Main.qml.

      Output from qmllint:

      [RequiredLintTest]$ ~/Dokumente/toolchain-linux/dist/bin/qmllint Main.qml
      Warning: Main.qml:9:2: Component is missing required property propTest from Usage [required]
      	Usage {
      	^^^^^
      

      Base.qml:

      import QtQuick
      
      Item {
      	required property int myProp
      }
      

      Usage.qml:

      import QtQuick
      
      Item {
      	property alias propTest: subItem.myProp
      
      	Base {
      		id: subItem
      
      		myProp: 42
      	}
      }
      

      Main.qml:

      import QtQuick
      
      Window {
      	height: 480
      	title: qsTr("Hello World")
      	visible: true
      	width: 640
      
      	Usage {
      	}
      }
      

      Attachments

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

        Activity

          People

            olivier.decanniere Olivier De Cannière
            larss Lars Schmertmann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: