Hi,

I'm a freshman on qml plug-in development.
I want to simulate key and mouse events for testing my qml script automatically.
Now, I can simulate the key event successfully by 
"item->scene()->sendEvent(item, &keyEvent);"

But it cannot work when I call "item->scene()->sendEvent(item, &mouseEvent);" 
to simulate mouse event.
I've tried another way "QApplication::sendEvent(view, &mouseEvent);", but it 
still cannot work.
The return value is always false.

My qml script is follow, it can output log when I click actual mouse key.
Rectangle {
   id: container
......

MouseArea {

       id: mouseArea

       anchors.fill: parent

       onClicked: {

           mouse.accepted  = true;

           console.log("Mouse Clicked! key: " + mouse.button + " | keys: " + 
mouse.buttons);

       }
}

Do you have any suggestion?

Best Regards,

Kevin Wang
_______________________________________________
Qt-qml mailing list
Qt-qml@trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-qml

Reply via email to