def layout(self):
"""
Populate the window.
"""
self._main_layout = QW.QVBoxLayout(self)
self._form_layout = QW.QFormLayout()
# Combobox widget holding possible connectors
self._connector_select_widget = QW.QComboBox(self)
connector_names = list(self._fit.avail_connectors.keys())
connector_names.sort()
for n in connector_names:
self._connector_select_widget.addItem(n)
self._connector_select_widget.setCurrentIndex(0)
self._connector_select_widget.activated.connect(self._update_dialog)
# Input box holding name
self._connector_name_input = QW.QLineEdit(self)
self._connector_name_input.setText("connector")
self._connector_name_input.textChanged.connect(self._update_connector_name)
# Final OK button
self._OK_button = QW.QPushButton("OK", self)
self._OK_button.clicked.connect(self._ok_button_handler)
# Add to form
self._form_layout.addRow(QW.QLabel("Select Model:"), self._connector_select_widget)
self._form_layout.addRow(QW.QLabel("Name:"), self._connector_name_input)
# Populate widgets
self._arg_widgets = {}
self._update_dialog()
# add to main layout
self._main_layout.addLayout(self._form_layout)
self._main_layout.addWidget(self._OK_button)
self.setWindowTitle('Add new global connector')
评论列表
文章目录