On Fri, 3 Sept 2021 at 17:14, Johannes Kröger (WhereGroup) <[email protected]> wrote: > > Hi list! > > In QGIS 3.16 a right-click context menu was added to the map canvas: > https://www.qgis.org/en/site/forusers/visualchangelog316/index.html#add-context-menu-to-map-canvas > > How can we disable that via PyQGIS? > > https://qgis.org/pyqgis/master/gui/QgsMapCanvas.html lists a > "contextMenuEvent" method but does not provide any documentation at all. > > The environment is a QGIS based standalone application.
Make sure your map tool doesn't return the QgsMapTool::ShowContextMenu flag. (Or subclass the inbuilt tool you are using and override its flags() implementation) Nyall > > Cheers, Hannes > > _______________________________________________ > QGIS-Developer mailing list > [email protected] > List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer _______________________________________________ QGIS-Developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
