mirror of
https://github.com/nqrduck/nqrduck-pulseprogrammer.git
synced 2024-11-08 10:50:02 +00:00
Fixed Header label position.
This commit is contained in:
parent
ab1a49bed0
commit
0b3445fc5a
1 changed files with 21 additions and 17 deletions
|
@ -65,7 +65,10 @@ class PulseProgrammerView(ModuleView):
|
|||
logger.debug("Updating pulse parameter options to %s", self.module.model.pulse_parameter_options.keys())
|
||||
# We set it to the length of the pulse parameter options + 1 because we want to add a row for the parameter option buttons
|
||||
self.pulse_table.setRowCount(len(self.module.model.pulse_parameter_options) + 1)
|
||||
self.pulse_table.setVerticalHeaderLabels(self.module.model.pulse_parameter_options.keys())
|
||||
# Move the vertical header labels on row down
|
||||
pulse_options = [""]
|
||||
pulse_options.extend(list(self.module.model.pulse_parameter_options.keys()))
|
||||
self.pulse_table.setVerticalHeaderLabels(pulse_options)
|
||||
|
||||
@pyqtSlot()
|
||||
def on_new_event_button_clicked(self):
|
||||
|
@ -127,7 +130,7 @@ class PulseProgrammerView(ModuleView):
|
|||
func = functools.partial(self.module.controller.delete_event, event_name=event.name)
|
||||
event_options_widget.delete_event.connect(func)
|
||||
self.pulse_table.setCellWidget(row_idx, column_idx, event_options_widget)
|
||||
else:
|
||||
|
||||
logger.debug("Adding button for event %s and parameter %s", event, parameter)
|
||||
logger.debug("Parameter object id: %s", id(event.parameters[parameter]))
|
||||
button = QPushButton()
|
||||
|
@ -137,8 +140,9 @@ class PulseProgrammerView(ModuleView):
|
|||
button.setIconSize(icon.availableSizes()[0])
|
||||
button.setFixedSize(icon.availableSizes()[0])
|
||||
|
||||
self.pulse_table.setCellWidget(row_idx, column_idx, button)
|
||||
self.pulse_table.setRowHeight(row_idx, icon.availableSizes()[0].height())
|
||||
# We add 1 to the row index because the first row is used for the event options
|
||||
self.pulse_table.setCellWidget(row_idx + 1, column_idx, button)
|
||||
self.pulse_table.setRowHeight(row_idx + 1, icon.availableSizes()[0].height())
|
||||
self.pulse_table.setColumnWidth(column_idx, icon.availableSizes()[0].width())
|
||||
|
||||
# Connect the button to the on_button_clicked slot
|
||||
|
|
Loading…
Reference in a new issue