Skip to content

Commit e3a88ed

Browse files
committed
bug fixed: enable/disable query
1 parent 81a44bc commit e3a88ed

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/comboboxquerywidget.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void ComboBoxQueryWidget::handleResponse(QString initialQuery, QString response)
8686
int value = recoveredResponse.toInt();
8787
//check if this combobox is a enable/disable comboBox and convert response (1 or -1) to coresponding comboBox index (0 or 1)
8888
if (this->enableDisableComboBox) {
89-
value = value == 1 ? 0 : 1;
89+
value = value == 1 ? 0 : 1;
9090
}
9191
if(this->comboBox->count() > value){
9292
this->comboBox->setCurrentIndex(value);
@@ -104,6 +104,9 @@ void ComboBoxQueryWidget::handleResponse(QString initialQuery, QString response)
104104
}
105105

106106
void ComboBoxQueryWidget::changeValue(int value) {
107+
if(this->enableDisableComboBox){
108+
value = value == 1 ? -1 : 1; //query value must be 1 or -1 if this ComboBox is used to just enable and disable a parameter
109+
}
107110
QString command = this->name + " " + QString::number(value);
108111
emit query(this, command);
109112
}

0 commit comments

Comments
 (0)