Changeset - 5d5d3a41557c
[Not reviewed]
show-symbols
0 2 0
Hasan Yavuz Ă–ZDERYA - 9 years ago 2016-08-20 10:41:55
hy@ozderya.net
update symbol display on resize
2 files changed with 7 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/plot.cpp
Show inline comments
 
@@ -274,18 +274,23 @@ void Plot::updateSymbols()
 
    if (curves.size() > 0)
 
    {
 
        for (unsigned i = 0; i < curves.size(); i++)
 
        {
 
            QwtSymbol* symbol = NULL;
 
            QwtPlotCurve* curve = static_cast<QwtPlotCurve*>(curves[i]);
 
            qDebug() << i;
 
            if (isSymbolsOn)
 
            {
 
                symbol = new QwtSymbol(QwtSymbol::Ellipse,
 
                                       QBrush(Qt::white),
 
                                       curve->pen(),
 
                                       QSize(SYMBOL_SIZE, SYMBOL_SIZE));
 
            }
 
            curve->setSymbol(symbol);
 
        }
 
    }
 
}
 

	
 
void Plot::resizeEvent(QResizeEvent * event)
 
{
 
    QwtPlot::resizeEvent(event);
 
    onXScaleChanged();
 
}
src/plot.h
Show inline comments
 
@@ -60,12 +60,13 @@ private:
 
    QAction darkBackgroundAction;
 
    QAction showLegendAction;
 

	
 
    /// update the display of symbols depending on `isSymbolsOn`
 
    void updateSymbols();
 
    void resetAxes();
 
    void resizeEvent(QResizeEvent * event);
 

	
 
public slots:
 
    void showGrid(bool show = true);
 
    void showMinorGrid(bool show = true);
 
    void unzoom();
 
    void darkBackground(bool enabled = true);
0 comments (0 inline, 0 general)