本文整理汇总了C++中QTimer::objectName方法的典型用法代码示例。如果您正苦于以下问题:C++ QTimer::objectName方法的具体用法?C++ QTimer::objectName怎么用?C++ QTimer::objectName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTimer
的用法示例。
在下文中一共展示了QTimer::objectName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: preSignalActivate
void TimerModel::preSignalActivate(QObject *caller, int methodIndex)
{
if (methodIndex != m_timeoutIndex) {
return;
}
QTimer *timer = qobject_cast<QTimer*>(caller);
if (!timer || timer->objectName().toLower().startsWith(QLatin1String("gammaray"))) {
return;
}
const TimerInfoPtr timerInfo = findOrCreateQTimerTimerInfo(timer);
if (!timerInfo) {
// Ok, likely a GammaRay timer
//cout << "TimerModel::preSignalActivate(): Unable to find timer "
// << (void*)timer << " (" << timer->objectName().toStdString() << ")!" << endl;
return;
}
if (!timerInfo->functionCallTimer()->start()) {
cout << "TimerModel::preSignalActivate(): Recursive timeout for timer "
<< (void*)timer << " (" << timer->objectName().toStdString() << ")!" << endl;
return;
}
Q_ASSERT(!m_currentSignals.contains(caller));
m_currentSignals[caller] = timerInfo;
}
示例2: timerTriggered_
void FileWatcher::timerTriggered_()
{
//cout << "Timer activated" << endl;
//get the timer instance
QTimer * timer = qobject_cast<QTimer *>(sender());
//emit the final for the file corresponding to the timer name
//cout << " - timer name: " << String(timer->objectName()) << endl;
//cout << " - timer file: " << String(timers_[timer->objectName()]) << endl;
emit fileChanged(String(timers_[timer->objectName()]));
//erase the timer name from the list
timers_.erase(timer->objectName());
}