Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. How do I change the PySide2 package name?
Forum Updated to NodeBB v4.3 + New Features

How do I change the PySide2 package name?

Scheduled Pinned Locked Moved Unsolved Qt for Python
3 Posts 3 Posters 450 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nan Feng
    wrote on last edited by
    #1

    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

    JonBJ 1 Reply Last reply
    0
    • N Nan Feng

      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

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @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 indeed PySide2; if you move to Qt6 it will be PySide6. That is just the way it is/was, and you should stick to that, PySide2 is how it is referred to everywhere. Trying to alter that to PySide5 is a pointless/harmful action.

      If you insist on it, Python allows import ... as ... e.g.

      import PySide2 as PySide5
      

      But PySide2 is a namespace, not a class, so I don't know whether that will work.

      1 Reply Last reply
      0
      • CristianMaureiraC Offline
        CristianMaureiraC Offline
        CristianMaureira
        wrote on last edited by
        #3

        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.py https://github.com/mottosso/Qt.py or qtpy https://github.com/spyder-ide/qtpy to just configure backend you want, and it's not visible in your code.

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved