<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
</head>
<body>
<div>Hi Tim,</div>
<div><br>
</div>
<div>It has to be done programmatically, via a plug-in. The form fields which have to be remain disabled are known beforehand. The name and types of the remaining activated fields are not known beforehand. So I cannot use the drag and drop UI. </div>
<div><br>
</div>
<div>Would be happy to hear of way around this.</div>
<div><br>
</div>
<div>Best regards,</div>
<div>Tej</div>
<div><br>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Tim Sutton <tim@kartoza.com><br>
<b>Sent:</b> Friday, January 3, 2020 9:27 PM<br>
<b>To:</b> Tejas L <tejvan@live.com><br>
<b>Cc:</b> QGIS Developer <qgis-developer@lists.osgeo.org><br>
<b>Subject:</b> Re: [QGIS-Developer] Disabling some fields in a QgsAttributeDialog</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">Hi
<div class=""><br class="">
</div>
<div class="">Why not use the QGIS drag and drop form designer? It takes care of exactly this kind of use case. See chapter 3 in my tutorial here: </div>
<div class=""><br class="">
</div>
<div class=""><a href="https://tinyurl.com/QGISFieldMapping" class="">https://tinyurl.com/QGISFieldMapping</a></div>
<div class=""><br class="">
</div>
<div class="">Regards</div>
<div class=""><br class="">
</div>
<div class="">Tim</div>
<div class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 3 Jan 2020, at 14:57, Tejas L <<a href="mailto:tejvan@live.com" class="">tejvan@live.com</a>> wrote:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
Hello Devs,</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
I would like to present a custom dialog when a feature is clicled. The dialog must look and behave like<span class="x_Apple-converted-space"> </span><span class="" style="font-family:Calibri,Helvetica,sans-serif; background-color:rgb(255,255,255); display:inline!important">QgsAttributeDialog
 except that two specific fields must be disabled (or hidden).</span> </div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
How could I programatically disable (or hide) certain fields in the QgsAttributeDialog? </div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
Best regards,</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Helvetica,sans-serif; font-size:12pt">
Tej</div>
<span class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">_______________________________________________</span><br class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">QGIS-Developer
 mailing list</span><br class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<a href="mailto:QGIS-Developer@lists.osgeo.org" class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">QGIS-Developer@lists.osgeo.org</a><br class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">List
 info:<span class="x_Apple-converted-space"> </span></span><a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<span class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important">Unsubscribe:<span class="x_Apple-converted-space"> </span></span><a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" class="" style="font-family:Helvetica; font-size:14px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:start; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></div>
</blockquote>
</div>
<br class="">
<div class="">
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-ligatures:normal; font-variant-caps:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; font-weight:normal; letter-spacing:normal; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; line-height:normal; text-align:center">
<span>—</span></div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-ligatures:normal; font-variant-caps:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; letter-spacing:normal; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; line-height:normal; text-align:center">
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal; min-height:14px">
<br class="">
</div>
<br class="x_Apple-interchange-newline" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none">
<span style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none"><span><span><span><span><span><span><span><span><span><span><span><img id="x_662C6D3C-70C8-478D-9077-C4B8B97D2A86" class="" style="max-width: 100%; height: auto;" data-outlook-trace="F:1|T:1" src="cid:1A5DF6DE-E302-4C28-BFBD-29663CBF1351"></span>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal; min-height:14px">
<br class="x_Apple-interchange-newline">
<br class="x_Apple-interchange-newline">
<br class="x_Apple-interchange-newline">
<br class="x_Apple-interchange-newline">
<br class="">
</div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal; min-height:14px">
<br class="">
</div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal">
<b class="">Tim Sutton</b></div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal; min-height:14px">
<br class="">
</div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal">
<b class="">Co-founder:</b><span class="x_Apple-converted-space"> </span>Kartoza</div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal">
<b class="">Ex Project chair:</b><span class="" style="font-weight:normal"><span class="x_Apple-converted-space"> </span><a href="http://QGIS.org" class="">QGIS.org</a></span></div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal; min-height:14px">
<br class="">
</div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal">
Visit <a href="http://kartoza.com/" class=""><span class="" style="">http://kartoza.com</span></a> to find out about open source:</div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal; min-height:14px">
<br class="">
</div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal">
Desktop GIS programming services</div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal">
Geospatial web development</div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal">
GIS Training</div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal">
Consulting Services</div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal; min-height:14px">
<br class="">
</div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal">
<b class="">Skype</b>: timlinux </div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal">
<b class="">IRC:</b><span class="x_Apple-converted-space"> </span>timlinux on #qgis at <a href="http://freenode.net" class="">freenode.net</a></div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal">
<br class="">
</div>
<div class="" style="color:rgb(0,0,0); font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; orphans:auto; text-align:center; text-indent:0px; text-transform:none; white-space:normal; widows:auto; word-spacing:0px; text-decoration:none; font-variant-ligatures:normal; font-variant-numeric:normal; font-variant-alternates:normal; font-variant-east-asian:normal; margin:0px; line-height:normal">
<span class="" style="color:rgb(102,106,115); font-family:"Proxima Nova",sans-serif; font-size:14px; text-align:left; background-color:rgb(255,255,255)">I'd love to connect. </span><a target="_blank" class="x_t-quick-start-share-link" href="https://calendly.com/timlinux" style="color:rgb(0,162,255); text-decoration:none; font-family:"Proxima Nova",sans-serif; font-size:14px; text-align:left">Here's
 my calendar link</a><span class="" style="color:rgb(102,106,115); font-family:"Proxima Nova",sans-serif; font-size:14px; text-align:left; background-color:rgb(255,255,255)"> to make finding time easy.</span></div>
</span></span></span></span></span></span></span></span></span></span></span></div>
</div>
<br class="">
</div>
</div>
</body>
</html>