Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Load .UI files in PySide



  • Hi,

    I am new to PySide and I would like to create an application that uses .ui file for GUI.

    @
    class MyWidget(QWidget):
    def init(self, parent):
    super(QWidget, self).init(parent)
    loader = QUiLoader()
    file = QFile(":/forms/myform.ui")
    file.open(QFile.ReadOnly)
    myWidget = loader.load(file, self)
    file.close()

        layout = QVBoxLayout()
        layout.addWidget(myWidget)
        self.setLayout(layout)
    

    @

    It throws global name QUiLoader is not defined. MY QtGui, QtCore modules do not have QUiLoader attribute.

    Please share your suggestions.

    Thanks in advance,
    Haney.


Log in to reply