loading external UIs



  • hello guys... how do i load a figma file into PyQt5?



  • #!/usr/bin/python3
    import os
    import sys
    from PyQt5 import QtCore, QtGui, QtWidgets , uic
    
    LOCAL_DIR = os.path.dirname(os.path.realpath(__file__)) + "/"
    
    
    class Main(QtWidgets.QMainWindow):
        def __init__(self):
            super().__init__()
            self.ui = uic.loadUi(LOCAL_DIR + "main.ui", self)
            self.show()
    
    
    if __name__== '__main__':
        app = QtWidgets.QApplication([])
        gui = Main()
        sys.exit(app.exec_())
    

Log in to reply