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

qmllint required semicolon when changing variable declaration to `let`

    XMLWordPrintable

Details

    • Windows

    Description

      I changed a line of code that defines a regular expression to declare a variable with `let` instead of `var`, and qmllint caused the build to fail. After changing it back to `var`, the build succeeded. In both cases, the code ran fine and didn't throw any errors when I tested it.

       

      Using a linux docker in Bitbucket Pipelines, the following was run to install qmllint and test the codebase:

       

      apt-get install -y qt5-default qtdeclarative5-dev-tools
      find -type f -name \*qml -exec qmllint \{\} +
      

      Here was the output:

      ./qml/GControls/GSpinBox11.qml:68 : Expected token `;'

       

      Here's the code that caused the problem (used inside a SpinBox):

      validator: RegExpValidator {
          regExp: {
              let expression = "\\d+"
      

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            ben.green Benjamin Green
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes