GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
workspace-view.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2013-2017 John W. Eaton
4 Copyright (C) 2011-2016 Jacob Dawid
5 
6 This file is part of Octave.
7 
8 Octave is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with Octave; see the file COPYING. If not, see
20 <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #if ! defined (octave_workspace_view_h)
25 #define octave_workspace_view_h 1
26 
27 #include <QItemDelegate>
28 #include <QTableView>
29 #include <QSemaphore>
30 #include <QComboBox>
31 #include <QSortFilterProxyModel>
32 #include <QCheckBox>
33 #include <QSignalMapper>
34 
35 #include "octave-dock-widget.h"
36 #include "workspace-model.h"
37 
39 {
40  Q_OBJECT
41 
42 public:
43 
44  workspace_view (QWidget *parent = 0);
45 
46  ~workspace_view (void) { }
47 
48 public slots:
49 
50  void notice_settings (const QSettings *);
51 
52  void setModel (workspace_model *model);
53 
54  void save_settings (void);
55 
56 signals:
57 
58  /** signal that user had requested a command on a variable */
59  void command_requested (const QString& cmd);
60 
61 protected:
62 
63  void closeEvent (QCloseEvent *event);
64 
65 protected slots:
66 
67  void contextmenu_requested (const QPoint& pos);
68 
69  // context menu slots
70  void handle_contextmenu_copy (void);
72  void handle_contextmenu_rename (void);
73  void handle_contextmenu_disp (void);
74  void handle_contextmenu_plot (void);
75  void handle_contextmenu_stem (void);
76  void handle_contextmenu_filter (void);
77 
78  void header_contextmenu_requested (const QPoint& mpos);
79  void toggle_header (int column);
80 
81  void handle_model_changed (void);
82 
83  void copyClipboard ();
84  void selectAll ();
85 
86  void filter_update (const QString& expression);
87  void filter_activate (bool enable);
88  void update_filter_history ();
89 
90 private:
91 
92  void relay_contextmenu_command (const QString& cmdname);
93 
94  QString get_var_name (QModelIndex index);
95  QTableView *view;
98 
99  QSortFilterProxyModel _filter_model;
100  QCheckBox *_filter_checkbox;
101  QComboBox *_filter;
104 
105  enum { MaxFilterHistory = 10 };
106 
107  QStringList _columns_shown;
108  QStringList _columns_shown_keys;
109  QSignalMapper *_sig_mapper;
110 };
111 
112 #endif
void filter_activate(bool enable)
OCTAVE_EXPORT octave_value_list column
Definition: sparse.cc:123
QCheckBox * _filter_checkbox
void closeEvent(QCloseEvent *event)
QStringList _columns_shown
QTableView * view
QWidget * _filter_widget
void handle_contextmenu_stem(void)
void toggle_header(int column)
void handle_contextmenu_filter(void)
void command_requested(const QString &cmd)
signal that user had requested a command on a variable
void filter_update(const QString &expression)
void header_contextmenu_requested(const QPoint &mpos)
QSortFilterProxyModel _filter_model
void handle_contextmenu_rename(void)
QStringList _columns_shown_keys
workspace_view(QWidget *parent=0)
OCTAVE_EXPORT octave_value_list any number nd example oindent prints the prompt xample Pick a any number!nd example oindent and waits for the user to enter a value The string entered by the user is evaluated as an expression
Definition: input.cc:871
workspace_model * _model
void setModel(workspace_model *model)
void contextmenu_requested(const QPoint &pos)
void update_filter_history()
int view_previous_row_count
void handle_model_changed(void)
QComboBox * _filter
void save_settings(void)
QString get_var_name(QModelIndex index)
QSignalMapper * _sig_mapper
void notice_settings(const QSettings *)
void handle_contextmenu_copy(void)
void handle_contextmenu_disp(void)
void relay_contextmenu_command(const QString &cmdname)
void handle_contextmenu_copy_value(void)
void handle_contextmenu_plot(void)