Proposal: require pyqt version >= 4.5

21 views
Skip to first unread message

Edward K. Ream

unread,
Jun 14, 2014, 12:47:33 PM6/14/14
to leo-e...@googlegroups.com
My guess is that few people will be affected, and those that are can easily upgrade.  For example, my installed version of pyqt is 4.7 on Windows and 4.8.6 on Ubuntu.  (It's 5.3.0 on Windows with Python 3.4).

Please speak up *immediately* if you have any objections with this proposal.

Requiring "modern" (>=4.5) versions of pyqt would allow new-style connections of events.  This would simplify the code by replacing code such as::

    if isQt5:
        action.triggered.connect(func)
    else:
        action.connect(act, Qt.SIGNAL('triggered()'),func)

by just:

    action.triggered.connect(func)

Code such as this appears in *many* places in Leo's core.  You could say that such code should also appear in plugins, but several plugins *already* use new-style connections, which is another reason to suppose that few people will object.

Speak now or live with the consequences.

Edward

Terry Brown

unread,
Jun 14, 2014, 2:16:48 PM6/14/14
to leo-e...@googlegroups.com
On Sat, 14 Jun 2014 09:47:33 -0700 (PDT)
"Edward K. Ream" <edre...@gmail.com> wrote:

> My guess is that few people will be affected, and those that are can
> easily upgrade. For example, my installed version of pyqt is 4.7 on
> Windows and 4.8.6 on Ubuntu. (It's 5.3.0 on Windows with Python 3.4).

I don't think we should do anything that would break support for Ubuntu
12.04 which is supported until April 2017. Happily, pyqt4 in 12.04 is
currently at 4.9 :-)

So no objection from me, I suspect 4.4 was a long time ago.

Cheers -Terry

Edward K. Ream

unread,
Jun 14, 2014, 2:46:49 PM6/14/14
to leo-editor
On Sat, Jun 14, 2014 at 1:16 PM, 'Terry Brown' via leo-editor
<leo-e...@googlegroups.com> wrote:

> I don't think we should do anything that would break support for Ubuntu
> 12.04 which is supported until April 2017. Happily, pyqt4 in 12.04 is
> currently at 4.9 :-)
>
> So no objection from me, I suspect 4.4 was a long time ago.

I plan to make the following easily reversible change today: change
most instances of "if isQt5" to "if True or isQt5". This will enable
the new-style connections regardless of PyQt version.

There are one or two places where the isQt5 constant is needed to
choose between two different method names. Such places will remain
unchanged.

Edward

Edward K. Ream

unread,
Jun 14, 2014, 3:11:04 PM6/14/14
to leo-e...@googlegroups.com
On Saturday, June 14, 2014 1:46:49 PM UTC-5, Edward K. Ream wrote:

I plan to make the following easily reversible change today: change
most instances of "if isQt5" to "if True or isQt5".  This will enable
the new-style connections regardless of PyQt version.

There are one or two places where the isQt5 constant is needed to
choose between two different method names.  Such places will remain
unchanged.

Done at rev 427b746728cc...

Please report any problems immediately.  All tests pass and I am happily eating my own dog food.

EKR
Reply all
Reply to author
Forward
0 new messages