<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi,<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 19 Apr 2021, at 13:18, Ales Erjavec <<a href="mailto:ales.erjavec324@gmail.com" class="">ales.erjavec324@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi,<br class=""><br class="">In PyQt6 this fails with a type error:<br class="">```<br class="">from PyQt6.QtCore import QEvent<br class=""><br class="">class CustomEvent(QEvent):<br class=""> EventType = QEvent.registerEventType()<br class=""> def __init__(self):<br class=""> super().__init__(CustomEvent.EventType) # << Error Here<br class=""><br class="">ev = CustomEvent()<br class="">ev.type()<br class="">```<br class="">because the QEvent.__init__ arg must be QEvent.Type; in PyQt6 this is<br class="">an python enum and cannot represent 'undeclared' values).<br class=""><br class=""></div></div></blockquote><br class=""></div>I believe <font face="SFMono-Regular" class="">QEvent.registerEventType()</font> returns an integer not a <font face="SFMono-Regular" class="">QEvent.Type</font> instance. If you modify that line like:<div class=""><font face="SFMono-Regular" class=""> EventType = QEvent.Type(QEvent.registerEventType())</font></div><div class="">then I think it might be accepted.</div><div class=""><br class=""></div><div class="">Regards,</div><div class="">-- Colin</div></body></html>