diff options
Diffstat (limited to 'src/corelib/global/qtversionchecks.h')
-rw-r--r-- | src/corelib/global/qtversionchecks.h | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/src/corelib/global/qtversionchecks.h b/src/corelib/global/qtversionchecks.h index 72b62ce105..86fc094f4e 100644 --- a/src/corelib/global/qtversionchecks.h +++ b/src/corelib/global/qtversionchecks.h @@ -28,7 +28,7 @@ void QT7_ONLY(Q_CORE_EXPORT) void operate(); } */ -#if QT_VERSION_MAJOR == 7 +#if QT_VERSION_MAJOR == 7 || defined(QT_BOOTSTRAPPED) # define QT7_ONLY(...) __VA_ARGS__ # define QT6_ONLY(...) #elif QT_VERSION_MAJOR == 6 @@ -72,4 +72,43 @@ # define QT6_CALL_NEW_OVERLOAD_TAIL QT6_ONLY(, QT6_CALL_NEW_OVERLOAD) #endif +/* + Macro to tag Tech Preview APIs. + It expands to nothing, because we want to use it in places where + nothing is generally allowed (not even an attribute); for instance: + to tag other macros, Q_PROPERTY declarations, and so on. + + Still: use it as if it were an C++ attribute. + + To mark a class as TP: + class QT_TECH_PREVIEW_API Q_CORE_EXPORT QClass { ... }; + + To mark a function: + QT_TECH_PREVIEW_API void qFunction(); + + To mark an enumeration or enumerator: + enum class QT_TECH_PREVIEW_API QEnum { + Enum1, + Enum2 QT_TECH_PREVIEW_API, + }; + + To mark parts of a class: + class QClass : public QObject + { + // Q_OBJECT omitted d/t QTBUG-123229 + + QT_TECH_PREVIEW_API + Q_PROPERTY(int countNG ...) // this is TP + + Q_PROPERTY(int count ...) // this is stable API + + public: + QT_TECH_PREVIEW_API + void f(); // TP + + void g(); // stable + }; +*/ +#define QT_TECH_PREVIEW_API + #endif /* QTVERSIONCHECKS_H */ |