/[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 3401 by capela, Sat Dec 29 00:21:11 2012 UTC revision 3402 by schoenebeck, Wed Jan 3 13:01:00 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;
1174            const bool bFix = r.param.fix;
1175    
1176          QString val = (r.alive) ? r.param.value : r.param.defaultv;          QString val = (r.alive) ? r.param.value : r.param.defaultv;
1177    
# Line 1183  QWidget* DeviceParamDelegate::createEdit Line 1184  QWidget* DeviceParamDelegate::createEdit
1184                                  if (val != QString::null)                                  if (val != QString::null)
1185                                          pCheckBox->setChecked(val.toLower() == "true");                                          pCheckBox->setChecked(val.toLower() == "true");
1186                                  pCheckBox->setEnabled(bEnabled);                                  pCheckBox->setEnabled(bEnabled);
1187                                    pCheckBox->setCheckable(!bFix);
1188                                  return pCheckBox;                                  return pCheckBox;
1189                          } else if (r.param.possibilities.count() > 0) {                          } else if (r.param.possibilities.count() > 0) {
1190                                  QStringList opts = r.param.possibilities;                                  QStringList opts = r.param.possibilities;
# Line 1195  QWidget* DeviceParamDelegate::createEdit Line 1197  QWidget* DeviceParamDelegate::createEdit
1197                                  else                                  else
1198                                          pComboBox->setCurrentIndex(pComboBox->findText(val));                                          pComboBox->setCurrentIndex(pComboBox->findText(val));
1199                                  pComboBox->setEnabled(bEnabled);                                  pComboBox->setEnabled(bEnabled);
1200                                    pComboBox->setEditable(!bFix);
1201                                  return pComboBox;                                  return pComboBox;
1202                          } else if (r.param.type == LSCP_TYPE_INT && bEnabled) {                          } else if (r.param.type == LSCP_TYPE_INT && bEnabled) {
1203                                  QSpinBox *pSpinBox = new QSpinBox(pParent);                                  QSpinBox *pSpinBox = new QSpinBox(pParent);
# Line 1207  QWidget* DeviceParamDelegate::createEdit Line 1210  QWidget* DeviceParamDelegate::createEdit
1210                                                  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 ?
1211                                  );                                  );
1212                                  pSpinBox->setValue(val.toInt());                                  pSpinBox->setValue(val.toInt());
1213                                    pSpinBox->setReadOnly(bFix);
1214                                  return pSpinBox;                                  return pSpinBox;
1215                          } else if (bEnabled) {                          } else if (bEnabled) {
1216                                  QLineEdit *pLineEdit = new QLineEdit(val, pParent);                                  QLineEdit *pLineEdit = new QLineEdit(val, pParent);
1217                                    pLineEdit->setReadOnly(bFix);
1218                                  return pLineEdit;                                  return pLineEdit;
1219                          } else {                          } else {
1220                                  QLabel *pLabel = new QLabel(val, pParent);                                  QLabel *pLabel = new QLabel(val, pParent);

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

  ViewVC Help
Powered by ViewVC