<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>you can use one of the signals emitted by a QgsVectorLayer, for
example <a class="reference internal"
href="https://qgis.org/pyqgis/3.14/core/QgsVectorLayer.html?highlight=qgsvectorlayer#qgis.core.QgsVectorLayer.attributeAdded"
title="qgis.core.QgsVectorLayer.attributeAdded"><code
class="xref py py-obj docutils literal notranslate"><span
class="pre">attributeAdded</span></code></a> or <a
class="reference internal"
href="https://qgis.org/pyqgis/3.14/core/QgsVectorLayer.html?highlight=qgsvectorlayer#qgis.core.QgsVectorLayer.afterCommitChanges"
title="qgis.core.QgsVectorLayer.afterCommitChanges"><code
class="xref py py-obj docutils literal notranslate"><span
class="pre">afterCommitChanges</span></code></a> (see
<a class="moz-txt-link-freetext" href="https://qgis.org/pyqgis/3.14/core/QgsVectorLayer.html">https://qgis.org/pyqgis/3.14/core/QgsVectorLayer.html</a>) for the
whole list of signals. Then you will need a python script to
connect a slot (function) to that signal doing what you wanted to
be done with your layer(s). at least you will need a place where
to put your function in and connect it to the signal, this can be
done manual from the console or you can put in the open project
macro or in a startup.py...this depends what you want to achieve.
I described a bit different example in this post on
stackexchange:
<a class="moz-txt-link-freetext" href="https://gis.stackexchange.com/questions/379781/forcing-choice-for-default-value-during-data-entry/379827#379827">https://gis.stackexchange.com/questions/379781/forcing-choice-for-default-value-during-data-entry/379827#379827</a>
but it will show you, how you can start with signals and slots.</p>
<p>hope this helps a bit<br>
</p>
<p>Stefan<br>
</p>
<div class="moz-cite-prefix">Am 25.11.2020 um 22:43 schrieb L.W.:<br>
</div>
<blockquote type="cite"
cite="mid:f3604022-a4bf-63cd-696d-16d44a1165a9@gmx.de">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<p>That's what I want to use, but how to set the "default value" -
no, not per propertier and form builder.</p>
<p>I want to set the DV by input in "UI A" (add feature to layer
A) and then add new feature to B, and in UI B the DV is set to
value from form A.</p>
<p><br>
</p>
<div class="moz-cite-prefix">Am 25.11.2020 um 21:19 schrieb
Harrissou:<br>
</div>
<blockquote type="cite"
cite="mid:51C59BC5-D23A-4F23-A547-2E22F9BA8B6E@gmail.com">
<meta http-equiv="content-type" content="text/html;
charset=UTF-8">
Hi,<br>
Something like setting default values for field: <a
href="https://docs.qgis.org/3.16/en/docs/user_manual/working_with_vector/vector_properties.html#default-values"
moz-do-not-send="true">https://docs.qgis.org/3.16/en/docs/user_manual/working_with_vector/vector_properties.html#default-values</a>
? <br>
<br>
Regards,<br>
Harrissou<br>
<br>
<div class="gmail_quote">Le 25 novembre 2020 20:49:17 GMT+01:00,
"L.W." <a class="moz-txt-link-rfc2396E"
href="mailto:eaglelw@gmx.de" moz-do-not-send="true"><eaglelw@gmx.de></a>
a écrit :
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<pre class="k9mail">Hello,
I have a question again, I know the possibility of the project
variables, which can be queried from all layers.
I have to insert several points and lines or polygons in different layers.
All inserted features have in common that they have certain attributes
that are the same for all.
It would be nice if I only have to enter these common attributes for the
first feature and the values are then automatically inserted as
default values for each new feature.
One possible way would of course be a link to a shared data table, but I
don't necessarily want to go this way for reasons.
I know the option of giving a UI a Python script when it is opened (even
if I can't Python), but I haven't found anything to execute a script
after closing, for example.
Obviously logical, you can of course set the variables beforehand, but
that would be another step that you have to take beforehand and you
cannot get to these variables without a whole series of mouse clicks.
Any ideas?
Regards<hr>Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org" moz-do-not-send="true">Qgis-user@lists.osgeo.org</a>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
</blockquote>
</div>
<br>
-- <br>
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez
excuser ma brièveté. </blockquote>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Mit freundlichen Grüßen
Stefan Giese
Projektleiter/Consultant
------------------------------------------------------
Aufwind durch Wissen!
Jetzt neu: Webinare und Online-Schulungen
bei der <a class="moz-txt-link-abbreviated" href="http://www.foss-academy.com">www.foss-academy.com</a>
------------------------------------------------------
WhereGroup GmbH
Schwimmbadstr. 2
79100 Freiburg
Germany
Fon: +49 (0)761 / 519 102 - 61
Fax: +49 (0)761 / 519 102 - 11
<a class="moz-txt-link-abbreviated" href="mailto:stefan.giese@wheregroup.com">stefan.giese@wheregroup.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.wheregroup.com">www.wheregroup.com</a>
Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885</pre>
</body>
</html>