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

Use Enum Class for Qt Protobuf Enum

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Fixed
    • P2: Important
    • None
    • None
    • Protocol Buffers
    • None
    • e04f23a76 (dev), 96ed03953 (6.8)

    Description

      I notice that generated C++ code from protobuf enum is using `enum`. Is it possible to use `enum class` for protobuf enum so that the same enum value can be declare multiple time? for example:

      message Foo {
        enum Bar {
          Unknown = 0;
          ValOne = 1;
          ValTwo = 2;
        }
        Bar bar = 1;
        
        enum Baz {
          Unknown = 0;
          ValThree = 1;
          ValFour = 2;
        }
        Baz baz = 2;
      }
      

      There are some discussion on the protobuf github repo but looks like it did not implemented.
      https://github.com/protocolbuffers/protobuf/issues/67
      https://github.com/protocolbuffers/protobuf/issues/1079

      Does Qt is using some kind of custom code generation? or this issue must be solved at upstream ?

      Attachments

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

        Activity

          People

            semlanik Alexey Edelev
            zajimuma Zaji Muma
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes