The Q_PROPERTY macro defines the member variable oil_pressure_volt for you. Line 48 is adding a duplicate definition and thus causing the error. Delete that line. Get rid of m_oil_pressure_volt also, since it is just a duplicate of the property.
You would confuse yourself less if you didn't use the name "oil_pressure_volt" everywhere. C++ doesn't care what the argument names are, so in the set method, use "newValue" or something like that. Likewise in your definition of the signal.
If you want the -name- of the property that is exposed to QML to be something different from the member variable name, then use the MEMBER form of Q_PROPERTY:
Q_PROPERTY( double oilPressureVoltage MEMBER m_oil_pressure_volt WRITE set_oil_pressure_volt NOTIFY oil_pressure_volt_Changed )
Q_PROPERTY( double oilPressureVoltage MEMBER m_oil_pressure_volt WRITE set_oil_pressure_volt NOTIFY oil_pressure_volt_Changed )
To copy to clipboard, switch view to plain text mode
You will refer to it as "oilPressureVoltage" from QML.
Bookmarks