GNU Octave 7.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-2022 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
31class QCheckBox;
32class QTableWidget;
33class QTableWidgetItem;
34
35namespace octave
36{
37 class base_qobject;
38 class interpreter;
39}
40
41namespace octave
42{
43
44 class Container;
45
46 class Table : public Object
47 {
48 Q_OBJECT
49
50 public:
51 Table (octave::base_qobject& oct_qobj, octave::interpreter& interp,
52 const graphics_object& go, QTableWidget *tableWidget);
53 ~Table (void);
54
56
57 bool eventFilter (QObject *watched, QEvent *event);
58
59 static Table *
60 create (octave::base_qobject& oct_qobj, octave::interpreter& interp,
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);
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 updateColumnwidth(void)
Definition: Table.cc:1087
~Table(void)
Definition: Table.cc:495
void updatePalette(void)
Definition: Table.cc:1386
void updateExtent(void)
Definition: Table.cc:1373
void updateData(void)
Definition: Table.cc:1295
void updateEnable(void)
Definition: Table.cc:1315
octave_value m_curData
Definition: Table.h:84
static Table * create(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go)
Definition: Table.cc:439
Container * innerContainer(void)
Definition: Table.h:55
bool m_keyReleaseHandlerDefined
Definition: Table.h:87
void updateRowname(void)
Definition: Table.cc:1403
void updateDataColumn(int col)
Definition: Table.cc:1203
void checkBoxClicked(int row, int col, QCheckBox *checkBox)
Definition: Table.cc:691
Table(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go, QTableWidget *tableWidget)
Definition: Table.cc:455
QWidget * checkBoxForLogical(octave_value cal, bool enabled)
Definition: Table.cc:416
void updateColumnname(void)
Definition: Table.cc:991
bool m_blockUpdates
Definition: Table.h:85
void itemSelectionChanged(void)
Definition: Table.cc:498
void sendCellEditCallback(int row, int col, octave_value old_value, octave_value new_value, octave_value edit_data, octave_value error)
Definition: Table.cc:539
void update(int pId)
Definition: Table.cc:894
bool columneditable(int column)
Definition: Table.cc:1161
void itemChanged(QTableWidgetItem *item)
Definition: Table.cc:807
void cellClicked(int row, int col)
Definition: Table.cc:520
std::string columnformat(int column)
Definition: Table.cc:1176
Container * m_container
Definition: Table.h:82
QTableWidget * m_tableWidget
Definition: Table.h:83
void updateRearrangeableColumns(void)
Definition: Table.cc:1501
void redraw(void)
Definition: Table.cc:888
bool eventFilter(QObject *watched, QEvent *event)
Definition: Table.cc:1514
bool m_keyPressHandlerDefined
Definition: Table.h:86
void comboBoxCurrentIndexChanged(const QString &value)
Definition: Table.cc:570
Base class for Octave interfaces that use Qt.
void error(const char *fmt,...)
Definition: error.cc:980
std::size_t format(std::ostream &os, const char *fmt,...)
Definition: utils.cc:1471