<div dir="ltr">Great Matthias,<div><br></div><div>I remove all global variables and now it work fine !</div><div><br></div><div>It remain just one problem, I add some code [0] connected with a button to insert a filename in a field.</div><div><div>If use the button from single form all works fine but when I use it in from the parent-child form the code start lot of times (it seems one time for every record in the table).</div><div><br></div><div>[0]<br></div><div>def apriFile(QLine):</div><div> fileName=QLine.text()</div><div> try:</div><div> if os.path.isfile(fileName): </div><div> os.startfile(fileName)</div><div> else:</div><div> msgBox = QMessageBox()</div><div> msgBox.setText("Il file non esiste.")</div><div> msgBox.exec_()</div><div> except:</div><div> msgBox = QMessageBox()</div><div> msgBox.setText("Non riesco ad aprire il file.")</div><div> msgBox.exec_()</div></div><div><br></div><div>Thanks a lot and let me know how to send your beer.</div><div>;-)</div><div><br><div class="gmail_extra"><br><div class="gmail_quote">2015-10-02 9:24 GMT+02:00 Matthias Kuhn <span dir="ltr"><<a href="mailto:matthias@opengis.ch" target="_blank">matthias@opengis.ch</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
Hi Luca<br>
<br>
Would this core functionality of QGIS be an option for you?<br>
<br>
<a href="https://www.qgis.org/en/site/forusers/visualchangelog210/index.html#feature-filter-chaining-for-relation-reference-widget" target="_blank">https://www.qgis.org/en/site/forusers/visualchangelog210/index.html#feature-filter-chaining-for-relation-reference-widget</a><br>
<br>
If you are still required to use python in your forms: are you using
global variables? They can be an issue for embedded forms.<br>
<br>
Cheers,<br>
Matthias<div><div class="h5"><br>
<br>
<div>On 10/02/2015 09:09 AM, Luca Lanteri
wrote:<br>
</div>
</div></div><blockquote type="cite"><div><div class="h5">
<div dir="ltr">Sadly, after further test I discover that the
crashes remain, so I think it is a qgis bug and not a problem in
my code.
<div>The problem happens when I put my custom form into a
subform widget (QgsRelationEditorWidget). If I add a new
record in the subform and I move to another record using the
left column QGIS crashes. It seems to be a more general
problem because the crash appears also when I add some simple
control that modify the object in the form.</div>
<div><br>
</div>
<div>I can open a ticket and add some test data.</div>
<div>If it is a minor bug and it could be resolved easily I
really offer a pizza and a beer to resolve it.</div>
<div><br>
</div>
<div>All the best</div>
<div>Luca</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2015-10-01 23:53 GMT+02:00 Luca Lanteri
<span dir="ltr"><<a href="mailto:mescal72@gmail.com" target="_blank">mescal72@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr">
<div>
<div>
<div>Hi,<br>
<br>
</div>
now I'm already using the python logic but my code is
terrible and I have a lot of crash problem.<br>
</div>
<div>Now that I using your example all is easier and
seem to worsk fine.<br>
<br>
</div>
<div>I owe you one beer.<br>
Many many tanks !<span><font color="#888888"><br>
</font></span></div>
<span><font color="#888888">
<div><br>
</div>
<div>Luca<br>
<br>
</div>
</font></span></div>
</div>
<div>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2015-10-01 22:23 GMT+02:00
Blumentrath, Stefan <span dir="ltr"><<a href="mailto:Stefan.Blumentrath@nina.no" target="_blank"></a><a href="mailto:Stefan.Blumentrath@nina.no" target="_blank">Stefan.Blumentrath@nina.no</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div link="#0563C1" vlink="#954F72" lang="NO-BOK">
<div>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)" lang="EN-US">Hi Luca,</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)" lang="EN-US">Sounds like a case for Python
logic!</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)" lang="EN-US">General principles are
explained here:</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)" lang="EN-US"><a href="http://nathanw.net/2011/09/05/qgis-tips-custom-feature-forms-with-python-logic/" target="_blank">http://nathanw.net/2011/09/05/qgis-tips-custom-feature-forms-with-python-logic/</a></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)" lang="EN-US">Also nice, and probably
exactly what you are looking for:</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)" lang="EN-US"><a href="http://medspx.fr/blog/Qgis/cascade_forms/" target="_blank">http://medspx.fr/blog/Qgis/cascade_forms/</a></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)" lang="EN-US"> </span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)" lang="EN-US">Cheers</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)" lang="EN-US">Stefan</span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)" lang="EN-US"> </span></p>
<p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif" lang="EN-US">From:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif" lang="EN-US"> <a href="mailto:qgis-user-bounces@lists.osgeo.org" target="_blank">qgis-user-bounces@lists.osgeo.org</a>
[mailto:<a href="mailto:qgis-user-bounces@lists.osgeo.org" target="_blank">qgis-user-bounces@lists.osgeo.org</a>]
<b>On Behalf Of </b>Luca Lanteri<br>
<b>Sent:</b> 1. oktober 2015 22:07<br>
<b>To:</b> qgis-user <<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank"></a><a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a>><br>
<b>Subject:</b> [Qgis-user] QGIS - value
relation widget</span></p>
<div>
<div>
<p class="MsoNormal"> </p>
<div>
<div>
<p class="MsoNormal">Hi to all,<br>
<br>
I need to build a form when the
value of a combo are filtered basing
on the value of anoter combobox.
<br>
I have a first combo where I choose
the region and a second with the
municipalities.
<br>
I need that the second combo shows
only the municipalities of the
choosed region.<br>
I tried to use use the widget
"relationship value" with the a
filter like classe_munic =
attribute($currentfeature,
'classe_munic') without any success.
<br>
<br>
Has anyone ever done something
similar?<br>
Thank in advance </p>
</div>
<p class="MsoNormal" style="margin-bottom:12pt"><br>
Luca</p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>_______________________________________________
Qgis-user mailing list
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a></pre>
</blockquote>
<br>
</div>
<br>_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br></blockquote></div><br></div></div></div>