pabigot / qcustomplot

Clone of Qt C++ widget for plotting and data visualization
http://www.qcustomplot.com
1 stars 1 forks source link

provide helpers for converting between pixel and coordinate pairs #2

Closed pabigot closed 10 years ago

pabigot commented 10 years ago

Use of Qt capabilities is simpler if one can traffic in QPoint and QPointF rather than doubles. Support this by extending the QCPAxis pixel/coord converters with mapToCoord and mapFromCoord, then lift this to QCPAxisRect adding support for QRect/QRectF, then lift that to QCustomPlot using the default axis rect.

pabigot commented 10 years ago

Of course, a single QCPAxis can't convert a QPoint, and it turns out QCPAxisRect has no concept of which axes are horizontal or vertical unless they've been specified for drag or zoom (which might be different for whatever reason). So the helper can only be provided in QCustomPlot and only in relation to xAxis and yAxis.