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


C++ Gesture::setAction方法代码示例

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


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

示例1: sGesture

void Parser::sGesture() {
    if (m_reader.isEndElement() && m_reader.name() == "gesture") {
        state.removeLast();
        return;
    } else if (m_reader.isStartElement() && m_reader.name() == "action") {
        state.append("ACTION");
        auto attrs = m_reader.attributes();
        if (!attrs.hasAttribute("type"))
            throw(err("Attribute 'type' expected."));

        Group *g = Memory::getGroup(appKey);
        g->addGest(ges->num, Lists::gT(ges->type), Lists::gD(ges->direction));
        Gesture *gest = g->getGest(ges->num, Lists::gT(ges->type), Lists::gD(ges->direction));
        gest->setAction(Lists::aT(attrs.value("type").toString()));
        //sAction(g->getGest(ges->num, Lists::gT(ges->type), Lists::gD(ges->direction))->getAction());->setAction(Lists::aT(attrs.value("type").toString()))
        QStringList params = m_reader.readElementText().split(":");
        foreach(const QString &p, params)
            gest->getAction()->addParam(p.section("=",0,0),p.section("=",1));

        state.removeLast();
    } else
开发者ID:f3r,项目名称:Touchegg-gce,代码行数:21,代码来源:parser.cpp

示例2: qDebug

Gesture *GestureHandler::createGesture(const QString &type, int id, const QHash<QString, QVariant>& attrs,
    bool isComposedGesture) const
{
    // Creamos el gesto sin su acción
    Gesture *ret;
    if (isComposedGesture)
        ret = this->gestureFact->createComposedGesture(type, id, attrs);
    else
        ret = this->gestureFact->createSimpleGesture(type, id, attrs);

    if (ret == NULL)
        return NULL;

    // Vemos sobre que ventana se ha ejecutado
    Window gestureWindow = this->getGestureWindow(attrs.value(GEIS_GESTURE_ATTRIBUTE_CHILD_WINDOW_ID).toInt());
    //if (gestureWindow == None)
    //    return NULL;
    QString appClass = this->getAppClass(gestureWindow);

    // Creamos y asignamos la acción asociada al gesto
    ActionTypeEnum::ActionType actionType = this->config->getAssociatedAction(appClass, ret->getType(),
            ret->getNumFingers(), ret->getDirection());
    QString actionSettings = this->config->getAssociatedSettings(appClass, ret->getType(), ret->getNumFingers(),
            ret->getDirection());
    QString timing = this->config->getAssociatedTiming(appClass, ret->getType(), ret->getNumFingers(),
            ret->getDirection());

    ret->setAction(this->actionFact->createAction(actionType, actionSettings, timing, gestureWindow));

    // Mostramos los datos sobre el gesto
    qDebug() << "[+] New gesture:";
    qDebug() << "\tType      -> " << GestureTypeEnum::getValue(ret->getType());
    qDebug() << "\tFingers   -> " << ret->getNumFingers();
    qDebug() << "\tDirection -> " << GestureDirectionEnum::getValue(ret->getDirection());
    qDebug() << "\tAction    -> " << ActionTypeEnum::getValue(actionType);
    qDebug() << "\tTiming    -> " << timing;
    qDebug() << "\tApp Class -> " << appClass;

    return ret;
}
开发者ID:Eventide,项目名称:touchegg,代码行数:40,代码来源:GestureHandler.cpp


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