Olivier Goffart wrote:

> I would like to add that using a floating point type as a key of a QHash
> might be dangerous as there will be == comparison on floating point type,
> which might not work well due to rounding issue

The Qwt code is completely uninterested in hashing (or sorting) of doubles.
It only uses a simple QList<double> to store doubles for its values.

> To my knowledge, Qt never had a qHash function for floating point types.
> I just verified it by grepping the diff between Qt 4.5 and Qt 4.6

For Qt <= 4.2 I had to add a dummy implementation of qHash<double> to the
Qwt headers. After reporting the bug to the TrollTech support the problem
was gone in Qt 4.3. Seems like this ( or a similar ) problem has been
reintroduced in Qt 4.6. 

> To my knowledge, Qt never had a qHash function for floating point types.
> I just verified it by grepping the diff between Qt 4.5 and Qt 4.6

I didn't check the QTL code, but I guess the code in qhash.h(875) is not
instantiated by the compiler in Qt 4.3 - Qt 4.5 for lists, that are never
sorted ?

Uwe

PS: It seems to be Windows only - I never saw problems with qHash on Linux.






_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback

Reply via email to