def main():
app = QApplication(sys.argv)
w = QMainWindow()
central_widget = CentralWidget()
my_widgets = [
(GoalWidget('one', '5'), 1, 1),
(GoalWidget('two', '2'), 1, 2),
(GoalWidget('An example of goal\nwith a long name', '3'), 2, 2),
(GoalWidget('four', '1'), 2, 3),
(GoalWidget('five', '4'), 3, 2),
]
my_lines = [
(0, 2), (1, 2),
(2, 4), (3, 4),
]
for widget, row, column in my_widgets:
central_widget.addCustomWidget(widget, row, column)
for upper, lower in my_lines:
central_widget.addCustomLine(upper, lower)
w.setCentralWidget(central_widget)
w.show()
sys.exit(app.exec_())
评论列表
文章目录