src/config.h

changeset 587
507e5d5c348c
parent 539
72ad83a67165
child 590
7aec744ce97b
equal deleted inserted replaced
586:89d1161197d3 587:507e5d5c348c
96 virtual void resetValue() override { value = defval; } \ 96 virtual void resetValue() override { value = defval; } \
97 virtual bool isDefault() const override { return value == defval; } \ 97 virtual bool isDefault() const override { return value == defval; } \
98 virtual QVariant toVariant() const override { return QVariant::fromValue<T> (value); } \ 98 virtual QVariant toVariant() const override { return QVariant::fromValue<T> (value); } \
99 virtual QVariant defaultVariant() const override { return QVariant::fromValue<T> (defval); } \ 99 virtual QVariant defaultVariant() const override { return QVariant::fromValue<T> (defval); } \
100 virtual void loadFromVariant (const QVariant& val) override { value = val.value<T>(); } \ 100 virtual void loadFromVariant (const QVariant& val) override { value = val.value<T>(); } \
101 static NAME##Config& getByName (str name);
101 102
102 #define DEFINE_UNARY_OPERATOR(T, OP) \ 103 #define DEFINE_UNARY_OPERATOR(T, OP) \
103 T operator OP() { \ 104 T operator OP() { \
104 return OP value; \ 105 return OP value; \
105 } 106 }

mercurial