QCustomPlot Discussion and Comments

QT 6.4.2 debug\moc_qcustomplot.cpp(360): error C2882: 'QCP': illegal use of namespace identifier in expressionReturn to overview

debug\moc_qcustomplot.cpp(360): error C2882: 'QCP': illegal use of namespace identifier in expression
(MSVC 2019)

Same with gcc in msys2 or others. Apparently the moc processing has changed, and the Q_MOC_RUN define evaulation does not work as before.

Anyone any ideas how to fix this?

Oliver

Hi Oliver,

Thanks for bringing this up. Is this new behavior since Qt6.4.2? Because the release tests ran fine for Qt6.4.0 (which was the current Qt version when QCP 2.1.1 was released), and it would be quite weird for them to break moc in a Qt patch version (but not impossible).

Anyway, I'll test it out later to see what's going on.

It seems not to be a moc issue, but rather a changed output the moc creates. It is creating a template with QPC as template argument, and QPC is a namespace in this context.

Oliver

I was able to get this managed. The issue is the naming of the Namespace the same as a class called QCP. When you rename the namespace to eg Q_CP it works with Qt 6.4.3.