#include "variable-editor-model.h"
Public Slots | |
void | double_click (const QModelIndex &idx) |
void | update_data (const octave_value &val) |
void | update_data_cache (void) |
Signals | |
void | data_error_signal (const QString &name) const |
void | description_changed (const QString &description) |
void | edit_variable_signal (const QString &name, const octave_value &val) |
void | interpreter_event (const fcn_callback &fcn) |
void | interpreter_event (const meth_callback &meth) |
void | set_editable_signal (bool) |
void | update_data_signal (const octave_value &val) |
void | user_error_signal (const QString &title, const QString &msg) const |
Public Member Functions | |
variable_editor_model (const QString &expr, const octave_value &val, QObject *parent=nullptr) | |
variable_editor_model (const variable_editor_model &)=delete | |
~variable_editor_model (void) | |
bool | clear_content (const QModelIndex &idx) |
void | clear_update_pending (void) |
int | column_width (void) const |
int | columnCount (const QModelIndex &idx=QModelIndex()) const |
QVariant | data (const QModelIndex &idx=QModelIndex(), int role=Qt::DisplayRole) const |
octave_idx_type | data_columns (void) const |
octave_idx_type | data_rows (void) const |
int | display_columns (void) const |
int | display_rows (void) const |
Qt::ItemFlags | flags (const QModelIndex &idx) const |
QVariant | headerData (int section, Qt::Orientation orientation, int role) const |
bool | insertColumns (int column, int count, const QModelIndex &parent=QModelIndex()) |
bool | insertRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
bool | is_editable (void) const |
void | maybe_resize_columns (int cols) |
void | maybe_resize_rows (int rows) |
std::string | name (void) const |
variable_editor_model & | operator= (const variable_editor_model &)=delete |
char | quote_char (const QModelIndex &idx) const |
bool | removeColumns (int column, int count, const QModelIndex &parent=QModelIndex()) |
bool | removeRows (int row, int count, const QModelIndex &parent=QModelIndex()) |
bool | requires_sub_editor (const QModelIndex &idx) const |
int | rowCount (const QModelIndex &idx=QModelIndex()) const |
void | set_update_pending (const QModelIndex &idx, const QString &str) |
bool | setData (const QModelIndex &idx, const QVariant &v, int role=Qt::EditRole) |
QString | subscript_expression (const QModelIndex &idx) const |
bool | update_pending (const QModelIndex &idx) const |
QString | update_pending_data (const QModelIndex &idx) const |
octave_value | value_at (const QModelIndex &idx) const |
Private Slots | |
void | data_error (const QString &msg) |
void | user_error (const QString &title, const QString &msg) |
Private Member Functions | |
void | change_display_size (int old_rows, int old_cols, int new_rows, int new_cols) |
void | eval_expr_event (const QString &expr) |
void | evaluation_error (const std::string &expr) const |
void | init_from_oct (interpreter &interp) |
void | invalidate (void) |
bool | is_valid (void) const |
QString | make_description_text (void) const |
void | reset (const octave_value &val) |
octave_value | retrieve_variable (interpreter &, const std::string &name) |
void | update_description (const QString &description=QString()) |
Static Private Member Functions | |
static base_ve_model * | create (const QString &expr, const octave_value &val) |
Private Attributes | |
base_ve_model * | rep |
Definition at line 135 of file variable-editor-model.h.
octave::variable_editor_model::variable_editor_model | ( | const QString & | expr, |
const octave_value & | val, | ||
QObject * | parent = nullptr |
||
) |
Definition at line 950 of file variable-editor-model.cc.
References data_error(), data_error_signal(), display_columns(), display_rows(), is_editable(), update_data(), update_data_signal(), update_description(), user_error(), and user_error_signal().
|
inline |
Definition at line 148 of file variable-editor-model.h.
References rep.
|
delete |
|
private |
Definition at line 1299 of file variable-editor-model.cc.
Referenced by maybe_resize_columns(), maybe_resize_rows(), and update_data().
bool octave::variable_editor_model::clear_content | ( | const QModelIndex & | idx | ) |
Definition at line 1062 of file variable-editor-model.cc.
References data_columns(), data_rows(), and setData().
Referenced by octave::variable_editor_view::clearContent().
|
inline |
Definition at line 236 of file variable-editor-model.h.
References octave::base_ve_model::clear_update_pending(), and rep.
Referenced by setData(), and update_data().
|
inline |
Definition at line 174 of file variable-editor-model.h.
References octave::base_ve_model::column_width(), and rep.
Referenced by octave::variable_editor_view::setModel().
|
inline |
Definition at line 184 of file variable-editor-model.h.
References octave::base_ve_model::columnCount(), and rep.
|
staticprivate |
Definition at line 924 of file variable-editor-model.cc.
References octave_value::columns(), octave_value::is_string(), octave_value::is_zero_by_zero(), octave_value::iscell(), octave_value::islogical(), octave_value::isnumeric(), octave_value::isstruct(), octave_value::ndims(), octave_value::numel(), and octave_value::rows().
Referenced by reset().
|
inline |
Definition at line 189 of file variable-editor-model.h.
References octave::base_ve_model::data(), and rep.
|
inline |
Definition at line 276 of file variable-editor-model.h.
References octave::base_ve_model::data_columns(), and rep.
Referenced by clear_content(), removeColumns(), and octave::variable_editor_view::selected_command_requested().
|
privateslot |
Definition at line 1356 of file variable-editor-model.cc.
References invalidate(), and update_description().
Referenced by variable_editor_model().
|
signal |
Referenced by variable_editor_model(), init_from_oct(), and update_data().
|
inline |
Definition at line 266 of file variable-editor-model.h.
References octave::base_ve_model::data_rows(), and rep.
Referenced by clear_content(), removeRows(), and octave::variable_editor_view::selected_command_requested().
|
signal |
Referenced by update_description().
|
inline |
Definition at line 271 of file variable-editor-model.h.
References octave::base_ve_model::display_columns(), and rep.
Referenced by variable_editor_model(), octave::variable_editor_view::handle_horizontal_scroll_action(), maybe_resize_columns(), maybe_resize_rows(), and update_data().
|
inline |
Definition at line 261 of file variable-editor-model.h.
References octave::base_ve_model::display_rows(), and rep.
Referenced by variable_editor_model(), octave::variable_editor_view::handle_vertical_scroll_action(), maybe_resize_columns(), maybe_resize_rows(), and update_data().
|
slot |
Definition at line 1395 of file variable-editor-model.cc.
References edit_variable_signal(), QtHandles::Utils::fromStdString(), octave::base_ve_model::name(), name(), rep, requires_sub_editor(), subscript_expression(), and value_at().
|
signal |
Referenced by double_click().
|
private |
Definition at line 1176 of file variable-editor-model.cc.
References octave::interpreter::eval_string(), evaluation_error(), init_from_oct(), and interpreter_event().
Referenced by insertColumns(), insertRows(), removeColumns(), and removeRows().
|
private |
Definition at line 1236 of file variable-editor-model.cc.
References QtHandles::Utils::fromStdString(), and user_error_signal().
Referenced by eval_expr_event(), and setData().
Qt::ItemFlags octave::variable_editor_model::flags | ( | const QModelIndex & | idx | ) | const |
Definition at line 1074 of file variable-editor-model.cc.
References is_valid(), requires_sub_editor(), and retval.
|
inline |
Definition at line 247 of file variable-editor-model.h.
References octave::base_ve_model::header_data(), and rep.
|
private |
Definition at line 1154 of file variable-editor-model.cc.
References data_error_signal(), QtHandles::Utils::fromStdString(), name(), retrieve_variable(), and update_data_signal().
Referenced by eval_expr_event(), and update_data_cache().
bool octave::variable_editor_model::insertColumns | ( | int | column, |
int | count, | ||
const QModelIndex & | parent = QModelIndex() |
||
) |
Definition at line 1122 of file variable-editor-model.cc.
References eval_expr_event(), QtHandles::Utils::fromStdString(), and name().
bool octave::variable_editor_model::insertRows | ( | int | row, |
int | count, | ||
const QModelIndex & | parent = QModelIndex() |
||
) |
Definition at line 1088 of file variable-editor-model.cc.
References eval_expr_event(), QtHandles::Utils::fromStdString(), and name().
|
signal |
Referenced by eval_expr_event(), setData(), and update_data_cache().
|
signal |
|
private |
Definition at line 1378 of file variable-editor-model.cc.
References reset().
Referenced by data_error().
|
inline |
Definition at line 164 of file variable-editor-model.h.
References octave::base_ve_model::is_editable(), and rep.
Referenced by variable_editor_model(), and reset().
|
inlineprivate |
Definition at line 326 of file variable-editor-model.h.
References octave::base_ve_model::is_valid(), and rep.
Referenced by flags().
|
inlineprivate |
Definition at line 334 of file variable-editor-model.h.
References octave::base_ve_model::make_description_text(), and rep.
Referenced by update_description().
void octave::variable_editor_model::maybe_resize_columns | ( | int | cols | ) |
Definition at line 1341 of file variable-editor-model.cc.
References change_display_size(), display_columns(), display_rows(), octave::base_ve_model::maybe_resize_columns(), and rep.
Referenced by octave::variable_editor_view::handle_horizontal_scroll_action().
void octave::variable_editor_model::maybe_resize_rows | ( | int | rows | ) |
Definition at line 1326 of file variable-editor-model.cc.
References change_display_size(), display_columns(), display_rows(), octave::base_ve_model::maybe_resize_rows(), and rep.
Referenced by octave::variable_editor_view::handle_vertical_scroll_action().
|
inline |
Definition at line 159 of file variable-editor-model.h.
References octave::base_ve_model::name(), and rep.
Referenced by double_click(), init_from_oct(), insertColumns(), insertRows(), removeColumns(), removeRows(), reset(), retrieve_variable(), setData(), and update_data().
|
delete |
|
inline |
Definition at line 241 of file variable-editor-model.h.
References octave::base_ve_model::quote_char(), and rep.
Referenced by setData().
bool octave::variable_editor_model::removeColumns | ( | int | column, |
int | count, | ||
const QModelIndex & | parent = QModelIndex() |
||
) |
Definition at line 1134 of file variable-editor-model.cc.
References data_columns(), eval_expr_event(), QtHandles::Utils::fromStdString(), and name().
bool octave::variable_editor_model::removeRows | ( | int | row, |
int | count, | ||
const QModelIndex & | parent = QModelIndex() |
||
) |
Definition at line 1102 of file variable-editor-model.cc.
References data_rows(), eval_expr_event(), QtHandles::Utils::fromStdString(), and name().
|
inline |
Definition at line 216 of file variable-editor-model.h.
References rep, and octave::base_ve_model::requires_sub_editor().
Referenced by double_click(), and flags().
|
private |
Definition at line 1364 of file variable-editor-model.cc.
References create(), QtHandles::Utils::fromStdString(), is_editable(), name(), rep, set_editable_signal(), and update_description().
Referenced by invalidate(), and update_data().
|
private |
Definition at line 1208 of file variable-editor-model.cc.
References error(), octave::interpreter::eval_string(), octave_value::is_cs_list(), name(), octave_value(), symbol_exist(), and x.
Referenced by init_from_oct(), and setData().
|
inline |
Definition at line 179 of file variable-editor-model.h.
References rep, and octave::base_ve_model::rowCount().
|
signal |
Referenced by reset().
|
inline |
Definition at line 221 of file variable-editor-model.h.
References rep, and octave::base_ve_model::set_update_pending().
Referenced by setData().
bool octave::variable_editor_model::setData | ( | const QModelIndex & | idx, |
const QVariant & | v, | ||
int | role = Qt::EditRole |
||
) |
Definition at line 987 of file variable-editor-model.cc.
References clear_update_pending(), octave::interpreter::eval_string(), evaluation_error(), interpreter_event(), name(), quote_char(), retrieve_variable(), set_update_pending(), subscript_expression(), and update_data_signal().
Referenced by clear_content().
|
inline |
Definition at line 256 of file variable-editor-model.h.
References rep, and octave::base_ve_model::subscript_expression().
Referenced by double_click(), and setData().
|
slot |
Definition at line 1262 of file variable-editor-model.cc.
References change_display_size(), clear_update_pending(), data_error_signal(), display_columns(), display_rows(), QtHandles::Utils::fromStdString(), octave_value::is_undefined(), name(), and reset().
Referenced by variable_editor_model(), and octave::variable_editor::edit_variable().
|
slot |
Definition at line 1250 of file variable-editor-model.cc.
References init_from_oct(), and interpreter_event().
|
signal |
Referenced by variable_editor_model(), init_from_oct(), and setData().
|
private |
Definition at line 1388 of file variable-editor-model.cc.
References description_changed(), and make_description_text().
Referenced by variable_editor_model(), data_error(), and reset().
|
inline |
Definition at line 226 of file variable-editor-model.h.
References rep, and octave::base_ve_model::update_pending().
|
inline |
Definition at line 231 of file variable-editor-model.h.
References rep, and octave::base_ve_model::update_pending_data().
|
privateslot |
Definition at line 1244 of file variable-editor-model.cc.
Referenced by variable_editor_model().
|
signal |
Referenced by variable_editor_model(), and evaluation_error().
|
inline |
Definition at line 169 of file variable-editor-model.h.
References rep, and octave::base_ve_model::value_at().
Referenced by double_click().
|
private |
Definition at line 318 of file variable-editor-model.h.
Referenced by ~variable_editor_model(), clear_update_pending(), column_width(), columnCount(), data(), data_columns(), data_rows(), display_columns(), display_rows(), double_click(), headerData(), is_editable(), is_valid(), make_description_text(), maybe_resize_columns(), maybe_resize_rows(), name(), quote_char(), requires_sub_editor(), reset(), rowCount(), set_update_pending(), subscript_expression(), update_pending(), update_pending_data(), and value_at().