大家有没看过Qt3给的例子中plotter 呢,其中有个in1.txt文件,说是模拟数据文件,我对其做了更改,自己设置要画线的横坐标为0~4095,纵坐标为0~4095,相关程序如下(其中有强制类型转换)
//the data of y
double m;
for(int j=0;j<4096;j++)
{
datay[j]=j;
m=(double)datay[j];
datay[j]=m;
}
//the data of x
double n;
for(int j=0;j<4096;j++)
{
datax[j]=j;
n=(double)datax[j];
datax[j]=n;
}
然后更改了画图函数如下
void Plotter::drawCurves(QPainter *painter)
{
PlotSettings settings = zoomStack[curZoom];
QRect rect(Margin, Margin,
width() - 2 * Margin, height() - 2 * Margin);
painter->setClipRect(rect.x() + 1, rect.y() + 1,
rect.width() - 2, rect.height() - 2);
double datax[4096];
double datay[4096];
int maxPoints=4096;
int numPoints=0;
QPointArray points(maxPoints);
for (int i=0; i<maxPoints; ++i) {
double dx = datax - settings.minX;
double dy = datay - settings.minY;
double x = rect.left() + (dx * (rect.width() - 1)
/ settings.spanX());
double y = rect.bottom() - (dy * (rect.height() - 1)
/ settings.spanY());
if (fabs(x) < 32768 && fabs(y) < 32768) {
points[numPoints] = QPoint((int)x, (int)y);
++numPoints;
}
}
points.truncate(numPoints);
painter->setPen(colorForIds[(uint)id % 6]);
painter->drawPolyline(points);
++it;
}
}
编译也能通过,并能生成intel80386 在qvfb上显示的界面和for arm 在目标板上显示的界面,但是,在qvfb中只有图表没有由横纵坐标组成的线条,在目标板上时报错error while loading shared libraries:/**/libqte.so.3:symbol localeconv ,version GLIBC_2.2 not defined in file libc.so.6 with link time reference请总版主帮忙解决啊,各路大侠帮忙解决啊