本文整理汇总了C++中qtouchevent::TouchPoint::setNormalizedPos方法的典型用法代码示例。如果您正苦于以下问题:C++ TouchPoint::setNormalizedPos方法的具体用法?C++ TouchPoint::setNormalizedPos怎么用?C++ TouchPoint::setNormalizedPos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qtouchevent::TouchPoint
的用法示例。
在下文中一共展示了TouchPoint::setNormalizedPos方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleTouchEvent
void QWindowSystemInterface::handleTouchEvent(QWidget *tlw, ulong timestamp, QEvent::Type type, QTouchEvent::DeviceType devType, const QList<struct TouchPoint> &points)
{
if (!points.size()) // Touch events must have at least one point
return;
QList<QTouchEvent::TouchPoint> touchPoints;
Qt::TouchPointStates states;
QTouchEvent::TouchPoint p;
QList<struct TouchPoint>::const_iterator point = points.constBegin();
QList<struct TouchPoint>::const_iterator end = points.constEnd();
while (point != end) {
p.setId(point->id);
p.setPressure(point->pressure);
states |= point->state;
Qt::TouchPointStates state = point->state;
if (point->isPrimary) {
state |= Qt::TouchPointPrimary;
}
p.setState(state);
p.setRect(point->area);
p.setScreenPos(point->area.center());
p.setNormalizedPos(point->normalPosition);
touchPoints.append(p);
++point;
}
QWindowSystemInterfacePrivate::TouchEvent *e =
new QWindowSystemInterfacePrivate::TouchEvent(tlw, timestamp, type, devType, touchPoints);
QWindowSystemInterfacePrivate::queueWindowSystemEvent(e);
}