Hi Guys,

Ive been working on a project trying to read the analog input from an Arduino board through serial, then display this on a qml gui in text form first and then move onto a rotating gauge.

I completed the process using qdebug at each step, so I'm reading the input until I come to the Q_PROPERTY stage and I get this error.

Qt Code:
  1. C:\Users\Stephn\Documents\nissan300zx\serialport.h:48: error: 'double SerialPort::oil_pressure_volt' conflicts with a previous declaration
  2. double oil_pressure_volt;
To copy to clipboard, switch view to plain text mode 
^

Qt Code:
  1. #ifndef SERIALPORT_H
  2. #define SERIALPORT_H
  3.  
  4. #include <QObject>
  5. #include <QQuickItem>
  6. #include <QSerialPort>
  7. #include <QSerialPortInfo>
  8. #include <QByteArray>
  9.  
  10. class SerialPort : public QObject
  11. {
  12. Q_OBJECT
  13. Q_PROPERTY(double oil_pressure_volt READ oil_pressure_volt WRITE set_oil_pressure_volt NOTIFY oil_pressure_volt_Changed)
  14.  
  15. public:
  16. SerialPort(QObject *parent = 0);
  17. SerialPort(QString);
  18.  
  19. double oil_pressure_volt() const
  20. {
  21. return m_oil_pressure_volt;
  22. }
  23.  
  24. public slots:
  25. void analogRead2();
  26. void updateOilPressure(QString);
  27.  
  28. void set_oil_pressure_volt(double oil_pressure_volt)
  29. {
  30. if (m_oil_pressure_volt == oil_pressure_volt)
  31. return;
  32.  
  33. m_oil_pressure_volt = oil_pressure_volt;
  34. emit oil_pressure_volt_Changed(oil_pressure_volt);
  35. }
  36.  
  37. signals:
  38.  
  39. void oil_pressure_volt_Changed(double oil_pressure_volt);
  40.  
  41. private:
  42. QSerialPort *arduino;
  43. static const quint16 arduino_uno_vendor_id = 0x2341;
  44. static const quint16 arduino_uno_product_id = 0x0001;
  45. QByteArray serialData;
  46. QString serialBuffer;
  47. QString parsed_data;
  48. double oil_pressure_volt;
  49.  
  50. double m_oil_pressure_volt;
  51. };
  52.  
  53. #endif // SERIALPORT_H
To copy to clipboard, switch view to plain text mode 

much appreciated for any help you can give me.