FluentUI/example/src/stdafx.h

48 lines
3.9 KiB
C
Raw Normal View History

2024-04-11 14:51:43 +08:00
#pragma once
2023-03-02 18:21:43 +08:00
2024-06-28 17:09:23 +08:00
#define Q_PROPERTY_AUTO_P(TYPE, M) \
Q_PROPERTY(TYPE M MEMBER _##M NOTIFY M##Changed) \
public: \
Q_SIGNAL void M##Changed(); \
void M(TYPE in_##M) { \
_##M = in_##M; \
Q_EMIT M##Changed(); \
} \
TYPE M() { \
return _##M; \
} \
\
private: \
2024-04-12 16:50:49 +08:00
TYPE _##M;
2024-04-11 14:51:43 +08:00
2024-06-28 17:09:23 +08:00
#define Q_PROPERTY_AUTO(TYPE, M) \
Q_PROPERTY(TYPE M MEMBER _##M NOTIFY M##Changed) \
public: \
Q_SIGNAL void M##Changed(); \
void M(const TYPE &in_##M) { \
_##M = in_##M; \
Q_EMIT M##Changed(); \
} \
TYPE M() { \
return _##M; \
} \
\
private: \
2024-04-12 16:50:49 +08:00
TYPE _##M;
2024-01-17 14:00:20 +08:00
2024-06-28 17:09:23 +08:00
#define Q_PROPERTY_READONLY_AUTO(TYPE, M) \
Q_PROPERTY(TYPE M READ M NOTIFY M##Changed FINAL) \
public: \
Q_SIGNAL void M##Changed(); \
void M(const TYPE &in_##M) { \
_##M = in_##M; \
Q_EMIT M##Changed(); \
} \
TYPE M() { \
return _##M; \
} \
\
private: \
2024-04-12 16:50:49 +08:00
TYPE _##M;