363 |
QTable::setLeftMargin(0); |
QTable::setLeftMargin(0); |
364 |
// Initialize the fixed table column headings. |
// Initialize the fixed table column headings. |
365 |
QHeader *pHeader = QTable::horizontalHeader(); |
QHeader *pHeader = QTable::horizontalHeader(); |
366 |
pHeader->setLabel(0, tr("Parameter")); |
pHeader->setLabel(0, tr("Description")); |
367 |
pHeader->setLabel(1, tr("Value")); |
pHeader->setLabel(1, tr("Value")); |
368 |
pHeader->setLabel(2, tr("Description")); |
pHeader->setLabel(2, tr("Parameter")); |
369 |
// Set read-onlyness of each column |
// Set read-onlyness of each column |
370 |
QTable::setColumnReadOnly(0, true); |
QTable::setColumnReadOnly(0, true); |
371 |
// QTable::setColumnReadOnly(1, true); -- of course not. |
// QTable::setColumnReadOnly(1, true); -- of course not. |
372 |
QTable::setColumnReadOnly(2, true); |
QTable::setColumnReadOnly(2, true); |
373 |
|
QTable::setColumnStretchable(0, true); |
374 |
} |
} |
375 |
|
|
376 |
// Default destructor. |
// Default destructor. |
391 |
int iRow = 0; |
int iRow = 0; |
392 |
qsamplerDeviceParamMap::ConstIterator iter; |
qsamplerDeviceParamMap::ConstIterator iter; |
393 |
for (iter = params.begin(); iter != params.end(); ++iter) { |
for (iter = params.begin(); iter != params.end(); ++iter) { |
394 |
QTable::setText(iRow, 0, iter.key()); |
const qsamplerDeviceParam& param = iter.data(); |
395 |
QTable::setText(iRow, 1, iter.data().value); |
QTable::setText(iRow, 0, param.description); |
396 |
QTable::setText(iRow, 2, iter.data().description); |
if (param.type == LSCP_TYPE_BOOL) { |
397 |
|
QStringList opts; |
398 |
|
opts.append(tr("false")); |
399 |
|
opts.append(tr("true")); |
400 |
|
QComboTableItem *pComboItem = new QComboTableItem(this, opts); |
401 |
|
pComboItem->setCurrentItem(param.value.lower() == "true" ? 1 : 0); |
402 |
|
pComboItem->setEnabled(param.fix); |
403 |
|
QTable::setItem(iRow, 1, pComboItem); |
404 |
|
} else if (param.possibilities.count() > 0) { |
405 |
|
QComboTableItem *pComboItem = new QComboTableItem(this, |
406 |
|
param.possibilities); |
407 |
|
pComboItem->setCurrentItem(param.value); |
408 |
|
pComboItem->setEnabled(param.fix); |
409 |
|
QTable::setItem(iRow, 1, pComboItem); |
410 |
|
} else { |
411 |
|
QTableItem* pTableItem = new QTableItem(this, |
412 |
|
param.fix ? QTableItem::Never : QTableItem::OnTyping, |
413 |
|
param.value); |
414 |
|
QTable::setItem(iRow, 1, pTableItem); |
415 |
|
} |
416 |
|
QTable::setText(iRow, 2, iter.key()); |
417 |
++iRow; |
++iRow; |
418 |
} |
} |
419 |
|
|