File indexing completed on 2024-04-28 04:38:37
0001 /* 0002 SPDX-FileCopyrightText: 2009 Andreas Pakulat <apaku@gmx.de> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef KDEVPLATFORM_PLUGIN_DOCUMENTSWITCHERTREEVIEW_H 0008 #define KDEVPLATFORM_PLUGIN_DOCUMENTSWITCHERTREEVIEW_H 0009 0010 #include <QTreeView> 0011 0012 class DocumentSwitcherPlugin; 0013 0014 class DocumentSwitcherTreeView : public QTreeView 0015 { 0016 Q_OBJECT 0017 0018 public: 0019 enum Roles { 0020 ProjectRole = Qt::UserRole + 1 0021 }; 0022 explicit DocumentSwitcherTreeView(DocumentSwitcherPlugin* plugin); 0023 0024 using QTreeView::sizeHintForColumn; 0025 0026 protected: 0027 void keyPressEvent(QKeyEvent* event) override; 0028 void keyReleaseEvent(QKeyEvent* event) override; 0029 void drawBranches(QPainter* painter, const QRect& rect, 0030 const QModelIndex& index) const override; 0031 0032 private: 0033 DocumentSwitcherPlugin* plugin; 0034 }; 0035 0036 #endif // KDEVPLATFORM_PLUGIN_DOCUMENTSWITCHERTREEVIEW_H