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

[Reg 5.15 -> 6.0] qmllint: Property "length" not found on type "QString"

    XMLWordPrintable

Details

    • b28c8c87ec84dccc156603f8479fd0a8a06bc46c (qt/qtdeclarative/dev) 62400a6278f5f36e231f89d86e3d036f4c9e457c (qt/qtdeclarative/6.1.2)

    Description

      I build qtdeclarative from 76a7c93f9b860e2f6fde2198edde19a5d704a97f .

      For code below qmllint produces warning:

      $ /usr/local/qt6_tools/bin/qmllint Test.qml 
      Warning: Test.qml:7:48: Property "length" not found on type "QString"
              console.log("text.length", textInput.text.length);
      

      qml Test.qml works just fine, and print resulted length, so this is valid QML code.

      Not sure what error is, no special handling for "QString", or that qmllint can not understand that in JavaScript it has type "string". As I see for "string" there is special handling for "length" property.

      import QtQuick 2.15
      
      TextInput {
          id: textInput
      
          Component.onCompleted: {
              console.log("text.length", textInput.text.length);
          }
      }
      
      

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: