Z
Z
Zaur Ashurbekov2015-06-04 12:09:04
Qt
Zaur Ashurbekov, 2015-06-04 12:09:04

Why does it throw errors when adding elements to QSet and QList?

Hello Habr!
How are you doing? How is your health?
Actually the question:
There is a code:

...
QSet<eqRec> eqsOne;
...
for(QList<eqRec>::iterator it = access.getEqs()->begin(); it != access.getEqs()->end(); it++){
   ...
   eqsOne.insert(*it);  // место, откуда переходит на ошибку
   ...
}

The mistake itself

C:\Qt\5.4\mingw491_32\include\QtCore\qhash.h:102: error: no matching function for call to 'qHash(const eqRec&)'
{ return (qHash(t) ^ seed); }

What am I doing wrong?
PS eqRec - class

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MiiNiPaa, 2015-06-04
@zaurius

What is the type of eqRec?
You can see by mistake that the hash function is not defined for it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question