Hi,
when I use a ForLoop for initialing a QVector<double>, and have a setPen like this:
curve.setPen(Qt::red, 4, Qt::DotLine)
curve.setPen(Qt::red, 4, Qt::DotLine)
To copy to clipboard, switch view to plain text mode
, the plot can not show the DotLine style. code is:
QVector<double> t(20);
//t<<1<<2<<3<<4<<5<<6<<7<<8<<9; //if I replace this line with under ForLoop the problem is solved.
for(int i=0;i<10;i++)
{
t[i]=i;
}
curve.setSamples(t,t );
curve.setPen(Qt::red, 4, Qt::DotLine);
curve.attach(&plot);
plot.show();
QVector<double> t(20);
//t<<1<<2<<3<<4<<5<<6<<7<<8<<9; //if I replace this line with under ForLoop the problem is solved.
for(int i=0;i<10;i++)
{
t[i]=i;
}
curve.setSamples(t,t );
curve.setPen(Qt::red, 4, Qt::DotLine);
curve.attach(&plot);
plot.show();
To copy to clipboard, switch view to plain text mode
I uploaded a picture of this. Thanks for any help
NotShowStyle.png
Bookmarks