MCPcopy Create free account
hub / github.com/davy7125/polyphone / TreeView

Method TreeView

sources/editor/tree/treeview.cpp:41–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39#include "samplereaderfactory.h"
40
41TreeView::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
67void TreeView::mousePressEvent(QMouseEvent * event)
68{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected