UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
table_editor.hpp
1 /* table_editor.hpp */
2 /* $Id$ */
3 #ifndef __table_editor_hpp
4 #define __table_editor_hpp
5 
6 #include <QWidget>
7 #include <hds_widgets/table_doc.hpp>
8 
9 class QAction;
10 class QTableWidget;
11 class QTableWidgetItem;
12 class QSpinBox;
13 class QMenu;
14 
16 namespace hds
17 {
18  class TableDoc;
19  class TableEditorDelegate;
20  class Dialog;
21 
23  class TableEditor : public QWidget
24  {
25  Q_OBJECT
26 
27  public:
28 
30  TableEditor(QWidget * parent = 0, Qt::WindowFlags f = 0);
31 
33  virtual ~TableEditor();
34 
35 
38  void attachDoc(TableDoc &doc);
39 
41  void detachDoc();
42 
43  protected:
44 
47  QTableWidgetItem* get_table_wid_item(const TableDoc::AbstractItem &doc_item);
48 
49  void keyPressEvent(QKeyEvent *event);
50 
51  protected slots:
52 
53  virtual void tableContextMenuRequested(QPoint);
54  virtual void insertRow();
55  virtual void insertRows();
56  virtual void removeSelectedRows();
57  virtual void selectAllRows();
58  virtual void unselectAllRows();
59 
60  private:
61 
63  QTableWidget *mp_tw;
64 
66  TableDoc *mp_doc;
67 
69  TableEditorDelegate *mp_delegate;
70 
72  QMenu *mp_table_menu;
73 
75  hds::Dialog *mp_rows_num_dlg;
76 
78  QSpinBox *mp_rows_num_spinbox;
79 
80  QAction *mp_insert_row_action;
81  QAction *mp_insert_rows_action;
82  QAction *mp_remove_selected_rows_action;
83  QAction *mp_select_all_rows_action;
84  QAction *mp_unselect_all_rows_action;
85  };
86 }; // hds
87 
88 #endif /* table_editor.hpp */
Definition: table_doc.hpp:12
QTableWidgetItem * get_table_wid_item(const TableDoc::AbstractItem &doc_item)
Definition: table_editor.hpp:23
Definition: table_doc.hpp:27
Definition: dialog.hpp:15
virtual ~TableEditor()
void attachDoc(TableDoc &doc)
Definition: table_editor_delegate.hpp:15
TableEditor(QWidget *parent=0, Qt::WindowFlags f=0)