diff --git a/src/plotmanager.cpp b/src/plotmanager.cpp --- a/src/plotmanager.cpp +++ b/src/plotmanager.cpp @@ -276,7 +276,9 @@ void PlotManager::_addCurve(QwtPlotCurve curves.append(curve); unsigned index = curves.size()-1; - curve->setPen(Plot::makeColor(index)); + auto color = _infoModel->index(index, ChannelInfoModel::COLUMN_NAME)\ + .data(Qt::ForegroundRole).value(); + curve->setPen(color); // create the plot for the curve if we are on multi display Plot* plot; diff --git a/src/snapshot.cpp b/src/snapshot.cpp --- a/src/snapshot.cpp +++ b/src/snapshot.cpp @@ -107,6 +107,11 @@ void Snapshot::setName(QString name) emit nameChanged(this); } +ChannelInfoModel* Snapshot::infoModel() +{ + return &cInfoModel; +} + QString Snapshot::channelName(unsigned channel) { return cInfoModel.data(cInfoModel.index(channel, ChannelInfoModel::COLUMN_NAME), diff --git a/src/snapshot.h b/src/snapshot.h --- a/src/snapshot.h +++ b/src/snapshot.h @@ -45,6 +45,7 @@ public: QString name(); QString displayName(); ///< `name()` plus '*' if snapshot is not saved + ChannelInfoModel* infoModel(); void setName(QString name); QString channelName(unsigned channel); diff --git a/src/snapshotview.cpp b/src/snapshotview.cpp --- a/src/snapshotview.cpp +++ b/src/snapshotview.cpp @@ -29,7 +29,7 @@ SnapshotView::SnapshotView(QWidget *pare ui->setupUi(this); - plotMan = new PlotManager(ui->plotArea); + plotMan = new PlotManager(ui->plotArea, snapshot->infoModel()); ui->menuSnapshot->insertAction(ui->actionClose, snapshot->deleteAction()); this->setWindowTitle(snapshot->displayName());