Changeset - d4a271f3d46a
[Not reviewed]
default
0 2 0
Hasan Yavuz ÖZDERYA - 8 years ago 2017-04-12 15:49:09
hy@ozderya.net
show zoom selection size in the tracker text
2 files changed with 22 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/zoomer.cpp
Show inline comments
 
/*
 
  Copyright © 2016 Hasan Yavuz Özderya
 
  Copyright © 2017 Hasan Yavuz Özderya
 

	
 
  This file is part of serialplot.
 

	
 
@@ -52,3 +52,19 @@ void Zoomer::zoom( const QRectF & rect)
 

	
 
    ScrollZoomer::zoom(rect);
 
}
 

	
 
QwtText Zoomer::trackerTextF(const QPointF& pos) const
 
{
 
    QwtText b = ScrollZoomer::trackerTextF(pos);
 

	
 
    const QPolygon pa = selection();
 
    const QRectF rect = invTransform(QRect(pa.first(), pa.last()).normalized());
 

	
 
    QString sizeText = QString(" [%1, %2]").\
 
        arg(rect.width(), 0, 'g', 4).\
 
        arg(rect.height(), 0, 'g', 4);
 

	
 
    b.setText(b.text() + sizeText);
 

	
 
    return b;
 
}
src/zoomer.h
Show inline comments
 
/*
 
  Copyright © 2016 Hasan Yavuz Özderya
 
  Copyright © 2017 Hasan Yavuz Özderya
 

	
 
  This file is part of serialplot.
 

	
 
@@ -33,6 +33,10 @@ public:
 

	
 
signals:
 
    void unzoomed();
 

	
 
protected:
 
    /// Re-implemented to display selection size in the tracker text.
 
    QwtText trackerTextF(const QPointF &pos) const;
 
};
 

	
 
#endif // ZOOMER_H
0 comments (0 inline, 0 general)