Results 1 to 8 of 8

Thread: QTouchEvent issue

  1. #1
    Join Date
    Feb 2012
    Posts
    2
    Qt products
    Qt4 Qt/Embedded

    Default QTouchEvent issue

    Hi all,
    I am working with QT Creator on a basic application trying to catch touch pad events: basic single finger touch events and then I would like to investigate multi-touch (by using an external Logitech multi-touch pad).
    I am using a “standard” ASUS laptop, with its own embedded touchpad.
    As OS I am using Ubuntu 11.04 release., with Qt 4.7.
    As reference I used the fingerpaint project here: http://doc.qt.nokia.com/4.7-snapshot...ngerpaint.html

    But I ***can’t catch*** any of the event
    QEvent::TouchBegin
    QEvent::TouchUpdate
    QEvent::TouchEnd
    But just mouse events.

    See ScribbleArea::event(QEvent *event) in the scribblearea.cpp

    Any help? Could it be due to the fact that the touchpad driver has a behavior like the mouse?
    How can I catch the finger event, when I pass it on the touch pad?

    Thanks in advance for you help
    Massimiliano

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QTouchEvent issue

    I'd expect that a regular touch pad would generate mouse events, not touch events...
    I'd try it on a device with a touch screen for example, or a with a touch pad which supports multiple touch points.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Feb 2012
    Posts
    2
    Qt products
    Qt4 Qt/Embedded

    Default Re: QTouchEvent issue

    Quote Originally Posted by high_flyer View Post
    I'd expect that a regular touch pad would generate mouse events, not touch events...
    I'd try it on a device with a touch screen for example, or a with a touch pad which supports multiple touch points.
    Hi,
    thanks for the feedback.
    I tried with a "Logitech Wireless touchpad" (http://www.logitech.com/en-us/mice-p...e/devices/8417)
    and I continue to ***not*** be able to catch any of the event
    QEvent::TouchBegin
    QEvent::TouchUpdate
    QEvent::TouchEnd
    but just mouse events.

    any help to solve this issue, would be much appreciated

    thanks in advance
    M

  4. #4
    Join Date
    Oct 2010
    Location
    Iran
    Posts
    27
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QTouchEvent issue

    bool window::event(QEvent *tevent)
    {
    ....
    ....
    ....

    return QWidget::event(tevent);

    }

  5. #5
    Join Date
    Oct 2013
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QTouchEvent issue

    Hi,

    Any answers for this question? I do have the same problem.

    Thanks for your help!

    Best Regards,
    Kumar

  6. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QTouchEvent issue

    Touch pads are not touch screens. As far as Qt is concerned, touch pads are mouse devices. It is irrelevant that you use them by touching them with your finger; that's a hardware detail.

    If you want an app to see touch events, you have to use a touch screen or something that emulates one.

  7. #7
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTouchEvent issue

    My understanding is that some touch pads are multi touch capable, i.e. like touch screens.

    However, Qt is not involved there at all. If the input system does only report mouse events, it only has mouse events to work with.
    If the input system reports touch events, then Qt passes those on as well.

    Cheers,
    _

  8. #8
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QTouchEvent issue

    Yes, I probably should have said " As far as Qt is concerned, if the OS treats a touch pad as a mouse device, then Qt sees only mouse events".

    I guess one could write a driver that would treat a touch pad like a touch screen, but a finger is a pretty big and blunt pointing device in relation to the size of the touch pad. (Although the same relative sizes pertain to cell phone screens, I suppose).

Similar Threads

  1. How to simulate QTouchEvent using mouse
    By dpatel in forum Qt Programming
    Replies: 5
    Last Post: 28th April 2016, 01:40
  2. How to set QTouchEvent::TouchPoint primary?
    By elindros in forum Qt Programming
    Replies: 1
    Last Post: 21st January 2013, 19:20
  3. QTouchEvent Not Sending
    By QbelcorT in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 25th November 2010, 09:45
  4. QTouchEvent and State Machine Framework
    By acano in forum Qt Programming
    Replies: 1
    Last Post: 30th September 2010, 07:58
  5. Multiple widgets to receive QTouchEvent
    By jlin in forum Qt Programming
    Replies: 1
    Last Post: 15th December 2009, 04:37

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.