QObject::connect: Cannot connect (null)::finished() to QSignalMapper::map()

cky050 2013-03-30 12:56:47
  QListIterator<QToolButton *> iter(numList);
QListIterator<QPropertyAnimation *> iterAin(aniList);
QPropertyAnimation *tempAni;
int i = 0;
if(iter.hasNext()){ //mySignalIn -->> shanliang
connect(this,SIGNAL(mySignalIn()),s_pSignalMapper,SLOT(map()));
s_pSignalMapper->setMapping(this,i);
i++;
}
while(iter.hasNext()){ //move -->> shanliang
tempAni = iterAin.next();
if(!tempAni)qDebug() << "NULL";
connect(tempAni,SIGNAL(finished()),s_pSignalMapper,SLOT(map()));
s_pSignalMapper->setMapping(tempAni,i);
i++;
}
connect(iterAin.next(),SIGNAL(finished()),this,SLOT(collect()));
connect(s_pSignalMapper,SIGNAL(mapped(int)),this,SLOT(shanLiang(int)));


编译不报错,一运行就出错。
谁能告诉我为什么??
...全文
236 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
cky050 2013-04-02
  • 打赏
  • 举报
回复
引用 1 楼 c114455 的回复:
QListIterator<QToolButton *> iter(numList); QListIterator<QPropertyAnimation *> iterAin(aniList); QToolButton *tempButton; int i = 0; if(iter.hasNext()){ ……
嗯嗯。
c114455 2013-04-02
  • 打赏
  • 举报
回复
QListIterator<QToolButton *> iter(numList); QListIterator<QPropertyAnimation *> iterAin(aniList); QToolButton *tempButton; int i = 0; if(iter.hasNext()){ tempButton = iter.next(); connect(this,SIGNAL(mySignalIn()),tempButton,SLOT(click())); connect(tempButton,SIGNAL(clicked()),s_pSignalMapper,SLOT(map())); s_pSignalMapper->setMapping(tempButton,i); i++; } while(iter.hasNext()){ tempButton = iter.next(); connect(iterAin.next(),SIGNAL(finished()),tempButton,SLOT(click())); connect(tempButton,SIGNAL(clicked()),s_pSignalMapper,SLOT(map())); s_pSignalMapper->setMapping(tempButton,i); i++; } connect(iterAin.next(),SIGNAL(finished()),this,SLOT(collect())); connect(s_pSignalMapper,SIGNAL(mapped(int)),this,SLOT(shanLiang(int))); //shanlaing --> move connect(this,SIGNAL(mySignalMove(int)),this,SLOT(SetAnimation(int)));

3,423

社区成员

发帖
与我相关
我的任务
社区描述
其他开发语言 其他开发语言
社区管理员
  • 其他开发语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧