UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
tree_selector_wid.hpp
1 /* tree_selector_wid.hpp */
2 /* $Id$ */
3 #ifndef __tree_selector_wid_hpp
4 #define __tree_selector_wid_hpp
5 
6 #include <QTreeWidget>
7 
8 #include <hds_widgets/selector_wid.hpp>
9 
11 namespace hds
12 {
15  {
16  Q_OBJECT
17 
18  public:
19 
22  TreeSelectorWid(QWidget *parent = 0, Qt::WindowFlags f = 0);
23 
26  TreeSelectorWid(int columns, QWidget * parent = 0, Qt::WindowFlags f = 0);
27 
29  virtual ~TreeSelectorWid();
30 
31 
33  virtual int currentId() const;
34 
36  virtual QStringList current() const;
37 
40  virtual QString current(int id) const;
41 
43  virtual void setCurrent(int id);
44 
46  virtual int count() const;
47 
50  virtual void add(const QStringList &item);
51 
53  virtual void remove(int id);
54 
56  virtual void clear();
57 
58 
60  void resizeToContents();
61 
62 
65  void setHeaderLabels(const QStringList &labels);
66 
68  void headers(bool on);
69 
71  bool headers() const;
72 
74  int columns();
75 
77  void setColumns(int n);
78 
79 
81  int defColumnForFind() const;
82 
84  void setDefColumnForFind(int id);
85 
86  protected:
87 
89  const QTreeWidget& treeWid() const {return *mp_tree_widget;}
90 
92  QTreeWidget& treeWid() {return *mp_tree_widget;}
93 
94  protected slots:
95 
97  virtual void currentItemChangedSlot(QTreeWidgetItem *current,
98  QTreeWidgetItem *previous);
99 
101  virtual void textEditedSlot(const QString &str);
102 
103  signals:
104 
106  void itemDoubleClicked(QTreeWidgetItem *item, int column);
107 
108  private:
109 
110  QTreeWidget *mp_tree_widget;
111 
112  bool m_copy_item_text;
113 
114  QString m_current_str;
115 
116  int m_col_for_find_id;
117 
118  void setup_object();
119  };
120 };
121 
122 
123 #endif /* tree_selector_wid.hpp */
virtual int count() const
void itemDoubleClicked(QTreeWidgetItem *item, int column)
Definition: tree_selector_wid.hpp:14
virtual void add(const QStringList &item)
void setColumns(int n)
virtual void clear()
void setHeaderLabels(const QStringList &labels)
virtual void textEditedSlot(const QString &str)
virtual int currentId() const
bool headers() const
virtual void setCurrent(int id)
virtual void currentItemChangedSlot(QTreeWidgetItem *current, QTreeWidgetItem *previous)
const QTreeWidget & treeWid() const
Definition: tree_selector_wid.hpp:89
TreeSelectorWid(QWidget *parent=0, Qt::WindowFlags f=0)
void setDefColumnForFind(int id)
Definition: selector_wid.hpp:14
virtual QStringList current() const
QTreeWidget & treeWid()
Definition: tree_selector_wid.hpp:92
virtual ~TreeSelectorWid()
int defColumnForFind() const