Mercurial > octave
diff libgui/src/variable-editor.h @ 29124:b8d9dff6218c stable
check object size before plotting from variiable editor (bug #56685)
* variable-editor-model.h: make data_rows and data_columns public
* variable-editor.cc: do not include QSignalMapper here;
(idx_to_expr): remove obsolete static function;
(make_plot_mapper): only add the plot command to the mapper;
(selected_to_octave): remove obsolete function;
(selected_command_requested): get selected range and the object size
from the model for comparing object size and selection, generate
command string and emit signal for executing it in the console;
(createVariable): only pass keywoard for variable creation instead
of complete complete, which is now generate in selected_command_requested;
(variable_editor): initialize new class variable for the edtiors
plot signal mapper;
(edit_variable): connect signal mapper to selected_command_requested
and remove connection from previously used relay signal;
(relay_selected_command): removed, direct connection is used;
(construct_tool_bar): create plot mapper and store it for later
connecting its signal, remove connection here
* variable-editor.h: include QSignalMapper here;
removed selected_to_octave;
removed selected_command_signal;
removed relay_selected_command;
added class variable m_plot_mapper;
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Tue, 02 Jun 2020 20:02:39 +0200 |
parents | bd51beb6205e |
children | 77ba9dfe5b29 0a5b15007766 |
line wrap: on
line diff
--- a/libgui/src/variable-editor.h Fri Nov 27 11:16:43 2020 +0100 +++ b/libgui/src/variable-editor.h Tue Jun 02 20:02:39 2020 +0200 @@ -27,6 +27,7 @@ #define octave_variable_editor_h 1 #include <QHeaderView> +#include <QSignalMapper> #include <QStackedWidget> #include <QTableView> @@ -207,9 +208,6 @@ void createRowMenu (const QPoint& pt); - // Convert selection to an Octave expression. - QString selected_to_octave (void); - void selected_command_requested (const QString& cmd); private: @@ -321,8 +319,6 @@ void delete_selected_signal (void); - void selected_command_signal (const QString& cmd); - public slots: void callUpdate (const QModelIndex&, const QModelIndex&); @@ -353,10 +349,6 @@ void levelUp (void); - // Send command to Octave interpreter. - // %1 in CMD is replaced with the value of selected_to_octave. - void relay_selected_command (const QString& cmd); - protected: void focusInEvent (QFocusEvent *ev); @@ -401,6 +393,8 @@ QString m_hovered_focus_vname; + QSignalMapper *m_plot_mapper; + QWidget *m_focus_widget; variable_dock_widget *m_focus_widget_vdw;