Results 1 to 2 of 2

Thread: QwtPlotPicker double click

  1. #1
    Join Date
    Apr 2013
    Posts
    63
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default QwtPlotPicker double click

    Searched but I could not found any thread on this.
    How to capture a double click Signal from QwtPlotPicker?

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

    Default Re: QwtPlotPicker double click

    A picker machine for double clicks looks like this:

    Qt Code:
    1. class DoubleClickMachine: public QwtPickerMachine
    2. {
    3. public:
    4. DoubleClickMachine():
    5. QwtPickerMachine( PointSelection )
    6. {
    7. }
    8.  
    9. virtual QList<Command> transition(
    10. const QwtEventPattern &, const QEvent *event )
    11. {
    12. QList<QwtPickerMachine::Command> cmdList;
    13.  
    14. if ( event->type() == QEvent::MouseButtonDblClick )
    15. {
    16. cmdList += Begin;
    17. cmdList += Append;
    18. cmdList += End;
    19. }
    20.  
    21. return cmdList;
    22. }
    23. };
    To copy to clipboard, switch view to plain text mode 

    and

    Qt Code:
    1. QwtPlotPicker *picker = new QwtPlotPicker( plot->canvas() );
    2. picker->setStateMachine( new DoubleClickMachine() );
    3. connect( picker, SIGNAL( selected( const QPointF & ) ), ... );
    To copy to clipboard, switch view to plain text mode 
    Uwe

  3. The following 2 users say thank you to Uwe for this useful post:

    Momergil (5th October 2013), mqt (3rd July 2013)

Similar Threads

  1. Replies: 2
    Last Post: 19th April 2013, 13:02
  2. Telling apart single click and double click in QTableView
    By jgirlich in forum Qt Programming
    Replies: 1
    Last Post: 5th March 2013, 14:27
  3. Replies: 2
    Last Post: 16th July 2012, 12:40
  4. Replies: 6
    Last Post: 5th June 2009, 09:38
  5. Replies: 2
    Last Post: 11th January 2009, 23:24

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.