Qt World Summit: Register Today!

QTouchEvent : No TouchBegin if I don't Move or Up

  • Hi all,
    I have a problem handling QTouchEvent.

    • I call QWidget::setAttribute(Qt::WA_AcceptTouchEvents);
    • I receive QEvent::TouchBegin QEvent::TouchUpdate QEvent::TouchEnd

    But, if i touch the screen without moving at all, I receive the touchBegin only when I up my finger ( and i receive the TouchEnd event just after)
    How can I do to receive the TouchBegin event once I touch the screen?

    Thank you for your answers.

  • What platform, which Qt version, what kind of hardware? Normally you should receive the TouchBegin immediately, what you describe is indeed quite odd.

  • I work on Windows Seven with Qt4.6.3 and NVIDIA Quadro 600.
    I notice that I had the same problem with Windows Seven event but I solved it using TWF_WANTPALM flag.
    Thank you.

  • Up!
    I haven't found any correct solution!


  • Same problem here, tried 5.x.x till 5.2.1 versions, Panasonic CF-C1, Windows 7 64bit.

  • Ok, sorry, I didn't saw BenjaminLong BenjaminLong solution.
    Then I confirm this will work after QMainWindow::show :
    WId wid = my_mindow->winId();
    if ( !RegisterTouchWindow((HWND)wid,TWF_WANTPALM) )
    qWarning() << "RegisterTouchWindow failed !";


  • Yes but this is a solution for Windows API.
    For Qt, I've only used :

    @6120 : You have the correct behaviour I descrided with Qt?

  • I'm using Qt ... on Windows ...

    For my case I couldn't get any contextMenuEvent.
    I have checked the received event of my widget and I had the same strange behaviour as you described in your first post...
    adding TWF_WANTPALM on the native handle of my mainwindow solved it, now I receive TouchEvents immediately and contextMenuEvents are working fine.

    I also noticed some dificulties with drag and drop, I have to check If that is solving the problem.


Log in to reply