PyQt6 QIODeviceBase.openModeFlag.ReadOnly enum missing?

loreprojects at gmail.com loreprojects at gmail.com
Mon Feb 28 20:35:32 GMT 2022


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'

 

Thank you

 

Garry

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20220228/963eb506/attachment.htm>


More information about the PyQt mailing list