self.okButton.clicked.connect(self.accept)
self.cancelButton.clicked.connect(self.reject)
input_axiskeys = ["".join(tag.key for tag in info.axistags) for info in infos]
self.multi_axes_display.setEnabled(False)
self.multi_axes_display.setText("Current: " + ", ".join(input_axiskeys))
if all(len(keys) == len(input_axiskeys[0]) for keys in input_axiskeys):
selector_keys = input_axiskeys[0]
else:
selector_keys = ""
self.multi_axes_display.setToolTip("Select lanes with same number of axes to change their interpretation here")
for axis_index, axis_selector in enumerate(self.axis_selectors):
axis_selector = self.axis_selectors[axis_index]
within_bounds = axis_index < len(selector_keys)
axis_selector.setVisible(within_bounds)
axis_selector.setEnabled(within_bounds)
axis_selector.setCurrentText(selector_keys[axis_index] if within_bounds else "x")
After Change
self.multi_axes_display.setText("Current: " + ", ".join(input_axiskeys))
if all(len(keys) == len(input_axiskeys[0]) for keys in input_axiskeys):
self.axesEdit.setMaxLength(len(input_axiskeys[0]))
self.axesEdit.textChanged.connect(self.validate_new_axiskeys)
different_axiskeys = set(input_axiskeys)
if len(different_axiskeys) == 1:
self.axesEdit.setText(different_axiskeys.pop())
else: