Domanda

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.

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top