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

C++ sendAction函数代码示例

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

本文整理汇总了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();
}
开发者ID:HSOFEUP,项目名称:dune,代码行数:8,代码来源:GraphicsScene.cpp


示例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);
    }
}
开发者ID:MBRSL,项目名称:NTUGameProgramming2011,代码行数:53,代码来源:OurEnemyActor.cpp


示例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);
	}
}
开发者ID:fikacschoko,项目名称:NTUGameProgramming2011,代码行数:13,代码来源:Donzo.cpp


示例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);
    }
}
开发者ID:Artom-Kozincev,项目名称:qTox,代码行数:29,代码来源:groupchatform.cpp


示例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;
}
开发者ID:BackupTheBerlios,项目名称:minos-svn,代码行数:9,代码来源:XMPPRPCObj.cpp


示例6: sendAction

QString AsteriskManager::actionSIPshowpeer(QString peer)
{
  QVariantMap headers;
  headers["Peer"] = peer;

  return sendAction("SIPshowpeer", headers);
}
开发者ID:dwatson78,项目名称:Qt-Asterisk-Desktop,代码行数:7,代码来源:asteriskmanager.cpp


示例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);
}
开发者ID:jonathanbuchanan,项目名称:Sunglasses,代码行数:31,代码来源:ShadowPointLight.cpp


示例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);
    }
}
开发者ID:ankeshanand,项目名称:ProjectTox-Qt-GUI,代码行数:33,代码来源:inputtextwidget.cpp


示例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);
    }
}
开发者ID:Martijnvdc,项目名称:ProjectTox-Qt-GUI,代码行数:28,代码来源:inputtextwidget.cpp


示例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;
}
开发者ID:BackupTheBerlios,项目名称:minos-svn,代码行数:9,代码来源:XMPPRPCObj.cpp


示例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();
}
开发者ID:Katod,项目名称:SmartVP,代码行数:17,代码来源:motiondetectorwrapper.cpp


示例12: insertNotEmpty

QString AsteriskManager::actionLogin(QString username, QString secret)
{
  QVariantMap headers;
  headers["Username"] = username;

  insertNotEmpty(&headers, "Secret", secret);

  return sendAction("Login", headers);
}
开发者ID:dwatson78,项目名称:Qt-Asterisk-Desktop,代码行数:9,代码来源:asteriskmanager.cpp


示例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);
        }
    }
}
开发者ID:LukasBitter,项目名称:P2,代码行数:25,代码来源:gameview.cpp


示例14: center_button_callscreen

void center_button_callscreen(ClickRecognizerRef recognizer, Window *window)
{
    if (busy) return;

    if (callEstablished)
    {
        speakerOn = !speakerOn;
        renderActionBar();
    }

    sendAction(1);
}
开发者ID:vitaliyy,项目名称:PebbleDialer-Watchapp,代码行数:12,代码来源:callscreen.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ sendBuffer函数代码示例发布时间:2022-05-30
下一篇:
C++ send函数代码示例发布时间: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