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

Add support for #CLASSHEADER directives

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 6.8.0
    • Remote Objects
    • None
    • All

    Description

      Similar to:

      https://doc.qt.io/qt-6/qtremoteobjects-repc.html#header-and-footer-directives

      #HEADER namespace MyNamespace {
      class MyType

      { #CLASSHEADER <MY_CUSTOM_CODE> ... }

      ;
      #FOOTER } // namespace MyNamespace

      Not sure if CLASSHEADER is even the correct way to do it. We essentially need a custom Q_CLASSINFO, so we can add Q_CLASSINFO("RegisterEnumClassesUnscoped", "false");.

      We currently run a python script that alters the generated headers as a workaround:

      # Call script that updates the generated files after qt6_add_repc_merged
      find_package(Python3 REQUIRED COMPONENTS Interpreter)
      set(GENERATED_HEADERS_DIR "${CMAKE_BINARY_DIR}/Libs")
      add_custom_command(
          TARGET ${PROJECT_NAME}
          POST_BUILD
          COMMAND ${Python3_EXECUTABLE} ${IBH_TOOLS_DIR}/update_generated_rep_files.py ${GENERATED_HEADERS_DIR}
          COMMENT "Adding Q_CLASSINFO to generated QRemoteObjectReplica classes")
      

      Attachments

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

        Activity

          People

            bstottle Brett Stottlemyer
            kelteseth Elias Steurer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes