PyQt6 QIODeviceBase.openModeFlag.ReadOnly enum missing?

Phil Thompson phil at riverbankcomputing.com
Mon Feb 28 21:58:33 GMT 2022


On 28/02/2022 20:35, loreprojects at gmail.com wrote:
> Hello,
> 
> 
> 
> I've been working through some PyQt5 code to trying and upgrade to the 
> PyQt6
> scenario:
> 
> I have ran into an issue with
> https://www.riverbankcomputing.com/static/Docs/PyQt6/api/qtcore/qiodevicebas
> e.html
> <https://www.riverbankcomputing.com/static/Docs/PyQt6/api/qtcore/qiodeviceba
> se.html#OpenModeFlag> #OpenModeFlag
> 
> 
> 
> Is this still to be implemented or is there something I should / 
> should-not
> be doing in place of this?
> 
> By the way, this is currently only used to fetch the qwebchannel.js 
> file.
> 
> 
> 
> Some Code:
> 
>        from PyQt6.QtCore import QIODevice, QIODeviceBase
> 
> 
> 
>        if qt_resource_file.open(QIODeviceBase.openModeFlag.ReadOnly):
> 
>            qt_resource_content =
> bytes(qt_resource_file.readAll()).decode('utf-8')
> 
> 
> 
> My error:
> 
>        AttributeError: type object 'QIODeviceBase' has no attribute
> 'openModeFlag'

OpenModeFlag not openModeFlag

Phil


More information about the PyQt mailing list