Hi,
I have now integrated a PlotPicker in my QwtPlot and coded a function which should set the picked x and y location in two QLabes:
void MainWindow::valuePlotPickerSelected( const QwtDoublePoint& point)
{
QString temp; temp.
setNum(point.
x());
valuePlotX->setText(temp); temp.setNum(point.y());
valuePlotY->setText(temp);
}
void MainWindow::valuePlotPickerSelected( const QwtDoublePoint& point)
{
QString temp; temp.setNum(point.x());
valuePlotX->setText(temp); temp.setNum(point.y());
valuePlotY->setText(temp);
}
To copy to clipboard, switch view to plain text mode
This seems to work most of the time. But when I don't replot or even sometimes when i replot it sets the x value to 0.
Y value is allways correct, but I sometimes can pick many points and it is sheer luck if the x value is correct or 0.
What could the problem be? Is it a problem, that there can be less x values than I have pixels on the QwtPlot?
Thanks for taking the time!
sun
Bookmarks