Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Unable to successfully import files with mix use of PySide6 and PyQt6
Forum Updated to NodeBB v4.3 + New Features

Unable to successfully import files with mix use of PySide6 and PyQt6

Scheduled Pinned Locked Moved Unsolved General and Desktop
22 Posts 3 Posters 6.4k 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.
  • JonBJ JonB

    @explorer100
    For Python at Qt5 all (most) Qt enumeration types were just defined at "the top level", be that Qt or more specialized ones like QDialog. At Qt6 they were moved to lower-level, more specific areas dependent on their usage, like QDialog.DialogCode here, there are many other cases elsewhere in the Qt classes. Any code or examples you may come across which used such types/constants needs changing from 5 to 6. You are not the first person to fall foul of this.

    This ought affect PyQt6 and PySide6 equally, I'm not sure if you are finding a difference. Usually you get a runtime error since the old symbol is not defined. I don't know about your case. You were "unlucky" to come across this issue so early in your attempts. If you have old code or examples look out for such enumerations which need upgrading.

    E Offline
    E Offline
    explorer100
    wrote on last edited by
    #21

    @JonB Thanks Jon for the clarification.
    For me, using PySide6.. the enumeration was ok while specifying the top level. I should have made another connection with a previous issue where I couldn't specify Qmessage.Information anymore. After discovering this, I changed it to QMessageBox.Icon.Information and all is well.

    Thanks again for your support.

    By the way.. the matplotlib interface now also looks like it might work with all using PyQt6.
    will keep you posted. thanks again.

    JonBJ 1 Reply Last reply
    0
    • E explorer100

      @JonB Thanks Jon for the clarification.
      For me, using PySide6.. the enumeration was ok while specifying the top level. I should have made another connection with a previous issue where I couldn't specify Qmessage.Information anymore. After discovering this, I changed it to QMessageBox.Icon.Information and all is well.

      Thanks again for your support.

      By the way.. the matplotlib interface now also looks like it might work with all using PyQt6.
      will keep you posted. thanks again.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #22

      @explorer100
      Somebody, somewhere did write some sort of Python upgrade script to find and replace all the occurrences of the old symbols with the new ones. I don't know how good it is, but maybe it comes with a list of those which need changing you can look through.

      I know I have referred to it in my posts here, but that was a long time ago. Whether I can find it again I don't know....

      Oh, it's at https://stackoverflow.com/questions/72086632/migrating-to-qt6-pyqt6-what-are-all-the-deprecated-short-form-names-in-qt5. For PyQt5->6. There's a script to copy or a Py package to fetch. Or there's https://github.com/qutebrowser/qutebrowser/issues/5904#issuecomment-736792450. It seems they look through files supplied with PyQt rather than having a hard-coded list you could look at.

      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