444 |
} else if (param.type == LSCP_TYPE_INT) { |
} else if (param.type == LSCP_TYPE_INT) { |
445 |
qsamplerDeviceParamTableSpinBox *pSpinItem = |
qsamplerDeviceParamTableSpinBox *pSpinItem = |
446 |
new qsamplerDeviceParamTableSpinBox(this, |
new qsamplerDeviceParamTableSpinBox(this, |
447 |
bEnabled ? QTableItem::OnTyping : QTableItem::Never); |
bEnabled ? QTableItem::OnTyping : QTableItem::Never, |
448 |
pSpinItem->setMinValue(param.range_min.toInt()); |
param.value); |
449 |
pSpinItem->setMaxValue(param.range_max.toInt()); |
if (!param.range_min.isEmpty()) |
450 |
pSpinItem->setValue(param.value.toInt()); |
pSpinItem->setMinValue(param.range_min.toInt()); |
451 |
|
if (!param.range_max.isEmpty()) |
452 |
|
pSpinItem->setMaxValue(param.range_max.toInt()); |
453 |
QTable::setItem(iRow, 2, pSpinItem); |
QTable::setItem(iRow, 2, pSpinItem); |
454 |
} else { |
} else { |
455 |
qsamplerDeviceParamTableEditBox *pEditItem = |
qsamplerDeviceParamTableEditBox *pEditItem = |
476 |
|
|
477 |
// Constructor. |
// Constructor. |
478 |
qsamplerDeviceParamTableSpinBox::qsamplerDeviceParamTableSpinBox ( |
qsamplerDeviceParamTableSpinBox::qsamplerDeviceParamTableSpinBox ( |
479 |
QTable *pTable, EditType editType ) |
QTable *pTable, EditType editType, const QString& sText ) |
480 |
: QTableItem(pTable, editType, QString::null) |
: QTableItem(pTable, editType, sText) |
481 |
{ |
{ |
482 |
m_iValue = m_iMinValue = m_iMaxValue = 0; |
m_iValue = sText.toInt(); |
483 |
|
m_iMinValue = 0; |
484 |
|
m_iMaxValue = 999999; |
485 |
} |
} |
486 |
|
|
487 |
// Public accessors. |
// Public accessors. |
512 |
pSpinBox->setMaxValue(m_iMaxValue); |
pSpinBox->setMaxValue(m_iMaxValue); |
513 |
} |
} |
514 |
pSpinBox->setValue(m_iValue); |
pSpinBox->setValue(m_iValue); |
|
// pSpinBox->setEnabled(QTableItem::isEnabled()); |
|
515 |
return pSpinBox; |
return pSpinBox; |
516 |
} |
} |
517 |
|
|
542 |
QObject::connect(pEditBox, SIGNAL(returnPressed()), |
QObject::connect(pEditBox, SIGNAL(returnPressed()), |
543 |
QTableItem::table(), SLOT(doValueChanged())); |
QTableItem::table(), SLOT(doValueChanged())); |
544 |
pEditBox->setText(QTableItem::text()); |
pEditBox->setText(QTableItem::text()); |
|
// pEditBox->setEnabled(QTableItem::isEnabled()); |
|
545 |
return pEditBox; |
return pEditBox; |
546 |
} |
} |
547 |
|
|