File indexing completed on 2024-04-28 04:38:10
0001 /* 0002 SPDX-FileCopyrightText: 2007 Hamish Rodda <rodda@kde.org> 0003 SPDX-FileCopyrightText: 2009 Lior Mualem <lior.m.kde@gmail.com> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #ifndef KDEVPLATFORM_PLUGIN_CLASSTREE_H 0009 #define KDEVPLATFORM_PLUGIN_CLASSTREE_H 0010 0011 #include <QTreeView> 0012 #include <QPointer> 0013 0014 #include <language/duchain/identifier.h> 0015 0016 #include "language/util/navigationtooltip.h" 0017 0018 class ClassBrowserPlugin; 0019 class ClassModel; 0020 0021 class ClassTree 0022 : public QTreeView 0023 { 0024 Q_OBJECT 0025 0026 public: 0027 ClassTree(QWidget* parent, ClassBrowserPlugin* plugin); 0028 ~ClassTree() override; 0029 0030 public: 0031 /// Find the given a_id in the tree and highlight it. 0032 void highlightIdentifier(const KDevelop::IndexedQualifiedIdentifier& a_id); 0033 0034 static bool populatingClassBrowserContextMenu(); 0035 0036 protected: 0037 void contextMenuEvent(QContextMenuEvent* e) override; 0038 ClassModel* model(); 0039 bool event(QEvent* event) override; 0040 0041 private Q_SLOTS: 0042 void itemActivated(const QModelIndex& index); 0043 0044 private: 0045 ClassBrowserPlugin* m_plugin; 0046 QPointer<KDevelop::NavigationToolTip> m_tooltip; 0047 }; 0048 0049 #endif