Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Macbook trackpad & singer finger events
Forum Updated to NodeBB v4.3 + New Features

Macbook trackpad & singer finger events

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    ixSci
    wrote on last edited by
    #1

    Hi there!

    I'm trying to get event when user touch the trackpad with single finger but have no success. I receive events only for 2 more fingers.
    I've set Qt::WA_AcceptTouchEvents and Qt::WA_TouchPadAcceptSingleTouchEvents to the main window.
    What else should I do to start receive those events?

    Thanks!

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tucnak
      wrote on last edited by
      #2

      On the words you are doing all in the right way. Can you show snippet of your code?

      1 Reply Last reply
      0
      • I Offline
        I Offline
        ixSci
        wrote on last edited by
        #3

        @MainWindow::MainWindow(QWidget *parent)
        {
        ...
        qApp->installEventFilter(this);
        setAttribute(Qt::WA_AcceptTouchEvents);
        setAttribute(Qt::WA_TouchPadAcceptSingleTouchEvents);
        }
        bool MainWindow::eventFilter(QObject *, QEvent * pEvent)
        {
        switch(pEvent->type())
        {
        case QEvent::TouchBegin:
        qDebug("BEGIN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
        break;
        case QEvent::TouchUpdate:
        qDebug("UPDATE!!!!!!!!!!!!!!!!!!!!!!!!!!");
        break;
        case QEvent::TouchEnd:
        qDebug("END!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
        break;
        };
        return false;
        }@
        It prints nothing for 1 finger.

        1 Reply Last reply
        0
        • I Offline
          I Offline
          ixSci
          wrote on last edited by
          #4

          It seems I've found the issue: widgets which are lied on top of my window receive touch events and since they doesn't have Qt::WA_TouchPadAcceptSingleTouchEvents, just ignore it.
          Is there a better solution then just set that flag to all descendants recursively?

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved