mirror of https://github.com/qt/qtcharts.git
Fail compilation when QtGraphs in the same TU
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
Fixes: QTBUG-135691
Change-Id: Ic612ec36b1369ceee0eef83220c41e75f38a611e
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
(cherry picked from commit 5a7ad3e526
)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
3ecc6ff429
commit
c8e36314a9
|
@ -24,4 +24,11 @@
|
||||||
*/
|
*/
|
||||||
#define QT_CHARTS_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
|
#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
|
#endif // QCHARTGLOBAL_H
|
||||||
|
|
Loading…
Reference in New Issue