Hello! I have a very simple class, called Node.

Node.h
Qt Code:
  1. #ifndef NODE_H
  2. #define NODE_H
  3.  
  4. #include <QSet>
  5.  
  6. class Node
  7. {
  8.  
  9. public:
  10. Node();
  11. Node(const uchar &c);
  12.  
  13. uchar val;
  14. QSet<Node> childNodes;
  15.  
  16. bool addChild(const Node& node);
  17.  
  18. inline bool operator==(const Node &n1, const Node &n2)
  19. {
  20. return n1.val == n2.val;
  21. }
  22.  
  23. inline uint qHash(const Node &node)
  24. {
  25. return qHash(node.val);
  26. }
  27.  
  28. };
  29.  
  30. #endif // NODE_H
To copy to clipboard, switch view to plain text mode 
Node.cpp
Qt Code:
  1. #include "Node.h"
  2.  
  3. Node::Node()
  4. {
  5. val = -1;
  6. }
  7.  
  8. Node::Node(const uchar &c)
  9. {
  10. val = c;
  11. }
  12.  
  13. bool Node::addChild(const Node &node)
  14. {
  15. if(childNodes.contains(node))
  16. return false;
  17.  
  18. childNodes.insert(node);
  19. return true;
  20. }
To copy to clipboard, switch view to plain text mode 
I get the following error messages:

  • 'bool Node::operator==(const Node&, const Node&)' must take exactly one argument
  • no matching function for call to 'qHash(const Node&)'
  • no match for 'operator==' in key0==((QHashNode<Node, QHashDummyValue*)this)->QHashNode<Node,QHashDummyValue>::key'


What can be the problem?

Thanks in advance!