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

"ReferenceError: lowercaseTypeName is not defined" for value types

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • 6.6.0 Beta1
    • 6.3
    • QML: Compiler
    • None
    • Windows
    • 05f56d7c78754855c643470ad4e8dfd35c96f927

    Description

      I'm unable to use Q_GADGET + QML_VALUE_TYPE to declare a type with and enum exported to QML. At runtime I get this warning:
      ReferenceError: lowercaseTypeName is not defined for value types

      C++ code:
      struct LowercaseTypeName
      {{{}}
          Q_GADGET
          QML_VALUE_TYPE(lowercaseTypeName)

          enum Foo
          {
              BAR1,
              BAR2
          };
          Q_ENUM(Foo)
      };

      QML code:
      property int value: 0
      property bool is_bar1: value === lowercaseTypeName.BAR1

      If I use QML_ELEMENT + QML_UNCREATABLE instead of QML_VALUE_TYPE then I get a different warning:
      value type names should begin with a lowercase letter

      Inheriting from QObject and using Q_OBJECT works OK.

      The project uses QML modules in case it matters.

      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
            slawomir Slawomir Czarko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes