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

availableDataRates -> crash and/or wrong values

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P2: Important P2: Important
    • None
    • 5.1.1
    • Sensors
    • None
    • Linux

      Try to run the following code on linuxsysaccelerometer sensor backend (noticed this issue while implementing my own sensor backend) and observe that "minimum" and "maximum" values both return 100, when they are defined as:

      LinuxSysAccelerometer::LinuxSysAccelerometer(QSensor *sensor)
          : QSensorBackend(sensor)
          , m_timerid(0)
          , path(QString())
          , divisor(0)
          , delimiter(QString())
      {
          setReading<QAccelerometerReading>(&m_reading);
          addDataRate(1, 100); // 100Hz
      

      More serious issue is that it crashes when calling: console.log(acc1.availableDataRates.length)

          Accelerometer {
              id : acc1
              active: true
      
              Component.onCompleted: {
                  console.log(acc1.availableDataRates[0].minimum) // 100 - should be 1
                  console.log(acc1.availableDataRates[0].maximum) // 100
                  console.log(acc1.availableDataRates.length) // crash
              }
          }
      

      On my own sensor backend the crash is reproducible even when calling:
      console.log(acc1.availableDataRates[0].minimum)

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

            lpotter Lorn Potter
            paeglis Gatis Paeglis
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes