Hi,

I am trying to test the Dials Multitouch example which comes along with Qt. I am not sure is the issue in my setup, touch screen or Qt. I am facing exactly same issue (well partially) described here

Here is my project setup.

Qt 4.6.2
Qt Creator 1.3.1
Win 7 32 bit OS
Hp Compaq L2105tm Multitouch Monitor (supports 2 touches)

I am able to compile and run the application with following issues.

Firstly I have to add in main.cpp of the example (to receive multitouch event even for the first time)

Qt Code:
  1. QCoreApplication::setAttribute(Qt::AA_DontCreateNativeWidgetSiblings);
To copy to clipboard, switch view to plain text mode 

In release mode I can rotate two knobs only for the first time for each knob.
Usecases
Rotate knb1 knb2 -> works fine first time
Rotate knb1 knb2 again -> only one knob will rotate.
Rotate knb3 knb4 -> works fine since these knobs are rotated for the first time.
Now any combination of knobs between 1-4 will not work as expected. Only one knob is rotated even if I try to rotate two knobs.

In debug mode all the above cases work fine, i.e I can rotate any combination of two knobs any number of times (70% of times). Sometimes debug build is also not working as expected.

After digging into the issue for two days I found

(1) that in case of failures the touch event is directly received by the knobs and in case of correct behavior the touch event is first received by containing widget of knobs(int this case its QWidget) and from there the event is propagated to respective knob.

(2) In case of correct behavior the code returns from
Qt Code:
  1. if (!isActive())
  2. {
  3. return;
  4. }
To copy to clipboard, switch view to plain text mode 
which is at around line 230 in qt\src\gui\accessible\qaccessible_win.cpp. While in case of incorrect behavior the code goes further down in that function.

In case if its of any help, here goes the stack trace in case of correct behavior

Qt Code:
  1. 0 QDial::mouseMoveEvent qdial.cpp 349 0x00a29e70
  2. 1 QWidget::event qwidget.cpp 7983 0x006dc938
  3. 2 QAbstractSlider::event qabstractslider.cpp 956 0x009fbe56
  4. 3 QDial::event qdial.cpp 508 0x00a2a2a0
  5. 4 QApplicationPrivate::notify_helper qapplication.cpp 4300 0x00692520
  6. 5 QApplication::notify qapplication.cpp 3865 0x00690723
  7. 6 QCoreApplication::notifyInternal qcoreapplication.cpp 704 0x6a1fd302
  8. 7 QCoreApplication::sendEvent qcoreapplication.h 215 0x00ce6f9e
  9. 8 QWidget::event qwidget.cpp 8431 0x006ddbcf
  10. 9 QAbstractSlider::event qabstractslider.cpp 956 0x009fbe56
  11. 10 QDial::event qdial.cpp 508 0x00a2a2a0
  12. 11 QApplicationPrivate::notify_helper qapplication.cpp 4300 0x00692520
  13. 12 QApplication::notify qapplication.cpp 4265 0x006923a0
  14. 13 QCoreApplication::notifyInternal qcoreapplication.cpp 704 0x6a1fd302
  15. 14 QCoreApplication::sendSpontaneousEvent qcoreapplication.h 218 0x00ce6f4a
  16. 15 QApplicationPrivate::translateRawTouchEvent qapplication.cpp 5670 0x006941fc
  17. 16 QApplicationPrivate::translateTouchEvent qapplication_win.cpp 4067 0x006fa075
  18. 17 QtWndProc@16 qapplication_win.cpp 1680 0x006f2e8f
  19. 18 USER32!IsWindowVisible C:\Windows\system32\user32.dll 0 0x777f86ef
  20. 19 ?? 0 0x00060534
  21. 20 ?? 0 0x00000240
To copy to clipboard, switch view to plain text mode 

Stack trace in case of incorrect behavior
Qt Code:
  1. 0 QWidgetPrivate::registerTouchWindow qwidget_win.cpp 2050 0x0096e706
  2. 1 QWidgetPrivate::create_sys qwidget_win.cpp 494 0x00968781
  3. 2 QWidget::create qwidget.cpp 1319 0x0092ba61
  4. 3 QWidgetPrivate::createWinId qwidget.cpp 2310 0x0092f84e
  5. 4 QWidget::setAttribute qwidget.cpp 10392 0x00940f38
  6. 5 QWidget::winId qwidget.cpp 2281 0x0092f63a
  7. 6 QAccessible::updateAccessibility qaccessible_win.cpp 286 0x00db2145
  8. 7 QAbstractSlider::setValue qabstractslider.cpp 539 0x00c5b49a
  9. 8 QAbstractSlider::triggerAction qabstractslider.cpp 631 0x00c5b6fd
  10. 9 QAbstractSlider::setSliderPosition qabstractslider.cpp 499 0x00c5b397
  11. 10 QDial::mouseMoveEvent qdial.cpp 356 0x00c89ef6
  12. 11 QWidget::event qwidget.cpp 7983 0x0093c938
  13. 12 QAbstractSlider::event qabstractslider.cpp 956 0x00c5be3a
  14. 13 QDial::event qdial.cpp 508 0x00c8a284
  15. 14 QApplicationPrivate::notify_helper qapplication.cpp 4300 0x008f2520
  16. 15 QApplication::notify qapplication.cpp 3865 0x008f0723
  17. 16 QCoreApplication::notifyInternal qcoreapplication.cpp 704 0x6a1fd302
  18. 17 QCoreApplication::sendEvent qcoreapplication.h 215 0x00f46f7e
  19. 18 QWidget::event qwidget.cpp 8430 0x0093dbb3
  20. 19 QAbstractSlider::event qabstractslider.cpp 956 0x00c5be3a
  21. 20 QDial::event qdial.cpp 508 0x00c8a284
  22. 21 QApplicationPrivate::notify_helper qapplication.cpp 4300 0x008f2520
  23. 22 QApplication::notify qapplication.cpp 4265 0x008f23a0
  24. 23 QCoreApplication::notifyInternal qcoreapplication.cpp 704 0x6a1fd302
  25. 24 QCoreApplication::sendSpontaneousEvent qcoreapplication.h 218 0x00f46f2a
  26. 25 QApplicationPrivate::translateRawTouchEvent qapplication.cpp 5670 0x008f41fc
  27. 26 QApplicationPrivate::translateTouchEvent qapplication_win.cpp 4067 0x0095a059
  28. 27 QtWndProc@16 qapplication_win.cpp 1680 0x00952e73
  29. 28 USER32!IsWindowVisible C:\Windows\system32\user32.dll 0 0x777f86ef
  30. 29 ?? 0 0x00020362
  31. 30 ?? 0 0x00000240
  32. 31 USER32!IsWindowVisible C:\Windows\system32\user32.dll 0 0x777f8876
  33. 32 qt_is_translatable_mouse_event qapplication_win.cpp 1395 0x009520dd
  34. 33 USER32!IsWindowVisible C:\Windows\system32\user32.dll 0 0x777f89b5
  35. 34 ?? 0 0x00000000
To copy to clipboard, switch view to plain text mode 
Note:
The FingerPaint example that Qt provides works fine. I can draw with two finger everytimes (since my monitor only supports two simultaneous touches).

Now please enlighten me what going wrong here. I suspect that this issue is related to focus of the widgets.

Any pointers to further investigation or solution are appreciated.

Thanks