Various Issues with PyQt6

Phil Thompson phil at riverbankcomputing.com
Fri Feb 26 09:00:33 GMT 2021


On 26/02/2021 05:42, Kovid Goyal wrote:
> On Tue, Feb 09, 2021 at 12:45:55PM +0000, Phil Thompson wrote:
>> PyQt6 does not support API elements that are deprecated (ie. x(), y(), 
>> pos()
>> etc.). However the Qt docs are wrong in that these methods aren't 
>> marked as
>> such.
>> 
>> The exact equivalent of event.x() is event.position().toPoint().x()
> 
> Ah, more pointless busywork. At least this one is easy to solve, unlike
> the silly PyQt scoped enums. At application startup:
> 
> from PyQt6.Qt import QSinglePointEvent
> 
> QSinglePointEvent.pos = lambda self: self.position().toPoint()
> QSinglePointEvent.x = lambda self: self.position().toPoint().x()
> QSinglePointEvent.y = lambda self: self.position().toPoint().y()
> 
> And since we are here, is the shorthand Qt module for importing from
> one namespace really going away in PyQt6? I get
> 
> ModuleNotFoundError: No module named 'PyQt6.Qt'

You could always read the docs for all the silly changes...

https://www.riverbankcomputing.com/static/Docs/PyQt6/pyqt5_differences.html

Phil


More information about the PyQt mailing list