Wednesday 22 April 2015

python - How to change cursor shape in pyQGIS?


I noticed that PyQGis has QgsMapToolPan() and QgsMapToolZoom() functions, and the cursor shape on the canvas will change to a hand (for pan), magnifying-glass(+/-) (for zoomIn / zoomOut).



I have a toolbar for Select (arrow icon), Marquee (bounding box icon), besides the Pan, ZoomIn and ZoomOut tool buttons.


Currently I created the Select & Marquee tools as QgsMapTool(canvas) and setAction with the appropriately ui widget buttons.


How can I change the cursor shape to arrow when the Select tool is activated, and cross when the Marquee tool is activated?


(I noted the default cursor shape for QgsMapTool() is Cross icon which I could use for the Marquee tool.)




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...