• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ postEvent函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中postEvent函数的典型用法代码示例。如果您正苦于以下问题:C++ postEvent函数的具体用法?C++ postEvent怎么用?C++ postEvent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: CyCity

void CvDllPythonEvents::reportCityRename( CvCity *pCity )
{
	if (preEvent())
	{
		CyArgsList eventData;
		eventData.add("cityRename");						// add key to lookup python handler fxn

		CyCity* pCyCity = new CyCity(pCity);
		eventData.add(gDLL->getPythonIFace()->makePythonObject(pCyCity));

		postEvent(eventData);
		delete pCyCity;
	}
}
开发者ID:DCMF,项目名称:Dawn-of-Civilization,代码行数:14,代码来源:CvDllPythonEvents.cpp


示例2: postEvent

void CvDllPythonEvents::reportModNetMessage(int iData1, int iData2, int iData3, int iData4, int iData5)
{
	if (preEvent())
	{
		CyArgsList eventData;
		eventData.add("ModNetMessage");				// add key to lookup python handler fxn
		eventData.add(iData1);
		eventData.add(iData2);
		eventData.add(iData3);
		eventData.add(iData4);
		eventData.add(iData5);
		postEvent(eventData);
	}
}
开发者ID:DCMF,项目名称:Dawn-of-Civilization,代码行数:14,代码来源:CvDllPythonEvents.cpp


示例3: CyUnit

void CvDllPythonEvents::reportUnitRename(CvUnit *pUnit)
{
	if (preEvent())
	{
		CyArgsList eventData;
		eventData.add("UnitRename");						// add key to lookup python handler fxn

		CyUnit* pCyUnit = new CyUnit(pUnit);
		eventData.add(gDLL->getPythonIFace()->makePythonObject(pCyUnit));

		postEvent(eventData);
		delete pCyUnit;
	}
}
开发者ID:DCMF,项目名称:Dawn-of-Civilization,代码行数:14,代码来源:CvDllPythonEvents.cpp


示例4: CyPlot

void CvDllPythonEvents::reportPlotPicked(CvPlot *pPlot)
{
	if (preEvent())
	{
		CyArgsList eventData;
		eventData.add("plotPicked");						// add key to lookup python handler fxn

		CyPlot* pCyPlot = new CyPlot(pPlot);
		eventData.add(gDLL->getPythonIFace()->makePythonObject(pCyPlot));

		postEvent(eventData);
		delete pCyPlot;
	}
}
开发者ID:DCMF,项目名称:Dawn-of-Civilization,代码行数:14,代码来源:CvDllPythonEvents.cpp


示例5: int

void DccVoiceThread::stopPlaying()
{
#ifndef COMPILE_DISABLE_DCC_VOICE
	//qDebug("Stop playing");
	if(!m_bPlaying)return;

	KviThreadDataEvent<int> * e = new KviThreadDataEvent<int>(KVI_DCC_THREAD_EVENT_ACTION);
	e->setData(new int(KVI_DCC_VOICE_THREAD_ACTION_STOP_PLAYING));
	postEvent(parent(),e);

	m_bPlaying = false;
	if(!m_bRecording)closeSoundcard();
#endif
}
开发者ID:philouvb,项目名称:KVIrc,代码行数:14,代码来源:DccVoiceWindow.cpp


示例6: locker

/*!
 * Creates a new session and sends the session key to the web browser.
 *
 * Subclasses may override this function to perform custom session initialization,
 * but they must call the base class implementation in order to update the internal
 * session database and fetch a new session ID.
 */
int QxtHttpSessionManager::newSession()
{
    QMutexLocker locker(&qxt_d().sessionLock);
    int sessionID = createService();
    QUuid key;
    do
    {
        key = QUuid::createUuid();
    }
    while (qxt_d().sessionKeys.contains(key));
    qxt_d().sessionKeys[key] = sessionID;
    postEvent(new QxtWebStoreCookieEvent(sessionID, qxt_d().sessionCookieName, key.toString()));
    return sessionID;
}
开发者ID:AshotN,项目名称:tomahawk,代码行数:21,代码来源:qxthttpsessionmanager.cpp


示例7: switch

 TagValue::operator FCam::Time &() const {
     switch (type) {
     case Null:
         postEvent(Event::Error, Event::BadCast, "Cannot cast a null to a time");
         dummyTime = FCam::Time(0, 0); return dummyTime;
     case Int:
         postEvent(Event::Error, Event::BadCast, "Cannot cast an int to a time");
         dummyTime = FCam::Time(0, 0); return dummyTime;
     case Float:
         postEvent(Event::Error, Event::BadCast, "Cannot cast a float to a time");
         dummyTime = FCam::Time(0, 0); return dummyTime;
     case Double:
         postEvent(Event::Error, Event::BadCast, "Cannot cast a double to a time");
         dummyTime = FCam::Time(0, 0); return dummyTime;
     case String:
         postEvent(Event::Error, Event::BadCast, "Cannot cast a string to a time");
         dummyTime = FCam::Time(0, 0); return dummyTime;
     case Time:
         return ((FCam::Time *)data)[0];
     case IntVector:
         postEvent(Event::Error, Event::BadCast, "Cannot cast an int vector to a time");
         dummyTime = FCam::Time(0, 0); return dummyTime;
     case FloatVector:
         postEvent(Event::Error, Event::BadCast, "Cannot cast a float vector to a time");
         dummyTime = FCam::Time(0, 0); return dummyTime;
     case DoubleVector:
         postEvent(Event::Error, Event::BadCast, "Cannot cast a double vector to a time");
         dummyTime = FCam::Time(0, 0); return dummyTime;
     case StringVector:
         postEvent(Event::Error, Event::BadCast, "Cannot cast a string vector to a time");
         dummyTime = FCam::Time(0, 0); return dummyTime;
     case TimeVector:
         postEvent(Event::Error, Event::BadCast, "Cannot cast a time vector to a time");
         dummyTime = FCam::Time(0, 0); return dummyTime;
     }
     dummyTime = FCam::Time(0, 0); return dummyTime;
 }
开发者ID:bayanbatn,项目名称:cs478assignment2,代码行数:37,代码来源:TagValue.cpp


示例8: postEvent

void ICQMain::deliver(PACKET *p)
{
	// If this is a local session, deliver it locally
	ClientSession *s = sessionHash->get(p->to);
	if (s) {
		postEvent(EV_S_IN, s, p);
		return;
	}

	// Otherwise, let some modules to handle it
	EVENT ev;
	ev.event = EV_DELIVER;
	ev.conn = NULL;
	ev.mapi = this;
	ev.s = NULL;
	ev.packet = p;

	if (dispatchEvent(&ev))
		return;

	// No module handled it, deliver it as if this is an offline event
	if (!p->online)
		postEvent(EV_S_IN, NULL, p);
}
开发者ID:cysfek,项目名称:openq-ng.linq2,代码行数:24,代码来源:icqmain.cpp


示例9: dataLock

int ConnectThread::run()
{
	MYSQL* sql = m_mysql->lockHandle();
	if (!mysql_real_connect(sql, stringOrNull(m_host), stringOrNull(m_user), stringOrNull(m_pass), stringOrNull(m_database), m_port, stringOrNull(m_unixSocket), m_clientFlag))
	{
		MutexLocker dataLock(m_dataMutex);
		m_success = false;
		m_error = std::string( mysql_error(sql) );
		postEvent( CONNECTION_FINISHED );

		m_mysql->unlockHandle();
		return 0;
	}
	else
	{
		MutexLocker dataLock(m_dataMutex);
		m_success = true;
		m_error = "";
		postEvent( CONNECTION_FINISHED );

		m_mysql->unlockHandle();
		return 0;
	}
}
开发者ID:100acrebb,项目名称:gmsv_mysqloo,代码行数:24,代码来源:CLASS_ConnectThread.cpp


示例10: int

void DccVoiceThread::startPlaying()
{
#ifndef COMPILE_DISABLE_DCC_VOICE
    //qDebug("Start playing");
    if(m_bPlaying)return;

    if(openSoundcardForWriting())
    {
        KviThreadDataEvent<int> * e = new KviThreadDataEvent<int>(KVI_DCC_THREAD_EVENT_ACTION);
        e->setData(new int(KVI_DCC_VOICE_THREAD_ACTION_START_PLAYING));
        postEvent(parent(),e);
        m_bPlaying = true;
    }
#endif
}
开发者ID:xeddmc,项目名称:KVIrc,代码行数:15,代码来源:DccVoiceWindow.cpp


示例11: lockAudio

void AmSession::clearAudio()
{
  lockAudio();
  if(input){
    input->close();
    input = 0;
  }
  if(output){
    output->close();
    output = 0;
  }
  unlockAudio();
  DBG("Audio cleared !!!\n");
  postEvent(new AmAudioEvent(AmAudioEvent::cleared));
}
开发者ID:BackupTheBerlios,项目名称:sems-svn,代码行数:15,代码来源:AmSession.cpp


示例12: postEvent

/**
 * Starts the application.
 * Note that this method only returns when the application terminates.
 * @return The return code of the application.
 */
int Application::run()
{
	// Create the main window.
	// We can do it on the stack, as the method does not return as long as the
	// application is running.
	MainWindow mainWnd;
	mainWnd_ = &mainWnd;
	mainWnd_->show();

	// Do application initialisation.
	// The reason for posting an event is to have a running application (event
	// loop) before starting the initialisation process. This way, the process
	// can take full advantage of the event mechanism.
	postEvent(this, new QEvent(static_cast<QEvent::Type>(AppInitEvent)));

	return exec();
}
开发者ID:acampbell,项目名称:kscope,代码行数:22,代码来源:application.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ postMessage函数代码示例发布时间:2022-05-30
下一篇:
C++ post函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap