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


C++ TouchPoint::id方法代码示例

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


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

示例1: removeTouchPoint

void GestureEngine::removeTouchPoint(QTouchEvent::TouchPoint e)
{
    gwc::touchpoint removed_point;
    removed_point.init(e.id(), e.pos().x() / 1920, e.pos().y()/ 1080, 0, 1, 1);
    removed_point.status = gwc::TOUCHREMOVED;
    addEvent(removed_point);
}
开发者ID:cassab,项目名称:Decorato_Sketching,代码行数:7,代码来源:gestureengine.cpp

示例2: updateTouchPoint

void GestureEngine::updateTouchPoint(QTouchEvent::TouchPoint e)
{
    gwc::touchpoint updated_point;
    updated_point.init(e.id(), e.pos().x() / 1920, e.pos().y()/ 1080, 0, 1, 1);
    updated_point.status = gwc::TOUCHUPDATE;
    addEvent(updated_point);
}
开发者ID:cassab,项目名称:Decorato_Sketching,代码行数:7,代码来源:gestureengine.cpp

示例3: addTouchPoint

void GestureEngine::addTouchPoint(QTouchEvent::TouchPoint e)
{
    gwc::touchpoint new_point;
    new_point.init(e.id(), e.pos().x() / 1920, e.pos().y() / 1080, 0, 1920, 1080);
    new_point.status = gwc::TOUCHADDED;
    addEvent(new_point);

    qDebug() << "Added to Gestureworks";
}
开发者ID:cassab,项目名称:Decorato_Sketching,代码行数:9,代码来源:gestureengine.cpp

示例4: touchStateToString

QDebug operator<<(QDebug dbg, const QTouchEvent::TouchPoint &s)
{
	dbg.nospace() << "\"TouchPoint\":"
			<< "{ \"id\":" << s.id()
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
			<< ", \"primary\":\"" << (s.isPrimary() ? "true" : "false") << "\""
#endif
			<< ", \"state\":" << touchStateToString(s.state())
			<< ", \"pos\":\"" << s.pos() << "\""
			<< ", \"pressure\":\"" << s.pressure() << "\""
			<< " }";
	return dbg.space();
}
开发者ID:KyleMaas,项目名称:luna-sysmgr,代码行数:13,代码来源:debugglobal.cpp

示例5: switch

PlatformTouchPoint::PlatformTouchPoint(const QTouchEvent::TouchPoint& point)
{
    // The QTouchEvent::TouchPoint API states that ids will be >= 0.
    m_id = static_cast<unsigned>(point.id());
    switch (point.state()) {
    case Qt::TouchPointReleased: m_state = TouchReleased; break;
    case Qt::TouchPointMoved: m_state = TouchMoved; break;
    case Qt::TouchPointPressed: m_state = TouchPressed; break;
    case Qt::TouchPointStationary: m_state = TouchStationary; break;
    }
    m_screenPos = point.screenPos().toPoint();
    m_pos = point.pos().toPoint();
}
开发者ID:1833183060,项目名称:wke,代码行数:13,代码来源:PlatformTouchPointQt.cpp

示例6:

PlatformTouchPoint::PlatformTouchPoint(const QTouchEvent::TouchPoint& point, State state)
    // The QTouchEvent::TouchPoint API states that ids will be >= 0.
    : m_id(point.id())
    , m_state(state)
    , m_screenPos(point.screenPos().toPoint())
    , m_pos(point.pos().toPoint())
{
    // Qt reports touch point size as rectangles, but we will pretend it is an oval.
    QRect touchRect = point.rect().toAlignedRect();
    if (touchRect.isValid()) {
        m_radiusX = point.rect().width() / 2;
        m_radiusY = point.rect().height() / 2;
    } else {
        // http://www.w3.org/TR/2011/WD-touch-events-20110505: 1 if no value is known.
        m_radiusX = 1;
        m_radiusY = 1;
    }
    m_force = point.pressure();
    // FIXME: Support m_rotationAngle if QTouchEvent at some point supports it.
}
开发者ID:xiaolu31,项目名称:webkit-node,代码行数:20,代码来源:PlatformTouchPointQt.cpp


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