GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
octave::variable_editor_model Class Reference

#include "variable-editor-model.h"

Inheritance diagram for octave::variable_editor_model:
Collaboration diagram for octave::variable_editor_model:

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 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
 
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_modeloperator= (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)
 
octave_idx_type data_columns (void) const
 
octave_idx_type data_rows (void) const
 
void eval_oct (const std::string &name, const std::string &expr)
 
void evaluation_error (const std::string &expr) const
 
void init_from_oct (const std::string &str)
 
void invalidate (void)
 
bool is_valid (void) const
 
QString make_description_text (void) const
 
void reset (const octave_value &val)
 
octave_value retrieve_variable (const std::string &name)
 
void set_data_oct (const std::string &name, const std::string &expr, const QModelIndex &)
 
void update_description (const QString &description=QString())
 

Static Private Member Functions

static base_ve_modelcreate (const QString &expr, const octave_value &val)
 

Private Attributes

base_ve_modelrep
 

Detailed Description

Definition at line 130 of file variable-editor-model.h.

Constructor & Destructor Documentation

◆ variable_editor_model() [1/2]

octave::variable_editor_model::variable_editor_model ( const QString &  expr,
const octave_value val,
QObject parent = nullptr 
)

◆ ~variable_editor_model()

octave::variable_editor_model::~variable_editor_model ( void  )
inline

Definition at line 143 of file variable-editor-model.h.

References rep.

◆ variable_editor_model() [2/2]

octave::variable_editor_model::variable_editor_model ( const variable_editor_model )
delete

Member Function Documentation

◆ change_display_size()

void octave::variable_editor_model::change_display_size ( int  old_rows,
int  old_cols,
int  new_rows,
int  new_cols 
)
private

Definition at line 1286 of file variable-editor-model.cc.

Referenced by maybe_resize_columns(), maybe_resize_rows(), and update_data().

◆ clear_content()

bool octave::variable_editor_model::clear_content ( const QModelIndex &  idx)

◆ clear_update_pending()

void octave::variable_editor_model::clear_update_pending ( void  )
inline

Definition at line 231 of file variable-editor-model.h.

References octave::base_ve_model::clear_update_pending(), and rep.

Referenced by set_data_oct(), and update_data().

◆ column_width()

int octave::variable_editor_model::column_width ( void  ) const
inline

◆ columnCount()

int octave::variable_editor_model::columnCount ( const QModelIndex &  idx = QModelIndex ()) const
inline

Definition at line 179 of file variable-editor-model.h.

References octave::base_ve_model::columnCount(), and rep.

◆ create()

base_ve_model * octave::variable_editor_model::create ( const QString &  expr,
const octave_value val 
)
staticprivate

Definition at line 931 of file variable-editor-model.cc.

References val.

Referenced by reset().

◆ data()

QVariant octave::variable_editor_model::data ( const QModelIndex &  idx = QModelIndex (),
int  role = Qt::DisplayRole 
) const
inline

Definition at line 184 of file variable-editor-model.h.

References octave::base_ve_model::data(), and rep.

◆ data_columns()

octave_idx_type octave::variable_editor_model::data_columns ( void  ) const
inlineprivate

Definition at line 321 of file variable-editor-model.h.

References octave::base_ve_model::data_columns(), and rep.

Referenced by clear_content(), and removeColumns().

◆ data_error

void octave::variable_editor_model::data_error ( const QString &  msg)
privateslot

Definition at line 1343 of file variable-editor-model.cc.

References invalidate(), and update_description().

Referenced by variable_editor_model().

◆ data_error_signal

void octave::variable_editor_model::data_error_signal ( const QString &  name) const
signal

◆ data_rows()

octave_idx_type octave::variable_editor_model::data_rows ( void  ) const
inlineprivate

Definition at line 316 of file variable-editor-model.h.

References octave::base_ve_model::data_rows(), and rep.

Referenced by clear_content(), and removeRows().

◆ description_changed

void octave::variable_editor_model::description_changed ( const QString &  description)
signal

Referenced by update_description().

◆ display_columns()

int octave::variable_editor_model::display_columns ( void  ) const
inline

◆ display_rows()

int octave::variable_editor_model::display_rows ( void  ) const
inline

◆ double_click

void octave::variable_editor_model::double_click ( const QModelIndex &  idx)
slot

◆ edit_variable_signal

void octave::variable_editor_model::edit_variable_signal ( const QString &  name,
const octave_value val 
)
signal

Referenced by double_click().

◆ eval_oct()

void octave::variable_editor_model::eval_oct ( const std::string name,
const std::string expr 
)
private

◆ evaluation_error()

void octave::variable_editor_model::evaluation_error ( const std::string expr) const
private

Definition at line 1230 of file variable-editor-model.cc.

References arg, QtHandles::Utils::fromStdString(), and user_error_signal().

Referenced by eval_oct(), and set_data_oct().

◆ flags()

Qt::ItemFlags octave::variable_editor_model::flags ( const QModelIndex &  idx) const

Definition at line 1042 of file variable-editor-model.cc.

References is_valid(), requires_sub_editor(), and retval.

◆ headerData()

QVariant octave::variable_editor_model::headerData ( int  section,
Qt::Orientation  orientation,
int  role 
) const
inline

Definition at line 242 of file variable-editor-model.h.

References octave::base_ve_model::header_data(), and rep.

◆ init_from_oct()

void octave::variable_editor_model::init_from_oct ( const std::string str)
private

◆ insertColumns()

bool octave::variable_editor_model::insertColumns ( int  column,
int  count,
const QModelIndex &  parent = QModelIndex() 
)

Definition at line 1094 of file variable-editor-model.cc.

References eval_oct(), QtHandles::Utils::fromStdString(), and name().

◆ insertRows()

bool octave::variable_editor_model::insertRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)

Definition at line 1056 of file variable-editor-model.cc.

References eval_oct(), QtHandles::Utils::fromStdString(), name(), and row.

◆ invalidate()

void octave::variable_editor_model::invalidate ( void  )
private

Definition at line 1365 of file variable-editor-model.cc.

References reset().

Referenced by data_error().

◆ is_editable()

bool octave::variable_editor_model::is_editable ( void  ) const
inline

Definition at line 159 of file variable-editor-model.h.

References octave::base_ve_model::is_editable(), and rep.

Referenced by reset(), and variable_editor_model().

◆ is_valid()

bool octave::variable_editor_model::is_valid ( void  ) const
inlineprivate

Definition at line 311 of file variable-editor-model.h.

References octave::base_ve_model::is_valid(), and rep.

Referenced by flags().

◆ make_description_text()

QString octave::variable_editor_model::make_description_text ( void  ) const
inlineprivate

Definition at line 329 of file variable-editor-model.h.

References octave::base_ve_model::make_description_text(), and rep.

Referenced by update_description().

◆ maybe_resize_columns()

void octave::variable_editor_model::maybe_resize_columns ( int  cols)

◆ maybe_resize_rows()

void octave::variable_editor_model::maybe_resize_rows ( int  rows)

◆ name()

◆ operator=()

variable_editor_model& octave::variable_editor_model::operator= ( const variable_editor_model )
delete

◆ quote_char()

char octave::variable_editor_model::quote_char ( const QModelIndex &  idx) const
inline

Definition at line 236 of file variable-editor-model.h.

References octave::base_ve_model::quote_char(), and rep.

Referenced by setData().

◆ removeColumns()

bool octave::variable_editor_model::removeColumns ( int  column,
int  count,
const QModelIndex &  parent = QModelIndex() 
)

◆ removeRows()

bool octave::variable_editor_model::removeRows ( int  row,
int  count,
const QModelIndex &  parent = QModelIndex() 
)

◆ requires_sub_editor()

bool octave::variable_editor_model::requires_sub_editor ( const QModelIndex &  idx) const
inline

Definition at line 211 of file variable-editor-model.h.

References rep, and octave::base_ve_model::requires_sub_editor().

Referenced by double_click(), and flags().

◆ reset()

void octave::variable_editor_model::reset ( const octave_value val)
private

◆ retrieve_variable()

octave_value octave::variable_editor_model::retrieve_variable ( const std::string name)
private

Definition at line 1208 of file variable-editor-model.cc.

References octave::eval_string(), name(), octave_value(), string, symbol_exist(), and x.

Referenced by init_from_oct(), and set_data_oct().

◆ rowCount()

int octave::variable_editor_model::rowCount ( const QModelIndex &  idx = QModelIndex ()) const
inline

Definition at line 174 of file variable-editor-model.h.

References rep, and octave::base_ve_model::rowCount().

◆ set_data_oct()

void octave::variable_editor_model::set_data_oct ( const std::string name,
const std::string expr,
const QModelIndex &  idx 
)
private

◆ set_editable_signal

void octave::variable_editor_model::set_editable_signal ( bool  )
signal

Referenced by reset().

◆ set_update_pending()

void octave::variable_editor_model::set_update_pending ( const QModelIndex &  idx,
const QString &  str 
)
inline

Definition at line 216 of file variable-editor-model.h.

References rep, octave::base_ve_model::set_update_pending(), and str.

Referenced by setData().

◆ setData()

bool octave::variable_editor_model::setData ( const QModelIndex &  idx,
const QVariant &  v,
int  role = Qt::EditRole 
)

◆ subscript_expression()

QString octave::variable_editor_model::subscript_expression ( const QModelIndex &  idx) const
inline

Definition at line 251 of file variable-editor-model.h.

References rep, and octave::base_ve_model::subscript_expression().

Referenced by double_click(), and setData().

◆ update_data

void octave::variable_editor_model::update_data ( const octave_value val)
slot

◆ update_data_cache

void octave::variable_editor_model::update_data_cache ( void  )
slot

Definition at line 1244 of file variable-editor-model.cc.

References init_from_oct(), name(), and octave_link::post_event().

◆ update_data_signal

void octave::variable_editor_model::update_data_signal ( const octave_value val)
signal

◆ update_description()

void octave::variable_editor_model::update_description ( const QString &  description = QString ())
private

◆ update_pending()

bool octave::variable_editor_model::update_pending ( const QModelIndex &  idx) const
inline

Definition at line 221 of file variable-editor-model.h.

References rep, and octave::base_ve_model::update_pending().

◆ update_pending_data()

QString octave::variable_editor_model::update_pending_data ( const QModelIndex &  idx) const
inline

Definition at line 226 of file variable-editor-model.h.

References rep, and octave::base_ve_model::update_pending_data().

◆ user_error

void octave::variable_editor_model::user_error ( const QString &  title,
const QString &  msg 
)
privateslot

Definition at line 1238 of file variable-editor-model.cc.

Referenced by variable_editor_model().

◆ user_error_signal

void octave::variable_editor_model::user_error_signal ( const QString &  title,
const QString &  msg 
) const
signal

◆ value_at()

octave_value octave::variable_editor_model::value_at ( const QModelIndex &  idx) const
inline

Definition at line 164 of file variable-editor-model.h.

References rep, and octave::base_ve_model::value_at().

Referenced by double_click().

Member Data Documentation

◆ rep


The documentation for this class was generated from the following files: