28 #include <QTreeWidget>
54 if (colors.isEmpty ())
56 colors << QColor (190,255,255)
57 << QColor (220,255,220)
58 << QColor (220,220,255)
59 << QColor (255,255,190)
60 << QColor (255,220,220)
61 << QColor (255,190,255);
75 names << QObject::tr (
"automatic")
76 << QObject::tr (
"function")
77 << QObject::tr (
"global")
78 << QObject::tr (
"hidden")
79 << QObject::tr (
"inherited")
80 << QObject::tr (
"persistent");
101 Qt::ItemFlags retval = 0;
105 retval |= Qt::ItemIsEnabled;
108 retval |= Qt::ItemIsSelectable;
118 if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
131 if (role == Qt::BackgroundColorRole)
135 = class_chars.indexOf (
_scopes[idx.row ()].toAscii ());
136 if (actual_class >= 0)
142 if (role == Qt::DisplayRole
143 || (idx.column () == 0 && role == Qt::EditRole)
144 || (idx.column () == 0 && role == Qt::ToolTipRole) )
146 switch (idx.column ())
149 if (role == Qt::ToolTipRole)
151 = QVariant (tr (
"Right click to copy, rename, or display"));
153 retval = QVariant (
_symbols[idx.row ()]);
165 retval = QVariant (
_values[idx.row ()]);
175 = class_chars.indexOf (
_scopes[idx.row ()].toAscii ());
177 if (actual_class >= 0)
179 QStringList class_names
182 sclass = class_names.at (actual_class);
187 if (sclass.isEmpty ())
188 sclass = tr (
"complex");
190 sclass +=
", " + tr (
"complex");
193 retval = QVariant (sclass);
209 if (idx.column () == 0 && role == Qt::EditRole)
211 QString qold_name =
_symbols[idx.row ()];
213 QString qnew_name = value.toString ();
215 std::string new_name = qnew_name.toStdString ();
231 const QString& scopes,
232 const QStringList& symbols,
233 const QStringList& class_names,
234 const QStringList& dimensions,
235 const QStringList& values,
291 for (
int i = 0; i < class_chars.length (); i++)
293 QVariant default_var = default_colors.at (i);
294 QColor setting_color = settings->value (
"workspaceview/color_"
295 + class_chars.mid (i,1),
296 default_var).value<QColor> ();