Uploaded image for project: 'Qt for MCUs'
  1. Qt for MCUs
  2. QTMCU-239

enum must be declared at the root level

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • Qt for MCUs 2.6
    • QUL Team
    • None

    Description

      I'm not sure if this is a bug, but since it worked on bit Qt, let me create a ticket.

      This code doesn't build with an error:

      C:\work\ep\ROM\ROM\Template.qml:8: error: Type Template does not have a property A for reading
      C:/work/ep/ROM/ROM/Template.qml:8: error: Type Template does not have a property A for reading
              property int i: Template.A 

      ↓ code (the project is attached as MCU.zip.)

      // Template.qml
      import QtQuick
      Item {
          Item {
              id: qmlitem
              enum MyEnum {A}
              property int i: Template.A
          }
      }
       

      When the enum declaration was moved to the root level, it worked.

      // Template.qml
      import QtQuick
      Item {
          id: qmlitem
          enum MyEnum {A}
          property int i: Template.A
      }
       

      By the way, the original code worked on big Qt 6.6. Built successfully and no runtime error was observed(as far as I saw) the project is attached as bigQt.zip.

      // Screen01.ui.qml
      import QtQuick
      Item {
          Item {
              id: qmlitem
              enum MyEnum {A}
              property int i: Screen01.A
          }
      }
       

       

       

      Attachments

        1. bigQt.zip
          13 kB
        2. MCU.zip
          6 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            mikio_hirai Mikio Hirai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes