Commit bfcdca9e authored by Giacomo Strangolino's avatar Giacomo Strangolino

fix instrument selector readback #14060

parent 048b4d5c
1.0.2: fix Instrument selector readback1.0.2: fix Instrument selector readback1.0.2: fix Instrument selector readback1.0.2: fix Instrument selector readback1.0.2: fix Instrument selector readback1.0.2: fix Instrument selector readback1.0.2: fix Instrument selector readback1.0.2: fix Instrument selector readback1.0.2: fix Instrument selector readback
release_15: Changed color and widget for LIGHT ON/ LIGHT OFF indication: from TLed to TLabel #9779
release_14: Filter tab: changed reading source: CurrentFilter --> Instrument
......
......@@ -37,6 +37,7 @@
#include <QVBoxLayout>
#include <QRadioButton>
#include <QTimer>
#include <QDebug>
InstrumentSelector::InstrumentSelector(QWidget *parent) : QGroupBox(parent)
{
......@@ -86,16 +87,16 @@ void InstrumentSelector::slotRadioClicked()
void InstrumentSelector::setClicked(int idx)
{
QRadioButton *cb = findChild<QRadioButton *>(QString("cb%1").arg(idx));
printf("InstrumentSelector.setClicked: value %d cb found %p valid %d\n", idx, cb, cb->property("valid").toBool());
printf("InstrumentSelector.setClicked: value %d cb found %p [%s] valid %d\n", idx, cb,qstoc(cb->objectName()), cb->property("valid").toBool());
if(cb && cb->property("valid").toBool())
cb->setChecked(true);
else if(cb)
// if readOk arrives after setClicked, let readOk check cb
cb->setProperty("selected", true);
foreach(QRadioButton *rb, findChildren<QRadioButton *>())
rb->setProperty("selected", rb == cb);
}
void InstrumentSelector::readOk(bool ok)
{
qDebug() << __PRETTY_FUNCTION__ << "ok" << ok;
QVBoxLayout *lo = findChild<QVBoxLayout *>();
QTextEdit *lenok = findChild<QTextEdit *>("leInstrumentNotOK");
if(!ok && !lenok) {
......@@ -112,6 +113,7 @@ void InstrumentSelector::readOk(bool ok)
foreach(QRadioButton *rb, findChildren<QRadioButton *>()){
rb->setProperty("valid", ok);
rb->setCheckable(ok);
qDebug() << __PRETTY_FUNCTION__ << "- rb " << rb->objectName() << "valid" << ok << "selected" << rb->property("selected").toBool();
if(rb->property("selected").toBool())
rb->setChecked(true);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment