On Monday 30 November 2009 12:07:29 Uwe Rathmann wrote:
> 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.

QList does not need any qHash function.

> > 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> 

I guess you meant 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.

Which problem are you talking about here?

> > 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 ?

Sorry, I do not understand here.
What is QTL?  What are Lists that are not sorted, do you mean QSet<double>?
Would be interesting to know what is instantiating that code.

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

Reply via email to