LibraryWidget.hpp
1 #pragma once
2 #include <QTreeView>
3 
4 #include <vector>
5 class QFileSystemModel;
6 
7 namespace Library
8 {
9 class LibraryInterface;
10 class FileSystemModel;
11 class FileSystemRecursiveFilterProxy;
12 inline void setup_treeview(QTreeView& tv)
13 {
14  tv.setHeaderHidden(true);
15  tv.setDragEnabled(true);
16  tv.setDropIndicatorShown(true);
17  tv.setAlternatingRowColors(true);
18  tv.setSelectionMode(QAbstractItemView::SingleSelection);
19  for(int i = 1; i < tv.model()->columnCount(); ++i)
20  tv.hideColumn(i);
21 }
22 
23 std::vector<LibraryInterface*> libraryInterface(const QString& path);
24 
25 void setupFilesystemContextMenu(
26  QTreeView& m_tv, FileSystemModel& model, FileSystemRecursiveFilterProxy& proxy);
27 }