[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: Handling of flags in PyQt5 / PyQt6
From:       detlev () die-offenbachs ! de
Date:       2021-03-17 11:32:02
Message-ID: a8c93c03-9ccd-4031-b6bc-c6f6908feaac () email ! android ! com
[Download RAW message or body]

<div dir='auto'>+1 from my side!</div><div class="gmail_extra"><br><div class="gmail_quote">Am 17.03.2021 10:50 schrieb Phil Thompson &lt;phil@riverbankcomputing.com&gt;:<br type="attribution" /><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">On 16/03/2021 16:16, Florian Bruhin wrote:&#13;<br>
&gt; Hey again,&#13;<br>
&gt; &#13;<br>
&gt; On Tue, Mar 16, 2021 at 04:55:42PM +0100, Florian Bruhin wrote:&#13;<br>
&gt;&gt; Or as a more compact overview:&#13;<br>
&gt;&gt; &#13;<br>
&gt;&gt; PyQt5: enum only (or unscoped)&#13;<br>
&gt;&gt; PyQt6: flags only&#13;<br>
&gt;&gt; PySide2: flags only (or unscoped)&#13;<br>
&gt;&gt; PySide6: flags only (or unscoped)&#13;<br>
&gt; &#13;<br>
&gt; Well, looks like I successfully confused myself with the Alignment vs.&#13;<br>
&gt; AlignmentFlag names. Let me try again, please disregard the earlier&#13;<br>
&gt; mail.&#13;<br>
&gt; &#13;<br>
&gt; PySide2 and PySide6 both allow access via the *enum* name only. To make&#13;<br>
&gt; it clearer, let me try again with Qt.Orientation (enum) vs.&#13;<br>
&gt; Qt.Orientations (flag):&#13;<br>
&gt; &#13;<br>
&gt; PyQt5:&nbsp;&nbsp; Qt.Horizontal (unscoped) or Qt.Orientation.Horizontal (enum)&#13;<br>
&gt; PyQt6:&nbsp;&nbsp; Qt.Orientations.Horizontal (flag)&#13;<br>
&gt; PySide2: Qt.Horizontal (unscoped) or Qt.Orientation.Horizontal (enum)&#13;<br>
&gt; PySide6: Qt.Horizontal (unscoped) or Qt.Orientation.Horizontal (enum)&#13;<br>
&gt; &#13;<br>
&gt; So PyQt6 seems like the "oddball" here. I'm fine with using scoped&#13;<br>
&gt; values everywhere, but I think PyQt6 should support accessing flag&#13;<br>
&gt; values via the enum type, so that it's possible to write code which&#13;<br>
&gt; works with PyQt5 and PyQt6 (or PyQt6 and PySide6).&#13;<br>
&#13;<br>
Generally the difference between the enum name and the flag name is that &#13;<br>
the latter is the plural of the former. I felt that the plural form was &#13;<br>
the better name to use as it more accurately describes the usage of the &#13;<br>
"thing" - its a clue to the programmer that members can be ored &#13;<br>
together. Taken in isolation I think that that was the right choice.&#13;<br>
&#13;<br>
However, taking PyQt5 into account then I agree that the benefit is &#13;<br>
questionable, especially considering how similar the Qt5 and Qt6 APIs &#13;<br>
actually are. I'm happy to switch to using the enum name in v6.1 - &#13;<br>
assuming nobody is going to argue otherwise.&#13;<br>
&#13;<br>
Phil&#13;<br>
</p>
</blockquote></div><br></div>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic