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

repc does not include correct type headers

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.4.0
    • Remote Objects
    • None
    • Windows

    Description

      I am using Qts remote object compiler (repc) to generate some c++ replica headers from some auto-generated moc json output.

      The issue is repc seems to be hard coded to only include a selection of headers in its output (see https://github.com/qt/qtremoteobjects/blob/37c34645fc8d80717f1ea6b9ec7fddcfeef44f79/tools/repc/repcodegenerator.cpp#L230)

      This is fine so long as I make sure my classes only contain simple c++ value types however if the class contains a slot that takes a QUrl, QSize, etc then type will be undefined in the header file generated by repc. I can work around this by including these types before I include any of these repc generated replica headers but I feel like at least the comment Qt types should be supported.

      At the very least a way to inject code into the headers generated by repc may allow people to work around the issue. I noticed that repc has a -I cli argument which looked potential but from looking at the sources it appears that it is not hooked up to anything.

      Steps to reproduce:
      1. moc.exe InputHeader.hpp --output-json -o InputHeader.json
      2. repc.exe InputHeader.json -o replica InputHeaderReplica.hpp
      3 #include "InputHeaderReplica.hpp" // <- see undefined types if InputHeader.hpp used anything beyond the built in c++ types.

      See the attached Renderer.hpp, Renderer.json and RendererReplica.hpp for an examples for the above steps as I see them.

      Attachments

        1. Renderer.hpp
          4 kB
        2. Renderer.json
          8 kB
        3. RendererReplica.hpp
          9 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bstottle Brett Stottlemyer
            haiku Ollie Dawes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes