Changeset View
Changeset View
Standalone View
Standalone View
plugins/projectmanagerview/projecttreeview.h
Show All 17 Lines | 1 | /* This file is part of KDevelop | |||
---|---|---|---|---|---|
18 | Boston, MA 02110-1301, USA. | 18 | Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef KDEVPLATFORM_PLUGIN_PROJECTTREEVIEW_H | 21 | #ifndef KDEVPLATFORM_PLUGIN_PROJECTTREEVIEW_H | ||
22 | #define KDEVPLATFORM_PLUGIN_PROJECTTREEVIEW_H | 22 | #define KDEVPLATFORM_PLUGIN_PROJECTTREEVIEW_H | ||
23 | 23 | | |||
24 | #include <QTreeView> | 24 | #include <QTreeView> | ||
25 | #include <QPointer> | 25 | #include <QPointer> | ||
26 | #include <QBasicTimer> | ||||
27 | | ||||
28 | #include <stack> | ||||
26 | 29 | | |||
27 | class QAbstractProxyModel; | 30 | class QAbstractProxyModel; | ||
28 | 31 | | |||
29 | namespace KDevelop | 32 | namespace KDevelop | ||
30 | { | 33 | { | ||
31 | class IProject; | 34 | class IProject; | ||
32 | class ProjectBaseItem; | 35 | class ProjectBaseItem; | ||
36 | class ProjectFolderItem; | ||||
33 | class Path; | 37 | class Path; | ||
34 | } | 38 | } | ||
35 | 39 | | |||
36 | class ProjectTreeView: public QTreeView | 40 | class ProjectTreeView: public QTreeView | ||
37 | { | 41 | { | ||
38 | Q_OBJECT | 42 | Q_OBJECT | ||
39 | public: | 43 | public: | ||
40 | explicit ProjectTreeView( QWidget *parent = nullptr ); | 44 | explicit ProjectTreeView( QWidget *parent = nullptr ); | ||
Show All 12 Lines | 52 | protected Q_SLOTS: | |||
53 | void restoreState(KDevelop::IProject* project = nullptr); | 57 | void restoreState(KDevelop::IProject* project = nullptr); | ||
54 | void aboutToShutdown(); | 58 | void aboutToShutdown(); | ||
55 | void projectClosed(KDevelop::IProject* project); | 59 | void projectClosed(KDevelop::IProject* project); | ||
56 | void rowsInserted(const QModelIndex& parent, int start, int end) override; | 60 | void rowsInserted(const QModelIndex& parent, int start, int end) override; | ||
57 | void rowsAboutToBeRemoved(const QModelIndex& parent, int start, int end) override; | 61 | void rowsAboutToBeRemoved(const QModelIndex& parent, int start, int end) override; | ||
58 | 62 | | |||
59 | protected: | 63 | protected: | ||
60 | void keyPressEvent(QKeyEvent *event) override; | 64 | void keyPressEvent(QKeyEvent *event) override; | ||
65 | void timerEvent(QTimerEvent *event) override; | ||||
66 | void dragMoveEvent(QDragMoveEvent *event) override; | ||||
67 | void dragLeaveEvent(QDragLeaveEvent *event) override; | ||||
61 | void dropEvent(QDropEvent* event) override; | 68 | void dropEvent(QDropEvent* event) override; | ||
62 | void drawBranches(QPainter* painter, const QRect& rect, const QModelIndex& index) const override; | 69 | void drawBranches(QPainter* painter, const QRect& rect, const QModelIndex& index) const override; | ||
63 | 70 | | |||
64 | private: | 71 | private: | ||
65 | QModelIndex mapFromItem(const KDevelop::ProjectBaseItem* item); | 72 | QModelIndex mapFromItem(const KDevelop::ProjectBaseItem* item); | ||
66 | KDevelop::ProjectBaseItem* itemAtPos(const QPoint& pos) const; | 73 | KDevelop::ProjectBaseItem* itemAtPos(const QPoint& pos) const; | ||
67 | QList<KDevelop::ProjectBaseItem*> selectedProjects(); | 74 | QList<KDevelop::ProjectBaseItem*> selectedProjects(); | ||
68 | KDevelop::IProject* getCurrentProject(); | 75 | KDevelop::IProject* getCurrentProject(); | ||
69 | 76 | | |||
70 | QPointer<KDevelop::IProject> m_previousSelection; | 77 | QPointer<KDevelop::IProject> m_previousSelection; | ||
78 | | ||||
79 | // drag'n'drop implementation | ||||
80 | QBasicTimer expandTimer; | ||||
mwolff: add `m_` prefixes to all members | |||||
81 | KDevelop::ProjectFolderItem *curExpandTarget; | ||||
mwolff: don't abbreviate please | |||||
82 | std::stack<KDevelop::ProjectFolderItem*> expandStack; | ||||
71 | }; | 83 | }; | ||
72 | 84 | | |||
73 | #endif // KDEVPLATFORM_PLUGIN_PROJECTTREEVIEW_H | 85 | #endif // KDEVPLATFORM_PLUGIN_PROJECTTREEVIEW_H | ||
74 | 86 | |
add m_ prefixes to all members