ctkTestWrappedQProperty.h 623 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef __ctkTestWrappedQProperty_h
  2. #define __ctkTestWrappedQProperty_h
  3. // Qt includes
  4. #include <QObject>
  5. class ctkTestWrappedQProperty : public QObject
  6. {
  7. Q_OBJECT
  8. Q_PROPERTY(int value READ value WRITE setValue);
  9. public:
  10. ctkTestWrappedQProperty(QObject * newParent = 0) : QObject(newParent)
  11. {
  12. this->Value = 0;
  13. }
  14. /// Example of property declared using Q_PROPERTY
  15. /// Using Q_PROPERTY is enough to expose them, it's not required to declare them as slot
  16. int value() const { return this->Value; }
  17. void setValue(int newValue){ this->Value = newValue; }
  18. private:
  19. int Value;
  20. };
  21. #endif