Results 1 to 2 of 2

Thread: How to display text from the picker only during a click

  1. #1
    Join Date
    Mar 2008
    Location
    Colorado, USA
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to display text from the picker only during a click

    I have a QwtPlotPicker object, initialized with a QwtPickerClickPointMachine.
    Qt Code:
    1. QwtPlotPicker * picker = new QwtPlotPicker(ui->qwt_plot->canvas());
    2. picker->setStateMachine(new QwtPickerClickPointMachine);
    3. picker->setTrackerMode(QwtPicker::ActiveOnly);
    To copy to clipboard, switch view to plain text mode 
    I want the text of the picker to only display during a right-click, and I'm not sure how to do this. I set the trackerMode to ActiveOnly, but I don't know how to make the picker "active". This makes sense with dragging a rectangle or line, but not intuitively with a single-click. Is this possible, or do I need to use a different type of state machine?

  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: How to display text from the picker only during a click

    Qt Code:
    1. picker->setTrackerMode( QwtPicker::ActiveOnly );
    2. picker->setStateMachine( new QwtPickerDragPointMachine() );
    3. picker->setMousePattern( QwtEventPattern::MouseSelect1, Qt::RightButton );
    To copy to clipboard, switch view to plain text mode 
    Uwe

Similar Threads

  1. How to display text from a file to a text browser
    By ironmantis7x in forum Newbie
    Replies: 11
    Last Post: 14th June 2012, 16:23
  2. when click the text of QTreeWidgetItem,let it no reaction
    By weixj2003ld in forum Qt Programming
    Replies: 3
    Last Post: 16th March 2012, 04:22
  3. Edit Text of a QPushButton with mouse right click
    By theria05 in forum Qt Programming
    Replies: 6
    Last Post: 8th December 2010, 19:49
  4. Picker text
    By MuzZviman in forum Qwt
    Replies: 1
    Last Post: 2nd June 2010, 10:49
  5. Display Label Color by selecting Color Picker
    By sosanjay in forum Qt Programming
    Replies: 1
    Last Post: 25th September 2009, 07:11

Tags for this Thread

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.