
正文
Qt 槽函数的使用
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
今天在代码中遇到这样一个问题,自己感觉槽和函数都写的没错,但是就是不执行槽函数,因为是一个定时器的使用,即定时时间到了就执行槽函数。
SeventhWizardPage::SeventhWizardPage(QWidget *parent) :
QWizardPage(parent),
ui(new Ui::SeventhWizardPage),
parent(parent)
{
ui->setupUi(this);
m_pDispatcher = new CSCSETLDispatcher;
m_pTimer = new QTimer(this);
connect(m_pTimer, SIGNAL(timeout()), this, SLOT(UpdateData));
}
自己看了好久才发现其中的错误,就是在connect中写槽函数时忘记加括号了,然而编译也通过了,但是就是定时到了不执行槽函数。希望不要再犯如此小错误。








