4 Attachment(s)
no matching function for call to 'qHash(const PB::phonebook&)' error
C:\Qt\Qt5.10.0\5.10.0\mingw53_32\include\QtCore\qh ashfunctions.h:112: error: no matching function for call to 'qHash(const PB::phonebook&)'
Q_DECL_NOEXCEPT_EXPR(noexcept(qHash(t)))
^
can someone please assist me with solution to the above error I have attached files of my project
Re: no matching function for call to 'qHash(const PB::phonebook&)' error
From the docs:
Quote:
For a key type K, the qHash function must have one of these signatures:
uint qHash(K key);
uint qHash(const K &key);
uint qHash(K key, uint seed);
uint qHash(const K &key, uint seed);
Your qHash() function does not match any of these signatures. Read the compiler's error message and compare it to what your code says.
Re: no matching function for call to 'qHash(const PB::phonebook&)' error
thanks I have done that before and did not work except when I put everything in main function the code works well except when I put in header and source file, so no solution yet please assist again
Re: no matching function for call to 'qHash(const PB::phonebook&)' error
Did you not read my last reply?
Your code declares a function
Code:
uint qHash( PB::phonebook & )
Does that match any of the signatures described in the QHash documentation I posted? If you think it does, then you need to study your C++ books again. If you can't find a match, how could you change your function so it does match one of the signatures? Once you make that change, then that part of your code should compile without error.
I am not going to write your code for you - you need to understand this on your own.