<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">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.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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. 
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Luke<o:p></o:p></p>
</div>
</body>
</html>