def main(): app=QtWidgets.QApplication([]) gui=MyGui() gui.show() app.exec_()
def main(i): app = QtWidgets.QApplication(["test_app_" + str(i)]) st = "mg=TestGui" + str(i) + "()" exec(st, globals()) mg.show() app.exec_()
self.setCentralWidget(self.w) self.lay = QtWidgets.QHBoxLayout(self.w) self.person_view = ListAndForm( self.data_model.PersonList(collection=self.data_model.collection), EditFormSet(collection=self.data_model.collection), "Persons", self.w) self.food_view = ListAndForm( self.data_model.FoodList( collection=self.data_model.food_collection), EditFormSet(collection=self.data_model.food_collection), "Foods", self.w) self.food_view.modified.connect(self.person_view.update) # instantiate PersonFormSet => instantiate rows => row instantiates widgets based on the columns => .. # updating: call row's updateWidget method => re-creates column widgets self.lay.addWidget(self.person_view.widget) self.lay.addWidget(self.food_view.widget) """<rtf> Start the Qt program <rtf>""" if (__name__ == "__main__"): app = QtWidgets.QApplication([]) gui = MyGui() gui.show() app.exec_()