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

qmllint: Tumbler: attached properties of Tumbler must be accessed through a delegate item

    XMLWordPrintable

Details

    • 7424756626 (qt/qtdeclarative/dev) 7424756626 (qt/tqtc-qtdeclarative/dev)

    Description

      For inline "delegate" in "Tumbler" qmllint (recent dev) reports nothing:

      import QtQuick.Controls 2.15
      import QtQuick 2.15
      
      Tumbler { 
        delegate: Text {
           readonly property real angelVal: Tumbler.displacement / (Tumbler.tumbler.visibleItemCount / 2)
        }
      }
      

      but if I move property definition to TumblerDelegate.qml:

      import QtQuick 2.15
      
      Text {                                                                                                                                                                            
          id: delegate                                                                                                                                                                                                                                                                                                                                                    
          readonly property real angelVal: Tumbler.displacement / (Tumbler.tumbler.visibleItemCount / 2)
      }
      

      then qmllint reports warning:

      Tumbler: attached properties of Tumbler must be accessed through a delegate item                                                                                                                                                                           
          readonly property real angelVal: Tumbler.displacement / (Tumbler.tumbler.visibleItemCount / 2)                                                                                
                                                                           ^^^^^^^                         
      

      but attached properties works in both cases without any problem,
      so I suppose this is qmllint related issue.

      Attachments

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

        Activity

          People

            qtqmlteam Qt Qml Team User
            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