Results 1 to 3 of 3

Thread: Plot Picker x=0

  1. #1
    Join Date
    Sep 2008
    Posts
    17
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Wink Plot Picker x=0

    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:

    Qt Code:
    1. void MainWindow::valuePlotPickerSelected( const QwtDoublePoint& point)
    2. {
    3. QString temp; temp.setNum(point.x());
    4. valuePlotX->setText(temp); temp.setNum(point.y());
    5. valuePlotY->setText(temp);
    6. }
    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

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Plot Picker x=0

    Assuming, that MainWindow::valuePlotPickerSelected is connected to the selected signal of a QwtPlotPicker in PointSelection mode: in QwtPlotPicker::end() line 289 the pixel position is translated into plot coordinates. Check, what's going wrong there.

    Uwe

  3. The following user says thank you to Uwe for this useful post:

    sun (7th October 2008)

  4. #3
    Join Date
    Sep 2008
    Posts
    17
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Plot Picker x=0

    Thanks for the fast help!

    I'll try it sometime. It's not first priority at the moment.

Similar Threads

  1. Replies: 7
    Last Post: 22nd September 2008, 23:05
  2. Problem saving a plot
    By kalos80 in forum Qwt
    Replies: 2
    Last Post: 10th July 2008, 09:31
  3. Reg multiple plots in Qwt
    By Tavit in forum Qwt
    Replies: 4
    Last Post: 23rd June 2008, 14:43
  4. Replies: 15
    Last Post: 27th May 2008, 02:46
  5. Replies: 0
    Last Post: 27th May 2008, 02:00

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.