本文整理汇总了C++中sendAction函数的典型用法代码示例。如果您正苦于以下问题:C++ sendAction函数的具体用法?C++ sendAction怎么用?C++ sendAction使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sendAction函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sendAction
void
GraphicsScene::mouseReleaseEvent(QMouseEvent* event)
{
m_move = false;
sendAction("Pan", "0");
sendAction("Tilt", "0");
event->accept();
}
示例2: twoPointDis
void OurEnemyActor::walkingAgent(ACTORid enemyID, EnemyTeam **team, int teamCount)
{
float origin[3] = {0,0,0};
//敵人位置
float enemyPos[3];
FnActor enemy;
enemy.Object(enemyID);
enemy.GetPosition(enemyPos);
//自己位置
float selfPos[3];
FnActor self;
self.Object(aID);
self.GetPosition(selfPos);
float selfFDir[3], selfUDir[3];
actor.GetDirection(selfFDir,selfUDir);
float distance = twoPointDis(selfPos, enemyPos);
float flockingPos[3];
flockingPosition(flockingPos, selfPos, enemyPos, team, teamCount);
float flockingDis = twoPointDis(flockingPos, origin);
float newPos[3];
newPos[0] = flockingPos[0]+selfPos[0];
newPos[1] = flockingPos[1]+selfPos[1];
newPos[2] = flockingPos[2]+selfPos[2];
//先轉向再移動,再轉回來
actorFaceTo(aID, newPos[0], newPos[1], newPos[2]);
actor.MoveForward(flockingDis,true);
//actor.SetWorldDirection(selfFDir,selfUDir);
actorFaceTo(aID, enemyPos[0], enemyPos[1], enemyPos[2]);
//actor.SetPosition(newPos);
if(distance < AWARE_DISTANCE)
{
if(distance <= COMBAT_DISTANCE)
{
sendAction(ourCombatIdleAction);
}
else
{
sendAction(ourRunAction);
actor.MoveForward(SPEED, TRUE, FALSE, 0.0f, TRUE);
}
}
else
{
sendAction(ourIdleAction);
}
}
示例3: bloodAdjust
void Donzo::damaged( int attack_pt, ACTORid attacker, float angle )
{
HP -= attack_pt;
bloodAdjust();
if( HP < 0 )
sendAction(ourDieAction);
else{
if( angle < 180 )
sendAction(ourDamageHAction);
else
sendAction(ourDamageLAction);
}
}
示例4: sendAction
void GroupChatForm::onSendTriggered()
{
QString msg = msgEdit->toPlainText();
if (msg.isEmpty())
return;
msgEdit->setLastMessage(msg);
msgEdit->clear();
if (group->getPeersCount() != 1)
{
if (msg.startsWith("/me ", Qt::CaseInsensitive))
{
msg = msg.right(msg.length() - 4);
emit sendAction(group->getGroupId(), msg);
}
else
{
emit sendMessage(group->getGroupId(), msg);
}
}
else
{
if (msg.startsWith("/me ", Qt::CaseInsensitive))
addSelfMessage(msg.right(msg.length() - 4), true, QDateTime::currentDateTime(), true);
else
addSelfMessage(msg, false, QDateTime::currentDateTime(), true);
}
}
示例5: RPCResponse
//==============================================================================
// server...
void MinosRPCServer::queueResponse( std::string to )
{
RPCResponse * m = new RPCResponse( to, id, methodName );
m->args = callArgs.args; // copy vector of pointers
sendAction( m );
delete m;
}
示例6: sendAction
QString AsteriskManager::actionSIPshowpeer(QString peer)
{
QVariantMap headers;
headers["Peer"] = peer;
return sendAction("SIPshowpeer", headers);
}
示例7: glBindFramebuffer
void ShadowPointLight::shadowMap(Action action) {
Shader *shader = action.getParameterPointer<Shader>("shader");
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
glViewport(0, 0, resolution, resolution);
clear();
glm::mat4 projection = glm::perspective(90.0f, 1.0f, nearPlane, farPlane); // FOV = 90 degrees, aspect ratio = resolution / resolution = 1
glm::mat4 transforms[6];
transforms[0] = projection * glm::lookAt(position, position + glm::vec3(1.0f, 0.0f, 0.0f), glm::vec3(0.0f, -1.0f, 0.0f));
transforms[1] = projection * glm::lookAt(position, position + glm::vec3(-1.0f, 0.0f, 0.0f), glm::vec3(0.0f, -1.0f, 0.0f));
transforms[2] = projection * glm::lookAt(position, position + glm::vec3(0.0f, 1.0f, 0.0f), glm::vec3(0.0f, 0.0f, 1.0f));
transforms[3] = projection * glm::lookAt(position, position + glm::vec3(0.0f, -1.0f, 0.0f), glm::vec3(0.0f, 0.0f, -1.0f));
transforms[4] = projection * glm::lookAt(position, position + glm::vec3(0.0f, 0.0f, 1.0f), glm::vec3(0.0f, -1.0f, 0.0f));
transforms[5] = projection * glm::lookAt(position, position + glm::vec3(0.0f, 0.0f, -1.0f), glm::vec3(0.0f, -1.0f, 0.0f));
for (int i = 0; i < 6; ++i)
(*shader)["shadowMatrices[" + std::to_string(i) + "]"] = transforms[i];
(*shader)["lightPosition"] = position;
(*shader)["farPlane"] = farPlane;
Action render("render");
render.setRecursive(true);
render.addParameter("shader", shader);
sendAction(render, target);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
}
示例8: toHtml
/*! Handle keyboard events. */
void InputTextWidget::keyPressEvent(QKeyEvent* event)
{
// Send message on Return
if ((event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter)
&& (event->modifiers() == Qt::NoModifier || event->modifiers() == Qt::KeypadModifier)) {
// Prevents empty messages
if (toPlainText().trimmed().isEmpty()) {
return;
}
if (toPlainText().startsWith("/me ") ) {
QString html = toHtml();
html.remove(html.indexOf("/me "), 4);
emit sendAction(Smileypack::desmilify(html));
} else {
emit sendMessage(Smileypack::desmilify(toHtml()));
}
// not only clears the text, but also removes undo/redo history
clear();
// Override default shortcuts
} else if (event == QKeySequence::Copy) {
copyPlainText();
} else if (event == QKeySequence::Cut) {
cutPlainText();
} else if (event == QKeySequence::Paste) {
pastePlainText();
// Normal text writing
} else {
QTextEdit::keyPressEvent(event);
}
}
示例9: toHtml
/*! Handle keyboard events. */
void InputTextWidget::keyPressEvent(QKeyEvent* event)
{
// Send message on Return
if ((event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter)
&& (event->modifiers() == Qt::NoModifier || event->modifiers() == Qt::KeypadModifier)) {
if (toPlainText().startsWith("/me ") ) {
QString html = toHtml();
html.remove(html.indexOf("/me "), 4);
emit sendAction(EmoticonMenu::desmile(html));
} else {
emit sendMessage(EmoticonMenu::desmile(toHtml()));
}
clear();
// Override default shortcuts
} else if (event == QKeySequence::Copy) {
copyPlainText();
} else if (event == QKeySequence::Cut) {
cutPlainText();
} else if (event == QKeySequence::Paste) {
pastePlainText();
// Normal text writing
} else {
QTextEdit::keyPressEvent(event);
}
}
示例10: RPCRequest
//==============================================================================
void MinosRPCClient::queueCall( std::string to )
{
RPCRequest * m = new RPCRequest( to, methodName );
m->setNextId(); // only happens if no Id already
m->args = callArgs.args; // copy vector of pointers
sendAction( m );
delete m;
}
示例11: QObject
MotionDetectorWrapper::MotionDetectorWrapper(QObject *parent) :
QObject(parent),
m_motionDetector(new MotionDetector),
m_thread(new QThread),
m_showDetection(false)
{
qRegisterMetaType<cv::Mat>("cv::Mat");
qDebug() << "MotionDetecotWrapper created";
connect(m_motionDetector, SIGNAL(sendAction(QString)), SIGNAL(sendAction(QString)));
connect(m_thread, SIGNAL(finished()), m_motionDetector, SLOT(deleteLater()));
connect(m_motionDetector, &MotionDetector::showIm, this, &MotionDetectorWrapper::drawIm, Qt::QueuedConnection);
m_motionDetector->moveToThread(m_thread);
m_thread->start();
}
示例12: insertNotEmpty
QString AsteriskManager::actionLogin(QString username, QString secret)
{
QVariantMap headers;
headers["Username"] = username;
insertNotEmpty(&headers, "Secret", secret);
return sendAction("Login", headers);
}
示例13: sendAction
/**
* @brief GameView::sendSquad Action utilisateur demandant l'envoi de squad
* @param from Noeud source
* @param to Noeud de destination
*/
void GameView::sendSquad(Node *from, Node *to)
{
NodeCombat *nodeFromTmp = dynamic_cast <NodeCombat*>(from);
int nbRessource = (int)(nodeFromTmp->getRessources()*(ressUi->getPercentToSend()/100));
if(nodeFromTmp != 0)
{
NodeConnectable *nodeToComba = dynamic_cast <NodeConnectable*>(to);
NodeMana *nodeToMana = dynamic_cast <NodeMana*>(to);
if(nodeToComba != 0)
{
sendAction(GA_SEND, nodeFromTmp->getId(), nodeToComba->getId(),nbRessource);
}
else if(nodeToMana != 0 && nodeFromTmp->getOwner() != 0 &&
nodeFromTmp->getOwner()->getId() == owner->getId())
{
powerUi->addMana(nbRessource);
sendAction(GA_MANA_BURN, nodeFromTmp->getId(), 0,nbRessource);
}
}
}
示例14: center_button_callscreen
void center_button_callscreen(ClickRecognizerRef recognizer, Window *window)
{
if (busy) return;
if (callEstablished)
{
speakerOn = !speakerOn;
renderActionBar();
}
sendAction(1);
}