GNU Octave  6.2.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-2021 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 
35 namespace octave
36 {
37  class base_qobject;
38  class interpreter;
39 }
40 
41 namespace QtHandles
42 {
43 
44  class Container;
45 
46  class Table : public Object
47  {
48  Q_OBJECT
49 
50  public:
52  const graphics_object& go, QTableWidget* tableWidget);
53  ~Table (void);
54 
55  Container* innerContainer (void) { return m_container; }
56 
57  bool eventFilter (QObject* watched, QEvent* event);
58 
59  static Table *
61  const graphics_object& go);
62 
63  protected:
64  void update (int pId);
65  void redraw (void);
66  void updateColumnname (void);
67  void updateColumnwidth (void);
68  void updateData (void);
69  void updateEnable (void);
70  void updateExtent (void);
71  void updatePalette (void);
72  void updateRearrangeableColumns (void);
73  void updateRowname (void);
74 
75  private slots:
76  void itemChanged (QTableWidgetItem* item);
77  void comboBoxCurrentIndexChanged (const QString& value);
78  void cellClicked (int row, int col);
79  void itemSelectionChanged (void);
80 
81  private:
83  QTableWidget* m_tableWidget;
88  QWidget * checkBoxForLogical(octave_value cal, bool enabled);
89  void updateData (int row, int col, octave_value value, std::string format,
90  bool enabled);
91  void updateData (int row, int col);
92  void updateDataColumn (int col);
93  std::string columnformat (int column);
94  bool columneditable (int column);
95  void sendCellEditCallback (int row, int col, octave_value old_value,
96  octave_value new_value, octave_value edit_data, octave_value error);
97  void checkBoxClicked (int row, int col, QCheckBox* checkBox);
98 
99 
100 
101  };
102 
103 }
104 
105 #endif
void updateEnable(void)
Definition: Table.cc:1310
void updateDataColumn(int col)
Definition: Table.cc:1198
void updateData(void)
Definition: Table.cc:1290
bool m_keyPressHandlerDefined
Definition: Table.h:86
void updateColumnname(void)
Definition: Table.cc:986
QWidget * checkBoxForLogical(octave_value cal, bool enabled)
Definition: Table.cc:409
void sendCellEditCallback(int row, int col, octave_value old_value, octave_value new_value, octave_value edit_data, octave_value error)
Definition: Table.cc:533
std::string columnformat(int column)
Definition: Table.cc:1171
octave_value m_curData
Definition: Table.h:84
void update(int pId)
Definition: Table.cc:889
bool eventFilter(QObject *watched, QEvent *event)
Definition: Table.cc:1517
Container * m_container
Definition: Table.h:82
~Table(void)
Definition: Table.cc:488
void redraw(void)
Definition: Table.cc:883
void comboBoxCurrentIndexChanged(const QString &value)
Definition: Table.cc:565
void itemChanged(QTableWidgetItem *item)
Definition: Table.cc:802
void updateExtent(void)
Definition: Table.cc:1372
void updateRowname(void)
Definition: Table.cc:1402
Table(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go, QTableWidget *tableWidget)
Definition: Table.cc:448
bool columneditable(int column)
Definition: Table.cc:1156
bool m_keyReleaseHandlerDefined
Definition: Table.h:87
void itemSelectionChanged(void)
Definition: Table.cc:491
void updateRearrangeableColumns(void)
Definition: Table.cc:1500
void cellClicked(int row, int col)
Definition: Table.cc:514
void updateColumnwidth(void)
Definition: Table.cc:1082
bool m_blockUpdates
Definition: Table.h:85
static Table * create(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go)
Definition: Table.cc:432
QTableWidget * m_tableWidget
Definition: Table.h:83
Container * innerContainer(void)
Definition: Table.h:55
void checkBoxClicked(int row, int col, QCheckBox *checkBox)
Definition: Table.cc:686
void updatePalette(void)
Definition: Table.cc:1385
Base class for Octave interfaces that use Qt.
void error(const char *fmt,...)
Definition: error.cc:968
size_t format(std::ostream &os, const char *fmt,...)
Definition: utils.cc:1329