QtPdWidgets  2.3.1
TableView.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * Copyright (C) 2012 Florian Pose <fp@igh-essen.com>
4  *
5  * This file is part of the QtPdWidgets library.
6  *
7  * The QtPdWidgets library is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation, either version 3 of the License,
10  * or (at your option) any later version.
11  *
12  * The QtPdWidgets library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with the QtPdWidgets Library. If not, see
19  * <http://www.gnu.org/licenses/>.
20  *
21  ****************************************************************************/
22 
23 #ifndef PD_TABLEVIEW_H
24 #define PD_TABLEVIEW_H
25 
26 #include <QTableView>
27 #include <QScopedPointer>
28 
29 #include "Export.h"
30 
31 namespace Pd {
32 
33 class TableViewPrivate;
34 
35 /****************************************************************************/
36 
40  public QTableView
41 {
42  Q_OBJECT
43 
44  public:
45  TableView(QWidget *parent = 0);
46  ~TableView();
47 
48  protected:
49  bool event(QEvent *) override;
50  void keyPressEvent(QKeyEvent *) override;
51  void contextMenuEvent(QContextMenuEvent *) override;
52 
53  protected slots:
54  void commit();
55  void revert();
56  void addRow();
57  void removeRow();
58  void exportCsv();
59  void importCsv();
60  private:
61  QScopedPointer<TableViewPrivate> d_ptr;
62  Q_DISABLE_COPY(TableView)
63 
64  Q_DECLARE_PRIVATE(TableView)
65 };
66 
67 /****************************************************************************/
68 
69 } // namespace Pd
70 
71 #endif
Definition: Bar.h:36
#define PD_PUBLIC
Definition: Export.h:33
QScopedPointer< TableViewPrivate > d_ptr
Definition: TableView.h:61
Table view widget.
Definition: TableView.h:39