setCurveType missing in Qwt 6.0.1?
Hi to all,
I'm new to Qwt, and I need a little help.
Using qwtPlotCurve class I am not able to compile the following part of program:
Code:
curve->setSamples(xValue, yValue, samplesNumber);
curve
->setPen
(QColor(Qt
::blue));
curve
->setBrush
(QBrush(Qt
::blue, Qt
::SolidPattern));
curve->setBaseline(0);
These are the errors I have:
error: 'class QwtPlotCurve' has no member named 'setCurveType'
error: 'Yfx' is not a member of 'QwtPlotCurve'
I'm using QT Creator 2.2.1 (Qt 4.7.4) on Windows XP, and QWT 6.0.1.
I searched in the documentation, and setCurveType member, Yfx and Xfy have disappeared in the last version.
Even searching in .c and.h file in C:\qwt-6.0.1\src folder on my PC, I'm not able to find the setCurveType member or Yfx and Xfy definitions.
What seems strange to me is that noone in the forum raised this problem, so maybe I'm wrong: I apologize with all if this is the case.
Thank you in advance,
c
Re: setCurveType missing in Qwt 6.0.1?
Re: setCurveType missing in Qwt 6.0.1?
Thank you very much Uwe,
I checked the link that you proposed, but it doesn't solve my problem.
I needed to setCurvType equal to Xfy because I need to rotate the two axises x-y, having at the end the x axis (time axis) vertical and the y axis (amplitude axis) horizontal.
The result has to be as in the left part of this picture:
http://www.halliburton.com/public/la...promaxvsp3.jpg
The setOrientation command seems to me more related to the type of brush filling than related to the axis rotation.
c
Re: setCurveType missing in Qwt 6.0.1?
Quote:
Originally Posted by
chinalski
The setOrientation command seems to me more related to the type of brush filling than related to the axis rotation ...
Like what the curve type was in Qwt 5.x - there is ( and never was ) a mode to mirror points.
How are your points stored and how do you connect them to the curve object ?
Uwe
Re: setCurveType missing in Qwt 6.0.1?
Hi, this is the complete code for the part releted to the plot, I added setOrientation and setStyle to check your suggestion:
Code:
int samplesNumber=100;
double yValue[samplesNumber], xValue[samplesNumber];
double tempf;
for (int i = 0; i < samplesNumber; i++){
tempf = (double) (i-5)/5;
yValue[i] = sin(tempf);
xValue[i] = double(i);
}
curve->setOrientation(Qt::Vertical);
curve->setSamples(xValue, yValue, samplesNumber);
curve
->setPen
(QColor(Qt
::blue));
curve
->setBrush
(QBrush(Qt
::blue, Qt
::SolidPattern));
curve->setBaseline(0);
curve->attach(grafico);
Re: setCurveType missing in Qwt 6.0.1?
O.k then all you need to do is:
Code:
curve->setSamples(yValue, xValue, samplesNumber);
Uwe
Re: setCurveType missing in Qwt 6.0.1?
Ok Uwe, I've got it!
Just to resume for the forum people:
With the following command, inverting the position of xValue and yValue, I rotate the axises:
Code:
curve->setSamples(yValue, xValue, samplesNumber);
With the following command I change the orientation of the baseline, according to the new axises orientation.
Code:
curve->setOrientation(Qt::Horizontal);
Thank you Uwe, and thank you especially for the great job that you do with Qwt!
c