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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top