QSensorReading Proxy Page | Qt Sensors 5.15.18

- Qt 5.15
- Qt Sensors
- QSensorReading Proxy Page
- Qt 5.15.18 Reference Documentation

# QSensorReading Proxy Page

## Macros

| DECLARE_READING(classname)
| IMPLEMENT_READING(classname)

## Macro Documentation

### DECLARE_READING(classname)

The DECLARE_READING macro adds some required methods to a reading class.

This macro should be used for all reading classes. Pass the classname of your reading class.

     class MyReading : public QSensorReading
     {
         Q_OBJECT
         Q_PROPERTY(qreal myprop READ myprop)
         DECLARE_READING(MyReading)
     public:
         qreal myprop() const;
         vod setMyprop(qreal myprop);
     };

See also IMPLEMENT_READING().

### IMPLEMENT_READING(classname)

The IMPLEMENT_READING macro implements the required methods for a reading class.

This macro should be used for all reading classes. It should be placed into a single compilation unit (source file), not into a header file. Pass the classname of your reading class.

     IMPLEMENT_READING(MyReading)

See also DECLARE_READING().