24 #if defined (HAVE_CONFIG_H) 28 #include <QTreeWidget> 58 if (colors.isEmpty ())
60 colors << QColor (190, 255, 255)
61 << QColor (220, 255, 220)
62 << QColor (220, 220, 255)
63 << QColor (255, 255, 190)
64 << QColor (255, 220, 220)
65 << QColor (255, 190, 255);
78 names << QObject::tr (
"automatic")
79 << QObject::tr (
"function")
80 << QObject::tr (
"global")
81 << QObject::tr (
"hidden")
82 << QObject::tr (
"inherited")
83 << QObject::tr (
"persistent");
104 Qt::ItemFlags
retval = Qt::NoItemFlags;
108 retval |= Qt::ItemIsEnabled;
111 retval |= Qt::ItemIsSelectable;
121 if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
134 if (role == Qt::BackgroundColorRole)
138 = class_chars.indexOf (
m_scopes[idx.row ()].toLatin1 ());
139 if (actual_class >= 0)
145 if (role == Qt::DisplayRole
146 || (idx.column () == 0 && role == Qt::EditRole)
147 || (idx.column () == 0 && role == Qt::ToolTipRole))
149 switch (idx.column ())
152 if (role == Qt::ToolTipRole)
154 = QVariant (tr (
"Right click to copy, rename, or display"));
178 = class_chars.indexOf (
m_scopes[idx.row ()].toLatin1 ());
180 if (actual_class >= 0)
182 QStringList class_names
185 sclass = class_names.at (actual_class);
190 if (sclass.isEmpty ())
191 sclass = tr (
"complex");
193 sclass +=
", " + tr (
"complex");
196 retval = QVariant (sclass);
212 if (idx.column () == 0 && role == Qt::EditRole)
214 QString qold_name =
m_symbols[idx.row ()];
216 QString qnew_name =
value.toString ();
257 for (
int i = 0;
i < class_chars.length ();
i++)
259 QVariant default_var = default_colors.at (
i);
260 QColor setting_color = settings->value (
"workspaceview/color_" 261 + class_chars.mid (
i,1),
262 default_var).value<QColor> ();
289 for (
const auto& sr : sr_list)
306 else if (sr.is_persistent ())
308 else if (sr.is_automatic ())
310 else if (sr.is_formal ())
312 else if (sr.is_hidden ())
314 else if (sr.is_inherited ())
317 std::ostringstream buf;
318 val.short_disp (buf);
std::string str(char sep='x') const
QStringList m_class_names
QStringList m_columnNames
identity matrix If supplied two scalar respectively For allows like xample val
symbol_scope scope(void) const
bool setData(const QModelIndex &index, const QVariant &value, int role=Qt::EditRole)
QString fromStdString(const std::string &s)
static llvm::LLVMContext & context
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const
QList< QColor > m_storage_class_colors
std::list< symbol_record > all_variables(bool defined_only=true, unsigned int exclude=symbol_record::hidden) const
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
workspace_model(QObject *parent=nullptr)
bool valid_identifier(const char *s)
symbol_record::context_id current_context(void) const
int columnCount(const QModelIndex &parent=QModelIndex()) const
static QString storage_class_chars(void)
void set_workspace(bool top_level, bool debug, const symbol_scope &scope)
Qt::ItemFlags flags(const QModelIndex &index) const
void rename_variable(const QString &old_name, const QString &new_name)
static QList< QColor > storage_class_default_colors(void)
static dim_vector alloc(int n)
static QStringList storage_class_names(void)
void clear_workspace(void)
QVariant data(const QModelIndex &index, int role) const
static QList< QColor > storage_class_default_colors(void)
static QStringList storage_class_names(void)
octave_idx_type ndims(void) const
Number of dimensions.
Vector representing the dimensions (size) of an Array.
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
nd group nd example For each display the value
int rowCount(const QModelIndex &parent=QModelIndex()) const
void notice_settings(const QSettings *)