Results 1 to 4 of 4

Thread: Implement draggable QWtplotmarker

  1. #1
    Join Date
    Jul 2009
    Posts
    15
    Thanks
    1

    Default Implement draggable QWtplotmarker

    Hi,
    I have a marker and a picker combination in order to select a point in a histogram , but I need that the marker move when I select it and move when I click the left button mouse.

    Some ideas?
    Thanks.

  2. #2
    Join Date
    Sep 2007
    Posts
    61
    Thanks
    5
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Implement draggable QWtplotmarker

    Subclass a QwtPlotMarker, QObject so you can get the events. Then, write the eventFilter method so you can trap the events you want to capture.

    Look at the ShapedClock example from Qt.

    class DraggableMarker: public QObject, public QwtPlotMarker
    {
    Q_OBJECT

    public:

    DraggableMarker (QwtPlot *plot);
    virtual bool eventFilter (QObject *, QEvent *);
    };

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

    Default Re: Implement draggable QWtplotmarker

    A combination of a marker and the plot picker should be what you are looking for. The picker is for the dragging - the marker when you have placed it.

    Uwe

  4. #4
    Join Date
    Aug 2009
    Posts
    33
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Implement draggable QWtplotmarker

    I had to do something like that too, but i used a svg image to replace the marker.

    http://www.qtcentre.org/forum/f-qwt-...ect-23234.html

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.