GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
workspace-model.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2011-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_workspace_model_h)
27 #define octave_workspace_model_h 1
28 
29 #include <QAbstractTableModel>
30 #include <QChar>
31 #include <QColor>
32 #include <QList>
33 #include <QSemaphore>
34 #include <QStringList>
35 #include <QVector>
36 
37 #include "gui-settings.h"
38 
39 #include "syminfo.h"
40 
41 // Defined for purposes of sending QList<int> as part of signal.
43 
45 
47 {
48  Q_OBJECT
49 
50 public:
51 
52  workspace_model (QObject *parent = nullptr);
53 
54  ~workspace_model (void) = default;
55 
56  int rowCount (const QModelIndex& parent = QModelIndex ()) const;
57 
58  int columnCount (const QModelIndex& parent = QModelIndex ()) const;
59 
60  Qt::ItemFlags flags (const QModelIndex& index) const;
61 
62  QVariant headerData (int section, Qt::Orientation orientation,
63  int role = Qt::DisplayRole) const;
64 
65  QVariant data (const QModelIndex& index, int role) const;
66 
67  bool is_top_level (void) const { return m_top_level; }
68 
69  QColor storage_class_color (int s_class)
70  {
71  return m_storage_class_colors.at (s_class);
72  }
73 
74  symbol_info_list get_symbol_info (void) const { return m_syminfo_list; }
75 
76  QStringList get_symbol_names (void) const { return m_symbols; }
77  QStringList get_symbol_values (void) const { return m_values; }
78 
79 signals:
80 
81  void model_changed (void);
83 
84 public slots:
85 
86  void set_workspace (bool top_level, bool debug,
87  const symbol_info_list& syminfo);
88 
89  void clear_workspace (void);
90 
91  void notice_settings (const gui_settings *);
92 
93 private:
94 
95  void clear_data (void);
96  void update_table (void);
97 
100  QString m_scopes;
101  QStringList m_symbols;
102  QStringList m_class_names;
103  QStringList m_dimensions;
104  QStringList m_values;
106 
107  QStringList m_columnNames;
108 
111 
112 };
113 
115 
116 #endif
OCTAVE_END_NAMESPACE(octave)
void prompt_variable_editor(void)
QColor storage_class_color(int s_class)
QStringList m_columnNames
void model_changed(void)
symbol_info_list m_syminfo_list
bool is_top_level(void) const
symbol_info_list get_symbol_info(void) const
~workspace_model(void)=default
QStringList m_class_names
QStringList m_values
QList< QColor > m_storage_class_colors
QStringList m_dimensions
QStringList get_symbol_names(void) const
QStringList m_symbols
QStringList get_symbol_values(void) const
QIntList m_complex_flags
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
QList< int > QIntList
Definition: dialog.h:40
QList< int > QIntList