首页 > 其他 > 详细

Qt 槽函数的使用

时间:2014-08-25 09:52:44      阅读:327      评论:0      收藏:0      [点我收藏+]

今天在代码中遇到这样一个问题,自己感觉槽和函数都写的没错,但是就是不执行槽函数,因为是一个定时器的使用,即定时时间到了就执行槽函数。

 1 SeventhWizardPage::SeventhWizardPage(QWidget *parent) :
 2     QWizardPage(parent),
 3     ui(new Ui::SeventhWizardPage),
 4     parent(parent)
 5 {
 6     ui->setupUi(this);
 7     m_pDispatcher = new CSCSETLDispatcher;
 8     m_pTimer = new QTimer(this);
 9     connect(m_pTimer, SIGNAL(timeout()), this, SLOT(UpdateData));
10 }

自己看了好久才发现其中的错误,就是在connect中写槽函数时忘记加括号了,然而编译也通过了,但是就是定时到了不执行槽函数。希望不要再犯如此小错误。

Qt 槽函数的使用

原文:http://www.cnblogs.com/lit10050528/p/3934279.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!