Well I have 2 questions but I have really no idea of what I can do to solve this.
About QPainter:
in the .h file:
public:
QVector<int> xpuntos;
QVector<int> ypuntos;
public:
QVector<int> xpuntos;
QVector<int> ypuntos;
To copy to clipboard, switch view to plain text mode
In the cpp:
r,paso, itemax,and i (defined).
for(r=0.0;r<=4.0;r+=paso){
i=0;
x0=qrand();
x0/=RAND_MAX;
while(i<itemax){
x=r*x0*(1.0-x0);
//if( (x-x0)<epsilon){
// painter.drawPoint((int)(r*450.0/4.0),(int)(0-(x*450)));
// break;
//}
x0=x;
i++;
if(i>250){
xpuntos.append((int)(r*450.0/4.0));
ypuntos.append((int)(0-(x*450)));
}
}
}
for(i=0;i<xpuntos.size();i++){
painter.drawPoint(xpuntos.at(i),y.puntos.at(i)); //it could no determine type ....
}
r,paso, itemax,and i (defined).
for(r=0.0;r<=4.0;r+=paso){
i=0;
x0=qrand();
x0/=RAND_MAX;
while(i<itemax){
x=r*x0*(1.0-x0);
//if( (x-x0)<epsilon){
// painter.drawPoint((int)(r*450.0/4.0),(int)(0-(x*450)));
// break;
//}
x0=x;
i++;
if(i>250){
xpuntos.append((int)(r*450.0/4.0));
ypuntos.append((int)(0-(x*450)));
}
}
}
for(i=0;i<xpuntos.size();i++){
painter.drawPoint(xpuntos.at(i),y.puntos.at(i)); //it could no determine type ....
}
To copy to clipboard, switch view to plain text mode
The error is Qt doesn't recognize the type. why it cant determine type?
About QVector:
in the .h file:
QVector<QPoints> puntos;
QVector<QPoints> puntos;
To copy to clipboard, switch view to plain text mode
In the cpp:
My idea was inserting calculated data
i have 100 points with positions double x, double y.For example:
x=0.0, y=1;
for(i=0;i<itmax;i++){
x+=0.01
y=C*y0*(1.0-y0);
//Now the question... how I could add correctly this values to the QPoints vector?. My idea was:
puntos.append( puntos.setX( (int) x, puntos.setY( (int) y) );
}
x=0.0, y=1;
for(i=0;i<itmax;i++){
x+=0.01
y=C*y0*(1.0-y0);
//Now the question... how I could add correctly this values to the QPoints vector?. My idea was:
puntos.append( puntos.setX( (int) x, puntos.setY( (int) y) );
}
To copy to clipboard, switch view to plain text mode
It doesn't worked.... any other idea?
Bookmarks