This is weird. Any idea on this error?

The compiler (g++) complains

main.cpp: In function `int main()':
main.cpp:42: error: no matching function for call to `ClassB::zValue(QPointF, bool*)'
main.cpp:32: note: candidates are: virtual double ClassB::zValue(double, double, bool*) const
gmake: *** [main.o] Error 1


Qt Code:
  1. #include <QPointF>
  2.  
  3. class ClassA
  4. {
  5. public:
  6.  
  7. ClassA() {}
  8. virtual ~ClassA() {}
  9.  
  10. virtual double zValue( double xpos, double ypos, bool* ok=0 ) const=0;
  11. double zValue( const QPointF& xy, bool* ok=0 ) const;
  12.  
  13. };
  14.  
  15. double ClassA::zValue( const QPointF& xy, bool* ok ) const
  16. {
  17. return zValue( xy.x(), xy.y(), ok );
  18. }
  19.  
  20. class ClassB : public ClassA
  21. {
  22. public:
  23.  
  24. ClassB() {}
  25. ~ClassB() {}
  26.  
  27. virtual double zValue( double xpos, double ypos, bool* ok=0 ) const;
  28.  
  29. };
  30.  
  31. double ClassB::zValue( double xpos, double ypos, bool* ok ) const
  32. {
  33. if ( ok ) *ok = true;
  34. return xpos + ypos;
  35. }
  36.  
  37. int main()
  38. {
  39. ClassB mess;
  40.  
  41. bool ok;
  42. mess.zValue( QPointF( 0, 0 ), &ok );
  43.  
  44. }
To copy to clipboard, switch view to plain text mode