source: trunk/qt/FileTreeView.h @ 14539

Last change on this file since 14539 was 14539, checked in by mikedld, 6 years ago

Unify/prettify Qt client headers style

  • Property svn:keywords set to Date Rev Author Id
File size: 1.3 KB
Line 
1/*
2 * This file Copyright (C) 2009-2015 Mnemosyne LLC
3 *
4 * It may be used under the GNU GPL versions 2 or 3
5 * or any future license endorsed by Mnemosyne LLC.
6 *
7 * $Id: FileTreeView.h 14539 2015-06-12 22:12:12Z mikedld $
8 */
9
10#ifndef QTR_FILE_TREE_VIEW_H
11#define QTR_FILE_TREE_VIEW_H
12
13#include <QSet>
14#include <QTreeView>
15
16#include "Torrent.h" // FileList
17
18class QSortFilterProxyModel;
19
20class FileTreeDelegate;
21class FileTreeModel;
22
23class FileTreeView: public QTreeView
24{
25    Q_OBJECT
26
27  public:
28    FileTreeView (QWidget * parent = nullptr, bool editable = true);
29
30    void clear ();
31    void update (const FileList& files, bool updateProperties = true);
32
33    void setEditable (bool editable);
34
35  public slots:
36    void onClicked (const QModelIndex& index);
37    void onDoubleClicked (const QModelIndex& index);
38    void onOpenRequested (const QString& path);
39
40  signals:
41    void priorityChanged (const QSet<int>& fileIndices, int priority);
42    void wantedChanged (const QSet<int>& fileIndices, bool wanted);
43    void pathEdited (const QString& oldpath, const QString& newname);
44    void openRequested (const QString& path);
45
46  protected:
47    // QObject
48    bool eventFilter (QObject *, QEvent *);
49
50  private:
51    FileTreeModel * myModel;
52    QSortFilterProxyModel * myProxy;
53    FileTreeDelegate * myDelegate;
54};
55
56#endif // QTR_FILE_TREE_VIEW_H
Note: See TracBrowser for help on using the repository browser.