Gui slot call focus fix (#150)

* fix for editingFinished for qlineedit using isModified()

* spinbox disable keyboard tracking to use valuechanged so slot called only after editing finished, focus fix

* return pressed forces qtextfield to be set (slot for tab checks for modification flag due to avoid unnecessary set when focus). This is to remove inconsistencies from command line. A return should set even if it looks like no modification in gui

Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
This commit is contained in:
Dhanya Thattil
2020-09-02 16:56:57 +02:00
committed by GitHub
parent 050f0ff8a0
commit 180c7b7191
15 changed files with 290 additions and 133 deletions

View File

@ -26,7 +26,7 @@ void qDacWidget::SetupWidgetWindow(std::string name) {
void qDacWidget::Initialization() {
if (isDac) {
connect(spinDac, SIGNAL(editingFinished()), this, SLOT(SetDac()));
connect(spinDac, SIGNAL(valueChanged(double)), this, SLOT(SetDac()));
}
}
@ -38,7 +38,7 @@ void qDacWidget::SetDetectorIndex(int id) {
void qDacWidget::GetDac() {
LOG(logDEBUG) << "Getting Dac " << index;
disconnect(spinDac, SIGNAL(editingFinished()), this, SLOT(SetDac()));
disconnect(spinDac, SIGNAL(valueChanged(double)), this, SLOT(SetDac()));
try {
// dac units
auto retval = det->getDAC(index, 0, {detectorIndex}).squash(-1);
@ -52,7 +52,7 @@ void qDacWidget::GetDac() {
CATCH_DISPLAY(std::string("Could not get dac ") + std::to_string(index),
"qDacWidget::GetDac")
connect(spinDac, SIGNAL(editingFinished()), this, SLOT(SetDac()));
connect(spinDac, SIGNAL(valueChanged(double)), this, SLOT(SetDac()));
}
void qDacWidget::SetDac() {