Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-109215

Qt在Ubuntu20.4版本上无法获取触摸屏按压的尺寸

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.4.0, 5.15
    • Core: I/O
    • None
    • Ubuntu 18.04,Ubuntu 20.04
    • Linux/X11

    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);

      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            zhuhongguo Zhu Hongguo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes