Question

Before I embark into using this datatype and as I am a beginner in Qt, is it possible to use QGraphicsItem as key of QHash? It seems legal to declare something like:

QHash<QGraphicsItem*, someType> hashName;

So I guess it is something allowed.

Thanks.

Was it helpful?

Solution

Yes. But I'd use QMap<QGraphicsItem*, someType>, that doesn't make much difference, though. Also, you can inherit QGraphicsItem to attach data to items.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top