邢台网站建设哪家公司好,jsp网站开发 英文,上海网站建设培训,wordpress 无法自动更新实现效果
软件启动之后#xff0c;开始计时#xff0c;到达预定时间后#xff0c;调用其他类的某个函数。
类的分工
BaseType#xff1a;软件初始化的调用类 FuncType: 功能函数所在类
具体函数
// FuncType.h
class FuncType: public QObject
{Q_OBJECT
public:
publ…实现效果
软件启动之后开始计时到达预定时间后调用其他类的某个函数。
类的分工
BaseType软件初始化的调用类 FuncType: 功能函数所在类
具体函数
// FuncType.h
class FuncType: public QObject
{Q_OBJECT
public:
public slots:void slotFunction();
};// BaseType.h
#include memory
#include QTimer
#include FuncType.hclass BaseType: public QObject
{Q_OBJECT
public:
private:QTimer* m_clearTimer;std::shared_ptrFuncType m_functype{nullptr};
};// BaseType.cpp
FuncType::FuncType(QObject *parent) : QObject(parent)
{m_functype std::make_sharedFuncType();m_clearTimer new QTimer(this);connect(m_clearTimer, QTimer::timeout, m_functype.get(), FuncType::slotFunction);m_clearTimer-start(1000); // 1s
}