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

qmllint rejects enumeration types

    XMLWordPrintable

Details

    Description

      When running qmllint on a file that contains an enumeration type as shown in the documentation, it outputs the following error:

      qml/test.qml:5 : Unexpected token `reserved word'
      qml/test.qml:6 : Expected token `:'
      

      test.qml

      import QtQuick 2.9
      import QtQuick.Controls 2.2
      
      ApplicationWindow {
          enum ThisIsAnEnum {
              Foo,
              Bar
          }
      }
      

      Steps to reproduce

      • Run the python:3.6 Docker container bash, with access to test.qml
      • Run
        apt-get update
        
      • Run
        apt-get install -y qt5-default qtdeclarative5-dev-tools libsdl2-2.0
        
      • Run
        qmllint <path-to-file>/test.qml

         

      Documentation on the enumeration type: https://doc.qt.io/qt-5/qtqml-syntax-objectattributes.html#enumeration-attributes

      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:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes