Results 1 to 7 of 7

Thread: A crosshair which tracks a displayed curve

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: A crosshair which tracks a displayed curve

    Can we see some code?

  2. #2
    Join Date
    Mar 2007
    Posts
    74
    Qt products
    Qt4
    Platforms
    Windows
    Thanked 1 Time in 1 Post

    Default Re: A crosshair which tracks a displayed curve

    The only code I have is a hacked up version of the Bode plot..

    The images I attached are of a different app which I need to emulate.

    ie.

    d_picker = new QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft,
    QwtPicker::PointSelection,
    QwtPlotPicker::CrossRubberBand, QwtPicker::AlwaysOn,
    d_plot->canvas());
    d_picker->setRubberBandPen(QColor(Qt::red));
    d_picker->setTrackerMode(QwtPicker::ActiveOnly);

    will give me the Cross hair when I left click.

    I want this to persist when I release the mouse and then be able to grab it and
    move it with it following the displayed curve..

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    28
    Thanked 976 Times in 912 Posts

    Default Re: A crosshair which tracks a displayed curve

    Shouldn't you use QwtPlotMarker instead?

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,326
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 880 Times in 828 Posts

    Default Re: A crosshair which tracks a displayed curve

    All type of rubberbands support interactions, but they are not intended to display something persistant on the plot canvas.

    So you need to insert a plot item, when your interaction is done. Of course you have to hide this item again, when you restart your interaction. So your code will be a combination of a picker and a plot item.

    The plot item, that represents a point ( or a x or a y coordinate ) is indeed a marker, but you can also implement your own type of item. See f.e: http://qwt.svn.sourceforge.net/viewv...pp?view=markup

    HTH,
    Uwe

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
  •  
Qt is a trademark of The Qt Company.