Results 1 to 5 of 5

Thread: touchEvent register on a single widget on a multitouch screen

  1. #1
    Join Date
    Apr 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default touchEvent register on a single widget on a multitouch screen

    Hi,

    I am currently trying to create a multitouch onscreen keyboard.
    I own an asus t91mt, which has a dualtouch touchscreen.
    My problem is that, although a TouchEvent can registers up to 2 touches, two different widgets cannot be touched at the same time.

    It seems that once a widget recieves a TouchEvent, other widgets cannot, so that the second finger touch can only be recieved by the first widget touched.

    All my widgets have the Qt::WA_AcceptTouchEvents property set.

    Does anybody knows a way to bypass that issue ?

    I would really like some help here, as I have been banging my head on the walls trying to figure that out.

    Thanks in advance.

  2. #2
    Join Date
    Apr 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: touchEvent register on a single widget on a multitouch screen

    A quick update :
    I have finally found that using setAttribute(Qt::AA_DontCreateNativeWidgetsSibblin gs) on my app allows it to function properly. But only with the first multi touch event. I cant press two buttons simultaneously, but only once. Any further atempt will miserably fail.

    Is this a bug , or I have missed yet another thing ?

  3. #3
    Join Date
    Feb 2010
    Posts
    99
    Thanks
    31
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: touchEvent register on a single widget on a multitouch screen

    I am also facing exactly same issue.
    The fingerpaint example works fine but the Multitouch Dial example doesn't work. I am using Qt 4.6.2 and Qt Creator 1.3
    Does anyone know how to solve the issue?

  4. #4
    Join Date
    Feb 2010
    Posts
    99
    Thanks
    31
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: touchEvent register on a single widget on a multitouch screen

    Update:

    Currently I am trying that two buttons receive touch event at the same time. But only one button receives the event.

    Now if I place the buttons on a QFrame, they receive multitouch event but only for the first time, after that only one button receives touch event.
    Here behavior is similar to post#2 by tihoulas.

    I don't know what different happens when I place the buttons on QFrame. Any pointers would be helpful. Can some one point me to Nokia/Qt guys who might know about it?

    Thanks

  5. #5
    Join Date
    Feb 2010
    Posts
    99
    Thanks
    31
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: touchEvent register on a single widget on a multitouch screen

    Update:

    I think I have found the cause of this issue but not sure if that's by design or a bug in QWidget.
    As explained in above posts first time two widgets receive multi-touch events but after that only one widget receives touch events.
    Usually Qt doesn't create separate native widgets for each widget that is placed upon main window (unless Qt::WA_NativeWindow attribute is set). It only creates one native widget and maintains child widgets. You can confirm this using Spy++ (which comes along with Visual Studio) or similar tool. I found that after the first touch/mouse event, Qt creates a native widget for the knob even if QCoreApplication::setAttribute(Qt::AA_DontCreateNa tiveWidgetSiblings) is done. So now if you touch that knobs it will grab the touch event and won't allow other knobs to receive simultaneous event.

    I also made changes in QWidget::winID() and added following code
    Qt Code:
    1. if(QCoreApplication::testAttribute(Qt::AA_DontCreateNativeWidgetSiblings)==false)
    2. that->setAttribute(Qt::WA_NativeWindow);
    To copy to clipboard, switch view to plain text mode 
    instead of
    Qt Code:
    1. that->setAttribute(Qt::WA_NativeWindow);
    To copy to clipboard, switch view to plain text mode 
    My changes fixes issue, and now I can move multiple knobs simultaneously more than once. Let me know if someone thinks that this might break something. Also let me know where can I post this issue so that Qt team can fix it or justify current behavior.


    Added after 1 2 minutes:


    FYI:

    This is a bug and is already reported to Qt team. You can track it at Qt-BugReport
    Last edited by dpatel; 2nd December 2010 at 07:51.

Similar Threads

  1. Cannot register Service name on System Bus
    By drf in forum Qt Programming
    Replies: 1
    Last Post: 19th April 2012, 03:44
  2. Replies: 1
    Last Post: 6th February 2010, 10:54
  3. How can i make widget automatically adjust screen size
    By kapoorsudhish in forum Qt Programming
    Replies: 3
    Last Post: 23rd October 2009, 16:21
  4. How to register a font with Qt?
    By Vadi in forum Qt Programming
    Replies: 5
    Last Post: 1st February 2009, 06:33
  5. widget's cooridanates into screen coordinates.
    By Rakesh_Kumar in forum Qt Programming
    Replies: 1
    Last Post: 19th November 2008, 05:16

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.