Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[SOLVED] MOC documentation claims to support class templates, but actually it doesn't
Jakob last edited by Jakob
The documentation on http://doc.qt.io/qt-5/moc.html clearly states that moc does not support class templates that have signals or slots. This implies, that as long as my class does not have such things, it should be possible to create class templates that derive from QObject. In reality however, the moc-compiler complains "Template classes not supported by Q_OBJECT". This is a rather different statement.
The documentation should reflect that template classes are not supported at all.
A Former User last edited by
Technically putting the Q_OBJECT macro without using any signals or slots does not really make sense. Anyway, you can create a templated QObject without using the Q_OBJECT macro.
The Qt Quarterly number 15 talks about that.
Hope it helps