diff options
author | Sami Varanka <[email protected]> | 2025-05-22 19:57:37 +0300 |
---|---|---|
committer | Sami Varanka <[email protected]> | 2025-05-23 10:31:31 +0000 |
commit | 5a7ad3e526b7f585cf52b978f4a3e19268a418bd (patch) | |
tree | 99cd84b6d45898d83f6b37f8310c6610440234b0 | |
parent | 9afa6433ae06c4665558e3597819a021b3d622b4 (diff) |
Because QtGraphs has inherited many of its classes
from QtCharts, the modules have many classes with the same
name. Therefore, mixing QtCharts and QtGraphs headers in
the same TU violates ODR. This patch includes the check for that and
fails compilation with an error message.
Pick-to: 6.8 6.9
Fixes: QTBUG-135691
Change-Id: Ic612ec36b1369ceee0eef83220c41e75f38a611e
Reviewed-by: Miikka Heikkinen <[email protected]>
-rw-r--r-- | src/charts/qchartglobal.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/charts/qchartglobal.h b/src/charts/qchartglobal.h index b18cd678..2516b3c0 100644 --- a/src/charts/qchartglobal.h +++ b/src/charts/qchartglobal.h @@ -24,4 +24,11 @@ */ #define QT_CHARTS_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch)) +#ifdef QTGRAPHS_HEADERS +#error Mixing QtCharts and QtGraphs in the same TU is unsupported since they use\ + the same class names. +#endif + +#define QTCHARTS_HEADERS + #endif // QCHARTGLOBAL_H |