Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
6.4.0, 5.15
-
None
-
Ubuntu 18.04,Ubuntu 20.04
Description
Qt在Ubuntu20.4版本上无法获取触摸屏按压的尺寸,代码如下:
bool GraphicsView::viewportEvent(QEvent *event)
{
QEvent::Type type = event->type();
if(type == QEvent::TouchBegin || type == QEvent::TouchUpdate
type == QEvent::TouchEnd){ |
---|
QTouchEvent *pTouchEvent = static_cast(event);
QList touchPoints = pTouchEvent->touchPoints();
int nId = 0;
QColor penColor;
foreach (const QTouchEvent::TouchPoint tp, touchPoints)
{ qDebug() << "id" << tp.id() << "size" << tp.ellipseDiameters() << "position" << tp.pos(); }return true;
}
return QGraphicsView::viewportEvent(event);
}