Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Some quick feedback on the 6.8 implementation of QT/Protobuf
Forum Updated to NodeBB v4.3 + New Features

Some quick feedback on the 6.8 implementation of QT/Protobuf

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 488 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jarle
    wrote on last edited by
    #1

    In the latest iteration, classes generated from .proto files has made sub-classes immutable in C++.

    I think this is a disastrous decision. Protobuf "messages" can be quite complex with many levels of Message's containing other messages as sub-members.

    The native C++ protobuf implementation (from Google?) has "mutable_" methods, allowing direct mutable access to any member objects. In order to build a complex message, the message may pass trough several functions, or if statements, that add some state to various sub-properties before it's submitted. In it's current state, this will be very messy and inefficient, especially if each "substation" has to pull out any objects it want to modify, copy the data to new objects, modify the state, and then re-assemble the message with the updated state.

    It seems like QT Protobuf is targeted mainly for QML. That is fine, but please remember that applications that is more than a few fancy screens will require a layer in C++ to handle the business logic. Until now QT/gRPC/Protobuf was significantly simpler to work with than the standard C++ code generated by protoc. That just changed dramatically over night.

    Please either make a mutable version of "Message.property()", or add "Message.mutableProperty()".

    Pl45m4P 1 Reply Last reply
    0
    • J jarle

      In the latest iteration, classes generated from .proto files has made sub-classes immutable in C++.

      I think this is a disastrous decision. Protobuf "messages" can be quite complex with many levels of Message's containing other messages as sub-members.

      The native C++ protobuf implementation (from Google?) has "mutable_" methods, allowing direct mutable access to any member objects. In order to build a complex message, the message may pass trough several functions, or if statements, that add some state to various sub-properties before it's submitted. In it's current state, this will be very messy and inefficient, especially if each "substation" has to pull out any objects it want to modify, copy the data to new objects, modify the state, and then re-assemble the message with the updated state.

      It seems like QT Protobuf is targeted mainly for QML. That is fine, but please remember that applications that is more than a few fancy screens will require a layer in C++ to handle the business logic. Until now QT/gRPC/Protobuf was significantly simpler to work with than the standard C++ code generated by protoc. That just changed dramatically over night.

      Please either make a mutable version of "Message.property()", or add "Message.mutableProperty()".

      Pl45m4P Offline
      Pl45m4P Offline
      Pl45m4
      wrote on last edited by
      #2

      @jarle said in Some quick feedback on the 6.8 implementation of QT/Protobuf:

      It seems like QT Protobuf is targeted mainly for QML

      It's also for serialization purposes in C++
      See:

      • https://doc.qt.io/qt-6/qtprotobuf-module.html#details

      Please either make a mutable version of "Message.property()", or add "Message.mutableProperty()".

      For these kind of requests and suggestions for improvement better create a bugreport or contact Qt directly.


      If debugging is the process of removing software bugs, then programming must be the process of putting them in.

      ~E. W. Dijkstra

      1 Reply Last reply
      1
      • semlanikS Offline
        semlanikS Offline
        semlanik
        wrote on last edited by
        #3

        Hi @jarle,

        First of all, thanks for using and giving feedback to Qt Protobuf/GRPC. The removal of mutable getters was the hard decision, but the removed implementation had an issue related to the moc, that we didn't manage to fix in time, unfortunately.

        We will restore the functionality on further releases, not sure if 6.9 is the one, so don't give any promises here by now.

        1 Reply Last reply
        2
        • semlanikS Offline
          semlanikS Offline
          semlanik
          wrote on last edited by
          #4

          Here are two bugs for the context:
          https://bugreports.qt.io/browse/QTBUG-119912
          https://bugreports.qt.io/browse/QTBUG-119913

          And the change that removed them:
          https://codereview.qt-project.org/c/qt/qtgrpc/+/585992

          P.S. The fact you complain about the removal, forces us to reconsider our decision.

          1 Reply Last reply
          2

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved