GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Table.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2016-2023 The Octave Project Developers
4 //
5 // See the file COPYRIGHT.md in the top-level directory of this
6 // distribution or <https://octave.org/copyright/>.
7 //
8 // This file is part of Octave.
9 //
10 // Octave is free software: you can redistribute it and/or modify it
11 // under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Octave is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Octave; see the file COPYING. If not, see
22 // <https://www.gnu.org/licenses/>.
23 //
24 ////////////////////////////////////////////////////////////////////////
25 
26 #if ! defined (octave_Table_h)
27 #define octave_Table_h 1
28 
29 #include "Object.h"
30 
31 class QCheckBox;
32 class QTableWidget;
33 class QTableWidgetItem;
34 
36 
37 class base_qobject;
38 class interpreter;
39 
40 class Container;
41 
42 class Table : public Object
43 {
44  Q_OBJECT
45 
46 public:
47  Table (octave::base_qobject& oct_qobj, octave::interpreter& interp,
48  const graphics_object& go, QTableWidget *tableWidget);
49  ~Table (void);
50 
51  Container * innerContainer (void) { return m_container; }
52 
53  bool eventFilter (QObject *watched, QEvent *event);
54 
55  static Table *
56  create (octave::base_qobject& oct_qobj, octave::interpreter& interp,
57  const graphics_object& go);
58 
59 protected:
60  void update (int pId);
61  void redraw (void);
62  void updateColumnname (void);
63  void updateColumnwidth (void);
64  void updateData (void);
65  void updateEnable (void);
66  void updateExtent (void);
67  void updatePalette (void);
68  void updateRearrangeableColumns (void);
69  void updateRowname (void);
70 
71 private slots:
72  void itemChanged (QTableWidgetItem *item);
73  void comboBoxCurrentIndexChanged (const QString& value);
74  void cellClicked (int row, int col);
75  void itemSelectionChanged (void);
76 
77 private:
79  QTableWidget *m_tableWidget;
84  QWidget * checkBoxForLogical(octave_value cal, bool enabled);
85  void updateData (int row, int col, octave_value value, std::string format,
86  bool enabled);
87  void updateData (int row, int col);
88  void updateDataColumn (int col);
89  std::string columnformat (int column);
90  bool columneditable (int column);
91  void sendCellEditCallback (int row, int col, octave_value old_value,
92  octave_value new_value, octave_value edit_data, octave_value error);
93  void checkBoxClicked (int row, int col, QCheckBox* checkBox);
94 
95 };
96 
98 
99 #endif
OCTAVE_END_NAMESPACE(octave)
Definition: Object.h:47
Definition: Table.h:43
bool m_keyReleaseHandlerDefined
Definition: Table.h:83
void update(int pId)
Definition: Table.cc:886
void updatePalette(void)
Definition: Table.cc:1378
void updateDataColumn(int col)
Definition: Table.cc:1195
~Table(void)
Definition: Table.cc:490
bool m_keyPressHandlerDefined
Definition: Table.h:82
void updateRearrangeableColumns(void)
Definition: Table.cc:1493
std::string columnformat(int column)
Definition: Table.cc:1168
QTableWidget * m_tableWidget
Definition: Table.h:79
bool eventFilter(QObject *watched, QEvent *event)
Definition: Table.cc:1506
void updateColumnwidth(void)
Definition: Table.cc:1079
Container * innerContainer(void)
Definition: Table.h:51
Container * m_container
Definition: Table.h:78
void cellClicked(int row, int col)
Definition: Table.cc:515
bool m_blockUpdates
Definition: Table.h:81
void updateEnable(void)
Definition: Table.cc:1307
octave_value m_curData
Definition: Table.h:80
void checkBoxClicked(int row, int col, QCheckBox *checkBox)
Definition: Table.cc:684
void comboBoxCurrentIndexChanged(const QString &value)
Definition: Table.cc:563
void updateRowname(void)
Definition: Table.cc:1395
static Table * create(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go)
Definition: Table.cc:435
void sendCellEditCallback(int row, int col, octave_value old_value, octave_value new_value, octave_value edit_data, octave_value error)
Definition: Table.cc:534
void itemChanged(QTableWidgetItem *item)
Definition: Table.cc:799
void updateData(void)
Definition: Table.cc:1287
void redraw(void)
Definition: Table.cc:880
void itemSelectionChanged(void)
Definition: Table.cc:493
bool columneditable(int column)
Definition: Table.cc:1153
QWidget * checkBoxForLogical(octave_value cal, bool enabled)
Definition: Table.cc:412
void updateColumnname(void)
Definition: Table.cc:983
Table(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go, QTableWidget *tableWidget)
Definition: Table.cc:451
void updateExtent(void)
Definition: Table.cc:1365
Base class for Octave interfaces that use Qt.
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
void error(const char *fmt,...)
Definition: error.cc:979
std::size_t format(std::ostream &os, const char *fmt,...)
Definition: utils.cc:1473