QTimer 5.0.2

来源:互联网 发布:魔法特效制作软件 编辑:程序博客网 时间:2024/06/06 02:29


//信号----------------------------------------------------------

timeout();  //间隔时间超时后发出

QObject::destroyed(QObject * obj = 0)  // 对象销毁时发出


//槽函数----------------------------------------------------------

void QTimer::start() //开始启动定时器 可以设定参数毫秒

void QTimer::stop()   //停止定时器 但不销毁


// 常用函数-------------------------------------------------------

时间精度

Qt::TimerType

Qt::PreciseTimer       0     Precise timers try to keep millisecond accuracy

Qt::CoarseTimer        1    Coarse timers try to keep accuracy within 5% of the desired interval

Qt::VeryCoarseTimer    2   Very coarse timers only keep full second accuracy

void setTimerType(Qt::TimerType atype) //设置时间精度


blockSignals(bool b) : bool //b=true 阻断对象发出的信号b=false 不阻断信号的发出


bool signalsBlocked();  //信号是否被阻断 返回true 是 /false 不是


bool isSingleShot()  // 返回true 是单一定时器  false 不是


setSingleShot(bool b)  b=true 设置为单次定时器 (发送一次信号后停止工作,ID=-1,但不会销毁对象,需要重新start)   b=fasle (需要start  )


int remainingTime() //返回到定时间器第一次发出消息的剩余时间(毫秒)

// 返回 0  定时器超时   -1 无效的定时器(start后才有效)


int interval()  //  返回定时间的时间间隔(毫秒)  没有设定时间间隔则返回0


void setInterval(int msec);  //  设定 时间间隔 (毫秒)


void QTimer::singleShot(int msec, const QObject * receiver, const char * member)  //单一定时间


QThread * QObject::thread() const //  返回该对象的线程的生命


int timerId()   //返回运行的 定时器的ID  其他情况 -1


deleteLater()  //销毁对象 与delete不用 其与消息循环结合等待对象的所以事物完成才销毁


//信号----------------------------------------------------------

timeout();  //间隔时间超时后发出

QObject::destroyed(QObject * obj = 0)  // 对象销毁时发出


//槽函数----------------------------------------------------------

void QTimer::start() //开始启动定时器 可以设定参数毫秒

void QTimer::stop()   //停止定时器 但不销毁


// 常用函数-------------------------------------------------------

时间精度

Qt::TimerType

Qt::PreciseTimer       0     Precise timers try to keep millisecond accuracy

Qt::CoarseTimer        1    Coarse timers try to keep accuracy within 5% of the desired interval

Qt::VeryCoarseTimer    2   Very coarse timers only keep full second accuracy

void setTimerType(Qt::TimerType atype) //设置时间精度


blockSignals(bool b) : bool //b=true 阻断对象发出的信号b=false 不阻断信号的发出


bool signalsBlocked();  //信号是否被阻断 返回true 是 /false 不是


bool isSingleShot()  // 返回true 是单一定时器  false 不是


setSingleShot(bool b)  b=true 设置为单次定时器 (发送一次信号后停止工作,ID=-1,但不会销毁对象,需要重新start)   b=fasle (需要start  )


int remainingTime() //返回到定时间器第一次发出消息的剩余时间(毫秒)

// 返回 0  定时器超时   -1 无效的定时器(start后才有效)


int interval()  //  返回定时间的时间间隔(毫秒)  没有设定时间间隔则返回0


void setInterval(int msec);  //  设定 时间间隔 (毫秒)


void QTimer::singleShot(int msec, const QObject * receiver, const char * member)  //单一定时间


QThread * QObject::thread() const //  返回该对象的线程的生命


int timerId()   //返回运行的 定时器的ID  其他情况 -1


deleteLater()  //销毁对象 与delete不用 其与消息循环结合等待对象的所以事物完成才销毁


0 0
原创粉丝点击