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

 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中写槽函数时忘记加括号了,然而编译也通过了,但是就是定时到了不执行槽函数。希望不要再犯如此小错误。

相关文章:

  • 2022-12-23
  • 2021-10-24
  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
  • 2022-12-23
  • 2021-10-14
猜你喜欢
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2021-11-18
  • 2021-08-05
  • 2022-12-23
相关资源
相似解决方案