<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Adding a drop down menu to the map in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/adding-a-drop-down-menu-to-the-map/m-p/1061782#M4177</link>
    <description>&lt;P&gt;Is there a way to enable user to see a drop down menu when he/she right clicks to the map? And when he selects one of the items in that menu, some action needs to be performed.&lt;/P&gt;</description>
    <pubDate>Wed, 26 May 2021 13:53:18 GMT</pubDate>
    <dc:creator>FatmaAkdemir</dc:creator>
    <dc:date>2021-05-26T13:53:18Z</dc:date>
    <item>
      <title>Adding a drop down menu to the map</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/adding-a-drop-down-menu-to-the-map/m-p/1061782#M4177</link>
      <description>&lt;P&gt;Is there a way to enable user to see a drop down menu when he/she right clicks to the map? And when he selects one of the items in that menu, some action needs to be performed.&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 13:53:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/adding-a-drop-down-menu-to-the-map/m-p/1061782#M4177</guid>
      <dc:creator>FatmaAkdemir</dc:creator>
      <dc:date>2021-05-26T13:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a drop down menu to the map</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/adding-a-drop-down-menu-to-the-map/m-p/1063024#M4182</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/70678"&gt;@FatmaAkdemir&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes using a combination of the MapView and QtQuick.Controls you definitely could. You would need to listen for the MapView.onMouseClicked signal and then use&amp;nbsp;&lt;STRONG&gt;mouse.x&amp;nbsp;&lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;mouse.y&lt;/STRONG&gt; then use those to update the&amp;nbsp;&lt;STRONG&gt;x&lt;/STRONG&gt; and&amp;nbsp;&lt;STRONG&gt;y&lt;/STRONG&gt; of the QtQuick.Controls&amp;nbsp;&lt;STRONG&gt;ComboBox(drop down menu)&amp;nbsp;&lt;/STRONG&gt;which can take a &lt;STRONG&gt;ListModel(list of items in that menu)&lt;/STRONG&gt; then you can listen for the &lt;STRONG&gt;ComboBox.onActivated(int index)&lt;/STRONG&gt;&amp;nbsp;signal for the selection from that list and use the index to know which model from that list was selected and do whatever following action you would like.&lt;/P&gt;&lt;P&gt;Here is an example:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import QtQuick 2.6
import QtQuick.Controls 2.2
import QtQuick.Dialogs 1.2
import Esri.ArcGISRuntime 100.11

ApplicationWindow {
    id: appWindow
    width: 800
    height: 600
    title: "Example"

    property var myExModel : ["apple", "pie", "cherry", "pie"]

    // add a mapView component
    MapView {
        anchors.fill: parent
        // set focus to enable keyboard navigation
        focus: true

        // add a map to the mapview
        Map {
            // add the ArcGISStreets basemap to the map
            initBasemapStyle: Enums.BasemapStyleArcGISStreets
        }

        onMouseClicked: {
            myComboBox.x = mouse.x;
            myComboBox.y = mouse.y;
            myComboBox.visible = true;
        }
    }

    ComboBox {
        id: myComboBox
        model: myExModel
        visible: false

        onActivated: {
            myDialog.text = myExModel[index];
            visible = false;
            myDialog.open();
        }
    }

    MessageDialog {
        id: myDialog
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope you find this helpful!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;Jared&lt;/P&gt;</description>
      <pubDate>Fri, 28 May 2021 18:47:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/adding-a-drop-down-menu-to-the-map/m-p/1063024#M4182</guid>
      <dc:creator>JaredCaccamo</dc:creator>
      <dc:date>2021-05-28T18:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a drop down menu to the map</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/adding-a-drop-down-menu-to-the-map/m-p/1064020#M4196</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/297917"&gt;@JaredCaccamo&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;Thank you for the detailed answer. Unfortunately I am not using QML. Should I use QComboBox in this case? In fact I only need a pop-up button ("Delete") when user right clicks on a graphic. After user clicks on that button, graphic will be deleted from the map.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 12:22:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/adding-a-drop-down-menu-to-the-map/m-p/1064020#M4196</guid>
      <dc:creator>FatmaAkdemir</dc:creator>
      <dc:date>2021-06-02T12:22:37Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a drop down menu to the map</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/adding-a-drop-down-menu-to-the-map/m-p/1064139#M4201</link>
      <description>&lt;P&gt;Hello again&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/70678"&gt;@FatmaAkdemir&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In that case you can use&amp;nbsp;"mousePressed" with "RightButton" to catch the mouse events and "QMenu::exec" to open a context menu. Or if you don't want to use a menu, you could use "QPushButton" instead.&lt;/P&gt;&lt;P&gt;Documentation for C++:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-mapgraphicsview.html" target="_blank" rel="nofollow noopener noreferrer"&gt;https://developers.arcgis.com/qt/cpp/api-reference/esri-arcgisruntime-mapgraphicsview.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://doc.qt.io/qt-5/qmenu.html#exec-1" target="_self"&gt;https://doc.qt.io/qt-5/qmenu.html#exec-1&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://doc.qt.io/qt-5/qpushbutton.html" target="_self"&gt;https://doc.qt.io/qt-5/qpushbutton.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;Jared&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 15:51:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/adding-a-drop-down-menu-to-the-map/m-p/1064139#M4201</guid>
      <dc:creator>JaredCaccamo</dc:creator>
      <dc:date>2021-06-02T15:51:55Z</dc:date>
    </item>
  </channel>
</rss>

