BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
genericControl.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 // $Id: genericControl.h,v 1.14.16.1 2007/03/25 21:26:20 oliver Exp $
5 
6 #ifndef BALL_VIEW_WIDGETS_GENERICCONTROL_H
7 #define BALL_VIEW_WIDGETS_GENERICCONTROL_H
8 
9 #ifndef BALL_VIEW_WIDGETS_DOCKWIDGET_H
11 #endif
12 
13 #include <QtGui/QKeyEvent>
14 #include <QtGui/QTreeWidget>
15 #include <QtGui/QTreeWidgetItem>
16 #include <QtCore/QList>
17 
18 namespace BALL
19 {
20  namespace VIEW
21  {
25  class TreeWidget
26  : public QTreeWidget
27  {
28  public:
29 
31  TreeWidget(QWidget* parent = 0);
32 
34  void selectItems(const list<QTreeWidgetItem*>& items);
35  };
36 
51  : public DockWidget
52  {
53  Q_OBJECT
54 
55  public:
56 
58  typedef QList<QTreeWidgetItem*> ItemList;
59 
63 
67 
68  //@}
72 
81  GenericControl(QWidget* parent = 0, const char* name = 0);
82 
85  virtual ~GenericControl();
86 
87  ItemList getSelectedItems();
88 
90  QTreeWidgetItem* addRow(const QStringList& entries);
91 
98  virtual void onNotify(Message *message);
99 
107  virtual void initializeWidget(MainControl& main_control);
108 
110 
111  public slots:
112 
114  virtual void deleteCurrentItems(){};
115 
116  protected slots:
117 
118  virtual void deselectOtherControls_();
119 
120  /*_ Call deselectOtherControls_ if a selection exists.
121  Call this Method in the derived Classes in their updateSelection()
122  */
123  virtual void updateSelection();
124 
125  virtual void onItemClicked(QTreeWidgetItem*, int) {};
126 
127  protected:
128 
129  virtual void removeItem_(QTreeWidgetItem* item);
130 
134  };
135 
136 } } // namespaces
137 #endif // BALL_VIEW_WIDGETS_GENERICCONTROL_H