سؤال

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