How to Adding event onClick in MapImage element in QML?
-
Hi developers..
I create an application that using Ovi Maps (Map Element). I put some MapImage element on the maps. I want to add Event Handling (like a button) in MapImage element. I try to put MouseArea in MapImage but it doesn’t work. Anybody can help? Have another solutions?
-
Hi,
you should use "MapMouseArea":http://doc.qt.nokia.com/qtmobility/qml-mapmousearea.html
-
Yeah I've found it. Thanks. But the problem is, when I implemet onClicked, it doesn't works with left-click on my mouse, but it works with right-click. I try deploy the application onto device and not running properly. What should I do?
-
It sounds odd. The default mouse button is the left. Stating on docs you can try with:
@acceptedButtons: Qt.LeftButton@
-
hello, I have the exactly same problem, the onClicked event works with every button but Leftbutton, I've tried acceptedButtons: Qt.LeftButton with no luck. any advice is welcome.
cheers.
-
Same problem, it does only work with right button on desktop / simulator, and does not work at all on Symbian. I tried to change acceptedButtons with no luck
-
It is most probably because your general MouseArea is on top of your Map and catches events. You should either place it before your Map in the code or add "z: 1" in your map properties to place it in front.