企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
[TOC] ## QObject ## 常用函数 ## startTimer 通过 startTimer 触发 timerEvent, 每个n时刻,触发 ``` class MyObject : public QObject { Q_OBJECT public: MyObject(QObject *parent = 0); protected: void timerEvent(QTimerEvent *event); }; MyObject::MyObject(QObject *parent) : QObject(parent) { startTimer(50); // 每个50毫秒出发一次 timerEvent } void MyObject::timerEvent(QTimerEvent *event) { qDebug() << "Timer ID:" << event->timerId(); } ```