FluentUI/example/src/stdafx.h

51 lines
4.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-04-11 14:51:43 +08:00
#define Q_PROPERTY_AUTO_P(TYPE, M) \
2024-01-17 14:00:20 +08:00
Q_PROPERTY(TYPE M MEMBER _##M NOTIFY M##Changed) \
2024-04-11 14:51:43 +08:00
public: \
Q_SIGNAL void M##Changed(); \
void M(TYPE in_##M) \
2024-01-17 14:00:20 +08:00
{ \
2024-04-11 14:51:43 +08:00
_##M = in_##M; \
Q_EMIT M##Changed(); \
2024-01-17 14:00:20 +08:00
} \
2024-04-11 14:51:43 +08:00
TYPE M() \
2024-01-17 14:00:20 +08:00
{ \
2024-04-11 14:51:43 +08:00
return _##M; \
2024-01-17 14:00:20 +08:00
} \
2024-04-11 14:51:43 +08:00
private: \
2024-04-12 16:50:49 +08:00
TYPE _##M;
2024-04-11 14:51:43 +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-04-11 14:51:43 +08:00
#define Q_PROPERTY_READONLY_AUTO(TYPE, M) \
2024-01-17 14:00:20 +08:00
Q_PROPERTY(TYPE M READ M NOTIFY M##Changed FINAL) \
2024-04-11 14:51:43 +08:00
public: \
Q_SIGNAL void M##Changed(); \
void M(const TYPE& in_##M) \
2024-01-17 14:00:20 +08:00
{ \
2024-04-11 14:51:43 +08:00
_##M = in_##M; \
Q_EMIT M##Changed(); \
2024-01-17 14:00:20 +08:00
} \
2024-04-11 14:51:43 +08:00
TYPE M() \
2024-01-17 14:00:20 +08:00
{ \
2024-04-11 14:51:43 +08:00
return _##M; \
2024-01-17 14:00:20 +08:00
} \
2024-04-11 14:51:43 +08:00
private: \
2024-04-12 16:50:49 +08:00
TYPE _##M;