• 4476阅读
  • 0回复

探讨个问题,QtDemo的SQL下面的DrillDown例子,有点没明白 [复制链接]

上一主题 下一主题
离线bangqianchen
 

只看楼主 倒序阅读 楼主  发表于: 2009-12-13
— 本帖被 XChinux 从 General Qt Programming 移动到本区(2011-01-02) —
ImageItem.cpp文件,头行:

  1. ImageItem::ImageItem(int id, const QPixmap &pixmap, QGraphicsItem *parent,
  2.                       QGraphicsScene *scene)
  3.      : QGraphicsPixmapItem(pixmap, parent, scene)


该类继承自QGraphicsPixmapItem,问题就在这里,QGraphicsPixmapItem构造函数只有两个参数,它的基类
  1. QGraphicsPixmapItem ( QGraphicsItem * parent = 0 )
  2. QGraphicsPixmapItem ( const QPixmap & pixmap, QGraphicsItem * parent = 0 )

或者基类的基类QGraphicsItem的构造函数
  1. QGraphicsItem ( QGraphicsItem * parent = 0 )

也不会接受一个QGraphicsScene *类型的参数,但是这里确可以,并且程序不报任何错。真是有点糊涂了! 请赐教!
快速回复
限100 字节
 
上一个 下一个