| 358 | |
| 359 | |
| 360 | class FormComboWidget(QtWidgets.QWidget): |
| 361 | update_buttons = QtCore.Signal() |
| 362 | |
| 363 | def __init__(self, datalist, comment="", parent=None): |
| 364 | super().__init__(parent) |
| 365 | layout = QtWidgets.QVBoxLayout() |
| 366 | self.setLayout(layout) |
| 367 | self.combobox = QtWidgets.QComboBox() |
| 368 | layout.addWidget(self.combobox) |
| 369 | |
| 370 | self.stackwidget = QtWidgets.QStackedWidget(self) |
| 371 | layout.addWidget(self.stackwidget) |
| 372 | self.combobox.currentIndexChanged.connect( |
| 373 | self.stackwidget.setCurrentIndex) |
| 374 | |
| 375 | self.widgetlist = [] |
| 376 | for data, title, comment in datalist: |
| 377 | self.combobox.addItem(title) |
| 378 | widget = FormWidget(data, comment=comment, parent=self) |
| 379 | self.stackwidget.addWidget(widget) |
| 380 | self.widgetlist.append(widget) |
| 381 | |
| 382 | def setup(self): |
| 383 | for widget in self.widgetlist: |
| 384 | widget.setup() |
| 385 | |
| 386 | def get(self): |
| 387 | return [widget.get() for widget in self.widgetlist] |
| 388 | |
| 389 | |
| 390 | class FormTabWidget(QtWidgets.QWidget): |