Important: Please read the Qt Code of Conduct -

Switching back from code to Qt Designer in PyQT

  • Hello,

    I'm new to PyQt5, I got to design my GUI in QT designer and convert my .ui project to a .py file. I did handle the coding part with no problems. The problem I'm getting now is I need to work on the layout and add more buttons and other functionalities. I don't want to do this through the code, as you can imagine the struggle.

    Is there any way to switch back to Qt designer ?


  • @hachbani
    You can go back in the Designer on the .ui file any time, to make further changes, and regenerate the .py file. You are not supposed to further edit that .py file yourself, only import it.

  • As stated above, if you are using designer correctly (and to a larger extend OOP) then you can make your changes in designer and update the class that you use to encapsulate the interface in. You should be either subclassing the generated UI class or instantiating it and using ui.setupUi(self) in another qwidget derived class.

Log in to reply