我有一个名为roleName
的PySide2.QtCore.QByteArray
对象,我通过对Python字符串进行编码得到了它:
propName = metaProp.name() // this is call of [const char *QMetaProperty::name() ](https://doc.qt.io/qt-5/qmetaproperty.html#name)
// encode the object
roleName = QByteArray(propName.encode())
print(roleName) // this gives b'myname'
// now I would like to get just "myname" without the "b"
roleString = str(roleName)
print(roleString) // this gives the same output as above
我怎样才能获取我的解码字符串?