Linking a qtDesigner .ui file to python/pyqt?

前端 未结 12 1436
北海茫月
北海茫月 2020-11-28 01:33

So if I go into QtDesigner and build a UI, it\'ll be saved as a .ui file. How can I make this as a python file or use this in python?

12条回答
  •  生来不讨喜
    2020-11-28 01:52

    You need to generate a python file from your ui file with the pyuic tool (site-packages\pyqt4\bin)

    pyuic form1.ui > form1.py
    

    with pyqt4

    pyuic4.bat form1.ui > form1.py
    

    Then you can import the form1 into your script.

提交回复
热议问题