当前位置: 首页>>代码示例>>C++>>正文


C++ QTimer::interval方法代码示例

本文整理汇总了C++中QTimer::interval方法的典型用法代码示例。如果您正苦于以下问题:C++ QTimer::interval方法的具体用法?C++ QTimer::interval怎么用?C++ QTimer::interval使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QTimer的用法示例。


在下文中一共展示了QTimer::interval方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: QObject

SessionServer::SessionServer(QObject *parent)
	: QObject(parent),
	_store(nullptr),
	_identman(nullptr),
	_sessionLimit(1),
	_connectionTimeout(0),
	_historyLimit(0),
	_expirationTime(0),
	_allowPersistentSessions(false),
	_mustSecure(false)
{
	QTimer *cleanupTimer = new QTimer(this);
	connect(cleanupTimer, &QTimer::timeout, this, &SessionServer::cleanupSessions);
	cleanupTimer->setInterval(15 * 1000);
	cleanupTimer->start(cleanupTimer->interval());

	_publicListingApi = new sessionlisting::AnnouncementApi(this);

	connect(_publicListingApi, &sessionlisting::AnnouncementApi::sessionAnnounced, this, &SessionServer::sessionAnnounced);
	connect(_publicListingApi, &sessionlisting::AnnouncementApi::messageReceived, [this](const QString &msg) {
		wall("Session announced: " + msg);
	});

	QTimer *announcementRefreshTimer = new QTimer(this);
	connect(announcementRefreshTimer, &QTimer::timeout, this, &SessionServer::refreshSessionAnnouncements);
	announcementRefreshTimer->setInterval(1000 * 60 * 5);
	announcementRefreshTimer->start(announcementRefreshTimer->interval());

#ifndef NDEBUG
	_randomlag = 0;
#endif
}
开发者ID:Rambo2015,项目名称:Drawpile,代码行数:32,代码来源:sessionserver.cpp

示例2: interval

int QTimerProto::interval() const
{
  QTimer *item = qscriptvalue_cast<QTimer*>(thisObject());
  if (item)
    return item->interval();
  return -1;
}
开发者ID:AlFoX,项目名称:qt-client,代码行数:7,代码来源:qtimerproto.cpp

示例3: property

QScriptValue TimerClass::property(const QScriptValue &object,
				  const QScriptString &name, uint /*id*/) {
  QTimer *timer = qscriptvalue_cast<QTimer*>(object.data()); 
  if (!timer)
    return QScriptValue();
  if (name == _interval) {
    return timer->interval();
  } else if (name == _singleShot) {
    return timer->isSingleShot();
  }
  return QScriptValue();
}
开发者ID:alex-games,项目名称:a1,代码行数:12,代码来源:TimerClass.cpp

示例4: QObject

SessionServer::SessionServer(QObject *parent)
	: QObject(parent),
	_store(nullptr),
	_identman(nullptr),
	_sessionLimit(1),
	_connectionTimeout(0),
	_historyLimit(0),
	_expirationTime(0),
	_allowPersistentSessions(false),
	_mustSecure(false)
{
	QTimer *cleanupTimer = new QTimer(this);
	connect(cleanupTimer, SIGNAL(timeout()), this, SLOT(cleanupSessions()));
	cleanupTimer->setInterval(15 * 1000);
	cleanupTimer->start(cleanupTimer->interval());
}
开发者ID:sendomin,项目名称:Drawpile,代码行数:16,代码来源:sessionserver.cpp


注:本文中的QTimer::interval方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。