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

C++11 scoped enums are not scoped in QML

    XMLWordPrintable

    Details

      Description

      If I have something like the following code in C++

      class MyClass : public QObject
      {
       Q_OBJECT
      public:
       enum class MyEnum : uint16_t {
         Val1,
         Val2,
       }
       Q_ENUM(MyEnum)
      );
      
      // register the type
      

      I'd like to use it in QML as:

      console.log(MyClass.MyEnum.Val1)
      

      not as

      console.log(MyClass.Val1)
      

      and will be even nicer, if we could use it as a type

      property MyClass.MyEnum : MyClass.MyEnum.Val1
      

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              mbrasser Michael Brasser
              Reporter:
              taipan BogDan Vatra
              Votes:
              5 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes