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

Double-clicking QLineEdit、QTextEdit under the touch screen does not select a word

    XMLWordPrintable

Details

    • Linux/X11

    Description

      Double-clicking QLineEdit under the touch screen does not select a word,Three mouse clicks do not select the line.
      1.

          if (!mouseMove && positionChanged) {
              QWindowSystemInterfacePrivate::MouseEvent moveEvent(window, e->timestamp,
                  e->localPos, e->globalPos, e->buttons ^ button, e->modifiers, Qt::NoButton,
                  e->nonClientArea ? QEvent::NonClientAreaMouseMove : QEvent::MouseMove,
                  e->source, e->nonClientArea);
              if (e->synthetic())
                  moveEvent.flags |= QWindowSystemInterfacePrivate::WindowSystemEvent::Synthetic;
              qWarning()<< "positionChanged:"<< moveEvent.device << e->device;
              processMouseEvent(&moveEvent); // mouse move excluding state change
              processMouseEvent(e); // the original mouse event
              return;
          }
      

      Print the message when double-click under the touch screen(error1.mp4):

      positionChanged: {color:red}QPointingDevice("core pointer" Mouse id=1){color}      {color:red}QPointingDevice("Silicon Integrated System Co. SiS HID Touch Controller" TouchScreen id=c seat=30002 ptrType=Finger caps=Position|NormalizedPosition|Scroll maxPts=10){color}
      QLineEdit::mousePressEvent:  1106
      positionChanged: {color:red}QPointingDevice("core pointer" Mouse id=1){color}       {color:red}QPointingDevice("Silicon Integrated System Co. SiS HID Touch Controller" TouchScreen id=c seat=30002 ptrType=Finger caps=Position|NormalizedPosition|Scroll maxPts=10){color}
      QLineEdit::mousePressEvent:  1110
      

      2.

          if (mouseMove) {
              QGuiApplicationPrivate::lastCursorPosition = globalPoint;
              const auto doubleClickDistance = (e->device && e->device->type() == QInputDevice::DeviceType::Mouse ?
                          mouseDoubleClickDistance : touchDoubleTapDistance);
              const auto pressPos = persistentPoint.globalPressPosition();
              if (qAbs(globalPoint.x() - pressPos.x()) > doubleClickDistance ||
                  qAbs(globalPoint.y() - pressPos.y()) > doubleClickDistance)
                  mousePressButton = Qt::NoButton;
               qWarning()<<"doubleClickDistance: "<< doubleClickDistance << mouseDoubleClickDistance << touchDoubleTapDistance;
          } else {
              mouse_buttons = e->buttons;
              if (mousePress) {
                  ulong doubleClickInterval = static_cast<ulong>(QGuiApplication::styleHints()->mouseDoubleClickInterval());
                  doubleClick = e->timestamp - persistentPoint.pressTimestamp() < doubleClickInterval && {color:red}button{color} == {color:red}mousePressButton{color};
                  qWarning()<<"doubleClick: "<< button << mousePressButton;
                  mousePressButton = button;
              }
          }
      

      Print the message when double-click under the touch screen(error2.mp4),*It is obvious that the problem is caused by a e->device->type() error,*Will cause mousePressButton to be updated to Qt:: noButton and cause DoubleClick to be false :

      doubleClickDistance1:  15 15 30
      doubleClickDistance2:  QInputDevice::DeviceType::Mouse QInputDevice::DeviceType::Mouse
      doubleClick:  false Qt::LeftButton Qt::NoButton
      doubleClickDistance1:  30 15 30
      doubleClickDistance2:  QInputDevice::DeviceType::TouchScreen QInputDevice::DeviceType::Mouse
      doubleClickDistance1:  30 15 30
      doubleClickDistance2:  QInputDevice::DeviceType::TouchScreen QInputDevice::DeviceType::Mouse
      doubleClickDistance1:  15 15 30 // *error*
      doubleClickDistance2:  QInputDevice::DeviceType::Mouse{color} QInputDevice::DeviceType::Mouse
      doubleClick:  false Qt::LeftButton Qt::NoButton
      doubleClickDistance1:  30 15 30
      doubleClickDistance2:  QInputDevice::DeviceType::TouchScreen QInputDevice::DeviceType::Mouse
      doubleClickDistance1:  30 15 30
      doubleClickDistance2:  QInputDevice::DeviceType::TouchScreen QInputDevice::DeviceType::Mouse
      

      Attachments

        1. error1.mp4
          385 kB
        2. error2.mp4
          909 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            axelspoerl Axel Spoerl
            dami dami Lu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There is 1 open Gerrit change