PyQt5 to PySide2, loading UI-Files in different classes

后端 未结 3 807
后悔当初
后悔当初 2021-01-14 10:49

I have a python application which runs under python3.6 and is using PyQt5 for loading Ui windows. These windows were created with Qt Designer 5.9.4. The Code below shows a w

3条回答
  •  滥情空心
    2021-01-14 11:20

    Follow these simple steps:

    1. Assuming the ui file from qt designer is mycode.ui, convert this to the py file using the pyside2 ui converter by typing "pyside2-uic mycode.ui -o mycode.py" without the quotes. (Note use the pyside2 converter of pyside2-uic and not pyqt5 converter of pyuic5)

    2. With mycode.py generated by pyside2 format, just replace all the headers for the PyQt5 code to "import sys" and "from mycode import *"

    3. You are done...Hope this helps

提交回复
热议问题