Hi
i am developing on a touch Screen, but i have a particular problem for QML 1.1 where my generated MouseEvents are not being delivered to internal MouseAreas of a QML file. The outerMouseArea captures event but does not send it internally

Qt Code:
  1. Rectangle {
  2. id: screen;
  3.  
  4. /* Content */
  5. width: 800;
  6. height: 480;
  7.  
  8. Rectangle{
  9. id:header
  10. width: 300
  11. height: 42
  12. color: "blue"
  13. anchors.right: parent.right
  14. anchors.bottom: parent.bottom
  15. anchors.rightMargin: 10
  16. anchors.bottomMargin: 10
  17.  
  18. MouseArea{
  19. id: headerMouse
  20. width: header.width
  21. height: header.height
  22. x: header.x
  23. y: header.y
  24.  
  25.  
  26. onEntered:
  27. {
  28. console.log("on Entered");
  29. console.log("mouseArea x", x);
  30. console.log("mouseArea y", y);
  31. console.log("mouseArea width", width);
  32. console.log("mouseArea height", height);
  33. }
  34. onPressed:
  35. {
  36. console.log("onClicked inside X", mouseX);
  37. console.log("onClicked inside Y", mouseY);
  38. mouse.accepted = false;
  39. }
  40. }
  41. }
  42.  
  43. Rectangle{
  44. id:header2
  45. width: 300
  46. height: 42
  47. color: "yellow"
  48. anchors.left: parent.left
  49. anchors.leftMargin: 10
  50. anchors.top: parent.top
  51. anchors.topMargin: 10
  52.  
  53.  
  54. MouseArea{
  55. id: header2Mouse
  56. width: header2.width
  57. height: header2.height
  58. x: header2.x
  59. y: header2.y
  60.  
  61.  
  62. onEntered:
  63. {
  64. console.log("on Entered in header 2");
  65. console.log("mouseArea x", x);
  66. console.log("mouseArea y", y);
  67. console.log("mouseArea width", width);
  68. console.log("mouseArea height", height);
  69. }
  70. onPressed:
  71. {
  72. console.log("onClicked inside header 2", mouseX);
  73. console.log("onClicked inside header 2", mouseY);
  74. mouse.accepted = false;
  75. }
  76. }
  77. }
  78.  
  79. MouseArea
  80. {
  81. anchors.fill: parent
  82. onEntered:
  83. {
  84. console.log("area parent X", mouseX);
  85. console.log("area parent Y", mouseY);
  86. }
  87.  
  88. }
  89. onPressed:
  90. {
  91. mouse.accepted = false;
  92. }
  93. }
  94. }
To copy to clipboard, switch view to plain text mode 


I am using seperate thread to generate MouseEvents
Qt Code:
  1. QCursor::setPos(position.x, position.y);
  2. QPoint absoluteWidgetPosition = d->getViewer()->mapToGlobal(QPoint(0, 0));
  3. int relativeX = position.x - absoluteWidgetPosition.x();
  4. int relativeY = position.y - absoluteWidgetPosition.y();
  5.  
  6.  
  7. if(newState == PANEL_RELEASED)
  8. {
  9. qApp->postEvent(view, new QMouseEvent(QEvent::MouseButtonRelease, QPoint(relativeX,relativeY), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier));
  10.  
  11. qDebug() << "QEvent::MouseButtonPress Panel released: x" << relativeX << "y:" << relativeY;
  12. }
  13. else if(newState ==PANEL_PRESSED)
  14. {
  15. qApp->postEvent(view, new QMouseEvent(QEvent::MouseButtonPress, QPoint(relativeX,relativeY), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier));
  16.  
  17. qDebug() << "QEvent::MouseButtonPress Panel pressed: x" << relativeX << "y:" << relativeY ;
  18. }
To copy to clipboard, switch view to plain text mode 

I am capturing events in a derived class of QtQuick1ApplicationViewe
Qt Code:
  1. #include "myview.h"
  2. #include "qdebug.h"
  3.  
  4. MyView::MyView(QWidget *parent) :
  5. QtQuick1ApplicationViewer(parent)
  6. {
  7. }
  8.  
  9.  
  10. bool MyView::event(QEvent *e)
  11. {
  12. if((e->type() == QEvent::MouseButtonPress) ||
  13. (e->type() == QEvent::MouseButtonRelease))
  14. return QWidget::event(e);
  15. else
  16. return QtQuick1ApplicationViewer::event(e);
  17.  
  18. }
  19.  
  20. void MyView::mousePressEvent(QMouseEvent *evt)
  21. {
  22. qDebug() << "MouseEvent Press type" << evt->type();
  23.  
  24.  
  25. QtQuick1ApplicationViewer::mousePressEvent(evt);
  26. }
  27.  
  28. void MyView::mouseReleaseEvent(QMouseEvent *evt)
  29. {
  30. qDebug() << "MouseEvent Release type" << evt->type();
  31.  
  32. QtQuick1ApplicationViewer::mouseReleaseEvent(evt);
  33. }
To copy to clipboard, switch view to plain text mode 


Can anyone tell what the problem is. Thanks in advance.