Fixed issue with PySide6 and Obsolete QTextCodec
This commit is contained in:
parent
23df9a8686
commit
6c9c3f474d
10
Serialize.py
10
Serialize.py
|
@ -74,15 +74,7 @@ def deserializeIcon(iconPixmaps):
|
|||
for strState, statePixmap in modePixmaps.items():
|
||||
state = {"off": QtGui.QIcon.State.Off, "on": QtGui.QIcon.State.On}[strState]
|
||||
pxm = QtGui.QPixmap()
|
||||
# pxm.loadFromData(
|
||||
# QtCore.QByteArray.fromBase64(QtCore.QTextCodec.codecForName("UTF-8").fromUnicode(statePixmap))
|
||||
# )
|
||||
# t = QtCore.QTextStream(bytearray(statePixmap))
|
||||
# t.setEncoding(QtCore.QStringDecoder.Encoding.Utf8)
|
||||
# pxm.loadFromData(t.readAll())
|
||||
encoded = statePixmap.encode("utf-8")
|
||||
array = bytearray(encoded)
|
||||
pxm.loadFromData(array)
|
||||
pxm.loadFromData(QtCore.QByteArray.fromBase64(bytearray(statePixmap.encode("utf-8"))))
|
||||
ico.addPixmap(pxm, mode, state)
|
||||
return ico
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user