warning :
Class ... implements the interface QGraphicsItem but does not list it in Q_INTERFACES. qobject_cast to QGraphicsItem will not work!
解决方法:
替换
class Foo : public QObject, public QGraphicsItem为
class Foo : public QGraphicsObject
本文解决了一个在使用QGraphicsItem时遇到的继承问题,并提供了代码优化建议。
warning :
Class ... implements the interface QGraphicsItem but does not list it in Q_INTERFACES. qobject_cast to QGraphicsItem will not work!
解决方法:
替换
class Foo : public QObject, public QGraphicsItem为
class Foo : public QGraphicsObject
948
8405

被折叠的 条评论
为什么被折叠?