From 3ca5526701ddbcf459f5f617aef85c1a173b7bb4 Mon Sep 17 00:00:00 2001 From: jupfi Date: Wed, 3 Jan 2024 12:52:23 +0100 Subject: [PATCH] Finally prettified the pulse paramter options dialog for numeric options. --- src/nqrduck_pulseprogrammer/view.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/nqrduck_pulseprogrammer/view.py b/src/nqrduck_pulseprogrammer/view.py index 3f39a53..f0187de 100644 --- a/src/nqrduck_pulseprogrammer/view.py +++ b/src/nqrduck_pulseprogrammer/view.py @@ -383,8 +383,14 @@ class OptionsDialog(QDialog): self.layout = QVBoxLayout(self) + numeric_layout = QFormLayout() + numeric_layout.setHorizontalSpacing(30) + self.label = QLabel("Change options for the pulse parameter: %s" % parameter) self.layout.addWidget(self.label) + + self.layout.addLayout(numeric_layout) + parameter = event.parameters[parameter] options = parameter.get_options() @@ -409,13 +415,10 @@ class OptionsDialog(QDialog): # If the options are a float/int we will create a QSpinBox elif isinstance(option, NumericOption): - numeric_layout = QHBoxLayout() numeric_label = QLabel(option.name) numeric_lineedit = QLineEdit(str(option.value)) - numeric_layout.addWidget(numeric_label) - numeric_layout.addWidget(numeric_lineedit) - numeric_layout.addStretch(1) - self.layout.addLayout(numeric_layout) + numeric_lineedit.setMaximumWidth(300) + numeric_layout.addRow(numeric_label, numeric_lineedit) self.return_functions[option] = numeric_lineedit.text