ImageItem.cpp文件,头行:
- ImageItem::ImageItem(int id, const QPixmap &pixmap, QGraphicsItem *parent,
- QGraphicsScene *scene)
- : QGraphicsPixmapItem(pixmap, parent, scene)
该类继承自QGraphicsPixmapItem,问题就在这里,QGraphicsPixmapItem构造函数只有两个参数,它的基类
- QGraphicsPixmapItem ( QGraphicsItem * parent = 0 )
- QGraphicsPixmapItem ( const QPixmap & pixmap, QGraphicsItem * parent = 0 )
或者基类的基类QGraphicsItem的构造函数
- QGraphicsItem ( QGraphicsItem * parent = 0 )
也不会接受一个QGraphicsScene *类型的参数,但是这里确可以,并且程序不报任何错。真是有点糊涂了! 请赐教!