title: Adding markers/places to Qt QML Maps?
body: <p>Good day ! I am designing a <strong>Qt-based GUI platform</strong> that <em>displays a map</em> and allows users to <em>add markers/pins</em> on top of the map.</p>
  
  <p>I am rendering the map in a QtQuickWidget using the following QML:          </p>
  
  <pre><code>Plugin {
      id: mapPlugin
      name: "osm"
  }
  </code></pre>
  
  <p>I want to allow the user to <strong>add an interactive pin on the map</strong> using a button on a form. The user can press and hold a point on the map which will open the form, where the user can name the place and press <strong>OK</strong>.</p>
  
  <p><a href="https://i.stack.imgur.com/7Jc0r.png" rel="nofollow noreferrer">Example of interactive pin</a></p>
  
  <p><em>Example of what I want to achieve:</em> <a href="https://webmshare.com/play/5EXV8" rel="nofollow noreferrer">https://webmshare.com/play/5EXV8</a></p>
  
  <hr>
  
  <ol>
  <li><p>I have tried using QQmlComponent and QQuickView but I was
  unsuccessful
  [<a href="http://doc.qt.io/qt-5/qtqml-cppintegration-interactqmlfromcpp.html]" rel="nofollow noreferrer">http://doc.qt.io/qt-5/qtqml-cppintegration-interactqmlfromcpp.html]</a></p></li>
  <li><p>Another way is to add objects within QML itself using <em>MapItems</em> but
      this is very unintuitive. This is what my map.qml looks like:
      <a href="https://gist.github.com/blackvitriol/7941688d6362162888630a28c79f8cd9" rel="nofollow noreferrer">https://gist.github.com/blackvitriol/7941688d6362162888630a28c79f8cd9</a></p></li>
  </ol>
  
  <p>Project Structure: <a href="https://imgur.com/a/P8YAS" rel="nofollow noreferrer">https://imgur.com/a/P8YAS</a></p>
  
  <p><strong>Can someone tell me how to allow the user to press and hold left click on the map, then add a marker to that point ?</strong> </p>