uic

How do I load children from .ui file in PySide?

How do I load children from .ui file in PySide? Question: For now I’m loading them like this: if __name__ == ‘__main__’: app = QApplication(sys.argv) loader = QUiLoader() file = QFile(‘main.ui’) file.open(QFile.ReadOnly) window = loader.load(file) file.close() window.show() # Here: window.centralwidget.findChild(QListWidget, ‘listWidget’).addItems([‘Item {0}’.format(x) for x in range(100)]) sys.exit(app.exec_()) But I think it’s uncomfortably, is there any …

Total answers: 1