| 24 | #include <QMessageBox> |
| 25 | |
| 26 | ComponentLibTreeView::ComponentLibTreeView(Lib *lib, QWidget *parent) : |
| 27 | QTreeView(parent) |
| 28 | { |
| 29 | if (lib) |
| 30 | _model = new ComponentLibItemModel(lib); |
| 31 | else |
| 32 | _model = new ComponentLibItemModel(new Lib()); |
| 33 | |
| 34 | setSelectionMode(QAbstractItemView::ExtendedSelection); |
| 35 | _editMode = false; |
| 36 | |
| 37 | _sortProxy = new NumericalSortFilterProxyModel(); |
| 38 | _sortProxy->setSourceModel(_model); |
| 39 | setModel(_sortProxy); |
| 40 | |
| 41 | sortByColumn(0, Qt::AscendingOrder); |
| 42 | |
| 43 | setSortingEnabled(true); |
| 44 | createActions(); |
| 45 | } |
| 46 | |
| 47 | Lib *ComponentLibTreeView::lib() const |
| 48 | { |
nothing calls this directly
no outgoing calls
no test coverage detected