<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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
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="FR" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Hi Andeas,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Good tip !<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">I have to keep init script for good reason ;-). But I was not aware (not enough yet) of such possibilities. So for setting current
 date it’s pretty cool.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">QGIS will still be amazing !<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Thanks again<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<table class="MsoNormalTable" border="0" cellspacing="3" cellpadding="0" width="0" style="width:483.45pt;margin-left:-1.5pt">
<tbody>
<tr style="height:115.45pt">
<td width="134" valign="top" style="width:98.5pt;padding:0cm 0cm 0cm 0cm;height:115.45pt">
<p class="MsoNormal" style="margin-left:21.3pt;text-indent:-21.3pt;line-height:115%">
<span style="font-size:11.0pt;line-height:115%;font-family:"Calibri",sans-serif;color:#1F497D"><img width="103" height="143" style="width:1.075in;height:1.4916in" id="Image_x0020_2" src="cid:image009.jpg@01D8402E.DD9E9320"></span><b><span lang="EN-US" style="font-size:14.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:#CC0066"><o:p></o:p></span></b></p>
</td>
<td width="510" style="width:380.45pt;padding:1.5pt 1.5pt 1.5pt 1.5pt;height:115.45pt">
<p class="MsoNormal" style="mso-margin-top-alt:1.0pt;margin-right:0cm;margin-bottom:1.0pt;margin-left:21.3pt;text-indent:-21.3pt;line-height:115%">
<span lang="EN-US" style="font-size:13.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:#003399">Sylvain PIERRE</span><b><span lang="EN-US" style="font-size:11.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:#003399"><o:p></o:p></span></b></p>
<p class="MsoNormal" style="mso-margin-top-alt:1.0pt;margin-right:0cm;margin-bottom:1.0pt;margin-left:0cm;line-height:115%">
<span lang="EN-US" style="font-size:8.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:black">Chef de projet système d’information<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:1.0pt;margin-right:0cm;margin-bottom:1.0pt;margin-left:0cm;line-height:115%">
<span lang="EN-US" style="font-size:8.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:black">Direction des Systèmes d’Information et du Développement Numérique<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:1.0pt;margin-right:0cm;margin-bottom:1.0pt;margin-left:0cm;line-height:115%">
<span style="font-size:8.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:black">Service Projets et Ingénierie Numérique<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:1.0pt;margin-right:0cm;margin-bottom:1.0pt;margin-left:0cm;line-height:115%">
<b><span style="font-size:8.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:black">Collectivité européenne d’Alsace<o:p></o:p></span></b></p>
<p class="MsoNormal" style="mso-margin-top-alt:1.0pt;margin-right:0cm;margin-bottom:1.0pt;margin-left:0cm;line-height:115%">
<span style="font-size:8.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:black">Tél : 03 88 76 68 88<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:1.0pt;margin-right:0cm;margin-bottom:1.0pt;margin-left:0cm;line-height:115%">
<span style="font-size:8.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:black"><a href="mailto:sylvain.pierre@alsace.eu">sylvain.pierre@alsace.eu</a><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:1.0pt;margin-right:0cm;margin-bottom:1.0pt;margin-left:0cm;line-height:115%">
<span style="font-size:11.0pt;line-height:115%;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><a href="http://www.alsace.eu"><span lang="EN-US" style="font-size:8.0pt;line-height:115%;font-family:"Verdana",sans-serif;mso-fareast-language:FR">www.alsace.eu</span></a></span><span lang="EN-US" style="font-size:8.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:1.0pt;margin-right:0cm;margin-bottom:1.0pt;margin-left:0cm;line-height:115%">
<a href="http://www.facebook.com/toutelalsace"><span style="font-size:8.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:#1F497D;text-decoration:none"><img border="0" width="14" height="15" style="width:.15in;height:.1583in" id="Image_x0020_4" src="cid:image010.png@01D8402E.DD9E9320" alt="facebook"></span></a><span lang="EN-US" style="font-size:8.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:#1F497D"> </span><a href="http://www.twitter.com/toutelalsace"><span style="font-size:8.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:#1F497D;text-decoration:none"><img border="0" width="15" height="15" style="width:.1583in;height:.1583in" id="Image_x0020_7" src="cid:image011.png@01D8402E.DD9E9320" alt="twitter"></span></a><span lang="EN-US" style="font-size:8.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:#1F497D"> </span><a href="http://www.instagram.com/toutelalsace"><span style="font-size:8.0pt;line-height:115%;font-family:"Verdana",sans-serif;color:#1F497D;text-decoration:none"><img border="0" width="15" height="15" style="width:.1583in;height:.1583in" id="Image_x0020_8" src="cid:image012.png@01D8402E.DD9E9320" alt="insta"></span></a><span style="font-size:11.0pt;line-height:115%;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">De :</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Andreas Neumann <a.neumann@carto.net>
<br>
<b>Envoyé :</b> vendredi 25 mars 2022 09:28<br>
<b>À :</b> Denis Rouzaud <denis.rouzaud@gmail.com><br>
<b>Cc :</b> PIERRE Sylvain <sylvain.pierre@alsace.eu>; qgis-developer@lists.osgeo.org<br>
<b>Objet :</b> Re: [QGIS-Developer] Drag and drop form function QdateEdit Widget init<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="3" cellpadding="0" width="100%" style="width:100.0%">
<tbody>
<tr>
<td width="100%" style="width:100.0%;background:#FFFF99;padding:4.8pt 4.8pt 4.8pt 4.8pt">
<p class="MsoNormal" align="center" style="text-align:center"><strong><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:#002266">Soyez vigilant : ce courriel provient d'une organisation externe à la CeA.</span></strong><span style="font-size:7.5pt;font-family:"Verdana",sans-serif;color:#002266">
<br>
• Assurez-vous d’abord qu’il ne s’agit pas d’un email malveillant avant de cliquer sur tout lien ou pièce jointe.
<br>
<a href="https://intranet.alsace.eu/actualites/apprenez-a-reconnaitre-un-email-phishing/">Apprendre à reconnaître un email de phishing.</a>
</span><o:p></o:p></p>
</td>
</tr>
<tr>
<td style="padding:4.8pt 4.8pt 4.8pt 4.8pt"></td>
</tr>
</tbody>
</table>
<p><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Hi Pierre,<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Not sure if you are aware that recent QGIS releases also have very good "default" value support without having to use Python. You can simply set default values with QGIS expressions. No need
 for Python code (unless you do something really special).<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">You can even set date values dependent on other widgets without having to use Python scripting - and do updates whenever something changes on the record, without having to fall back to Python
 scripting.<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Just wanted to make sure you are aware of this alternative mechanism. There might still be good reasons for using Python scripting though - but theses cases are now rarer.<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Greetings,<o:p></o:p></span></p>
<p><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Andreas<o:p></o:p></span></p>
<p id="reply-intro"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">On 2022-03-25 09:17, Denis Rouzaud via QGIS-Developer wrote:<o:p></o:p></span></p>
<blockquote style="border:none;border-left:solid #1010FF 1.5pt;padding:0cm 0cm 0cm 5.0pt;margin-left:0cm;margin-right:0cm">
<div id="replybody1">
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">QgsDateTimeEdit implements setDateTime, which is not virtual in QDateTimeEdit.
<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">It's probably that you have to find a QDateTimeEdit rather than the Qt native one.<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"> <o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Not 100% sure this is the issue though, but it won't hurt.<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"><o:p> </o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif">Le ven. 25 mars 2022 à 09:11, PIERRE Sylvain via QGIS-Developer <<a href="mailto:qgis-developer@lists.osgeo.org">qgis-developer@lists.osgeo.org</a>> a écrit :<o:p></o:p></span></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"><br>
Thanks for tip Richard, but I've tried with <br>
            today = QtCore.QDateTime.currentDateTime()<br>
But it's not working<br>
<br>
<br>
<br>
<br>
-----Message d'origine-----<br>
De : Richard Duivenvoorde <<a href="mailto:rdmailings@duif.net">rdmailings@duif.net</a>>
<br>
Envoyé : vendredi 25 mars 2022 08:50<br>
À : PIERRE Sylvain <<a href="mailto:sylvain.pierre@alsace.eu">sylvain.pierre@alsace.eu</a>>;
<a href="mailto:qgis-developer@lists.osgeo.org">qgis-developer@lists.osgeo.org</a><br>
Objet : Re: [QGIS-Developer] Drag and drop form function QdateEdit Widget init<br>
<br>
Soyez vigilant : ce courriel provient d'une organisation externe à la CeA.<br>
• Assurez-vous d'abord qu'il ne s'agit pas d'un email malveillant avant de cliquer sur tout lien ou pièce jointe.<br>
==================================================<br>
<br>
On 3/25/22 08:33, PIERRE Sylvain via QGIS-Developer wrote:<br>
<br>
> But this is not working with QDateEdit widget :<br>
> <br>
> today=date.today()<br>
> <br>
> control=dialog.findChild(QDateEdit,"date_insert")<br>
> <br>
> control.setDateTime(today)<br>
> <br>
> What is the right syntax to init the date widget ? It's impossible to debug init script (or may be I'm missing something...)<br>
<br>
Hi,<br>
<br>
Which module is 'date.today()' from, not Qt is it?<br>
<br>
You probably have to use the QDatetime: <a href="https://doc.qt.io/qt-5/qdatetime.html#currentDateTime" target="_blank">
https://doc.qt.io/qt-5/qdatetime.html#currentDateTime</a><br>
<br>
>>> QDateTime.currentDateTime()<br>
PyQt5.QtCore.QDateTime(2022, 3, 25, 8, 44, 19, 963)<br>
<br>
And set THAT with the widget?<br>
<br>
See: <a href="https://doc.qt.io/qt-5/qdatetimeedit.html#dateTime-prop" target="_blank">
https://doc.qt.io/qt-5/qdatetimeedit.html#dateTime-prop</a><br>
<br>
(it always a little hassle to juggle with date/time etc in Python/Qt)<br>
<br>
Regards,<br>
<br>
Richard Duivenvoorde<br>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><o:p></o:p></span></p>
</blockquote>
</div>
</div>
</div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">
https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><o:p></o:p></span></p>
</div>
</blockquote>
<p><span style="font-size:10.0pt;font-family:"Verdana",sans-serif"><o:p> </o:p></span></p>
</div>
</body>
</html>