Oddly if I left click on the mouse the pan cursor comes back. Seems like a refresh issue, but I refreshed the map an that did not work. Oddly I also only have this issue if drawing a polygon. If I draw a point of line, no issue.
From: QGIS-Developer <qgis-developer-boun...@lists.osgeo.org> On Behalf Of Catania, Luke A ERDC-RDE-GRL-VA CIV via QGIS-Developer Sent: Friday, March 17, 2023 7:44 PM To: qgis-developer@lists.osgeo.org Subject: [QGIS-Developer] Create layer, start edit session, commit and end edit session does not get me completely out of edit session and get my pan cursor back I have written code that automatically creates an empty QgsVectorLayer, adds it to the layer panel; I add a call to vlayer.featureAdded.connect(self.check_size) on the created layer that starts an edit session as well as checks that my polygon is within a min and max size. The user can then use QGIS edit tools to add the feature. After one feature is added it commits the changes. This tool is to just draw an AOI so I want to auto close the edit session. Though the layer is no longer in edit mode, the edit bullseye cursor is still showing. It seems the edit mode is still in play. I can still draw on the canvas and the shaded polygon shows up as if I am in edit mode. I don't get an error. Why does not running commitChanges() completely get me out of edit mode. My fix sine I cannot figure this out is to run iface.actionPan().trigger() to get myself back in pan mode, but why does this not get done automatically. If I use QGIS to create an empty layer, toggle editing on by selecting that option on the layer in the layer panel, add a feature, and then toggle editing off and select save when prompted, I get the pan cursor back and I am completely out of edit mode. What code do I need to run to accomplish this in python? I basically just use startEditing and commitChanges to start and end an edit session. Thanks, Luke
_______________________________________________ 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