double x0 = ui->qwtPlot->transform(ui->qwtPlot->x(), 0);
double y0 = ui->qwtPlot->transform(ui->qwtPlot->y(), 1);
double x1 = ui->qwtPlot->transform(ui->qwtPlot->x(), 3.0);
double y1 = ui->qwtPlot->transform(ui->qwtPlot->y(), 1);
linearGrad.
setCoordinateMode(QGradient::LogicalMode);
linearGrad.setColorAt(0, Qt::black);
linearGrad.setColorAt(0.5, Qt::white);
curve->setBrush(linearGrad);
curve->setBaseline(1);
points <<
QPointF( 0.0,
0.0 ) // ?????????? x, y
curve->setSamples( points ); // ????????????? ????? ????? ? ??????
double x0 = ui->qwtPlot->transform(ui->qwtPlot->x(), 0);
double y0 = ui->qwtPlot->transform(ui->qwtPlot->y(), 1);
double x1 = ui->qwtPlot->transform(ui->qwtPlot->x(), 3.0);
double y1 = ui->qwtPlot->transform(ui->qwtPlot->y(), 1);
QLinearGradient linearGrad(QPointF(x0, x0), QPointF(x1, y1));
linearGrad.setCoordinateMode(QGradient::LogicalMode);
linearGrad.setColorAt(0, Qt::black);
linearGrad.setColorAt(0.5, Qt::white);
curve->setBrush(linearGrad);
curve->setBaseline(1);
QPolygonF points;
points << QPointF( 0.0, 0.0 ) // ?????????? x, y
<< QPointF( 0.5, 1.5 ) << QPointF( 1.0, 1.5 )
<< QPointF( 1.5, 1.0 ) << QPointF( 2.0, 0.5 )
<< QPointF(2.5, 0.5) << QPointF(3.0, 1.0);
curve->setSamples( points ); // ????????????? ????? ????? ? ??????
To copy to clipboard, switch view to plain text mode
and I get wrong pixels coordinate. For example I use QwtPlot Widget and I can see in Designer that the size its
Bookmarks