GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
workspace-view.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) 2011-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_workspace_view_h)
27 #define octave_workspace_view_h 1
28 
29 #include <QCheckBox>
30 #include <QComboBox>
31 #include <QItemDelegate>
32 #include <QSemaphore>
33 #include <QSignalMapper>
34 #include <QSortFilterProxyModel>
35 #include <QTableView>
36 
37 #include "octave-dock-widget.h"
38 #include "workspace-model.h"
39 
40 class octave_value;
41 
42 namespace octave
43 {
44  class base_qobject;
45 
47  {
48  Q_OBJECT
49 
50  public:
51 
52  workspace_view (QWidget *parent, base_qobject& oct_qobj);
53 
54  ~workspace_view (void) = default;
55 
56  signals:
57 
58  //! Signal that user had requested a command on a variable.
59 
60  void command_requested (const QString& cmd);
61 
62  //! Signal that user wants to rename a variable.
63 
64  void rename_variable_signal (const QString&, const QString&);
65 
66  //! Signal that user wants to edit a variable.
67 
68  void edit_variable_signal (const QString&, const octave_value&);
69 
70  public slots:
71 
72  void setModel (workspace_model *model);
73 
74  void notice_settings (const gui_settings *);
75 
76  void save_settings (void);
77 
78  protected slots:
79 
80  void filter_update (const QString& expression);
81  void filter_activate (bool enable);
82  void update_filter_history (void);
83 
84  void header_contextmenu_requested (const QPoint& mpos);
85 
86  void toggle_header (int column);
87 
88  void contextmenu_requested (const QPoint& pos);
89 
90  void handle_contextmenu_copy (void);
92  void handle_contextmenu_rename (void);
93  void handle_contextmenu_edit (void);
94  void handle_contextmenu_clear (void);
95  void handle_contextmenu_disp (void);
96  void handle_contextmenu_plot (void);
97  void handle_contextmenu_stem (void);
98  void handle_contextmenu_filter (void);
99 
100  void handle_model_changed (void);
101 
102  void copyClipboard (void);
103  void selectAll (void);
104 
105  private:
106 
107  void relay_contextmenu_command (const QString& cmdname, bool str = false);
108 
109  QString get_var_name (const QModelIndex& index);
110 
113 
114  // We are using a sort model proxy so m_model won't provide the
115  // correct ordering. It is still OK to use this pointer to access
116  // other info attached to the model, for example the scope or colors.
118 
119  QSortFilterProxyModel m_filter_model;
120  QCheckBox *m_filter_checkbox;
121  QComboBox *m_filter;
124  };
125 }
126 
127 #endif
Base class for Octave interfaces that use Qt.
void handle_contextmenu_stem(void)
void toggle_header(int column)
void rename_variable_signal(const QString &, const QString &)
Signal that user wants to rename a variable.
void header_contextmenu_requested(const QPoint &mpos)
void relay_contextmenu_command(const QString &cmdname, bool str=false)
void handle_contextmenu_filter(void)
void handle_contextmenu_edit(void)
void contextmenu_requested(const QPoint &pos)
void filter_activate(bool enable)
void edit_variable_signal(const QString &, const octave_value &)
Signal that user wants to edit a variable.
void handle_contextmenu_plot(void)
workspace_model * m_model
void notice_settings(const gui_settings *)
~workspace_view(void)=default
void update_filter_history(void)
void command_requested(const QString &cmd)
Signal that user had requested a command on a variable.
QCheckBox * m_filter_checkbox
void handle_contextmenu_copy_value(void)
void setModel(workspace_model *model)
void handle_contextmenu_clear(void)
void handle_contextmenu_rename(void)
void handle_contextmenu_disp(void)
void filter_update(const QString &expression)
workspace_view(QWidget *parent, base_qobject &oct_qobj)
QString get_var_name(const QModelIndex &index)
QSortFilterProxyModel m_filter_model
void handle_contextmenu_copy(void)