<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 11 Jul 2019 at 07:56, J Barchan <<a href="mailto:jnbarchan@gmail.com">jnbarchan@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div style="font-family:tahoma,sans-serif"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 10 Jul 2019 at 21:28, Barry Scott <<a href="mailto:barry@barrys-emacs.org" target="_blank">barry@barrys-emacs.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><br><div><br><blockquote type="cite"><div>On 10 Jul 2019, at 11:55, J Barchan <<a href="mailto:jnbarchan@gmail.com" target="_blank">jnbarchan@gmail.com</a>> wrote:</div><br class="gmail-m_-2048288101904693378gmail-m_4280540874377343633Apple-interchange-newline"><div><span style="font-family:tahoma,sans-serif;font-size:12px;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">If I<span class="gmail-m_-2048288101904693378gmail-m_4280540874377343633Apple-converted-space"> </span></span><span style="font-size:12px;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:"courier new",monospace">return QOrientations()</span><span style="font-family:tahoma,sans-serif;font-size:12px;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"><span class="gmail-m_-2048288101904693378gmail-m_4280540874377343633Apple-converted-space"> </span>that works, but I'm unsure if that guarantees to return zero.</span></div></blockquote></div><br><div>I've not tried this - not ready to update Qt yet - does this print 0 to confirm the value in the enum?</div><div><br></div><div>print( <span class="gmail_default" style="font-family:tahoma,sans-serif"></span>int( <span>QOrientations())</span></div><div><span><br></span></div><div><span>Barry</span></div><div><span style="font-family:"courier new",monospace"><br></span></div></div></blockquote></div><div><font face="tahoma, sans-serif"><br></font></div><div><font face="tahoma, sans-serif">I confirm that </font><span class="gmail_default" style="font-family:tahoma,sans-serif"></span><font face="courier new, monospace">int( QOrientations() )</font><font face="tahoma, sans-serif"> returns 0. Assuming that is consistent/deliberate and not random (which I imagine it is) I guess that is what I will use here.</font></div><div><font face="tahoma, sans-serif"><br></font></div><div><font face="tahoma, sans-serif">I am still a little troubled by the fact that I can convert enum to int via </font><font face="courier new, monospace">int(QOrientations(enum_value))</font><font face="tahoma, sans-serif"> but have trouble converting int to enum via </font><font face="courier new, monospace">QOrientations(int_value)</font><font face="tahoma, sans-serif">. However the latter does seem to be a PyCharm IDE warning (</font><font face="courier new, monospace">"Unexpected type 'int', expected 'Orientations', 'Orientation'"</font><font face="tahoma, sans-serif">) but works at run-time, so I guess it's OK even if I cannot find a formula which works without warning. It would be nice to see a PyQt expert statement on what is the correct way to handle this not-unusual requirement....</font></div><div><br></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_-2048288101904693378gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><span style="font-family:tahoma,sans-serif">Kindest,</span></div><div><span style="font-family:tahoma,sans-serif">Jonathan</span></div></div></div></div></div></div>
</blockquote></div><div class="gmail_default" style="font-family:tahoma,sans-serif"></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Ah ha, I think I've got it! <span style="color:rgb(0,0,0);font-family:"DejaVu Sans Mono";font-size:9pt">Qt.Orientations(</span><span style="font-family:"DejaVu Sans Mono";font-size:9pt"><font color="#0000ff">0</font></span><span style="color:rgb(0,0,0);font-family:"DejaVu Sans Mono";font-size:9pt">) </span>generates a warning in my IDE, but <span style="color:rgb(0,0,0);font-family:"DejaVu Sans Mono";font-size:9pt">Qt.Orientations(Qt.Orientation(</span><span style="font-family:"DejaVu Sans Mono";font-size:9pt;color:rgb(0,0,255)">0</span><span style="color:rgb(0,0,0);font-family:"DejaVu Sans Mono";font-size:9pt">)) </span>seems not to! :) Fair enough....</div><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><span style="font-family:tahoma,sans-serif">Kindest,</span></div><div><span style="font-family:tahoma,sans-serif">Jonathan</span></div></div></div></div></div></div>