Changeset - f2e074e18515
[Not reviewed]
default
0 1 0
Hasan Yavuz ÖZDERYA - 7 years ago 2019-01-22 09:22:16
hy@ozderya.net
fix crash on snapshot display
1 file changed with 15 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/plotmanager.cpp
Show inline comments
 
/*
 
  Copyright © 2018 Hasan Yavuz Özderya
 
  Copyright © 2019 Hasan Yavuz Özderya
 

	
 
  This file is part of serialplot.
 

	
 
@@ -358,12 +358,24 @@ void PlotManager::_addCurve(QwtPlotCurve
 
    {
 
        // create a new plot widget
 
        plot = addPlotWidget();
 
        plot->setDispChannels(QVector<const StreamChannel*>(1, _stream->channel(index)));
 
    }
 
    else
 
    {
 
        plot = plotWidgets[0];
 
        plot->setDispChannels(_stream->allChannels());
 
    }
 

	
 
    if (_stream != nullptr)     // not displaying snapshot
 
    {
 
        QVector<const StreamChannel*> dispChannels;
 
        if (isMulti)
 
        {
 
            dispChannels = QVector<const StreamChannel*>(1, _stream->channel(index));
 
        }
 
        else
 
        {
 
            dispChannels = _stream->allChannels();
 
        }
 
        plot->setDispChannels(dispChannels);
 
    }
 

	
 
    // show the curve
0 comments (0 inline, 0 general)