How do I change the PySide2 package name?
-
Hi, this is a question not about PySide. PySide2 corresponds to Qt5, and I'm a bit obsessive-compulsive. It is believed that PySide5 should correspond to Qt5. So where can it be modified to PySide5.Mainly includes the package where .pyd is located, default in PySide2, want to change to PySide5. There is also the package of api, from PySide2 ... and import... from PySide2 I want to change to PySide5 as well. I didn't mean to break the project permission, I just thought it was better
-
Hi, this is a question not about PySide. PySide2 corresponds to Qt5, and I'm a bit obsessive-compulsive. It is believed that PySide5 should correspond to Qt5. So where can it be modified to PySide5.Mainly includes the package where .pyd is located, default in PySide2, want to change to PySide5. There is also the package of api, from PySide2 ... and import... from PySide2 I want to change to PySide5 as well. I didn't mean to break the project permission, I just thought it was better
@Nan-Feng
I simply don't think you should do this or worry about. The correct name of the Qt company's Python bindings for Qt5 is indeedPySide2; if you move to Qt6 it will bePySide6. That is just the way it is/was, and you should stick to that,PySide2is how it is referred to everywhere. Trying to alter that toPySide5is a pointless/harmful action.If you insist on it, Python allows
import ... as ...e.g.import PySide2 as PySide5But
PySide2is a namespace, not a class, so I don't know whether that will work. -
There is a popular phrase that says: "After the war, everyone is a captain".
Indeed the naming was a bit unfortunate, but it was the solution the first people that started the PySide port to Qt5 thought about it.We understood the confusion, that even went worse for the "Python" and "Python2" comparisons - people thought pyside2 was for python2 :'(
As JonB stated, you can do that in that level, you could also use meta projects like
Qt.pyhttps://github.com/mottosso/Qt.py orqtpyhttps://github.com/spyder-ide/qtpy to just configure backend you want, and it's not visible in your code.