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

QtProtobuf: lowercased enum values are not renamed in default assignment

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 6.6.1
    • Protocol Buffers
    • None
    • b1a78d7a765597d82f86ae3adbcc08efeab58c7c(dev)

    Description

      Hi, I've found another issue with the qtprotobufgen tool:

      Enum keys are renamed to first letter uppercase. This transformation is not applied, when a message field is assigned a lower case enum key by default.

      The following .proto code doesn't compile:

      syntax = "proto2";
      enum Format {
          lowercase = 0;
          UPPERCASE = 1;
          camelCase = 2;
          PascalCase = 3;
          snake_case = 4;
      }
      
      message FormattedMsg {
          required Format format = 1 [default = lowercase];
      }
      

      The enum in C++ looks like:

      enum Format {
          Lowercase = 0,
          UPPERCASE = 1,
          CamelCase = 2,
          PascalCase = 3,
          Snake_case = 4,
      }; 
      class FormattedMsg_QtProtobufData : public QSharedData
      { 
      public:
        FormattedMsg_QtProtobufData()
          : QSharedData(), 
            m_state(::FormatGadget::Format::lowercase) {}
      ...
      

      Attachments

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

        Activity

          People

            tatiana.borisova Tatiana Borisova
            jdoubleu jdoubleu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes