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


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

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


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

示例1:

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

示例2: createWebGestureEvent

WebGestureEvent WebEventFactory::createWebGestureEvent(const QTouchEvent::TouchPoint& point, const WebEvent::Type& gestureType, const QTransform& fromItemTransform)
{
    WebEvent::Type type             = gestureType;
    IntPoint position               = fromItemTransform.map(point.pos()).toPoint();
    IntPoint screenPosition         = point.screenPos().toPoint();
    WebEvent::Modifiers modifiers   = WebEvent::Modifiers(0);
    double timestamp                = 0;
    IntSize area                    = IntSize(point.rect().size().toSize());
    FloatPoint delta                = FloatPoint(0, 0);

    return WebGestureEvent(type, position, screenPosition, modifiers, timestamp, area, delta);
}
开发者ID:rgabor-dev,项目名称:webkitnix,代码行数:12,代码来源:WebEventFactoryQt.cpp

示例3: handleDoubleTapEvent

void QtWebPageEventHandler::handleDoubleTapEvent(const QTouchEvent::TouchPoint& point)
{
    QTransform fromItemTransform = m_webPage->transformFromItem();
    m_webPageProxy->findZoomableAreaForPoint(fromItemTransform.map(point.pos()).toPoint(), IntSize(point.rect().size().toSize()));
}
开发者ID:kanongil,项目名称:webkit,代码行数:5,代码来源:QtWebPageEventHandler.cpp

示例4: handleSingleTapEvent

void QtWebPageEventHandler::handleSingleTapEvent(const QTouchEvent::TouchPoint& point)
{
    m_postponeTextInputStateChanged = true;

    QTransform fromItemTransform = m_webPage->transformFromItem();
    WebGestureEvent gesture(WebEvent::GestureSingleTap, fromItemTransform.map(point.pos()).toPoint(), point.screenPos().toPoint(), WebEvent::Modifiers(0), 0, IntSize(point.rect().size().toSize()), FloatPoint(0, 0));
    m_webPageProxy->handleGestureEvent(gesture);
}
开发者ID:kanongil,项目名称:webkit,代码行数:8,代码来源:QtWebPageEventHandler.cpp

示例5: handlePotentialSingleTapEvent

void QtWebPageEventHandler::handlePotentialSingleTapEvent(const QTouchEvent::TouchPoint& point)
{
#if ENABLE(TOUCH_EVENTS)
    if (point.pos() == QPointF()) {
        // An empty point deactivates the highlighting.
        m_webPageProxy->handlePotentialActivation(IntPoint(), IntSize());
    } else {
        QTransform fromItemTransform = m_webPage->transformFromItem();
        m_webPageProxy->handlePotentialActivation(IntPoint(fromItemTransform.map(point.pos()).toPoint()), IntSize(point.rect().size().toSize()));
    }
#else
    Q_UNUSED(point);
#endif
}
开发者ID:kanongil,项目名称:webkit,代码行数:14,代码来源:QtWebPageEventHandler.cpp

示例6: handleDoubleTapEvent

void QtWebPageEventHandler::handleDoubleTapEvent(const QTouchEvent::TouchPoint& point)
{
    if (!m_webView->isInteractive())
        return;

    deactivateTapHighlight();
    QTransform fromItemTransform = m_webPage->transformFromItem();
    m_webPageProxy->findZoomableAreaForPoint(fromItemTransform.map(point.pos()).toPoint(), IntSize(point.rect().size().toSize()));
}
开发者ID:iArnaud,项目名称:webkitnix,代码行数:9,代码来源:QtWebPageEventHandler.cpp

示例7: activateTapHighlight

void QtWebPageEventHandler::activateTapHighlight(const QTouchEvent::TouchPoint& point)
{
#if ENABLE(TOUCH_EVENTS)
    ASSERT(!point.pos().toPoint().isNull());
    ASSERT(!m_isTapHighlightActive);
    m_isTapHighlightActive = true;
    QTransform fromItemTransform = m_webPage->transformFromItem();
    m_webPageProxy->handlePotentialActivation(IntPoint(fromItemTransform.map(point.pos()).toPoint()), IntSize(point.rect().size().toSize()));
#else
    Q_UNUSED(point);
#endif
}
开发者ID:iArnaud,项目名称:webkitnix,代码行数:12,代码来源:QtWebPageEventHandler.cpp


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