Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.6.0 Beta4
-
None
Description
While fixing QTBUG-116076, I found out that the qHash() adapter matches not only qfloat16, but also all concrete pointer types. Deprecating it, I get warnings for, among other things:
- QPersistentModelIndexData *
- QThreadPoolThread *
- unsigned char *
- Unknown macro: {[QAbstractAnimation *}
}
- bool
- QObject *
- QLoggingCategory *
The problem is that we can't change the hash calculation, as the function is inline. So the following solutions don't apply:
- constrain the adapter further, to include !is_pointer_v<T> and !is_integral_v<T>, because that would make it use qHash(const T*, size_t), which doesn't xor in seed.
- add a qHash(T*, size_t), hopefully a better match for pointer-to-non-const objects, but that would mean we need to be consistent with both existing qHash(const T*, size_t) as well as the adapter, and they're not consistent with each other
For the time being, it seems we can't do better than to wait this out for Qt 7?