Skip to content
Snippets Groups Projects
Commit da0d3a3e authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

correct logic for sR checkbox

parent 42f6c07d
No related branches found
No related tags found
1 merge request!1649Generic legacy 1D tables can again be read, now using new modal format dialog (#601)
Pipeline #100443 failed
......@@ -40,7 +40,7 @@ Legacy1dDialog::Legacy1dDialog()
auto have_sR = new QCheckBox;
gridLayout->addWidget(have_sR, 2, 0);
have_sR->setEnabled(Msettings.col_sR != 0);
have_sR->setCheckState(Msettings.col_sR == 0 ? Qt::Unchecked : Qt::Checked);
// connect statement is below, as it needs access to other widgets
gridLayout->addWidget(new QLabel("Read Q"), 0, 1);
......@@ -51,29 +51,28 @@ Legacy1dDialog::Legacy1dDialog()
gridLayout->addWidget(new QLabel("from column"), 1, 2);
auto from_sR = new QLabel("from column"); // this one can be made invisible
gridLayout->addWidget(new QLabel("from column"), 2, 2);
gridLayout->addWidget(from_sR, 2, 2);
auto sb_Q = new QSpinBox;
gridLayout->addWidget(sb_Q, 0, 3);
sb_Q->setMinimum(1);
sb_Q->setValue(Msettings.col_Q);
connect(sb_Q, &QSpinBox::valueChanged, [&p = Msettings](int i) { p.col_Q = i; });
auto sb_R = new QSpinBox;
gridLayout->addWidget(sb_R, 1, 3);
sb_R->setMinimum(1);
sb_R->setValue(Msettings.col_R);
connect(sb_R, &QSpinBox::valueChanged, [&p = Msettings](int i) { p.col_R = i; });
auto sb_sR = new QSpinBox;
gridLayout->addWidget(sb_sR, 2, 3);
sb_sR->setMinimum(1);
sb_sR->setValue(Msettings.col_sR);
connect(sb_sR, &QSpinBox::valueChanged, [&p = Msettings](int i) { p.col_sR = i; });
connect(have_sR, &QCheckBox::stateChanged, [&p = Msettings, from_sR, sb_sR](int i) {
if (i) {
p.col_sR = p.col_R + 1;
} else {
p.col_sR = 0;
}
sb_sR->setValue(i ? p.col_R + 1 : 0);
from_sR->setVisible(i != 0);
sb_sR->setVisible(i != 0);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment