41 |
InstrumentListModel::InstrumentListModel ( QObject *pParent ) |
InstrumentListModel::InstrumentListModel ( QObject *pParent ) |
42 |
: QAbstractItemModel(pParent), m_iMidiMap(LSCP_MIDI_MAP_ALL) |
: QAbstractItemModel(pParent), m_iMidiMap(LSCP_MIDI_MAP_ALL) |
43 |
{ |
{ |
44 |
QAbstractItemModel::reset(); |
// QAbstractItemModel::reset(); |
45 |
} |
} |
46 |
|
|
47 |
InstrumentListModel::~InstrumentListModel (void) |
InstrumentListModel::~InstrumentListModel (void) |
79 |
{ |
{ |
80 |
if (!index.isValid()) |
if (!index.isValid()) |
81 |
return QVariant(); |
return QVariant(); |
|
|
|
82 |
const Instrument *pInstr |
const Instrument *pInstr |
83 |
= static_cast<Instrument *> (index.internalPointer()); |
= static_cast<Instrument *> (index.internalPointer()); |
84 |
|
|
129 |
InstrumentMap::const_iterator itMap = m_instruments.find(m_iMidiMap); |
InstrumentMap::const_iterator itMap = m_instruments.find(m_iMidiMap); |
130 |
if (itMap != m_instruments.constEnd()) { |
if (itMap != m_instruments.constEnd()) { |
131 |
const InstrumentList& list = *itMap; |
const InstrumentList& list = *itMap; |
|
// resolve instrument in that map |
|
132 |
if (row < list.size()) |
if (row < list.size()) |
133 |
pInstr = list.at(row); |
pInstr = list.at(row); |
134 |
} |
} |
337 |
QTreeView::setAlternatingRowColors(true); |
QTreeView::setAlternatingRowColors(true); |
338 |
QTreeView::setSelectionBehavior(QAbstractItemView::SelectRows); |
QTreeView::setSelectionBehavior(QAbstractItemView::SelectRows); |
339 |
QTreeView::setSelectionMode(QAbstractItemView::SingleSelection); |
QTreeView::setSelectionMode(QAbstractItemView::SingleSelection); |
340 |
|
QTreeView::setItemsExpandable(false); |
341 |
|
|
342 |
QHeaderView *pHeader = QTreeView::header(); |
QHeaderView *pHeader = QTreeView::header(); |
343 |
pHeader->setDefaultAlignment(Qt::AlignLeft); |
pHeader->setDefaultAlignment(Qt::AlignLeft); |
344 |
pHeader->setMovable(false); |
pHeader->setMovable(false); |
398 |
{ |
{ |
399 |
m_pListModel->beginReset(); |
m_pListModel->beginReset(); |
400 |
m_pListModel->updateInstrument(pInstrument); |
m_pListModel->updateInstrument(pInstrument); |
401 |
m_pListModel->endReset();} |
m_pListModel->endReset(); |
402 |
|
} |
403 |
|
|
404 |
|
|
405 |
// Refreshener. |
// Refreshener. |