ppp
3rd June 2015, 07:22
Hello,
I am trying to work out how the invTransform function works. But I guess I misunderstood something.
Here is what I tried already:
#include <QApplication>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
int main( int argc, char** argv ){
QApplication app( argc, argv );
QwtPlot plot;
QwtPlotCurve curve;
QVector<QPointF> list;
list.append( QPointF(2,1.5) );
list.append( QPointF(3,5) );
list.append( QPointF(4,3.4) );
curve.setSamples( list );
curve.attach( &plot );
qDebug() << "invTransform(): " << plot.invTransform( curve.xAxis(), 3 );
qDebug() << "invTransform(): " << plot.canvasMap( QwtPlot::xBottom ).invTransform( list[1].x() );
plot.show();
qDebug() << "invTransform(): " << plot.invTransform( curve.xAxis(), 3);
return app.exec();
}
The Console outputs:
invTransform(): 3
invTransform(): 3
invTransform(): -3
Can someone please tell me why it's not working?!
I appreciate it.
I am trying to work out how the invTransform function works. But I guess I misunderstood something.
Here is what I tried already:
#include <QApplication>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
int main( int argc, char** argv ){
QApplication app( argc, argv );
QwtPlot plot;
QwtPlotCurve curve;
QVector<QPointF> list;
list.append( QPointF(2,1.5) );
list.append( QPointF(3,5) );
list.append( QPointF(4,3.4) );
curve.setSamples( list );
curve.attach( &plot );
qDebug() << "invTransform(): " << plot.invTransform( curve.xAxis(), 3 );
qDebug() << "invTransform(): " << plot.canvasMap( QwtPlot::xBottom ).invTransform( list[1].x() );
plot.show();
qDebug() << "invTransform(): " << plot.invTransform( curve.xAxis(), 3);
return app.exec();
}
The Console outputs:
invTransform(): 3
invTransform(): 3
invTransform(): -3
Can someone please tell me why it's not working?!
I appreciate it.