Results 1 to 3 of 3

Thread: Moving plot marker with the mouse

  1. #1
    Join Date
    Feb 2008
    Posts
    26
    Thanks
    5
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Moving plot marker with the mouse

    Hi,

    I want to move a QwtPlotMarker (vertical) when I click on it, and move it while the mouse button is down. Of course, the marker should follow the mouse cursor.

    What is the easiest way to achieve this ?

    Regards,

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

    Default Re: Moving plot marker with the mouse

    I would implement it as a combination of a QwtPlotMarker and a QwtPlotPicker.

    Uwe

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

    viridis (13th September 2008)

  4. #3
    Join Date
    Sep 2008
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Moving plot marker with the mouse

    Hi Uwe, I am trying to achieve exactly the same thing, however I'm quite new to Qwt and I need more help.

    Can you please give me a few hints about how to set up the picker to display the vertical movement marker and to emit the event after the movement is complete?

    Qt Code:
    1. m_picker = new QwtPlotPicker(m_amp->canvas());
    2. m_picker->setTrackerMode(QwtPicker::AlwaysOn);
    3. m_picker->setRubberBand(QwtPicker::VLineRubberBand);
    4. m_picker->setSelectionFlags(QwtPicker::PointSelection | QwtPicker::ClickSelection);
    5. connect(m_picker, SIGNAL(selected(const QwtDoublePoint&)), this, SLOT(Clicked(const QwtDoublePoint&)) );
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 2
    Last Post: 12th September 2012, 07:43
  2. mouse moving don't produce mouse events
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 06:13

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.