Changeset - 08b87927957a
[Not reviewed]
Hasan Yavuz Ă–ZDERYA - 9 years ago 2017-01-29 13:55:27
hy@ozderya.net
get channel colors from infomodel
4 files changed with 10 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/plotmanager.cpp
Show inline comments
 
@@ -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<QColor>();
 
    curve->setPen(color);
 

	
 
    // create the plot for the curve if we are on multi display
 
    Plot* plot;
src/snapshot.cpp
Show inline comments
 
@@ -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),
src/snapshot.h
Show inline comments
 
@@ -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);
 

	
src/snapshotview.cpp
Show inline comments
 
@@ -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());
0 comments (0 inline, 0 general)