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

QtRemoteObject, QList<QVariant> type mismatch (int/bool) between server and client.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.3, 6.8.0
    • Remote Objects
    • None

    Description

      Passing a QList<QVariant> as part of a slot Parameter between a remote object client/server, some typing error appears when QVariant are int and bool.

      Here are the output of server and client with a small example project (see attachment)

      Server

       

      Content: [
      Exam(patient: Patient(firstName: "John", lastName: "Deer"), patientWeight: 62, date: QDate("2017-01-30"), indic: QList(Indicator(indicId: 0, value: QVariant(bool, true)), Indicator(indicId: 1, value: QVariant(int, 1)))),
      
      Exam(patient: Patient(firstName: "John", lastName: "Deer"), patientWeight: 62, date: QDate("2017-02-01"), indic: QList(Indicator(indicId: 0, value: QVariant(int, 1)), Indicator(indicId: 1, value: QVariant(bool, true)))),
      
      Exam(patient: Patient(firstName: "John", lastName: "Deer"), patientWeight: 62, date: QDate("2017-03-20"), indic: QList(Indicator(indicId: 0, value: QVariant(int, 1)), Indicator(indicId: 1, value: QVariant(bool, false)), Indicator(indicId: 2, value: QVariant(bool, true)), Indicator(indicId: 3, value: QVariant(int, 0)))),
      
      Exam(patient: Patient(firstName: "John", lastName: "Deer"), patientWeight: 62, date: QDate("2017-02-02"), indic: QList(Indicator(indicId: 0, value: QVariant(int, 0)), Indicator(indicId: 1, value: QVariant(bool, true)))),
      
      Exam(patient: Patient(firstName: "John", lastName: "Deer"), patientWeight: 62, date: QDate("2017-01-31"), indic: QList(Indicator(indicId: 0, value: QVariant(bool, false)), Indicator(indicId: 1, value: QVariant(int, 1))))
      ]

       

      Client

       

      Client: [
      Exam(patient: Patient(firstName: "John", lastName: "Deer"), patientWeight: 62, date: QDate("2017-01-30"), indic: QList(Indicator(indicId: 0, value: QVariant(bool, true)), Indicator(indicId: 1, value: QVariant(bool, true)))),
      
      Exam(patient: Patient(firstName: "John", lastName: "Deer"), patientWeight: 62, date: QDate("2017-02-01"), indic: QList(Indicator(indicId: 0, value: QVariant(bool, true)), Indicator(indicId: 1, value: QVariant(bool, true)))),
      
      Exam(patient: Patient(firstName: "John", lastName: "Deer"), patientWeight: 62, date: QDate("2017-03-20"), indic: QList(Indicator(indicId: 0, value: QVariant(int, 1)), Indicator(indicId: 1, value: QVariant(bool, false)), Indicator(indicId: 2, value: QVariant(bool, true)), Indicator(indicId: 3, value: QVariant(int, 0)))),
      
      Exam(patient: Patient(firstName: "John", lastName: "Deer"), patientWeight: 62, date: QDate("2017-02-02"), indic: QList(Indicator(indicId: 0, value: QVariant(int, 0)), Indicator(indicId: 1, value: QVariant(bool, true)))),
      
      Exam(patient: Patient(firstName: "John", lastName: "Deer"), patientWeight: 62, date: QDate("2017-01-31"), indic: QList(Indicator(indicId: 0, value: QVariant(int, 0)), Indicator(indicId: 1, value: QVariant(bool, true))))
      ]

       

       

      We see here with the first 2 elemements "Exam" that Qvariant type change between the server and the client depending on the order in which variable are stored in the QList.

      We also see with the 4th elements "Exam" that the typing is correct this time, i suspect its because value are  really different this time (0 and 1/true, if they were both 0/false, both variants would be of type "int")). But then, the typing in the 5th elements is wrong again and seems to have kept the pattern of the previous element (int then bool instead of the expected bool then int)

       

       

      Attachments

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

        Activity

          People

            bstottle Brett Stottlemyer
            kgaurier Karl Gaurier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes