<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Marco,<br>
    <br>
    Thanks for your reply.<br>
    <br>
    I think this is suposed to work since __setitem__ is defined in the
    sip file [0]<br>
    <br>
    [0]
    <meta http-equiv="content-type" content="text/html;
      charset=ISO-8859-1">
    <a
href="https://github.com/qgis/Quantum-GIS/blob/master/python/core/qgsfeature.sip#L62">https://github.com/qgis/Quantum-GIS/blob/master/python/core/qgsfeature.sip#L62</a><br>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 05/06/2013 11:47 AM, Marco
      Bernasocchi wrote:<br>
    </div>
    <blockquote
cite="mid:CALWXeEFG=Hvn564BPvA57uJWgUYiEMzmmxwbGQ3ZytA=kHvzSg@mail.gmail.com"
      type="cite">
      <p dir="ltr">hi denis I dont have the new api completely in mind,
        but maybe this [0]<br>
        can help you.</p>
      <p dir="ltr">[0] <a moz-do-not-send="true"
href="http://lists.osgeo.org/pipermail/qgis-developer/2013-February/024278.html">http://lists.osgeo.org/pipermail/qgis-developer/2013-February/024278.html</a></p>
      <p dir="ltr">Marco Bernasocchi (mobile)<br>
        <a moz-do-not-send="true" href="http://opengis.ch">http://opengis.ch</a></p>
      <div class="gmail_quote">On May 6, 2013 11:27 AM, "Denis Rouzaud"
        <<a moz-do-not-send="true"
          href="mailto:denis.rouzaud@gmail.com">denis.rouzaud@gmail.com</a>>
        wrote:<br type="attribution">
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          Hi all,<br>
          <br>
          I got a crash when I did this:<br>
          <br>
          fields = layer.dataProvider().fields()<br>
          f = QgsFeature()<br>
          f.setFields(fields)<br>
          for field in fields:<br>
              f[<a moz-do-not-send="true" href="http://field.name"
            target="_blank">field.name</a>()] = QVariant("1")<br>
          <br>
          Using QVariant or not.<br>
          <br>
          What did I (again) did wrong ????<br>
          <br>
          Greetings,<br>
          <br>
          Denis<br>
          _______________________________________________<br>
          Qgis-developer mailing list<br>
          <a moz-do-not-send="true"
            href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
          <a moz-do-not-send="true"
            href="http://lists.osgeo.org/mailman/listinfo/qgis-developer"
            target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>