summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qtversionchecks.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/global/qtversionchecks.h')
-rw-r--r--src/corelib/global/qtversionchecks.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/corelib/global/qtversionchecks.h b/src/corelib/global/qtversionchecks.h
index 7b5d99af86..86fc094f4e 100644
--- a/src/corelib/global/qtversionchecks.h
+++ b/src/corelib/global/qtversionchecks.h
@@ -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 */