/[svn]/qsampler/trunk/src/qsamplerDevice.cpp
ViewVC logotype

Diff of /qsampler/trunk/src/qsamplerDevice.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3402 by schoenebeck, Wed Jan 3 13:01:00 2018 UTC revision 3404 by capela, Wed Jan 10 18:55:12 2018 UTC
# Line 1171  QWidget* DeviceParamDelegate::createEdit Line 1171  QWidget* DeviceParamDelegate::createEdit
1171                  Qt::DisplayRole).value<DeviceParameterRow>();                  Qt::DisplayRole).value<DeviceParameterRow>();
1172    
1173          const bool bEnabled = (r.alive) ? !r.param.fix : true;          const bool bEnabled = (r.alive) ? !r.param.fix : true;
         const bool bFix = r.param.fix;  
1174    
1175          QString val = (r.alive) ? r.param.value : r.param.defaultv;          QString val = (r.alive) ? r.param.value : r.param.defaultv;
1176    
# Line 1184  QWidget* DeviceParamDelegate::createEdit Line 1183  QWidget* DeviceParamDelegate::createEdit
1183                                  if (val != QString::null)                                  if (val != QString::null)
1184                                          pCheckBox->setChecked(val.toLower() == "true");                                          pCheckBox->setChecked(val.toLower() == "true");
1185                                  pCheckBox->setEnabled(bEnabled);                                  pCheckBox->setEnabled(bEnabled);
                                 pCheckBox->setCheckable(!bFix);  
1186                                  return pCheckBox;                                  return pCheckBox;
1187                          } else if (r.param.possibilities.count() > 0) {                          } else if (r.param.possibilities.count() > 0) {
1188                                  QStringList opts = r.param.possibilities;                                  QStringList opts = r.param.possibilities;
# Line 1197  QWidget* DeviceParamDelegate::createEdit Line 1195  QWidget* DeviceParamDelegate::createEdit
1195                                  else                                  else
1196                                          pComboBox->setCurrentIndex(pComboBox->findText(val));                                          pComboBox->setCurrentIndex(pComboBox->findText(val));
1197                                  pComboBox->setEnabled(bEnabled);                                  pComboBox->setEnabled(bEnabled);
                                 pComboBox->setEditable(!bFix);  
1198                                  return pComboBox;                                  return pComboBox;
1199                          } else if (r.param.type == LSCP_TYPE_INT && bEnabled) {                          } else if (r.param.type == LSCP_TYPE_INT && bEnabled) {
1200                                  QSpinBox *pSpinBox = new QSpinBox(pParent);                                  QSpinBox *pSpinBox = new QSpinBox(pParent);
# Line 1210  QWidget* DeviceParamDelegate::createEdit Line 1207  QWidget* DeviceParamDelegate::createEdit
1207                                                  r.param.range_max.toInt() : (1 << 24) // or better a higher default max value ?                                                  r.param.range_max.toInt() : (1 << 24) // or better a higher default max value ?
1208                                  );                                  );
1209                                  pSpinBox->setValue(val.toInt());                                  pSpinBox->setValue(val.toInt());
                                 pSpinBox->setReadOnly(bFix);  
1210                                  return pSpinBox;                                  return pSpinBox;
1211                          } else if (bEnabled) {                          } else if (bEnabled) {
1212                                  QLineEdit *pLineEdit = new QLineEdit(val, pParent);                                  QLineEdit *pLineEdit = new QLineEdit(val, pParent);
                                 pLineEdit->setReadOnly(bFix);  
1213                                  return pLineEdit;                                  return pLineEdit;
1214                          } else {                          } else {
1215                                  QLabel *pLabel = new QLabel(val, pParent);                                  QLabel *pLabel = new QLabel(val, pParent);

Legend:
Removed from v.3402  
changed lines
  Added in v.3404

  ViewVC Help
Powered by ViewVC