PDA

View Full Version : Very quick question: Can you use a pointer as a key in a QHash?



Jeffb
14th March 2012, 04:14
Can you use a pointer as a key in a QHash?

ChrisW67
14th March 2012, 06:31
Sure. You don't even need to provide a qHash() overload because one is generated for you by the template. Why do you ask?

Jeffb
14th March 2012, 07:06
Just wanted to make sure.
Had to decide whether to use a QMultiHash of values to Node ptrs or a QHash of Node ptrs to values.
The second one allows me to remove a row without having to iterate through the results of a find.

Thanks for that.
Jeff