Choreonoid  1.8
TreeView.h
Go to the documentation of this file.
1 
5 #ifndef CNOID_BASE_TREE_VIEW_H
6 #define CNOID_BASE_TREE_VIEW_H
7 
8 #include "ItemSelectionModel.h"
9 #include <cnoid/Signal>
10 #include <QTreeView>
11 #include "exportdecl.h"
12 
13 namespace cnoid {
14 
15 class CNOID_EXPORT TreeView : public QTreeView
16 {
17  Q_OBJECT
18 
19 public:
20  TreeView(QWidget* parent = 0);
21  ~TreeView();
22 
23  virtual void setModel(QAbstractItemModel* model);
24 
25  ItemSelectionModel* selectionModel() const;
26 
27  SignalProxy<void(const QModelIndex& index)> sigCollapsed();
28  SignalProxy<void(const QModelIndex& index)> sigExpanded();
29  SignalProxy<void(const QModelIndex& index)> sigActivated();
30  SignalProxy<void(const QModelIndex& index)> sigClicked();
31  SignalProxy<void(const QModelIndex& index)> sigDoubleClicked();
32  SignalProxy<void(const QModelIndex& index)> sigEntered();
33  SignalProxy<void(const QModelIndex& index)> sigPressed();
34  SignalProxy<void()> sigViewportEntered();
35 
36 
37 private Q_SLOTS:
38  void onCollapsed(const QModelIndex& index);
39  void onExpanded(const QModelIndex& index);
40  void onActivated(const QModelIndex& index);
41  void onClicked(const QModelIndex& index);
42  void onDoubleClicked(const QModelIndex& index);
43  void onEntered(const QModelIndex& index);
44  void onPressed(const QModelIndex& index);
45  void onViewportEntered(void);
46 
47 private:
48  Signal<void(const QModelIndex& index)> sigCollapsed_;
49  Signal<void(const QModelIndex& index)> sigExpanded_;
50 
51 private:
52  class Impl;
53  Impl* impl;
54 };
55 
56 }
57 
58 #endif
cnoid::ItemSelectionModel
Definition: ItemSelectionModel.h:14
ItemSelectionModel.h
cnoid
Definition: AbstractSceneLoader.h:11
cnoid::Signal
Definition: Signal.h:165
cnoid::SignalProxy
Definition: Signal.h:470
cnoid::TreeView
Definition: TreeView.h:15