Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to Adding event onClick in MapImage element in QML?
Qt 6.11 is out! See what's new in the release blog

How to Adding event onClick in MapImage element in QML?

Scheduled Pinned Locked Moved QML and Qt Quick
7 Posts 5 Posters 6.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • D Offline
      D Offline
      deimos
      wrote on last edited by
      #2

      Hi,

      you should use "MapMouseArea":http://doc.qt.nokia.com/qtmobility/qml-mapmousearea.html

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        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?

        1 Reply Last reply
        0
        • D Offline
          D Offline
          deimos
          wrote on last edited by
          #4

          It sounds odd. The default mouse button is the left. Stating on docs you can try with:

          @acceptedButtons: Qt.LeftButton@

          1 Reply Last reply
          0
          • A Offline
            A Offline
            adrz1
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                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.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved