GNU Octave 7.1.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-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_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
40namespace octave
41{
42 class base_qobject;
43
45 {
46 Q_OBJECT
47
48 public:
49
50 workspace_view (QWidget *parent, base_qobject& oct_qobj);
51
52 ~workspace_view (void) = default;
53
54 signals:
55
56 //! Signal that user had requested a command on a variable.
57
58 void command_requested (const QString& cmd);
59
60 //! Signal that user wnats to copy a variable value to the
61 //! clipboard.
62
63 void copy_variable_value_to_clipboard (const QString&);
64
65 //! Signal that user wants to rename a variable.
66
67 void rename_variable_signal (const QString&, const QString&);
68
69 //! Signal that user wants to edit a variable.
70
71 void edit_variable_signal (const QString&);
72
73 public slots:
74
75 void setModel (workspace_model *model);
76
77 void notice_settings (const gui_settings *);
78
79 void save_settings (void);
80
81 protected slots:
82
83 void filter_update (const QString& expression);
84 void filter_activate (bool enable);
85 void update_filter_history (void);
86
87 void header_contextmenu_requested (const QPoint& mpos);
88
89 void toggle_header (int column);
90
91 void contextmenu_requested (const QPoint& pos);
92
93 void handle_contextmenu_copy (void);
95 void handle_contextmenu_rename (void);
96 void handle_contextmenu_edit (void);
97 void handle_contextmenu_clear (void);
98 void handle_contextmenu_disp (void);
99 void handle_contextmenu_plot (void);
100 void handle_contextmenu_stem (void);
101 void handle_contextmenu_filter (void);
102
103 public slots:
104
105 void handle_model_changed (void);
106
107 void copyClipboard (void);
108 void selectAll (void);
109
110 private:
111
112 void relay_contextmenu_command (const QString& cmdname, bool str = false);
113 void set_filter_focus (bool focus);
114
115 QString get_var_name (const QModelIndex& index);
116
119
120 // We are using a sort model proxy so m_model won't provide the
121 // correct ordering. It is still OK to use this pointer to access
122 // other info attached to the model, for example the scope or colors.
124
125 QSortFilterProxyModel m_filter_model;
127 QComboBox *m_filter;
130 };
131}
132
133#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 set_filter_focus(bool focus)
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 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 edit_variable_signal(const QString &)
Signal that user wants to edit a variable.
void handle_contextmenu_rename(void)
void handle_contextmenu_disp(void)
void copy_variable_value_to_clipboard(const QString &)
Signal that user wnats to copy a variable value to the clipboard.
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)