diff --git a/src/channelinfomodel.cpp b/src/channelinfomodel.cpp --- a/src/channelinfomodel.cpp +++ b/src/channelinfomodel.cpp @@ -19,6 +19,7 @@ #include "channelinfomodel.h" +#include #include enum ChannelInfoColumn @@ -28,6 +29,18 @@ enum ChannelInfoColumn COLUMN_COUNT }; +const QColor colors[8] = +{ + QColor(237,97,68), + QColor(92,200,96), + QColor(225,98,207), + QColor(163,195,58), + QColor(148,123,239), + QColor(212,182,52), + QColor(238,82,133), + QColor(219,136,44) +}; + ChannelInfoModel::ChannelInfoModel(unsigned numberOfChannels, QObject* parent) : QAbstractTableModel(parent) { @@ -72,6 +85,11 @@ QVariant ChannelInfoModel::data(const QM { return QVariant(infos[index.row()].name); } + else if (role == Qt::ForegroundRole) + { + // TODO: support more colors than 8 + return colors[index.row() % 8]; + } } else if (index.column() == COLUMN_VISIBILITY) {