| 39 | #include "samplereaderfactory.h" |
| 40 | |
| 41 | TreeView::TreeView(QWidget * parent) : QTreeView(parent), |
| 42 | _fixingSelection(false), |
| 43 | _sf2Index(-1), |
| 44 | _bestMatchSample(-1), |
| 45 | _bestMatchInstrument(-1), |
| 46 | _bestMatchPreset(-1), |
| 47 | _expandClicked(false) |
| 48 | { |
| 49 | this->setItemDelegate(new TreeItemDelegate(this)); |
| 50 | this->viewport()->setAutoFillBackground(false); |
| 51 | this->sortByColumn(0, Qt::AscendingOrder); |
| 52 | |
| 53 | // Menu |
| 54 | _menu = new TreeViewMenu(parent); |
| 55 | connect(this, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(openMenu(QPoint))); |
| 56 | connect(_menu, SIGNAL(selectionChanged(IdList)), this, SLOT(onSelectionChanged(IdList))); |
| 57 | |
| 58 | // Drag & drop |
| 59 | this->setAcceptDrops(true); |
| 60 | this->setSelectionMode(QAbstractItemView::ExtendedSelection); |
| 61 | this->setDragEnabled(true); |
| 62 | this->viewport()->setAcceptDrops(true); |
| 63 | this->setDropIndicatorShown(true); |
| 64 | this->setDragDropMode(QAbstractItemView::InternalMove); |
| 65 | } |
| 66 | |
| 67 | void TreeView::mousePressEvent(QMouseEvent * event) |
| 68 | { |
nothing calls this directly
no outgoing calls
no test coverage detected