Changeset - 60b1d4871c81
[Not reviewed]
show-symbols
0 1 0
Hasan Yavuz ÖZDERYA - 9 years ago 2016-08-30 10:08:32
hy@ozderya.net
update symbol brush on background change
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/plot.cpp
Show inline comments
 
@@ -157,24 +157,25 @@ void Plot::darkBackground(bool enabled)
 
        legend.setTextPen(QPen(Qt::white));
 
    }
 
    else
 
    {
 
        setCanvasBackground(QBrush(Qt::white));
 
        gridColor.setHsvF(0, 0, 0.80);
 
        grid.setPen(gridColor);
 
        zoomer.setRubberBandPen(QPen(Qt::black));
 
        zoomer.setTrackerPen(QPen(Qt::black));
 
        sZoomer.setPickerPen(QPen(Qt::black));
 
        legend.setTextPen(QPen(Qt::black));
 
    }
 
    updateSymbols();
 
    replot();
 
}
 

	
 
/*
 
  Below crude drawing demostrates how color selection occurs for
 
  given channel index
 

	
 
  0°                     <--Hue Value-->                           360°
 
  |* . o . + . o . * . o . + . o . * . o . + . o . * . o . + . o . |
 

	
 
  * -> 0-3
 
  + -> 4-7
 
@@ -245,25 +246,25 @@ void Plot::updateSymbols()
 
{
 
    const QwtPlotItemList curves = itemList( QwtPlotItem::Rtti_PlotCurve );
 

	
 
    if (curves.size() > 0)
 
    {
 
        for (int i = 0; i < curves.size(); i++)
 
        {
 
            QwtSymbol* symbol = NULL;
 
            QwtPlotCurve* curve = static_cast<QwtPlotCurve*>(curves[i]);
 
            if (symbolSize)
 
            {
 
                symbol = new QwtSymbol(QwtSymbol::Ellipse,
 
                                       QBrush(Qt::white),
 
                                       canvasBackground(),
 
                                       curve->pen(),
 
                                       QSize(symbolSize, symbolSize));
 
            }
 
            curve->setSymbol(symbol);
 
        }
 
    }
 
}
 

	
 
void Plot::resizeEvent(QResizeEvent * event)
 
{
 
    QwtPlot::resizeEvent(event);
 
    onXScaleChanged();
0 comments (0 inline, 0 general)