There is a template class:
template<typename Type> class Node : public NodeBase { public: Node( QString name, NodeBase* parent ): NodeBase(name, parent) {} ~Node() {} // ... a lot of methods uses _data virtual QVariant data(int column, int role) const { // ... } virtual bool setData(int column, const QVariant &value, int role) { // ... } private: Type _data; } But it would be good to specialize virtual data and setData functions for the case when Type is enum . How can I do that?
I know how to specialize the entire Node class for the enum case, but then you have to rewrite all the other functions that use _data .