Various Issues with PyQt6
    Kovid Goyal 
    kovid at kovidgoyal.net
       
    Fri Feb 26 05:42:42 GMT 2021
    
    
  
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'
-- 
_____________________________________
Dr. Kovid Goyal 
https://www.kovidgoyal.net
https://calibre-ebook.com
_____________________________________
    
    
More information about the PyQt
mailing list