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. QTouchEvent : No TouchBegin if I don't Move or Up

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

Scheduled Pinned Locked Moved General and Desktop
8 Posts 3 Posters 5.9k 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.
  • B Offline
    B Offline
    BenjaminLong
    wrote on last edited by
    #1

    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.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      agocs
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • B Offline
        B Offline
        BenjaminLong
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          BenjaminLong
          wrote on last edited by
          #4

          Up!
          I haven't found any correct solution!

          Thanks

          1 Reply Last reply
          0
          • 6 Offline
            6 Offline
            6l20
            wrote on last edited by
            #5

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

            1 Reply Last reply
            0
            • 6 Offline
              6 Offline
              6l20
              wrote on last edited by
              #6

              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 !";
              }
              @

              TY

              1 Reply Last reply
              0
              • B Offline
                B Offline
                BenjaminLong
                wrote on last edited by
                #7

                Yes but this is a solution for Windows API.
                For Qt, I've only used :
                @setAttribute(Qt::WA_AcceptTouchEvents);@

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

                1 Reply Last reply
                0
                • 6 Offline
                  6 Offline
                  6l20
                  wrote on last edited by
                  #8

                  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.

                  Regards

                  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