I read documentation....and write next code .but I have a mistale
View code:
void DataPlot::strob(Qt::Orientation o,
{
spinBox2->setRange(0,699);
// spinBox2->setValue(43);
spinBox2->show();
double i = spinBox2->value();
QObject::connect(spinBox2,
SIGNAL(valueChanged
(int)),i,
SLOT(value
));
curve
->setPen
(QPen(Qt
::blue,
3));
// double i ;
double x[10];
double y[sizeof(x) / sizeof(x[0])];
for ( uint k = 0; k < sizeof(x) / sizeof(x[0]); k++ )
{
double v = i+k * 1.5;
if ( o == Qt::Horizontal )
{
x[k] = v;
y[k] = base;
}
else
{
x[k] = base;
y[k] = v;
}
}
curve->setData(x, y, sizeof(x) / sizeof(x[0]));
curve->attach(this);
}
void DataPlot::strob(Qt::Orientation o,
const QColor &c, double base)
{
QSpinBox*spinBox2 = new QSpinBox;
spinBox2->setRange(0,699);
// spinBox2->setValue(43);
spinBox2->show();
double i = spinBox2->value();
QObject::connect(spinBox2,SIGNAL(valueChanged(int)),i,SLOT(value));
QwtPlotCurve *curve = new QwtPlotCurve();
curve->setPen(QPen(Qt::blue,3));
// double i ;
double x[10];
double y[sizeof(x) / sizeof(x[0])];
for ( uint k = 0; k < sizeof(x) / sizeof(x[0]); k++ )
{
double v = i+k * 1.5;
if ( o == Qt::Horizontal )
{
x[k] = v;
y[k] = base;
}
else
{
x[k] = base;
y[k] = v;
}
}
curve->setData(x, y, sizeof(x) / sizeof(x[0]));
curve->attach(this);
}
To copy to clipboard, switch view to plain text mode
Bookmarks