Changeset View
Changeset View
Standalone View
Standalone View
addons/tabswitcher/tabswitchertreeview.h
Show All 15 Lines | 1 | /* This file is part of the KDE project | |||
---|---|---|---|---|---|
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to | ||
17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | 18 | Boston, MA 02110-1301, USA. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef KTEXTEDITOR_TABSWITCHER_TREEVIEW_H | 21 | #ifndef KTEXTEDITOR_TABSWITCHER_TREEVIEW_H | ||
22 | #define KTEXTEDITOR_TABSWITCHER_TREEVIEW_H | 22 | #define KTEXTEDITOR_TABSWITCHER_TREEVIEW_H | ||
23 | 23 | | |||
24 | #include <QListView> | 24 | #include <QTreeView> | ||
25 | 25 | | |||
26 | class TabSwitcherTreeView : public QListView | 26 | class TabSwitcherTreeView : public QTreeView | ||
27 | { | 27 | { | ||
28 | Q_OBJECT | 28 | Q_OBJECT | ||
29 | 29 | | |||
30 | public: | 30 | public: | ||
31 | /** | 31 | /** | ||
32 | * Default constructor. | 32 | * Default constructor. | ||
33 | */ | 33 | */ | ||
34 | TabSwitcherTreeView(); | 34 | TabSwitcherTreeView(); | ||
35 | 35 | | |||
36 | int sizeHintWidth() const; | ||||
37 | | ||||
38 | void resizeColumnsToContents(); | ||||
39 | | ||||
36 | Q_SIGNALS: | 40 | Q_SIGNALS: | ||
37 | /** | 41 | /** | ||
38 | * This signal is emitted whenever use activates an item through | 42 | * This signal is emitted whenever use activates an item through | ||
39 | * the list view. | 43 | * the list view. | ||
40 | * @note @p selectionIndex is a model index of the selectionModel() | 44 | * @note @p selectionIndex is a model index of the selectionModel() | ||
41 | * and not of the QListView's model itself. | 45 | * and not of the QListView's model itself. | ||
42 | */ | 46 | */ | ||
43 | void itemActivated(const QModelIndex & selectionIndex); | 47 | void itemActivated(const QModelIndex & selectionIndex); | ||
44 | 48 | | |||
45 | protected: | 49 | protected: | ||
46 | /** | 50 | /** | ||
47 | * Reimplemented for tracking the CTRL key modifier. | 51 | * Reimplemented for tracking the CTRL key modifier. | ||
48 | */ | 52 | */ | ||
49 | void keyReleaseEvent(QKeyEvent * event) override; | 53 | void keyReleaseEvent(QKeyEvent * event) override; | ||
50 | 54 | | |||
51 | /** | 55 | /** | ||
52 | * Reimplemented for tracking the ESCAPE key. | 56 | * Reimplemented for tracking the ESCAPE key. | ||
53 | */ | 57 | */ | ||
54 | void keyPressEvent(QKeyEvent * event) override; | 58 | void keyPressEvent(QKeyEvent * event) override; | ||
59 | | ||||
60 | void showEvent(QShowEvent *event) override; | ||||
55 | }; | 61 | }; | ||
56 | 62 | | |||
57 | #endif // KTEXTEDITOR_TABSWITCHER_TREEVIEW_H | 63 | #endif // KTEXTEDITOR_TABSWITCHER_TREEVIEW_H |