I found

QgsMapToolEmitPoint , QgsMapTool and canvas.setMapTool(...)


So I declared my class as AoiSizeValidator(QgsMapToolEmitPoint)



But gave that a try and it gets me x,y, initially but when I select an add 
layer from the qgis edit menu, I guess it sets a new map tool so mine gets 
overridden.  So looks like I need a different approach to get xy from the map 
canvas.


From: QGIS-Developer <qgis-developer-boun...@lists.osgeo.org> On Behalf Of 
Catania, Luke A ERDC-RDE-GRL-VA CIV via QGIS-Developer
Sent: Wednesday, April 5, 2023 11:27 AM
To: qgis-developer@lists.osgeo.org
Subject: [QGIS-Developer] Detect a Map Canvas Mouse Event

Trying to get a map canvas event when canvas is clicked and mouse is dragged.  
I have code that creates an empty layer, but I use the QGIS edit menu to add 
the actually layer.  I want to be able to track the mouse movement so I can 
calculated the area of the feature being drawn in real time so I can make sure 
the area is within a defined range.

Is there an event I can connect to so I can run my custom code when the even 
occurs?
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
  • [QGIS-Developer] Cr... Catania, Luke A ERDC-RDE-GRL-VA CIV via QGIS-Developer
    • Re: [QGIS-Deve... WhereGroup
    • Re: [QGIS-Deve... Catania, Luke A ERDC-RDE-GRL-VA CIV via QGIS-Developer
    • [QGIS-Develope... Catania, Luke A ERDC-RDE-GRL-VA CIV via QGIS-Developer
      • [QGIS-Deve... Catania, Luke A ERDC-RDE-GRL-VA CIV via QGIS-Developer
        • Re: [Q... Catania, Luke A ERDC-RDE-GRL-VA CIV via QGIS-Developer
          • Re... Catania, Luke A ERDC-RDE-GRL-VA CIV via QGIS-Developer
            • ... Jacky Volpes via QGIS-Developer

Reply via email to