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.h50
1 files changed, 42 insertions, 8 deletions
diff --git a/src/corelib/global/qtversionchecks.h b/src/corelib/global/qtversionchecks.h
index d6fad1ed6c..86fc094f4e 100644
--- a/src/corelib/global/qtversionchecks.h
+++ b/src/corelib/global/qtversionchecks.h
@@ -9,12 +9,7 @@
#pragma qt_sync_stop_processing
#endif
-#ifdef QT_BOOTSTRAPPED
-#include <QtCore/qconfig-bootstrapped.h>
-#else
-#include <QtCore/qconfig.h>
-#include <QtCore/qtcore-config.h>
-#endif
+#include <QtCore/qtconfiginclude.h>
/*
QT_VERSION is (major << 16) | (minor << 8) | patch.
@@ -33,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
@@ -61,7 +56,7 @@
int size() const { return int(size(QT6_CALL_NEW_OVERLOAD)); }
*/
-#ifdef Q_CLANG_QDOC
+#ifdef Q_QDOC
# define QT6_DECL_NEW_OVERLOAD
# define QT6_DECL_NEW_OVERLOAD_TAIL
# define QT6_IMPL_NEW_OVERLOAD
@@ -77,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 */