Skip to content

Using QT Designer to build Marmara Connector Front End

Rumeysa Yilmaz edited this page Feb 10, 2021 · 5 revisions

Having installed Qt Designer, launch the application and open the "guidesigner.ui" file in case you want to improve/change the design.

The desired development can be made from the opened QT Designer screen.

After the design part is finished, the .ui file should be converted to the python file.

Convert code ui to python:

pyuic5 -x guiDesigner.ui -o guiDesign.py

Then, a python file named "guiDesign.py" would be created.

Open the mainApp.py file with any IDE of your choice.

In the mainApp.py file, the file named "guiDesign.py" is imported. "Ui_MainWindow" is extend to the class.

from guiDesign import Ui_MainWindow  # Import

class MainClassGUI(QMainWindow, Ui_MainWindow): #Extend

def __init__(self, parent=None):
    super(MainClassGUI, self).__init__(parent)
    self.setupUi(self)

In this way, we can reach every feature of the GUI design.

We can try our project with the command below.

python3 mainApp.py