Uploaded image for project: 'Qt Automotive Suite'
  1. Qt Automotive Suite
  2. AUTOSUITE-1340

When building a simulator for QFace with a single value struct then it can end up having a compile errror

    XMLWordPrintable

    Details

    • Commits:
      49e2046ef031b35fa7cb38e53cdaee36d3a2831e (qt/qtivi/5.13) 945017497c8dd87c0a81abd15de46ba65eee62ed (qt/qtivi/5.13) 12aa8a72522e187267c5d9ce654656fbc3e96e18 (qt/qtinterfaceframework/dev) 6c362279235eab5941fb13c45610c514db8895b4 (qt/qtinterfaceframework/dev)

      Description

      Building a structure containing a single value is possible and works in normal cases:

      struct TestStruct {
         string myString;
      }
      interface MainService {
         TestStruct thatStruct;
      }
      

      When simulating, a default value for this struct has to be specified:

      com.test.main.MainService#thatStruct:
      config_simulator:
      default: ["Hello Qt"]
      

      This results in generated code mainservicebackend.cpp for the simulator with the snippet:

      , m_thatStruct(TestStruct({QLatin1String("Hello Qt")}))
      

      unfortunately, this gets a compiler error: it's an ambiguous constructor call for the TestStruct type. It could be a copy constructor, a QVariant constructor, or a QString constructor.

        Attachments

        For Gerrit Dashboard: AUTOSUITE-1340
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            gagi Dominik Holland
            Reporter:
            andysh Andy Shaw
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes