Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我开始使用这种数据类型之前,并且由于我是 Qt 的初学者,是否可以将其QGraphicsItem用作键QHash?声明如下内容似乎是合法的:
QGraphicsItem
QHash
QHash<QGraphicsItem*, someType> hashName;
所以我想这是允许的。
谢谢。
是的。但是我会使用QMap<QGraphicsItem*, someType>,但这并没有太大的区别。此外,您可以继承QGraphicsItem以将数据附加到项目。
QMap<QGraphicsItem*, someType>