QVariant EdgeModel::data(const QModelIndex &index, int role) const
{
+ Edge *e = g->m_edgeList[index.row()];
+
+ if (role == Qt::DecorationRole)
+ {
+ switch (index.column())
+ {
+ case 0:
+ return e->startNode()->color();
+ case 1:
+ return e->endNode()->color();
+ case 3:
+ return e->color();
+ default:
+ break;
+ }
+ return QVariant();
+ }
+
if (role != Qt::DisplayRole && role != Qt::EditRole)
return QVariant();
- Edge *e = g->m_edgeList[index.row()];
switch (index.column())
{
case 0: